OLD | NEW |
1 #ifndef ADBLOCKPLUS_FILTER_ENGINE_H | 1 #ifndef ADBLOCKPLUS_FILTER_ENGINE_H |
2 #define ADBLOCKPLUS_FILTER_ENGINE_H | 2 #define ADBLOCKPLUS_FILTER_ENGINE_H |
3 | 3 |
4 #include <vector> | 4 #include <vector> |
5 #include <map> | 5 #include <map> |
6 #include <string> | 6 #include <string> |
7 #include <tr1/memory> | 7 #include <tr1/memory> |
8 | 8 |
9 namespace AdblockPlus | 9 namespace AdblockPlus |
10 { | 10 { |
(...skipping 25 matching lines...) Expand all Loading... |
36 | 36 |
37 FilterEngine& filterEngine; | 37 FilterEngine& filterEngine; |
38 std::map<std::string, std::string> stringProperties; | 38 std::map<std::string, std::string> stringProperties; |
39 std::map<std::string, int> intProperties; | 39 std::map<std::string, int> intProperties; |
40 std::map<std::string, bool> boolProperties; | 40 std::map<std::string, bool> boolProperties; |
41 #else | 41 #else |
42 JsObject(); | 42 JsObject(); |
43 #endif | 43 #endif |
44 }; | 44 }; |
45 | 45 |
46 enum FilterType {BLOCKING_RULE, EXCEPTION_RULE, | |
47 ELEMHIDE_RULE, ELEMHIDE_EXCEPTION_RULE, | |
48 COMMENT_RULE, INVALID_RULE}; | |
49 | |
50 class Filter : public JsObject, | 46 class Filter : public JsObject, |
51 public std::tr1::enable_shared_from_this<Filter> | 47 public std::tr1::enable_shared_from_this<Filter> |
52 { | 48 { |
53 friend class FilterEngine; | 49 friend class FilterEngine; |
54 | 50 |
55 public: | 51 public: |
| 52 enum Type {TYPE_BLOCKING, TYPE_EXCEPTION, |
| 53 TYPE_ELEMHIDE, TYPE_ELEMHIDE_EXCEPTION, |
| 54 TYPE_COMMENT, TYPE_INVALID}; |
| 55 |
56 bool IsListed() const; | 56 bool IsListed() const; |
57 void AddToList(); | 57 void AddToList(); |
58 void RemoveFromList(); | 58 void RemoveFromList(); |
59 | 59 |
60 private: | 60 private: |
61 #if FILTER_ENGINE_STUBS | 61 #if FILTER_ENGINE_STUBS |
62 Filter(FilterEngine& filterEngine, const std::string& text); | 62 Filter(FilterEngine& filterEngine, const std::string& text); |
63 #else | 63 #else |
64 Filter(); | 64 Filter(); |
65 #endif | 65 #endif |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
109 #if FILTER_ENGINE_STUBS | 109 #if FILTER_ENGINE_STUBS |
110 std::map<std::string, FilterPtr> knownFilters; | 110 std::map<std::string, FilterPtr> knownFilters; |
111 std::vector<FilterPtr> listedFilters; | 111 std::vector<FilterPtr> listedFilters; |
112 std::map<std::string, SubscriptionPtr> knownSubscriptions; | 112 std::map<std::string, SubscriptionPtr> knownSubscriptions; |
113 std::vector<SubscriptionPtr> listedSubscriptions; | 113 std::vector<SubscriptionPtr> listedSubscriptions; |
114 #endif | 114 #endif |
115 }; | 115 }; |
116 } | 116 } |
117 | 117 |
118 #endif | 118 #endif |
OLD | NEW |