| OLD | NEW |
| 1 #ifndef _PLUGIN_CONFIGURATION_H_ | 1 #ifndef _PLUGIN_CONFIGURATION_H_ |
| 2 #define _PLUGIN_CONFIGURATION_H_ | 2 #define _PLUGIN_CONFIGURATION_H_ |
| 3 | 3 |
| 4 | 4 |
| 5 #include "PluginTypedef.h" | 5 #include "PluginTypedef.h" |
| 6 | 6 |
| 7 | 7 |
| 8 class CPluginConfiguration | 8 class CPluginConfiguration |
| 9 { | 9 { |
| 10 | 10 |
| 11 public: | 11 public: |
| 12 | 12 |
| 13 // Inject the userid and version id into the class when constructing | 13 // Inject the userid and version id into the class when constructing |
| 14 CPluginConfiguration(); | 14 CPluginConfiguration(); |
| 15 | 15 |
| 16 // Refresh (download) configuration | 16 // Refresh (download) configuration |
| 17 bool Download(); | 17 bool Download(); |
| 18 void Invalidate(); | 18 void Invalidate(); |
| 19 | 19 |
| 20 // Is configuration valid | 20 // Is configuration valid |
| 21 bool IsValid() const; | 21 bool IsValid() const; |
| 22 bool IsValidUserId() const; | 22 bool IsValidUserId() const; |
| 23 bool IsValidPluginExpired() const; | 23 bool IsValidPluginExpired() const; |
| 24 bool IsValidPluginUpdate() const; | |
| 25 bool IsValidPluginInfoPanel() const; | 24 bool IsValidPluginInfoPanel() const; |
| 26 bool IsValidDictionary() const; | 25 bool IsValidDictionary() const; |
| 27 #ifdef SUPPORT_FILTER | 26 #ifdef SUPPORT_FILTER |
| 28 bool IsValidFilter() const; | 27 bool IsValidFilter() const; |
| 29 #endif | 28 #endif |
| 30 #ifdef SUPPORT_WHITELIST | 29 #ifdef SUPPORT_WHITELIST |
| 31 bool IsValidWhiteList() const; | 30 bool IsValidWhiteList() const; |
| 32 #endif | 31 #endif |
| 33 #ifdef SUPPORT_CONFIG | 32 #ifdef SUPPORT_CONFIG |
| 34 bool IsValidConfig() const; | 33 bool IsValidConfig() const; |
| 35 #endif | 34 #endif |
| 36 | 35 |
| 37 // General plugin status | 36 // General plugin status |
| 38 bool IsPluginActivated() const; | 37 bool IsPluginActivated() const; |
| 39 bool IsPluginRegistered() const; | 38 bool IsPluginRegistered() const; |
| 40 bool IsPluginActivateEnabled() const; | 39 bool IsPluginActivateEnabled() const; |
| 41 bool IsPluginExpired() const; | 40 bool IsPluginExpired() const; |
| 42 | 41 |
| 43 int GetAdBlockLimit() const; | 42 int GetAdBlockLimit() const; |
| 44 CString GetUserId() const; | 43 CString GetUserId() const; |
| 45 | 44 |
| 46 // Does there exists a new version, that can be downloaded and installed | |
| 47 CString GetPluginUpdateVersion() const; | |
| 48 CString GetPluginUpdateUrl() const; | |
| 49 | |
| 50 int GetPluginInfoPanel() const; | 45 int GetPluginInfoPanel() const; |
| 51 | 46 |
| 52 // Dictionary information | 47 // Dictionary information |
| 53 int GetDictionaryVersion() const;» | 48 int GetDictionaryVersion() const; |
| 54 CString GetDictionaryUrl() const;» | 49 CString GetDictionaryUrl() const; |
| 55 | 50 |
| 56 #ifdef SUPPORT_CONFIG | 51 #ifdef SUPPORT_CONFIG |
| 57 CString GetConfigUrl() const; | 52 CString GetConfigUrl() const; |
| 58 int GetConfigVersion() const; | 53 int GetConfigVersion() const; |
| 59 #endif // SUPPORT_CONFIG | 54 #endif // SUPPORT_CONFIG |
| 60 | 55 |
| 61 private: | 56 private: |
| 62 | 57 |
| 63 bool m_isValid; | 58 bool m_isValid; |
| 64 bool m_isValidUserId; | 59 bool m_isValidUserId; |
| 65 bool m_isValidPluginActivated; | 60 bool m_isValidPluginActivated; |
| 66 bool m_isValidPluginActivateEnabled; | 61 bool m_isValidPluginActivateEnabled; |
| 67 bool m_isValidPluginExpired; | 62 bool m_isValidPluginExpired; |
| 68 bool m_isValidPluginUpdate; | |
| 69 bool m_isValidPluginInfoPanel; | 63 bool m_isValidPluginInfoPanel; |
| 70 bool m_isValidDictionary; | 64 bool m_isValidDictionary; |
| 71 bool m_isPluginRegistered; | 65 bool m_isPluginRegistered; |
| 72 int m_adBlockLimit; | 66 int m_adBlockLimit; |
| 73 #ifdef SUPPORT_WHITELIST | 67 #ifdef SUPPORT_WHITELIST |
| 74 bool m_isValidWhiteList; | 68 bool m_isValidWhiteList; |
| 75 #endif | 69 #endif |
| 76 #ifdef SUPPORT_FILTER | 70 #ifdef SUPPORT_FILTER |
| 77 bool m_isValidFilter; | 71 bool m_isValidFilter; |
| 78 #endif | 72 #endif |
| 79 #ifdef SUPPORT_CONFIG | 73 #ifdef SUPPORT_CONFIG |
| 80 bool m_isValidConfig; | 74 bool m_isValidConfig; |
| 81 #endif | 75 #endif |
| 82 | 76 |
| 83 // General plugin status | 77 // General plugin status |
| 84 bool m_isPluginActivated; | 78 bool m_isPluginActivated; |
| 85 bool m_isPluginActivateEnabled; | 79 bool m_isPluginActivateEnabled; |
| 86 bool m_isPluginExpired; | 80 bool m_isPluginExpired; |
| 87 | 81 |
| 88 // User registration | 82 // User registration |
| 89 CString m_userId; | 83 CString m_userId; |
| 90 | 84 |
| 91 // The version that currently can be downloaded from the server | |
| 92 CString m_pluginUpdateVersion; | |
| 93 CString m_pluginUpdateUrl; | |
| 94 | |
| 95 // Dictionary that currently can be downloaded from the server | 85 // Dictionary that currently can be downloaded from the server |
| 96 int m_dictionaryVersion; | 86 int m_dictionaryVersion; |
| 97 CString m_dictionaryUrl; | 87 CString m_dictionaryUrl; |
| 98 | 88 |
| 99 int m_pluginInfoPanel; | 89 int m_pluginInfoPanel; |
| 100 | 90 |
| 101 #ifdef SUPPORT_FILTER | 91 #ifdef SUPPORT_FILTER |
| 102 int m_filterVersion; | 92 int m_filterVersion; |
| 103 std::map<CString, CString> m_filterFileNameList; | 93 std::map<CString, CString> m_filterFileNameList; |
| 104 #endif | 94 #endif |
| 105 | 95 |
| 106 #ifdef SUPPORT_CONFIG | 96 #ifdef SUPPORT_CONFIG |
| 107 CString m_configUrl; | 97 CString m_configUrl; |
| 108 int m_configVersion; | 98 int m_configVersion; |
| 109 #endif // SUPPORT_CONFIG | 99 #endif // SUPPORT_CONFIG |
| 110 }; | 100 }; |
| 111 | 101 |
| 112 | 102 |
| 113 #endif // _PLUGIN_CONFIGURATION_H_ | 103 #endif // _PLUGIN_CONFIGURATION_H_ |
| OLD | NEW |