OLD | NEW |
1 /* | 1 /* |
2 * This file is part of Adblock Plus <https://adblockplus.org/>, | 2 * This file is part of Adblock Plus <https://adblockplus.org/>, |
3 * Copyright (C) 2006-2015 Eyeo GmbH | 3 * Copyright (C) 2006-2015 Eyeo GmbH |
4 * | 4 * |
5 * Adblock Plus is free software: you can redistribute it and/or modify | 5 * Adblock Plus is free software: you can redistribute it and/or modify |
6 * it under the terms of the GNU General Public License version 3 as | 6 * it under the terms of the GNU General Public License version 3 as |
7 * published by the Free Software Foundation. | 7 * published by the Free Software Foundation. |
8 * | 8 * |
9 * Adblock Plus is distributed in the hope that it will be useful, | 9 * Adblock Plus is distributed in the hope that it will be useful, |
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
57 void Clear(); | 57 void Clear(); |
58 | 58 |
59 // Private constructor used by the singleton pattern | 59 // Private constructor used by the singleton pattern |
60 CPluginSettings(); | 60 CPluginSettings(); |
61 | 61 |
62 public: | 62 public: |
63 ~CPluginSettings(); | 63 ~CPluginSettings(); |
64 | 64 |
65 static CPluginSettings* s_instance; | 65 static CPluginSettings* s_instance; |
66 | 66 |
67 static bool HasInstance(); | |
68 static CPluginSettings* GetInstance(); | 67 static CPluginSettings* GetInstance(); |
69 | 68 |
70 bool IsPluginEnabled() const; | 69 bool IsPluginEnabled() const; |
71 | 70 |
72 std::map<std::wstring, std::wstring> GetFilterLanguageTitleList() const; | 71 std::map<std::wstring, std::wstring> GetFilterLanguageTitleList() const; |
73 | 72 |
74 public: | 73 public: |
75 | 74 |
76 void TogglePluginEnabled(); | 75 void TogglePluginEnabled(); |
77 bool GetPluginEnabled() const; | 76 bool GetPluginEnabled() const; |
78 | 77 |
79 void AddError(const CString& error, const CString& errorCode); | |
80 | |
81 // Settings whitelist | 78 // Settings whitelist |
82 private: | 79 private: |
83 std::vector<std::wstring> m_whitelistedDomains; | 80 std::vector<std::wstring> m_whitelistedDomains; |
84 void ClearWhitelist(); | 81 void ClearWhitelist(); |
85 bool ReadWhitelist(bool bDebug=true); | 82 bool ReadWhitelist(bool bDebug=true); |
86 | 83 |
87 public: | 84 public: |
88 void AddWhiteListedDomain(const std::wstring& domain); | 85 void AddWhiteListedDomain(const std::wstring& domain); |
89 void RemoveWhiteListedDomain(const std::wstring& domain); | 86 void RemoveWhiteListedDomain(const std::wstring& domain); |
90 int GetWhiteListedDomainCount() const; | 87 int GetWhiteListedDomainCount() const; |
91 std::vector<std::wstring> GetWhiteListedDomainList(); | 88 std::vector<std::wstring> GetWhiteListedDomainList(); |
92 | 89 |
93 bool RefreshWhitelist(); | 90 bool RefreshWhitelist(); |
94 | 91 |
95 void SetSubscription(const std::wstring& url); | 92 void SetSubscription(const std::wstring& url); |
96 std::wstring GetSubscription(); | 93 std::wstring GetSubscription(); |
97 }; | 94 }; |
98 | 95 |
99 #endif // _PLUGIN_SETTINGS_H_ | 96 #endif // _PLUGIN_SETTINGS_H_ |
OLD | NEW |