OLD | NEW |
1 #ifndef _ADBLOCK_PLUS_CLIENT_H_ | 1 #ifndef _ADBLOCK_PLUS_CLIENT_H_ |
2 #define _ADBLOCK_PLUS_CLIENT_H_ | 2 #define _ADBLOCK_PLUS_CLIENT_H_ |
3 | 3 |
4 | 4 |
5 #include "PluginTypedef.h" | 5 #include "PluginTypedef.h" |
6 #include "PluginClientBase.h" | 6 #include "PluginClientBase.h" |
7 | 7 |
8 | 8 |
9 class CPluginFilter; | 9 class CPluginFilter; |
10 | 10 |
11 struct SubscriptionDescription | 11 struct SubscriptionDescription |
12 { | 12 { |
13 std::string url; | 13 std::wstring url; |
14 std::string title; | 14 std::wstring title; |
15 std::string specialization; | 15 std::wstring specialization; |
16 bool listed; | 16 bool listed; |
17 }; | 17 }; |
18 | 18 |
19 class CAdblockPlusClient : public CPluginClientBase | 19 class CAdblockPlusClient : public CPluginClientBase |
20 { | 20 { |
21 | 21 |
22 private: | 22 private: |
23 | 23 |
24 std::auto_ptr<CPluginFilter> m_filter; | 24 std::auto_ptr<CPluginFilter> m_filter; |
25 | 25 |
(...skipping 12 matching lines...) Expand all Loading... |
38 | 38 |
39 ~CAdblockPlusClient(); | 39 ~CAdblockPlusClient(); |
40 | 40 |
41 static CAdblockPlusClient* GetInstance(); | 41 static CAdblockPlusClient* GetInstance(); |
42 | 42 |
43 // Removes the url from the list of whitelisted urls if present | 43 // Removes the url from the list of whitelisted urls if present |
44 // Only called from ui thread | 44 // Only called from ui thread |
45 bool ShouldBlock(CString src, int contentType, const CString& domain, bool add
Debug=false); | 45 bool ShouldBlock(CString src, int contentType, const CString& domain, bool add
Debug=false); |
46 | 46 |
47 bool IsElementHidden(const CString& tag, IHTMLElement* pEl, const CString& dom
ain, const CString& indent, CPluginFilter* filter); | 47 bool IsElementHidden(const CString& tag, IHTMLElement* pEl, const CString& dom
ain, const CString& indent, CPluginFilter* filter); |
48 bool IsWhitelistedUrl(const std::string& url); | 48 bool IsWhitelistedUrl(const std::wstring& url); |
49 | 49 |
50 int GetIEVersion(); | 50 int GetIEVersion(); |
51 | 51 |
52 bool Matches(const std::string& url, const std::string& contentType, const std
::string& domain); | 52 bool Matches(const std::wstring& url, const std::wstring& contentType, const s
td::wstring& domain); |
53 std::vector<std::string> GetElementHidingSelectors(const std::string& domain); | 53 std::vector<std::wstring> GetElementHidingSelectors(const std::wstring& domain
); |
54 std::vector<SubscriptionDescription> FetchAvailableSubscriptions(); | 54 std::vector<SubscriptionDescription> FetchAvailableSubscriptions(); |
55 std::vector<SubscriptionDescription> GetListedSubscriptions(); | 55 std::vector<SubscriptionDescription> GetListedSubscriptions(); |
56 void SetSubscription(std::string url); | 56 void SetSubscription(const std::wstring& url); |
57 void UpdateAllSubscriptions(); | 57 void UpdateAllSubscriptions(); |
58 std::vector<std::string> GetExceptionDomains(); | 58 std::vector<std::wstring> GetExceptionDomains(); |
59 void AddFilter(const std::string& text); | 59 void AddFilter(const std::wstring& text); |
60 void RemoveFilter(const std::string& text); | 60 void RemoveFilter(const std::wstring& text); |
61 }; | 61 }; |
62 | 62 |
63 #endif // _ADBLOCK_PLUS_CLIENT_H_ | 63 #endif // _ADBLOCK_PLUS_CLIENT_H_ |
OLD | NEW |