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
30 #include "NSMediaContents.h"
\r
31 #include "oic_string.h"
\r
41 * @brief This class provides a set of APIs for Notification service Message .
\r
46 /** NSMessageType - enumeration for Notification service MessageType*/
\r
47 enum class NSMessageType
\r
49 NS_MESSAGE_ALERT = 0,
\r
50 NS_MESSAGE_NOTICE = 1,
\r
51 NS_MESSAGE_EVENT = 2,
\r
52 NS_MESSAGE_INFO = 3,
\r
56 * Constructor of NSMessage.
\r
58 NSMessage(): m_mediaContents(new NSMediaContents) { }
\r
61 * Constructor of NSMessage.
\r
63 * @param msg - pointer to NSMessage struct to initialize.
\r
65 NSMessage(::NSMessage *msg);
\r
68 * Destructor of NSMessage.
\r
70 ~NSMessage() = default;
\r
73 * This method is for getting Message Id from the Notification service Message.
\r
75 * @return Id as uint64_t.
\r
77 uint64_t getMessageId() const;
\r
80 * This method is for getting Provider Id from the Notification service Message.
\r
82 * @return Id as string.
\r
84 std::string getProviderId() const;
\r
87 * This method is for getting type from the Notification service Message.
\r
89 * @return type as NSMessageType.
\r
91 NSMessageType getType() const;
\r
94 * This method is for setting type from the Notification service Message.
\r
96 * @param type as NSMessageType.
\r
98 void setType(const NSMessageType &type);
\r
101 * This method is for getting time from the Notification service Message.
\r
103 * @return time as string.
\r
105 std::string getTime() const;
\r
108 * This method is for setting time from the Notification service Message.
\r
110 * @param time as string.
\r
112 void setTime(const std::string &time);
\r
115 * This method is for getting time to live from the Notification service Message.
\r
117 * @return ttl as uint64_t.
\r
119 uint64_t getTTL() const;
\r
122 * This method is for setting time to live from the Notification service Message.
\r
124 * @param ttl as uint64_t.
\r
126 void setTTL(const uint64_t &ttl);
\r
129 * This method is for getting Title from the Notification service Message.
\r
131 * @return Title as string.
\r
133 std::string getTitle() const;
\r
136 * This method is for setting Title from the Notification service Message.
\r
138 * @param Title as string.
\r
140 void setTitle(const std::string &title);
\r
143 * This method is for getting contentText from the Notification service Message.
\r
145 * @return contentText as string.
\r
147 std::string getContentText() const;
\r
150 * This method is for setting contentText from the Notification service Message.
\r
152 * @param contentText as string.
\r
154 void setContentText(const std::string &contextText);
\r
157 * This method is for getting sourceName from the Notification service Message.
\r
159 * @return sourceName as string.
\r
161 std::string getSourceName() const;
\r
164 * This method is for setting sourceName from the Notification service Message.
\r
166 * @param sourceName as string.
\r
168 void setSourceName(const std::string &sourceName);
\r
171 * This method is for getting mediaContents from the Notification service Message.
\r
173 * @return mediaContents as NSMediaContents pointer.
\r
175 NSMediaContents *getMediaContents() const;
\r
178 * This method is for setting mediaContents from the Notification service Message.
\r
180 * @param mediaContents as NSMediaContents pointer.
\r
182 void setMediaContents(NSMediaContents *mediaContents);
\r
186 uint64_t m_messageId;
\r
187 std::string m_providerId;
\r
189 NSMessageType m_type;
\r
190 std::string m_time;
\r
192 std::string m_title;
\r
193 std::string m_contentText;
\r
194 std::string m_sourceName;
\r
195 NSMediaContents *m_mediaContents;
\r
200 #endif /* _NS_MESSAGE_H_ */
\r