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

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

Issue 5797488346791936: Issue 1107 - Support notifications (Closed)
Left Patch Set: Created Jan. 19, 2015, 12:50 p.m.
Right Patch Set: fix comment Created Jan. 23, 2015, 3:56 p.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
« no previous file with change/comment | « include/AdblockPlus.h ('k') | include/AdblockPlus/Notification.h » ('j') | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
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 220 matching lines...) Expand 10 before | Expand all | Expand 10 after
231 */ 231 */
232 std::vector<SubscriptionPtr> GetListedSubscriptions() const; 232 std::vector<SubscriptionPtr> GetListedSubscriptions() const;
233 233
234 /** 234 /**
235 * Retrieves all recommended subscriptions. 235 * Retrieves all recommended subscriptions.
236 * @return List of recommended subscriptions. 236 * @return List of recommended subscriptions.
237 */ 237 */
238 std::vector<SubscriptionPtr> FetchAvailableSubscriptions() const; 238 std::vector<SubscriptionPtr> FetchAvailableSubscriptions() const;
239 239
240 /** 240 /**
241 * Creates new Notification(see `Notification`) object.
242 * @param type Type of the notification.
243 * @param id Id of the newly created notification.
244 * @return New Notification instance.
245 */
246 std::tr1::shared_ptr<Notification> CreateNotification(NotificationType type,
247 const std::string& id) const;
Wladimir Palant 2015/01/21 13:48:28 Why do we need this in the public API? Shouldn't n
sergei 2015/01/21 15:58:55 It is for local notifications. @Felix
Wladimir Palant 2015/01/21 19:23:18 What kind of local notifications? If the client ap
248
249 /**
250 * Determines which notification is to be shown next. 241 * Determines which notification is to be shown next.
251 * @param url URL to match notifications to (optional). 242 * @param url URL to match notifications to (optional).
252 * @return Notification to be shown, or null if there is no any. 243 * @return Notification to be shown, or `null` if there is no any.
253 */ 244 */
254 std::tr1::shared_ptr<Notification> GetNextNotificationToShow( 245 NotificationPtr GetNextNotificationToShow(
255 const std::string& url = std::string()); 246 const std::string& url = std::string());
256
257 /**
258 * Localizes the texts of the supplied notification.
259 * @param notification Notification to translate.
260 * @param locale The target locale (optional, defaults to the
261 * application locale)
Wladimir Palant 2015/01/21 13:48:28 Do we need this parameter at all? When would it ma
sergei 2015/01/21 15:58:55 1. The javascript notifications API has this argum
Wladimir Palant 2015/01/21 19:23:18 Yes, and it is already unused there. All the more
Felix Dahlke 2015/01/22 03:31:08 Agreed. I actually think we should remove it from
sergei 2015/01/22 14:08:15 I've removed locale for notification texts.
262 * @return the translated texts.
263 */
264 NotificationTexts GetNotificationTexts(
265 const std::tr1::shared_ptr<Notification>& notification,
266 const std::string& locale = std::string()) const;
Wladimir Palant 2015/01/21 13:48:28 Why isn't this a methods of the Notification class
sergei 2015/01/21 15:58:55 1. GetNotificationTexts is moved into Notification
Wladimir Palant 2015/01/21 19:23:18 What kind of flexibility? If we have a Notificatio
Felix Dahlke 2015/01/22 03:31:08 Agreed - there is no notification object in that s
sergei 2015/01/22 14:08:15 MarkAsShown is moved into Notification class. Just
267
268 /**
269 * Adds a local notification.
270 * @param value The notification to add
271 */
272 void AddNotification(const std::tr1::shared_ptr<Notification>& value);
Wladimir Palant 2015/01/21 13:48:28 Why do we need an API to add "local" notifications
sergei 2015/01/21 15:58:55 I guess it is designed for the cases when we can d
Felix Dahlke 2015/01/22 03:31:08 You're right Sergei, the question notification is
273
274 /**
275 * Removes an existing local notification.
276 * @param notification The notification to remove.
277 */
278 void RemoveNotification(const std::tr1::shared_ptr<Notification>& value);
279
280 /**
281 * Marks the notification as shown.
282 * @param notificationId The notification ID.
283 */
284 void MarkNotificationAsShown(const std::string& notificationId);
285 247
286 /** 248 /**
287 * Checks if any active filter matches the supplied URL. 249 * Checks if any active filter matches the supplied URL.
288 * @param url URL to match. 250 * @param url URL to match.
289 * @param contentType Content type of the requested resource. 251 * @param contentType Content type of the requested resource.
290 * @param documentUrl URL of the document requesting the resource. 252 * @param documentUrl URL of the document requesting the resource.
291 * Note that there will be more than one document if frames are 253 * Note that there will be more than one document if frames are
292 * involved, see 254 * involved, see
293 * Matches(const std::string&, const std::string&, const std::vector< std::string>&) const. 255 * Matches(const std::string&, const std::string&, const std::vector< std::string>&) const.
294 * @return Matching filter, or `null` if there was no match. 256 * @return Matching filter, or `null` if there was no match.
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
421 ContentType contentType, 383 ContentType contentType,
422 const std::string& documentUrl) const; 384 const std::string& documentUrl) const;
423 void UpdateAvailable(UpdateAvailableCallback callback, JsValueList& params); 385 void UpdateAvailable(UpdateAvailableCallback callback, JsValueList& params);
424 void UpdateCheckDone(const std::string& eventName, 386 void UpdateCheckDone(const std::string& eventName,
425 UpdateCheckDoneCallback callback, JsValueList& params); 387 UpdateCheckDoneCallback callback, JsValueList& params);
426 void FilterChanged(FilterChangeCallback callback, JsValueList& params); 388 void FilterChanged(FilterChangeCallback callback, JsValueList& params);
427 }; 389 };
428 } 390 }
429 391
430 #endif 392 #endif
LEFTRIGHT

Powered by Google App Engine
This is Rietveld