| OLD | NEW | 
|---|
| 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 | 
| 11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the | 11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the | 
| 12  * GNU General Public License for more details. | 12  * GNU General Public License for more details. | 
| 13  * | 13  * | 
| 14  * You should have received a copy of the GNU General Public License | 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/>. | 15  * along with Adblock Plus.  If not, see <http://www.gnu.org/licenses/>. | 
| 16  */ | 16  */ | 
| 17 | 17 | 
| 18 #ifndef ADBLOCK_PLUS_NOTIFICATION_H | 18 #ifndef ADBLOCK_PLUS_NOTIFICATION_H | 
| 19 #define ADBLOCK_PLUS_NOTIFICATION_H | 19 #define ADBLOCK_PLUS_NOTIFICATION_H | 
| 20 | 20 | 
| 21 #include <string> | 21 #include <string> | 
| 22 #include <vector> | 22 #include <vector> | 
| 23 #include "tr1_memory.h" |  | 
| 24 | 23 | 
| 25 namespace AdblockPlus | 24 namespace AdblockPlus | 
| 26 { | 25 { | 
| 27   class FilterEngine; | 26   class FilterEngine; | 
| 28   /** | 27   /** | 
| 29    * Possible notification types. | 28    * Possible notification types. | 
| 30    */ | 29    */ | 
| 31   enum NotificationType | 30   enum NotificationType | 
| 32   { | 31   { | 
| 33     NOTIFICATION_TYPE_INFORMATION, | 32     NOTIFICATION_TYPE_INFORMATION, | 
| 34     NOTIFICATION_TYPE_QUESTION, | 33     NOTIFICATION_TYPE_QUESTION, | 
| 35     NOTIFICATION_TYPE_CRITICAL | 34     NOTIFICATION_TYPE_CRITICAL | 
| 36   }; | 35   }; | 
| 37 | 36 | 
| 38   /** | 37   /** | 
| 39    * Wrapper for an Adblock Plus notification object. | 38    * Wrapper for an Adblock Plus notification object. | 
| 40    */ | 39    */ | 
| 41   class Notification: public JsValue | 40   class Notification: public JsValue | 
| 42   { | 41   { | 
| 43     friend class FilterEngine; | 42     friend class FilterEngine; | 
| 44   protected: | 43   protected: | 
| 45     static std::tr1::shared_ptr<Notification> JsValueToNotification(const JsValu
    ePtr& jsValue); | 44     static std::shared_ptr<Notification> JsValueToNotification(const JsValuePtr&
     jsValue); | 
| 46     /** | 45     /** | 
| 47      * Constructor. | 46      * Constructor. | 
| 48      * @param jsValue `JsValuePtr` notification JavaScript object. | 47      * @param jsValue `JsValuePtr` notification JavaScript object. | 
| 49      */ | 48      */ | 
| 50     explicit Notification(const JsValuePtr& jsValue); | 49     explicit Notification(const JsValuePtr& jsValue); | 
| 51   public: | 50   public: | 
| 52     /** | 51     /** | 
| 53      * Retrieves the type of this notification. | 52      * Retrieves the type of this notification. | 
| 54      * @return Type of this notification. | 53      * @return Type of this notification. | 
| 55      */ | 54      */ | 
| (...skipping 20 matching lines...) Expand all  Loading... | 
| 76     /** | 75     /** | 
| 77      * Marks this notification as shown. It is only relevant for question | 76      * Marks this notification as shown. It is only relevant for question | 
| 78      * notifications. Other notifications are marked automatically. | 77      * notifications. Other notifications are marked automatically. | 
| 79      */ | 78      */ | 
| 80     void MarkAsShown(); | 79     void MarkAsShown(); | 
| 81   private: | 80   private: | 
| 82     std::string title; | 81     std::string title; | 
| 83     std::string message; | 82     std::string message; | 
| 84     NotificationType type; | 83     NotificationType type; | 
| 85   }; | 84   }; | 
| 86   typedef std::tr1::shared_ptr<Notification> NotificationPtr; | 85   typedef std::shared_ptr<Notification> NotificationPtr; | 
| 87 } | 86 } | 
| 88 | 87 | 
| 89 #endif | 88 #endif | 
| OLD | NEW | 
|---|