Index: include/AdblockPlus/Notification.h |
diff --git a/include/AdblockPlus/Notification.h b/include/AdblockPlus/Notification.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..3206ff1a4f3b7c843d1cbe034faabd62f88f391a |
--- /dev/null |
+++ b/include/AdblockPlus/Notification.h |
@@ -0,0 +1,59 @@ |
+/* |
+ * This file is part of Adblock Plus <https://adblockplus.org/>, |
+ * Copyright (C) 2006-2015 Eyeo GmbH |
+ * |
+ * Adblock Plus is free software: you can redistribute it and/or modify |
+ * it under the terms of the GNU General Public License version 3 as |
+ * published by the Free Software Foundation. |
+ * |
+ * Adblock Plus is distributed in the hope that it will be useful, |
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of |
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
+ * GNU General Public License for more details. |
+ * |
+ * You should have received a copy of the GNU General Public License |
+ * along with Adblock Plus. If not, see <http://www.gnu.org/licenses/>. |
+ */ |
+ |
+#ifndef ADBLOCK_PLUS_NOTIFICATION_H |
+#define ADBLOCK_PLUS_NOTIFICATION_H |
+ |
+#include <string> |
+#include <vector> |
+#include "tr1_memory.h" |
+ |
+namespace AdblockPlus |
+{ |
+ class FilterEngine; |
+ enum NotificationType |
+ { |
+ NOTIFICATION_TYPE_INFORMATION, |
+ NOTIFICATION_TYPE_QUESTION, |
+ NOTIFICATION_TYPE_CRITICAL |
+ }; |
+ |
+ class Notification: public JsValue |
+ { |
+ friend class FilterEngine; |
+ protected: |
+ struct PrivateCtrArg{}; |
Felix Dahlke
2015/01/23 13:25:55
As I said before - this is the wrong place to disc
|
+ static std::tr1::shared_ptr<Notification> JsValueToNotification(const JsValuePtr& jsValue); |
+ public: |
+ explicit Notification(const JsValuePtr& jsValue, PrivateCtrArg); |
+ NotificationType GetType() const; |
+ /** |
+ * 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.
|
+ * @return the translated texts. |
Felix Dahlke
2015/01/23 13:25:55
We consistently start with an upper case letter af
|
+ */ |
+ const std::string& GetTitle() const; |
+ const std::string& GetMessageString() const; |
Felix Dahlke
2015/01/23 13:25:55
Why not just GetMessage()?
|
+ void MarkAsShown(); |
+ private: |
+ std::string title; |
+ std::string message; |
+ NotificationType type; |
+ }; |
+ typedef std::tr1::shared_ptr<Notification> NotificationPtr; |
+} |
+ |
+#endif |