OLD | NEW |
1 #pragma once | 1 #pragma once |
2 | 2 |
3 #include "Subscription.h" | 3 #include "Subscription.h" |
4 #include "../filter/Filter.h" | 4 #include "../filter/Filter.h" |
5 | 5 |
6 class UserDefinedSubscription : public Subscription | 6 class UserDefinedSubscription : public Subscription |
7 { | 7 { |
8 private: | 8 private: |
9 enum Defaults | 9 enum Defaults |
10 { | 10 { |
11 WHITELIST = 1, | 11 WHITELIST = 1, |
12 BLOCKING = 2, | 12 BLOCKING = 2, |
13 ELEMHIDE = 4, | 13 ELEMHIDE = 4, |
14 }; | 14 }; |
15 static int filterTypeToDefaults[Filter::Type::MAXTYPE + 1]; | 15 static int filterTypeToDefaults[Filter::Type::MAXTYPE + 1]; |
16 int mDefaults; | 16 int mDefaults; |
17 | 17 |
18 public: | 18 public: |
19 explicit UserDefinedSubscription(const String& id); | 19 explicit UserDefinedSubscription(const String& id); |
20 EMSCRIPTEN_KEEPALIVE bool IsDefaultFor(const Filter* filter) const; | 20 EMSCRIPTEN_KEEPALIVE bool IsDefaultFor(const Filter* filter) const; |
21 EMSCRIPTEN_KEEPALIVE void MakeDefaultFor(const Filter* filter); | 21 EMSCRIPTEN_KEEPALIVE void MakeDefaultFor(const Filter* filter); |
| 22 EMSCRIPTEN_KEEPALIVE void InsertFilterAt(Filter* filter, unsigned pos); |
| 23 EMSCRIPTEN_KEEPALIVE bool RemoveFilterAt(unsigned pos); |
22 EMSCRIPTEN_KEEPALIVE OwnedString Serialize() const; | 24 EMSCRIPTEN_KEEPALIVE OwnedString Serialize() const; |
23 }; | 25 }; |
OLD | NEW |