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

Delta Between Two Patch Sets: include/AdblockPlus/FilterEngine.h

Issue 9987009: Interface for the libadblockplus API (Closed)
Left Patch Set: Some changes to the API, implemented stubs Created March 26, 2013, 3:13 p.m.
Right Patch Set: Reduce redundant redundancy Created March 27, 2013, 6:45 a.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
Left: Side by side diff | Download
Right: Side by side diff | Download
LEFTRIGHT
1 #include <vector> 1 #include <vector>
2 #include <string> 2 #include <string>
3 3
4 namespace AdblockPlus 4 namespace AdblockPlus
5 { 5 {
6 class JsEngine; 6 class JsEngine;
7 7
8 struct Subscription 8 struct Subscription
9 { 9 {
10 std::string url;
10 std::string title; 11 std::string title;
11 std::string url;
12 12
13 Subscription(const std::string& title, const std::string& url); 13 Subscription(const std::string& url, const std::string& title);
14 }; 14 };
15 15
16 class FilterEngine 16 class FilterEngine
17 { 17 {
18 public: 18 public:
19 explicit FilterEngine(JsEngine& jsEngine); 19 explicit FilterEngine(JsEngine& jsEngine);
20 void AddSubscription(Subscription subscription); 20 void AddSubscription(Subscription subscription);
21 void RemoveSubscription(const Subscription& subscription); 21 void RemoveSubscription(const Subscription& subscription);
22 const Subscription* FindSubscription(const std::string& url) const;
22 const std::vector<Subscription>& GetSubscriptions() const; 23 const std::vector<Subscription>& GetSubscriptions() const;
23 void UpdateSubscriptionFilters(const Subscription& subscription); 24 void UpdateSubscriptionFilters(const Subscription& subscription);
24 std::vector<Subscription> FetchAvailableSubscriptions(); 25 std::vector<Subscription> FetchAvailableSubscriptions();
25 bool FiltersMatch(const std::string& url, 26 bool Matches(const std::string& url,
26 const std::string& contentType) const; 27 const std::string& contentType) const;
27 std::vector<std::string> GetElementHidingRules() const; 28 std::vector<std::string> GetElementHidingRules() const;
28 29
29 private: 30 private:
30 JsEngine& jsEngine; 31 JsEngine& jsEngine;
31 std::vector<Subscription> subscriptions; 32 std::vector<Subscription> subscriptions;
32 }; 33 };
33 } 34 }
LEFTRIGHT

Powered by Google App Engine
This is Rietveld