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

Unified Diff: include/AdblockPlus/Notification.h

Issue 5797488346791936: Issue 1107 - Support notifications (Closed)
Patch Set: remove local Notifications Created Jan. 22, 2015, 2:01 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « include/AdblockPlus/JsValue.h ('k') | lib/api.js » ('j') | src/JsEngine.cpp » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/AdblockPlus/Notification.h
diff --git a/include/AdblockPlus/Notification.h b/include/AdblockPlus/Notification.h
new file mode 100644
index 0000000000000000000000000000000000000000..711625faf3de2bd12e2e4b3fc9579001c57c5f9e
--- /dev/null
+++ b/include/AdblockPlus/Notification.h
@@ -0,0 +1,57 @@
+/*
+ * 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 <memory>
+
+namespace AdblockPlus
+{
+ class FilterEngine;
+ enum NotificationType
+ {
+ 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
+ };
+
+ class Notification: public JsValue
+ {
+ friend class FilterEngine;
+ protected:
+ struct PrivateCtrArg{};
+ 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.
+ * @return the translated texts.
+ */
+ const std::string& GetTitle() const;
+ const std::string& GetMessageString() const;
sergei 2015/01/22 14:08:15 It's not GetMessage because it's not possible to c
+ void MarkAsShown();
+ private:
+ std::string title;
+ std::string message;
+ NotificationType type;
+ };
+ typedef std::tr1::shared_ptr<Notification> NotificationPtr;
+}
+
+#endif
« no previous file with comments | « include/AdblockPlus/JsValue.h ('k') | lib/api.js » ('j') | src/JsEngine.cpp » ('J')

Powered by Google App Engine
This is Rietveld