[IOT-1591] Add warning code as notification type
[platform/upstream/iotivity.git] / service / notification / cpp-wrapper / common / NSMessage.h
index f9dab49..ae17131 100755 (executable)
@@ -29,6 +29,7 @@
 \r
 #include <string>\r
 #include "NSMediaContents.h"\r
+#include "OCRepresentation.h"\r
 \r
 namespace OIC\r
 {\r
@@ -44,17 +45,20 @@ namespace OIC
                 /** NSMessageType - enumeration for Notification service MessageType*/\r
                 enum class NSMessageType\r
                 {\r
-                    NS_MESSAGE_ALERT = 0,\r
-                    NS_MESSAGE_NOTICE = 1,\r
-                    NS_MESSAGE_EVENT = 2,\r
-                    NS_MESSAGE_INFO = 3,\r
+                    NS_MESSAGE_ALERT = 1,\r
+                    NS_MESSAGE_NOTICE = 2,\r
+                    NS_MESSAGE_EVENT = 3,\r
+                    NS_MESSAGE_INFO = 4,\r
+                    NS_MESSAGE_WARNING = 5,\r
                 };\r
 \r
                 /**\r
                         * Constructor of NSMessage.\r
                         */\r
                 NSMessage(): m_messageId(0), m_type(NSMessageType::NS_MESSAGE_ALERT), m_ttl(0),\r
-                    m_mediaContents(new NSMediaContents) { }\r
+                    m_mediaContents(new NSMediaContents), m_extraInfo(OC::OCRepresentation())\r
+                {\r
+                }\r
 \r
                 /**\r
                         * Constructor of NSMessage.\r
@@ -64,6 +68,21 @@ namespace OIC
                 NSMessage(::NSMessage *msg);\r
 \r
                 /**\r
+                     * Copy Constructor of NSMessage.\r
+                     *\r
+                     * @param msg - NSMessage to initialize.\r
+                     */\r
+                NSMessage(const NSMessage &msg);\r
+\r
+                /**\r
+                     * Copy assignment operator of NSMessage.\r
+                     *\r
+                     * @param msg -  NSMessage to initialize.\r
+                     * @return NSMessage object reference\r
+                     */\r
+                NSMessage &operator=(const NSMessage &msg);\r
+\r
+                /**\r
                         * Destructor of NSMessage.\r
                         */\r
                 ~NSMessage();\r
@@ -134,7 +153,7 @@ namespace OIC
                 /**\r
                      * This method is for setting Title from the Notification service Message.\r
                      *\r
-                     * @param Title as string.\r
+                     * @param title as string.\r
                      */\r
                 void setTitle(const std::string &title);\r
 \r
@@ -148,7 +167,7 @@ namespace OIC
                 /**\r
                      * This method is for setting contentText from the Notification service Message.\r
                      *\r
-                     * @param contentText as string.\r
+                     * @param contextText as string.\r
                      */\r
                 void setContentText(const std::string &contextText);\r
 \r
@@ -187,6 +206,27 @@ namespace OIC
                      */\r
                 std::string getTopic() const;\r
 \r
+                /**\r
+                     * This method is for setting Topic for the Notification service Message.\r
+                     *\r
+                     * @return Topic as string.\r
+                     */\r
+                void setTopic(const std::string &topic);\r
+\r
+                /**\r
+                     * This method is for getting extraInfo from the Notification service Message.\r
+                     *\r
+                     * @return extraInfo as OCRepresentation.\r
+                     */\r
+                OC::OCRepresentation getExtraInfo() const;\r
+\r
+                /**\r
+                     * This method is for setting extraInfo for the Notification service Message.\r
+                     *\r
+                     * @return extraInfo as OCRepresentation.\r
+                     */\r
+                void setExtraInfo(const OC::OCRepresentation &extraInfo);\r
+\r
             private:\r
                 uint64_t m_messageId;\r
                 std::string m_providerId;\r
@@ -199,6 +239,7 @@ namespace OIC
                 std::string m_sourceName;\r
                 NSMediaContents *m_mediaContents;\r
                 std::string m_topic;\r
+                OC::OCRepresentation m_extraInfo;\r
 \r
         };\r
     }\r