| LEFT | RIGHT |
| 1 #ifndef _PLUGIN_FILTER_H_ | 1 #ifndef _PLUGIN_FILTER_H_ |
| 2 #define _PLUGIN_FILTER_H_ | 2 #define _PLUGIN_FILTER_H_ |
| 3 | 3 |
| 4 | 4 |
| 5 #include "PluginTypedef.h" | 5 #include "PluginTypedef.h" |
| 6 #include <memory> | 6 #include <memory> |
| 7 #include "..\shared\Utils.h" | |
| 8 | 7 |
| 9 enum CFilterElementHideAttrPos | 8 enum CFilterElementHideAttrPos |
| 10 { | 9 { |
| 11 POS_NONE = 0, STARTING, ENDING, ANYWHERE, EXACT | 10 POS_NONE = 0, STARTING, ENDING, ANYWHERE, EXACT |
| 12 }; | 11 }; |
| 13 | 12 |
| 14 enum CFilterElementHideAttrType | 13 enum CFilterElementHideAttrType |
| 15 { | 14 { |
| 16 TYPE_NONE = 0, STYLE, ID, CLASS | 15 TYPE_NONE = 0, STYLE, ID, CLASS |
| 17 }; | 16 }; |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 128 // ============================================================================ | 127 // ============================================================================ |
| 129 | 128 |
| 130 class CPluginFilter | 129 class CPluginFilter |
| 131 { | 130 { |
| 132 | 131 |
| 133 private: | 132 private: |
| 134 | 133 |
| 135 CString m_dataPath; | 134 CString m_dataPath; |
| 136 | 135 |
| 137 std::map<int, CString> m_contentMapText; | 136 std::map<int, CString> m_contentMapText; |
| 138 | |
| 139 | 137 |
| 140 typedef std::map<DWORD, CFilter> TFilterMap; | 138 typedef std::map<DWORD, CFilter> TFilterMap; |
| 141 typedef std::vector<CFilter> TFilterMapDefault; | 139 typedef std::vector<CFilter> TFilterMapDefault; |
| 142 | 140 |
| 143 // (Tag,Name) -> Filter | 141 // (Tag,Name) -> Filter |
| 144 typedef std::multimap<std::pair<CString,CString>, CFilterElementHide> TFilterE
lementHideTagsNamed; | 142 typedef std::multimap<std::pair<CString,CString>, CFilterElementHide> TFilterE
lementHideTagsNamed; |
| 145 | 143 |
| 146 // Tag -> Filter | 144 // Tag -> Filter |
| 147 typedef std::multimap<CString, CFilterElementHide> TFilterElementHideTags; | 145 typedef std::multimap<CString, CFilterElementHide> TFilterElementHideTags; |
| 148 | 146 |
| (...skipping 22 matching lines...) Expand all Loading... |
| 171 | 169 |
| 172 bool IsElementHidden(const CString& tag, IHTMLElement* pEl, const CString& dom
ain, const CString& indent) const; | 170 bool IsElementHidden(const CString& tag, IHTMLElement* pEl, const CString& dom
ain, const CString& indent) const; |
| 173 | 171 |
| 174 | 172 |
| 175 bool ShouldBlock(CString src, int contentType, const CString& domain, bool add
Debug=false) const; | 173 bool ShouldBlock(CString src, int contentType, const CString& domain, bool add
Debug=false) const; |
| 176 bool ShouldWhiteList(CString url) const; | 174 bool ShouldWhiteList(CString url) const; |
| 177 }; | 175 }; |
| 178 | 176 |
| 179 | 177 |
| 180 #endif // _PLUGIN_FILTER_H_ | 178 #endif // _PLUGIN_FILTER_H_ |
| LEFT | RIGHT |