1 //******************************************************************
\r
3 // Copyright 2016 Samsung Electronics All Rights Reserved.
\r
5 //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
\r
7 // Licensed under the Apache License, Version 2.0 (the "License");
\r
8 // you may not use this file except in compliance with the License.
\r
9 // You may obtain a copy of the License at
\r
11 // http://www.apache.org/licenses/LICENSE-2.0
\r
13 // Unless required by applicable law or agreed to in writing, software
\r
14 // distributed under the License is distributed on an "AS IS" BASIS,
\r
15 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
\r
16 // See the License for the specific language governing permissions and
\r
17 // limitations under the License.
\r
19 //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
\r
24 * This file contains Notification service Message representation.
\r
27 #ifndef _NS_MESSAGE_H_
\r
28 #define _NS_MESSAGE_H_
\r
31 #include "NSMediaContents.h"
\r
39 * @brief This class provides a set of APIs for Notification service Message .
\r
44 /** NSMessageType - enumeration for Notification service MessageType*/
\r
45 enum class NSMessageType
\r
47 NS_MESSAGE_ALERT = 0,
\r
48 NS_MESSAGE_NOTICE = 1,
\r
49 NS_MESSAGE_EVENT = 2,
\r
50 NS_MESSAGE_INFO = 3,
\r
54 * Constructor of NSMessage.
\r
56 NSMessage(): m_messageId(0), m_type(NSMessageType::NS_MESSAGE_ALERT), m_ttl(0),
\r
57 m_mediaContents(new NSMediaContents) { }
\r
60 * Constructor of NSMessage.
\r
62 * @param msg - pointer to NSMessage struct to initialize.
\r
64 NSMessage(::NSMessage *msg);
\r
67 * Destructor of NSMessage.
\r
72 * This method is for getting Message Id from the Notification service Message.
\r
74 * @return Id as uint64_t.
\r
76 uint64_t getMessageId() const;
\r
79 * This method is for getting Provider Id from the Notification service Message.
\r
81 * @return Id as string.
\r
83 std::string getProviderId() const;
\r
86 * This method is for getting type from the Notification service Message.
\r
88 * @return type as NSMessageType.
\r
90 NSMessageType getType() const;
\r
93 * This method is for setting type from the Notification service Message.
\r
95 * @param type as NSMessageType.
\r
97 void setType(const NSMessageType &type);
\r
100 * This method is for getting time from the Notification service Message.
\r
102 * @return time as string.
\r
104 std::string getTime() const;
\r
107 * This method is for setting time from the Notification service Message.
\r
109 * @param time as string.
\r
111 void setTime(const std::string &time);
\r
114 * This method is for getting time to live from the Notification service Message.
\r
116 * @return ttl as uint64_t.
\r
118 uint64_t getTTL() const;
\r
121 * This method is for setting time to live from the Notification service Message.
\r
123 * @param ttl as uint64_t.
\r
125 void setTTL(const uint64_t &ttl);
\r
128 * This method is for getting Title from the Notification service Message.
\r
130 * @return Title as string.
\r
132 std::string getTitle() const;
\r
135 * This method is for setting Title from the Notification service Message.
\r
137 * @param Title as string.
\r
139 void setTitle(const std::string &title);
\r
142 * This method is for getting contentText from the Notification service Message.
\r
144 * @return contentText as string.
\r
146 std::string getContentText() const;
\r
149 * This method is for setting contentText from the Notification service Message.
\r
151 * @param contentText as string.
\r
153 void setContentText(const std::string &contextText);
\r
156 * This method is for getting sourceName from the Notification service Message.
\r
158 * @return sourceName as string.
\r
160 std::string getSourceName() const;
\r
163 * This method is for setting sourceName from the Notification service Message.
\r
165 * @param sourceName as string.
\r
167 void setSourceName(const std::string &sourceName);
\r
170 * This method is for getting mediaContents from the Notification service Message.
\r
172 * @return mediaContents as NSMediaContents pointer.
\r
174 NSMediaContents *getMediaContents() const;
\r
177 * This method is for setting mediaContents from the Notification service Message.
\r
179 * @param mediaContents as NSMediaContents pointer.
\r
181 void setMediaContents(NSMediaContents *mediaContents);
\r
184 * This method is for getting Topic from the Notification service Message.
\r
186 * @return Topic as string.
\r
188 std::string getTopic() const;
\r
191 * This method is for setting Topic for the Notification service Message.
\r
193 * @return Topic as string.
\r
195 void setTopic(const std::string &topic);
\r
198 uint64_t m_messageId;
\r
199 std::string m_providerId;
\r
201 NSMessageType m_type;
\r
202 std::string m_time;
\r
204 std::string m_title;
\r
205 std::string m_contentText;
\r
206 std::string m_sourceName;
\r
207 NSMediaContents *m_mediaContents;
\r
208 std::string m_topic;
\r
213 #endif /* _NS_MESSAGE_H_ */
\r