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

Side by Side Diff: include/AdblockPlus/FilterEngine.h

Issue 5653480979038208: Issue 2325 - Add a way to set settings in libadblockplus for FRP and automatic updates (Closed)
Patch Set: Address more comments Created June 22, 2015, 7:45 a.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | include/AdblockPlus/JsEngine.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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-2015 Eyeo GmbH 3 * Copyright (C) 2006-2015 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 168 matching lines...) Expand 10 before | Expand all | Expand 10 after
179 /** 179 /**
180 * Callback type invoked when the filters change. 180 * Callback type invoked when the filters change.
181 * The first parameter is the action event code (see 181 * The first parameter is the action event code (see
182 * [FilterNotifier.triggerListeners](https://adblockplus.org/jsdoc/adblockpl us/symbols/FilterNotifier.html#.triggerListeners) 182 * [FilterNotifier.triggerListeners](https://adblockplus.org/jsdoc/adblockpl us/symbols/FilterNotifier.html#.triggerListeners)
183 * for the full list). 183 * for the full list).
184 * The second parameter is the filter/subscription object affected, if any. 184 * The second parameter is the filter/subscription object affected, if any.
185 */ 185 */
186 typedef std::tr1::function<void(const std::string&, const JsValuePtr)> Filte rChangeCallback; 186 typedef std::tr1::function<void(const std::string&, const JsValuePtr)> Filte rChangeCallback;
187 187
188 /** 188 /**
189 * Container of name-value pairs representing a set of preferences.
190 */
191 typedef std::map<std::string, AdblockPlus::JsValuePtr> Prefs;
192
193 /**
189 * Constructor. 194 * Constructor.
190 * @param jsEngine `JsEngine` instance used to run JavaScript code 195 * @param jsEngine `JsEngine` instance used to run JavaScript code
191 * internally. 196 * internally.
197 * @param preconfiguredPrefs `AdblockPlus::FilterEngine::Prefs`
198 * name-value list of preconfigured prefs.
192 */ 199 */
193 explicit FilterEngine(JsEnginePtr jsEngine); 200 explicit FilterEngine(JsEnginePtr jsEngine,
201 const Prefs& preconfiguredPrefs = Prefs()
202 );
194 203
195 /** 204 /**
196 * Retrieves the `JsEngine` instance associated with this `FilterEngine` 205 * Retrieves the `JsEngine` instance associated with this `FilterEngine`
197 * instance. 206 * instance.
198 */ 207 */
199 JsEnginePtr GetJsEngine() const { return jsEngine; } 208 JsEnginePtr GetJsEngine() const { return jsEngine; }
200 209
201 /** 210 /**
202 * Checks if this is the first run of the application. 211 * Checks if this is the first run of the application.
203 * @return `true` if the application is running for the first time. 212 * @return `true` if the application is running for the first time.
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after
383 ContentType contentType, 392 ContentType contentType,
384 const std::string& documentUrl) const; 393 const std::string& documentUrl) const;
385 void UpdateAvailable(UpdateAvailableCallback callback, JsValueList& params); 394 void UpdateAvailable(UpdateAvailableCallback callback, JsValueList& params);
386 void UpdateCheckDone(const std::string& eventName, 395 void UpdateCheckDone(const std::string& eventName,
387 UpdateCheckDoneCallback callback, JsValueList& params); 396 UpdateCheckDoneCallback callback, JsValueList& params);
388 void FilterChanged(FilterChangeCallback callback, JsValueList& params); 397 void FilterChanged(FilterChangeCallback callback, JsValueList& params);
389 }; 398 };
390 } 399 }
391 400
392 #endif 401 #endif
OLDNEW
« no previous file with comments | « no previous file | include/AdblockPlus/JsEngine.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld