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<CString, CString> GetFilterLanguageTitleList() const; | 71 std::map<CString, CString> GetFilterLanguageTitleList() const; |
73 | 72 |
74 DWORD m_WindowsBuildNumber; | 73 DWORD m_WindowsBuildNumber; |
75 | 74 |
76 public: | 75 public: |
77 | 76 |
78 void TogglePluginEnabled(); | 77 void TogglePluginEnabled(); |
79 bool GetPluginEnabled() const; | 78 bool GetPluginEnabled() const; |
80 | 79 |
81 void AddError(const CString& error, const CString& errorCode); | |
82 | |
83 // Settings whitelist | 80 // Settings whitelist |
84 private: | 81 private: |
85 std::vector<std::wstring> m_whitelistedDomains; | 82 std::vector<std::wstring> m_whitelistedDomains; |
86 void ClearWhitelist(); | 83 void ClearWhitelist(); |
87 bool ReadWhitelist(bool bDebug=true); | 84 bool ReadWhitelist(bool bDebug=true); |
88 | 85 |
89 public: | 86 public: |
90 void AddWhiteListedDomain(const CString& domain); | 87 void AddWhiteListedDomain(const CString& domain); |
91 void RemoveWhiteListedDomain(const CString& domain); | 88 void RemoveWhiteListedDomain(const CString& domain); |
92 int GetWhiteListedDomainCount() const; | 89 int GetWhiteListedDomainCount() const; |
93 std::vector<std::wstring> GetWhiteListedDomainList(); | 90 std::vector<std::wstring> GetWhiteListedDomainList(); |
94 | 91 |
95 bool RefreshWhitelist(); | 92 bool RefreshWhitelist(); |
96 DWORD GetWindowsBuildNumber(); | 93 DWORD GetWindowsBuildNumber(); |
97 | 94 |
98 void SetSubscription(const std::wstring& url); | 95 void SetSubscription(const std::wstring& url); |
99 void SetDefaultSubscription(); | 96 void SetDefaultSubscription(); |
100 CString GetSubscription(); | 97 CString GetSubscription(); |
101 CString GetAppLocale(); | 98 CString GetAppLocale(); |
102 CString GetDocumentationLink(); | 99 CString GetDocumentationLink(); |
103 }; | 100 }; |
104 | 101 |
105 #endif // _PLUGIN_SETTINGS_H_ | 102 #endif // _PLUGIN_SETTINGS_H_ |
OLD | NEW |