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

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

Issue 5797488346791936: Issue 1107 - Support notifications (Closed)
Patch Set: C++03 Created Jan. 23, 2015, 10:52 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
OLDNEW
(Empty)
1 /*
2 * This file is part of Adblock Plus <https://adblockplus.org/>,
3 * Copyright (C) 2006-2015 Eyeo GmbH
4 *
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
7 * published by the Free Software Foundation.
8 *
9 * Adblock Plus is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with Adblock Plus. If not, see <http://www.gnu.org/licenses/>.
16 */
17
18 #ifndef ADBLOCK_PLUS_NOTIFICATION_H
19 #define ADBLOCK_PLUS_NOTIFICATION_H
20
21 #include <string>
22 #include <vector>
23 #include "tr1_memory.h"
24
25 namespace AdblockPlus
26 {
27 class FilterEngine;
28 enum NotificationType
29 {
30 NOTIFICATION_TYPE_INFORMATION,
31 NOTIFICATION_TYPE_QUESTION,
32 NOTIFICATION_TYPE_CRITICAL
33 };
34
35 class Notification: public JsValue
36 {
37 friend class FilterEngine;
38 protected:
39 struct PrivateCtrArg{};
Felix Dahlke 2015/01/23 13:25:55 As I said before - this is the wrong place to disc
40 static std::tr1::shared_ptr<Notification> JsValueToNotification(const JsValu ePtr& jsValue);
41 public:
42 explicit Notification(const JsValuePtr& jsValue, PrivateCtrArg);
43 NotificationType GetType() const;
44 /**
45 * Localizes the texts of the supplied notification.
Felix Dahlke 2015/01/23 13:25:55 Shouldn't this comment say that it returns just th
sergei 2015/01/23 14:48:19 Sorry, fixed and more comments are added.
46 * @return the translated texts.
Felix Dahlke 2015/01/23 13:25:55 We consistently start with an upper case letter af
47 */
48 const std::string& GetTitle() const;
49 const std::string& GetMessageString() const;
Felix Dahlke 2015/01/23 13:25:55 Why not just GetMessage()?
50 void MarkAsShown();
51 private:
52 std::string title;
53 std::string message;
54 NotificationType type;
55 };
56 typedef std::tr1::shared_ptr<Notification> NotificationPtr;
57 }
58
59 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld