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
32 #include "OCRepresentation.h"
\r
40 * @brief This class provides a set of APIs for Notification service Message .
\r
45 /** NSMessageType - enumeration for Notification service MessageType*/
\r
46 enum class NSMessageType
\r
48 NS_MESSAGE_ALERT = 1,
\r
49 NS_MESSAGE_NOTICE = 2,
\r
50 NS_MESSAGE_EVENT = 3,
\r
51 NS_MESSAGE_INFO = 4,
\r
52 NS_MESSAGE_WARNING = 5,
\r
56 * Constructor of NSMessage.
\r
58 NSMessage(): m_messageId(0), m_type(NSMessageType::NS_MESSAGE_ALERT), m_ttl(0),
\r
59 m_mediaContents(new NSMediaContents), m_extraInfo(OC::OCRepresentation())
\r
64 * Constructor of NSMessage.
\r
66 * @param msg - pointer to NSMessage struct to initialize.
\r
68 NSMessage(::NSMessage *msg);
\r
71 * Copy Constructor of NSMessage.
\r
73 * @param msg - NSMessage to initialize.
\r
75 NSMessage(const NSMessage &msg);
\r
78 * Copy assignment operator of NSMessage.
\r
80 * @param msg - NSMessage to initialize.
\r
81 * @return NSMessage object reference
\r
83 NSMessage &operator=(const NSMessage &msg);
\r
86 * Destructor of NSMessage.
\r
91 * This method is for getting Message Id from the Notification service Message.
\r
93 * @return Id as uint64_t.
\r
95 uint64_t getMessageId() const;
\r
98 * This method is for getting Provider Id from the Notification service Message.
\r
100 * @return Id as string.
\r
102 std::string getProviderId() const;
\r
105 * This method is for getting type from the Notification service Message.
\r
107 * @return type as NSMessageType.
\r
109 NSMessageType getType() const;
\r
112 * This method is for setting type from the Notification service Message.
\r
114 * @param type as NSMessageType.
\r
116 void setType(const NSMessageType &type);
\r
119 * This method is for getting time from the Notification service Message.
\r
121 * @return time as string.
\r
123 std::string getTime() const;
\r
126 * This method is for setting time from the Notification service Message.
\r
128 * @param time as string.
\r
130 void setTime(const std::string &time);
\r
133 * This method is for getting time to live from the Notification service Message.
\r
135 * @return ttl as uint64_t.
\r
137 uint64_t getTTL() const;
\r
140 * This method is for setting time to live from the Notification service Message.
\r
142 * @param ttl as uint64_t.
\r
144 void setTTL(const uint64_t &ttl);
\r
147 * This method is for getting Title from the Notification service Message.
\r
149 * @return Title as string.
\r
151 std::string getTitle() const;
\r
154 * This method is for setting Title from the Notification service Message.
\r
156 * @param title as string.
\r
158 void setTitle(const std::string &title);
\r
161 * This method is for getting contentText from the Notification service Message.
\r
163 * @return contentText as string.
\r
165 std::string getContentText() const;
\r
168 * This method is for setting contentText from the Notification service Message.
\r
170 * @param contextText as string.
\r
172 void setContentText(const std::string &contextText);
\r
175 * This method is for getting sourceName from the Notification service Message.
\r
177 * @return sourceName as string.
\r
179 std::string getSourceName() const;
\r
182 * This method is for setting sourceName from the Notification service Message.
\r
184 * @param sourceName as string.
\r
186 void setSourceName(const std::string &sourceName);
\r
189 * This method is for getting mediaContents from the Notification service Message.
\r
191 * @return mediaContents as NSMediaContents pointer.
\r
193 NSMediaContents *getMediaContents() const;
\r
196 * This method is for setting mediaContents from the Notification service Message.
\r
198 * @param mediaContents as NSMediaContents pointer.
\r
200 void setMediaContents(NSMediaContents *mediaContents);
\r
203 * This method is for getting Topic from the Notification service Message.
\r
205 * @return Topic as string.
\r
207 std::string getTopic() const;
\r
210 * This method is for setting Topic for the Notification service Message.
\r
212 * @return Topic as string.
\r
214 void setTopic(const std::string &topic);
\r
217 * This method is for getting extraInfo from the Notification service Message.
\r
219 * @return extraInfo as OCRepresentation.
\r
221 OC::OCRepresentation getExtraInfo() const;
\r
224 * This method is for setting extraInfo for the Notification service Message.
\r
226 * @return extraInfo as OCRepresentation.
\r
228 void setExtraInfo(const OC::OCRepresentation &extraInfo);
\r
231 uint64_t m_messageId;
\r
232 std::string m_providerId;
\r
234 NSMessageType m_type;
\r
235 std::string m_time;
\r
237 std::string m_title;
\r
238 std::string m_contentText;
\r
239 std::string m_sourceName;
\r
240 NSMediaContents *m_mediaContents;
\r
241 std::string m_topic;
\r
242 OC::OCRepresentation m_extraInfo;
\r
247 #endif /* _NS_MESSAGE_H_ */
\r