| Left: | ||
| Right: |
| OLD | NEW |
|---|---|
| (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 <memory> | |
| 24 | |
| 25 namespace AdblockPlus | |
| 26 { | |
| 27 class FilterEngine; | |
| 28 enum NotificationType | |
| 29 { | |
| 30 NOTIFICATION_TYPE_INFORMATION, NOTIFICATION_TYPE_QUESTION, NOTIFICATION_TYPE _CRITICAL | |
|
Wladimir Palant
2015/01/22 15:19:51
Nit: listing these one per line would be better, t
sergei
2015/01/22 16:15:11
fixed
| |
| 31 }; | |
| 32 | |
| 33 class Notification: public JsValue | |
| 34 { | |
| 35 friend class FilterEngine; | |
| 36 protected: | |
| 37 struct PrivateCtrArg{}; | |
| 38 static std::tr1::shared_ptr<Notification> JsValueToNotification(const JsValu ePtr& jsValue); | |
| 39 public: | |
| 40 explicit Notification(const JsValuePtr& jsValue, PrivateCtrArg); | |
| 41 NotificationType GetType() const; | |
| 42 /** | |
| 43 * Localizes the texts of the supplied notification. | |
| 44 * @return the translated texts. | |
| 45 */ | |
| 46 const std::string& GetTitle() const; | |
| 47 const std::string& GetMessageString() const; | |
|
sergei
2015/01/22 14:08:15
It's not GetMessage because it's not possible to c
| |
| 48 void MarkAsShown(); | |
| 49 private: | |
| 50 std::string title; | |
| 51 std::string message; | |
| 52 NotificationType type; | |
| 53 }; | |
| 54 typedef std::tr1::shared_ptr<Notification> NotificationPtr; | |
| 55 } | |
| 56 | |
| 57 #endif | |
| OLD | NEW |