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, |
| 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{}; |
| 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. |
| 46 * @return the translated texts. |
| 47 */ |
| 48 const std::string& GetTitle() const; |
| 49 const std::string& GetMessageString() const; |
| 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 |
OLD | NEW |