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-2017 eyeo GmbH | 3 * Copyright (C) 2006-2017 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 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
248 */ | 248 */ |
249 typedef std::map<std::string, AdblockPlus::JsValue> Prefs; | 249 typedef std::map<std::string, AdblockPlus::JsValue> Prefs; |
250 | 250 |
251 /** | 251 /** |
252 * Callback type invoked when a new notification should be shown. | 252 * Callback type invoked when a new notification should be shown. |
253 * The parameter is the Notification object to be shown. | 253 * The parameter is the Notification object to be shown. |
254 */ | 254 */ |
255 typedef std::function<void(Notification&&)> ShowNotificationCallback; | 255 typedef std::function<void(Notification&&)> ShowNotificationCallback; |
256 | 256 |
257 /** | 257 /** |
258 * Callback function returning false when current connection is not | 258 * Asynchronous callback function passing false when current connection |
259 * allowedConnectionType, e.g. because it is a metered connection. | 259 * type does not correspond to allowedConnectionType, e.g. because it is a |
| 260 * metered connection. |
260 */ | 261 */ |
261 typedef std::function<bool(const std::string* allowedConnectionType)> IsConn
ectionAllowedCallback; | 262 typedef std::function<void(const std::string* allowedConnectionType, const s
td::function<void(bool)>&)> IsConnectionAllowedAsyncCallback; |
262 | 263 |
263 /** | 264 /** |
264 * FilterEngine creation parameters. | 265 * FilterEngine creation parameters. |
265 */ | 266 */ |
266 struct CreationParameters | 267 struct CreationParameters |
267 { | 268 { |
268 /** | 269 /** |
269 * `AdblockPlus::FilterEngine::Prefs` name - value list of preconfigured | 270 * `AdblockPlus::FilterEngine::Prefs` name - value list of preconfigured |
270 * prefs. | 271 * prefs. |
271 */ | 272 */ |
272 Prefs preconfiguredPrefs; | 273 Prefs preconfiguredPrefs; |
273 /** | 274 /** |
274 * `AdblockPlus::FilterEngine::IsConnectionAllowedCallback` a callback | 275 * A callback of `AdblockPlus::FilterEngine::IsConnectionAllowedAsyncCallb
ack` type |
275 * checking whether the request from Adblock Plus should be blocked on | 276 * checking whether the request to download a subscription from Adblock Pl
us may be performed |
276 * the current connection. | 277 * on the current connection. |
277 */ | 278 */ |
278 IsConnectionAllowedCallback isConnectionAllowedCallback; | 279 IsConnectionAllowedAsyncCallback isSubscriptionDowloadAllowedCallback; |
279 }; | 280 }; |
280 | 281 |
281 /** | 282 /** |
282 * Callback type invoked when FilterEngine is created. | 283 * Callback type invoked when FilterEngine is created. |
283 */ | 284 */ |
284 typedef std::function<void(const FilterEnginePtr&)> OnCreatedCallback; | 285 typedef std::function<void(const FilterEnginePtr&)> OnCreatedCallback; |
285 | 286 |
286 /** | 287 /** |
287 * Asynchronously constructs FilterEngine. | 288 * Asynchronously constructs FilterEngine. |
288 * @param jsEngine `JsEngine` instance used to run JavaScript code | 289 * @param jsEngine `JsEngine` instance used to run JavaScript code |
(...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
572 void FilterChanged(const FilterChangeCallback& callback, JsValueList&& param
s) const; | 573 void FilterChanged(const FilterChangeCallback& callback, JsValueList&& param
s) const; |
573 FilterPtr GetWhitelistingFilter(const std::string& url, | 574 FilterPtr GetWhitelistingFilter(const std::string& url, |
574 ContentTypeMask contentTypeMask, const std::string& documentUrl) const; | 575 ContentTypeMask contentTypeMask, const std::string& documentUrl) const; |
575 FilterPtr GetWhitelistingFilter(const std::string& url, | 576 FilterPtr GetWhitelistingFilter(const std::string& url, |
576 ContentTypeMask contentTypeMask, | 577 ContentTypeMask contentTypeMask, |
577 const std::vector<std::string>& documentUrls) const; | 578 const std::vector<std::string>& documentUrls) const; |
578 }; | 579 }; |
579 } | 580 } |
580 | 581 |
581 #endif | 582 #endif |
OLD | NEW |