OLD | NEW |
1 /* | 1 /* |
2 * This file is part of Adblock Plus <https://adblockplus.org/>, | 2 * This file is part of Adblock Plus <https://adblockplus.org/>, |
3 * Copyright (C) 2006-2016 Eyeo GmbH | 3 * Copyright (C) 2006-2016 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 15 matching lines...) Expand all Loading... |
26 #include <AdblockPlus/JsValue.h> | 26 #include <AdblockPlus/JsValue.h> |
27 #include <AdblockPlus/Notification.h> | 27 #include <AdblockPlus/Notification.h> |
28 | 28 |
29 namespace AdblockPlus | 29 namespace AdblockPlus |
30 { | 30 { |
31 class FilterEngine; | 31 class FilterEngine; |
32 | 32 |
33 /** | 33 /** |
34 * Wrapper for an Adblock Plus filter object. | 34 * Wrapper for an Adblock Plus filter object. |
35 * There are no accessors for most | 35 * There are no accessors for most |
36 * [filter properties](https://adblockplus.org/jsdoc/adblockplus/symbols/Filte
r.html), | 36 * [filter properties](https://adblockplus.org/jsdoc/adblockpluscore/Filter.ht
ml), |
37 * use `GetProperty()` to retrieve them by name. | 37 * use `GetProperty()` to retrieve them by name. |
38 */ | 38 */ |
39 class Filter : public JsValue, | 39 class Filter : public JsValue, |
40 public std::enable_shared_from_this<Filter> | 40 public std::enable_shared_from_this<Filter> |
41 { | 41 { |
42 public: | 42 public: |
43 /** | 43 /** |
44 * Filter types, see https://adblockplus.org/en/filters. | 44 * Filter types, see https://adblockplus.org/en/filters. |
45 */ | 45 */ |
46 enum Type {TYPE_BLOCKING, TYPE_EXCEPTION, | 46 enum Type {TYPE_BLOCKING, TYPE_EXCEPTION, |
(...skipping 29 matching lines...) Expand all Loading... |
76 * Normally you shouldn't call this directly, but use | 76 * Normally you shouldn't call this directly, but use |
77 * FilterEngine::GetFilter() instead. | 77 * FilterEngine::GetFilter() instead. |
78 * @param value JavaScript filter object. | 78 * @param value JavaScript filter object. |
79 */ | 79 */ |
80 Filter(JsValuePtr value); | 80 Filter(JsValuePtr value); |
81 }; | 81 }; |
82 | 82 |
83 /** | 83 /** |
84 * Wrapper for a subscription object. | 84 * Wrapper for a subscription object. |
85 * There are no accessors for most | 85 * There are no accessors for most |
86 * [subscription properties](https://adblockplus.org/jsdoc/adblockplus/symbols
/Subscription.html), | 86 * [subscription properties](https://adblockplus.org/jsdoc/adblockpluscore/Sub
scription.html), |
87 * use `GetProperty()` to retrieve them by name. | 87 * use `GetProperty()` to retrieve them by name. |
88 */ | 88 */ |
89 class Subscription : public JsValue, | 89 class Subscription : public JsValue, |
90 public std::enable_shared_from_this<Subscription> | 90 public std::enable_shared_from_this<Subscription> |
91 { | 91 { |
92 public: | 92 public: |
93 /** | 93 /** |
94 * Checks if this subscription has been added to the list of subscriptions. | 94 * Checks if this subscription has been added to the list of subscriptions. |
95 * @return `true` if this subscription has been added. | 95 * @return `true` if this subscription has been added. |
96 */ | 96 */ |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
168 | 168 |
169 /** | 169 /** |
170 * Callback type invoked when a manually triggered update check finishes. | 170 * Callback type invoked when a manually triggered update check finishes. |
171 * The parameter is an optional error message. | 171 * The parameter is an optional error message. |
172 */ | 172 */ |
173 typedef std::function<void(const std::string&)> UpdateCheckDoneCallback; | 173 typedef std::function<void(const std::string&)> UpdateCheckDoneCallback; |
174 | 174 |
175 /** | 175 /** |
176 * Callback type invoked when the filters change. | 176 * Callback type invoked when the filters change. |
177 * The first parameter is the action event code (see | 177 * The first parameter is the action event code (see |
178 * [FilterNotifier.triggerListeners](https://adblockplus.org/jsdoc/adblockpl
us/symbols/FilterNotifier.html#.triggerListeners) | 178 * [FilterNotifier.triggerListeners](https://adblockplus.org/jsdoc/adblockpl
uscore/FilterNotifier.html#.triggerListeners) |
179 * for the full list). | 179 * for the full list). |
180 * The second parameter is the filter/subscription object affected, if any. | 180 * The second parameter is the filter/subscription object affected, if any. |
181 */ | 181 */ |
182 typedef std::function<void(const std::string&, const JsValuePtr)> FilterChan
geCallback; | 182 typedef std::function<void(const std::string&, const JsValuePtr)> FilterChan
geCallback; |
183 | 183 |
184 /** | 184 /** |
185 * Container of name-value pairs representing a set of preferences. | 185 * Container of name-value pairs representing a set of preferences. |
186 */ | 186 */ |
187 typedef std::map<std::string, AdblockPlus::JsValuePtr> Prefs; | 187 typedef std::map<std::string, AdblockPlus::JsValuePtr> Prefs; |
188 | 188 |
(...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
439 const JsValueList& params); | 439 const JsValueList& params); |
440 FilterPtr GetWhitelistingFilter(const std::string& url, | 440 FilterPtr GetWhitelistingFilter(const std::string& url, |
441 ContentType contentType, const std::string& documentUrl) const; | 441 ContentType contentType, const std::string& documentUrl) const; |
442 FilterPtr GetWhitelistingFilter(const std::string& url, | 442 FilterPtr GetWhitelistingFilter(const std::string& url, |
443 ContentType contentType, | 443 ContentType contentType, |
444 const std::vector<std::string>& documentUrls) const; | 444 const std::vector<std::string>& documentUrls) const; |
445 }; | 445 }; |
446 } | 446 } |
447 | 447 |
448 #endif | 448 #endif |
OLD | NEW |