OLD | NEW |
1 /* | 1 /* |
2 * This file is part of Adblock Plus <http://adblockplus.org/>, | 2 * This file is part of Adblock Plus <http://adblockplus.org/>, |
3 * Copyright (C) 2006-2013 Eyeo GmbH | 3 * Copyright (C) 2006-2013 Eyeo GmbH |
4 * | 4 * |
5 * Adblock Plus is free software: you can redistribute it and/or modify | 5 * Adblock Plus is free software: you can redistribute it and/or modify |
6 * it under the terms of the GNU General Public License version 3 as | 6 * it under the terms of the GNU General Public License version 3 as |
7 * published by the Free Software Foundation. | 7 * published by the Free Software Foundation. |
8 * | 8 * |
9 * Adblock Plus is distributed in the hope that it will be useful, | 9 * Adblock Plus is distributed in the hope that it will be useful, |
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 Subscription(JsValuePtr value); | 61 Subscription(JsValuePtr value); |
62 }; | 62 }; |
63 | 63 |
64 typedef std::tr1::shared_ptr<Filter> FilterPtr; | 64 typedef std::tr1::shared_ptr<Filter> FilterPtr; |
65 typedef std::tr1::shared_ptr<Subscription> SubscriptionPtr; | 65 typedef std::tr1::shared_ptr<Subscription> SubscriptionPtr; |
66 | 66 |
67 class FilterEngine | 67 class FilterEngine |
68 { | 68 { |
69 public: | 69 public: |
70 explicit FilterEngine(JsEnginePtr jsEngine); | 70 explicit FilterEngine(JsEnginePtr jsEngine); |
| 71 JsEnginePtr GetJsEngine() const {return jsEngine; } |
71 bool IsFirstRun() const; | 72 bool IsFirstRun() const; |
72 FilterPtr GetFilter(const std::string& text); | 73 FilterPtr GetFilter(const std::string& text); |
73 SubscriptionPtr GetSubscription(const std::string& url); | 74 SubscriptionPtr GetSubscription(const std::string& url); |
74 std::vector<FilterPtr> GetListedFilters() const; | 75 std::vector<FilterPtr> GetListedFilters() const; |
75 std::vector<SubscriptionPtr> GetListedSubscriptions() const; | 76 std::vector<SubscriptionPtr> GetListedSubscriptions() const; |
76 std::vector<SubscriptionPtr> FetchAvailableSubscriptions() const; | 77 std::vector<SubscriptionPtr> FetchAvailableSubscriptions() const; |
77 FilterPtr Matches(const std::string& url, | 78 FilterPtr Matches(const std::string& url, |
78 const std::string& contentType, | 79 const std::string& contentType, |
79 const std::string& documentUrl); | 80 const std::string& documentUrl) const; |
80 std::vector<std::string> GetElementHidingSelectors(const std::string& domain
) const; | 81 std::vector<std::string> GetElementHidingSelectors(const std::string& domain
) const; |
| 82 JsValuePtr GetPref(const std::string& pref) const; |
| 83 void SetPref(const std::string& pref, JsValuePtr value); |
81 | 84 |
82 private: | 85 private: |
83 JsEnginePtr jsEngine; | 86 JsEnginePtr jsEngine; |
84 bool initialized; | 87 bool initialized; |
85 bool firstRun; | 88 bool firstRun; |
86 | 89 |
87 void InitDone(JsValueList& params); | 90 void InitDone(JsValueList& params); |
88 }; | 91 }; |
89 } | 92 } |
90 | 93 |
91 #endif | 94 #endif |
OLD | NEW |