Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Side by Side Diff: src/plugin/PluginSettings.h

Issue 5187613258416128: Issue #1234 - Rewrite internals of debug facility (Closed)
Patch Set: rebase + address comments Created March 31, 2015, 1:56 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
OLDNEW
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 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 #define SETTING_TAB_DICTIONARY_VERSION L"dictionaryversion" 45 #define SETTING_TAB_DICTIONARY_VERSION L"dictionaryversion"
46 #define SETTING_TAB_SETTINGS_VERSION L"settingsversion" 46 #define SETTING_TAB_SETTINGS_VERSION L"settingsversion"
47 #define SETTING_TAB_FILTER_VERSION L"filterversion" 47 #define SETTING_TAB_FILTER_VERSION L"filterversion"
48 #define SETTING_TAB_WHITELIST_VERSION L"whitelistversion" 48 #define SETTING_TAB_WHITELIST_VERSION L"whitelistversion"
49 49
50 class CPluginIniFileW; 50 class CPluginIniFileW;
51 51
52 class CPluginSettings 52 class CPluginSettings
53 { 53 {
54 private: 54 private:
55 DWORD m_dwWorkingThreadId;
56
57 static CComAutoCriticalSection s_criticalSectionLocal; 55 static CComAutoCriticalSection s_criticalSectionLocal;
58 56
59 void Clear(); 57 void Clear();
60 58
61 // Private constructor used by the singleton pattern 59 // Private constructor used by the singleton pattern
62 CPluginSettings(); 60 CPluginSettings();
63 61
64 public: 62 public:
65 ~CPluginSettings(); 63 ~CPluginSettings();
66 64
67 static CPluginSettings* s_instance; 65 static CPluginSettings* s_instance;
68 66
69 static bool HasInstance(); 67 static bool HasInstance();
70 static CPluginSettings* GetInstance(); 68 static CPluginSettings* GetInstance();
71 69
72 bool IsPluginEnabled() const; 70 bool IsPluginEnabled() const;
73 71
74 std::map<CString, CString> GetFilterLanguageTitleList() const; 72 std::map<CString, CString> GetFilterLanguageTitleList() const;
75 73
76 void SetWorkingThreadId();
77 void SetWorkingThreadId(DWORD id);
78 bool IsWorkingThread(DWORD dwThread=0) const;
79
80 DWORD m_WindowsBuildNumber; 74 DWORD m_WindowsBuildNumber;
81 75
82 public: 76 public:
83 77
84 void TogglePluginEnabled(); 78 void TogglePluginEnabled();
85 bool GetPluginEnabled() const; 79 bool GetPluginEnabled() const;
86 80
87 void AddError(const CString& error, const CString& errorCode); 81 void AddError(const CString& error, const CString& errorCode);
88 82
89 // Settings whitelist 83 // Settings whitelist
(...skipping 11 matching lines...) Expand all
101 bool RefreshWhitelist(); 95 bool RefreshWhitelist();
102 DWORD GetWindowsBuildNumber(); 96 DWORD GetWindowsBuildNumber();
103 97
104 void SetSubscription(const std::wstring& url); 98 void SetSubscription(const std::wstring& url);
105 void SetDefaultSubscription(); 99 void SetDefaultSubscription();
106 CString GetSubscription(); 100 CString GetSubscription();
107 CString GetAppLocale(); 101 CString GetAppLocale();
108 CString GetDocumentationLink(); 102 CString GetDocumentationLink();
109 }; 103 };
110 104
111 std::wstring GetDataPath(const std::wstring& filename=L"");
112
113 #endif // _PLUGIN_SETTINGS_H_ 105 #endif // _PLUGIN_SETTINGS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld