Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: include/AdblockPlus/FilterEngine.h

Issue 9987009: Interface for the libadblockplus API (Closed)
Patch Set: Use new API in the shell Created March 27, 2013, 4:58 a.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « include/AdblockPlus.h ('k') | libadblockplus.gyp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/AdblockPlus/FilterEngine.h
===================================================================
new file mode 100644
--- /dev/null
+++ b/include/AdblockPlus/FilterEngine.h
@@ -0,0 +1,34 @@
+#include <vector>
+#include <string>
+
+namespace AdblockPlus
+{
+ class JsEngine;
+
+ struct Subscription
+ {
+ std::string url;
+ std::string title;
+
+ Subscription(const std::string& url, const std::string& title);
+ };
+
+ class FilterEngine
+ {
+ public:
+ explicit FilterEngine(JsEngine& jsEngine);
+ void AddSubscription(Subscription subscription);
+ void RemoveSubscription(const Subscription& subscription);
+ const Subscription* FindSubscription(const std::string& url) const;
+ const std::vector<Subscription>& GetSubscriptions() const;
+ void UpdateSubscriptionFilters(const Subscription& subscription);
+ std::vector<Subscription> FetchAvailableSubscriptions();
+ bool MatchesFilters(const std::string& url,
+ const std::string& contentType) const;
+ std::vector<std::string> GetElementHidingRules() const;
+
+ private:
+ JsEngine& jsEngine;
+ std::vector<Subscription> subscriptions;
+ };
+}
« no previous file with comments | « include/AdblockPlus.h ('k') | libadblockplus.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld