[IOT-1591] Add warning code as notification type
[platform/upstream/iotivity.git] / service / notification / cpp-wrapper / common / NSMessage.h
index 3f3d09c..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,16 +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_mediaContents(new NSMediaContents) { }\r
+                NSMessage(): m_messageId(0), m_type(NSMessageType::NS_MESSAGE_ALERT), m_ttl(0),\r
+                    m_mediaContents(new NSMediaContents), m_extraInfo(OC::OCRepresentation())\r
+                {\r
+                }\r
 \r
                 /**\r
                         * Constructor of NSMessage.\r
@@ -63,9 +68,24 @@ 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() = default;\r
+                ~NSMessage();\r
 \r
                 /**\r
                      * This method is for getting Message Id from the Notification service Message.\r
@@ -133,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
@@ -147,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
@@ -179,6 +199,33 @@ namespace OIC
                      */\r
                 void setMediaContents(NSMediaContents *mediaContents);\r
 \r
+                /**\r
+                     * This method is for getting Topic from the Notification service Message.\r
+                     *\r
+                     * @return Topic as string.\r
+                     */\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
@@ -191,6 +238,8 @@ namespace OIC
                 std::string m_contentText;\r
                 std::string m_sourceName;\r
                 NSMediaContents *m_mediaContents;\r
+                std::string m_topic;\r
+                OC::OCRepresentation m_extraInfo;\r
 \r
         };\r
     }\r