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

Unified Diff: include/AdblockPlus/Notification.h

Issue 4904655779790848: Issue 1107.update1 - read Notification properties (title, message and type) on the fly (Closed)
Patch Set: Created Jan. 27, 2015, 10:15 a.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 | « no previous file | src/FilterEngine.cpp » ('j') | src/FilterEngine.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
index c9b2b24ec28bcb5ad5d1e9bbdf1228e81e10e3f4..4d8df9b65a4b348355714472a6fab9679ad35a02 100644
--- a/include/AdblockPlus/Notification.h
+++ b/include/AdblockPlus/Notification.h
@@ -36,13 +36,22 @@ namespace AdblockPlus
};
/**
+ * Contains notification title and message. It's returned by
+ * `Notification::GetTexts`.
+ */
+ struct NotificationTexts
+ {
+ std::string title;
+ std::string message;
+ };
+
+ /**
* Wrapper for an Adblock Plus notification object.
*/
- class Notification: public JsValue
+ class Notification: public JsValue, public std::tr1::enable_shared_from_this<Notification>
Felix Dahlke 2015/01/27 13:09:09 Missed it before, but we have one space before `:`
sergei 2015/01/27 13:20:12 fixed. I styled it as Filter and Subscription in F
{
friend class FilterEngine;
protected:
- static std::tr1::shared_ptr<Notification> JsValueToNotification(const JsValuePtr& jsValue);
/**
* Constructor.
* @param jsValue `JsValuePtr` notification JavaScript object.
@@ -55,17 +64,11 @@ namespace AdblockPlus
*/
NotificationType GetType() const;
- /**
- * Retrieves the title of this notification.
- * @return Title of this notification.
- */
- const std::string& GetTitle() const;
-
- /**
- * Retrieves the message of this notification.
- * @return Message of this notification.
- */
- const std::string& GetMessageString() const;
+ /**
+ * Retrieves the title and message of this notification.
+ * @return Translated texts.
+ */
+ NotificationTexts GetTexts();
/**
* Marks this notification as shown. It is only relevant for question
@@ -73,9 +76,6 @@ namespace AdblockPlus
*/
void MarkAsShown();
private:
- std::string title;
- std::string message;
- NotificationType type;
};
typedef std::tr1::shared_ptr<Notification> NotificationPtr;
}
« no previous file with comments | « no previous file | src/FilterEngine.cpp » ('j') | src/FilterEngine.cpp » ('J')

Powered by Google App Engine
This is Rietveld