Index: include/AdblockPlus/FilterEngine.h |
=================================================================== |
new file mode 100644 |
--- /dev/null |
+++ b/include/AdblockPlus/FilterEngine.h |
@@ -0,0 +1,33 @@ |
+#include <vector> |
+#include <string> |
+ |
+namespace AdblockPlus |
+{ |
+ class JsEngine; |
+ |
+ struct Subscription |
+ { |
+ std::string title; |
+ std::string url; |
+ |
+ Subscription(const std::string& title, const std::string& url); |
+ }; |
+ |
+ class FilterEngine |
+ { |
+ public: |
+ explicit FilterEngine(JsEngine& jsEngine); |
+ void AddSubscription(Subscription subscription); |
+ void RemoveSubscription(const Subscription& subscription); |
+ const std::vector<Subscription>& GetSubscriptions() const; |
+ void UpdateSubscriptionFilters(const Subscription& subscription); |
+ std::vector<Subscription> FetchAvailableSubscriptions(); |
+ bool FiltersMatch(const std::string& url, |
+ const std::string& contentType) const; |
+ std::vector<std::string> GetElementHidingRules() const; |
+ |
+ private: |
+ JsEngine& jsEngine; |
+ std::vector<Subscription> subscriptions; |
+ }; |
+} |