merge with master
[framework/osp/messaging.git] / src / FMsg_CbsMessageImpl.h
1 //\r
2 // Open Service Platform\r
3 // Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.\r
4 //\r
5 // Licensed under the Apache License, Version 2.0 (the License);\r
6 // you may not use this file except in compliance with the License.\r
7 // You may obtain a copy of the License at\r
8 //\r
9 //     http://www.apache.org/licenses/LICENSE-2.0\r
10 //\r
11 // Unless required by applicable law or agreed to in writing, software\r
12 // distributed under the License is distributed on an "AS IS" BASIS,\r
13 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
14 // See the License for the specific language governing permissions and\r
15 // limitations under the License.\r
16 //\r
17 /**\r
18  * @if VISPARTNER-OPERATOR\r
19  *\r
20  * @file                FMsg_CbsMessageImpl.h\r
21  * @brief               This is the header file for the _CbsMessageImpl class.\r
22  *\r
23  * @visibility  partner-operator\r
24  *\r
25  * This header file contains the declarations of the _CbsMessageImpl class.\r
26  *\r
27  * @endif\r
28  */\r
29 \r
30 #ifndef _FMSG_INTERNAL_CBS_MESSAGE_IMPL_H_\r
31 #define _FMSG_INTERNAL_CBS_MESSAGE_IMPL_H_\r
32 \r
33 namespace Tizen { namespace Base\r
34 {\r
35 class ByteBuffer;\r
36 class String;\r
37 class DateTime;\r
38 } }\r
39 \r
40 #include <FBaseDateTime.h>\r
41 \r
42 namespace Tizen { namespace Messaging\r
43 {\r
44 \r
45 class CbsMessage;\r
46 \r
47 /**\r
48 * @if VISPARTNER-OPERATOR\r
49 *\r
50 * @class        _CbsMessageImpl\r
51 *\r
52 * @brief        This class provides methods for handling a CBS message.\r
53 *\r
54 * @since 2.1\r
55 *\r
56 * @final        This class is not intended for extension.\r
57 *\r
58 * @visibility   partner-operator\r
59 *\r
60 * The %_CbsMessageImpl class provides methods for handling a CBS message. It allows you to get the body text,\r
61 * received time, and sender address of a CBS message.\r
62 *\r
63 * @endif\r
64 */\r
65 \r
66 class _CbsMessageImpl\r
67         : public Tizen::Base::Object\r
68 {\r
69 public:\r
70         /**\r
71         * @if VISPARTNER-OPERATOR\r
72         *\r
73         * This destructor overrides Tizen::Base::Object::~Object().\r
74         *\r
75         * @since 2.1\r
76         *\r
77         * @visibility   partner-operator\r
78         *\r
79         * @endif\r
80         */\r
81         virtual ~_CbsMessageImpl(void);\r
82 \r
83         /**\r
84         * @if VISPARTNER-OPERATOR\r
85         *\r
86         * Compares the specified instance of %_CbsMessageImpl with the calling instance.\r
87         *\r
88         * @since 2.1\r
89         *\r
90         * @visibility   partner-operator\r
91         *\r
92         * @return               @c true, if the values match @n\r
93         *                               @c false, otherwise\r
94         * @param[in]    obj     The other Object to be compared\r
95         * @see                  Object::Equals()\r
96         *\r
97         * @endif\r
98         */\r
99         virtual bool Equals(const Tizen::Base::Object& obj) const;\r
100 \r
101         /**\r
102         * @if VISPARTNER-OPERATOR\r
103         *\r
104         * Gets the copied instance of the class.\r
105         *\r
106         * @since 2.1\r
107         *\r
108         * @visibility   partner-operator\r
109         *\r
110         * @return               An instance of %_CbsMessageImpl\r
111         * @exception    E_SUCCESS                       The method is successful.\r
112         * @exception    E_OUT_OF_MEMORY         The memory is insufficient.\r
113         *\r
114         * @remarks              In case of error, this method returns @c null. @n\r
115         *                               The specific error code can be accessed using the GetLastResult() method.\r
116         *\r
117         * @endif\r
118         */\r
119         CbsMessage* CloneN(void) const;\r
120 \r
121 \r
122         /**\r
123         * @if VISPARTNER-OPERATOR\r
124         *\r
125         * Gets the hash value of the current instance.\r
126         *\r
127         * @since 2.1\r
128         *\r
129         * @visibility   partner-operator\r
130         *\r
131         * @return               The current instance's hash value\r
132         *\r
133         * @endif\r
134         */\r
135         virtual int GetHashCode(void) const;\r
136 \r
137         /**\r
138         * @if VISPARTNER-OPERATOR\r
139         *\r
140         * Checks whether this message is an ETWS notification.\r
141         *\r
142         * @since 2.1\r
143         *\r
144         * @visibility   partner-operator\r
145         *\r
146         * @return               @c true if this message is an ETWS notification, @n\r
147         *                               else @c false\r
148         * @remarks              If the return value is @c true, the message is ETWS secondary notification.\r
149         *\r
150         * @endif\r
151         */\r
152         bool IsEtwsNotification(void) const;\r
153 \r
154         /**\r
155         * @if VISPARTNER-OPERATOR\r
156         *\r
157         * Gets the serial number of the CBS message.\r
158         *\r
159         * @since 2.1\r
160         *\r
161         * @visibility   partner-operator\r
162         *\r
163         * @return               The serial number of the CBS message\r
164         * @exception    E_SUCCESS                       The method is successful.\r
165         * @exception    E_OUT_OF_MEMORY         The memory is insufficient.\r
166         * @remarks              The specific error code can be accessed using the GetLastResult() method. @n\r
167         *                               In case of an error, this method returns null.\r
168         *\r
169         * @endif\r
170         */\r
171         Tizen::Base::ByteBuffer* GetSerialNumberN(void) const;\r
172 \r
173         /**\r
174         * @if VISPARTNER-OPERATOR\r
175         *\r
176         * Gets the message ID of the CBS message.\r
177         *\r
178         * @since 2.1\r
179         *\r
180         * @visibility   partner-operator\r
181         *\r
182         * @return               The the message ID of the CBS message\r
183         *\r
184         * @endif\r
185         */\r
186         int GetMessageId(void) const;\r
187 \r
188         /**\r
189         * @if VISPARTNER-OPERATOR\r
190         *\r
191         * Gets the body of the message.\r
192         *\r
193         * @since 2.1\r
194         *\r
195         * @visibility   partner-operator\r
196         *\r
197         * @return               The body of the message\r
198         *\r
199         * @endif\r
200         */\r
201         Tizen::Base::String GetText(void) const;\r
202 \r
203         /**\r
204         * @if VISPARTNER-OPERATOR\r
205         *\r
206         * Gets the date and time (UTC time) of the message when it is received.\r
207         *\r
208         * @since 2.1\r
209         *\r
210         * @visibility   partner-operator\r
211         *\r
212         * @return               The date and time (UTC time) when the message is received\r
213         *\r
214         * @endif\r
215         */\r
216         Tizen::Base::DateTime GetReceivedTime(void) const;\r
217 \r
218         /**\r
219         * @if VISPARTNER-OPERATOR\r
220         *\r
221         * Gets the Data Coding Scheme of the CBS message.\r
222         *\r
223         * @since 2.1\r
224         *\r
225         * @visibility           partner-operator\r
226         *\r
227         * @return               The Data Coding Scheme of the CBS message\r
228         * @exception            E_SUCCESS                        The method is successful.\r
229         * @exception            E_OUT_OF_MEMORY                  The memory is insufficient.\r
230         * @remarks              The specific error code can be accessed using the GetLastResult() method. @n\r
231         *                       In case of an error, this method returns null. @n\r
232         *                       The alphabet/coding and the language applied to CBS messages are defined in 3GPP TS 23.038\r
233         *\r
234         * @endif\r
235         */\r
236         byte GetDataCodingScheme(void) const;\r
237         \r
238         /**\r
239 \r
240         * @if VISPARTNER-OPERATOR\r
241         *\r
242         * Gets the language type of a message.\r
243         *\r
244 \r
245         * @since 2.1\r
246         *\r
247         * @visibility           partner-operator\r
248         *\r
249         * @return               The language type of a message  \r
250         *\r
251         * @endif\r
252         */\r
253         Tizen::Base::String GetLanguageType(void) const;\r
254 \r
255 public:\r
256         /**\r
257         * Gets the instance of CbsChannel\r
258         *\r
259         * @since 2.1\r
260         */\r
261     static CbsMessage* GetCbsMessageN();\r
262 \r
263     /**\r
264      * Gets the Impl instance.\r
265      *\r
266      * @since 2.1\r
267      * @return              The pointer to _CbsMessageImpl\r
268      * @param[in]   CbsMessage            An instance of CbsMessage\r
269      */\r
270         static _CbsMessageImpl* GetInstance(CbsMessage& cbsMessage);\r
271 \r
272 public:\r
273         /**\r
274         * This default constructor is intentionally declared as private so that only the platform can create an instance.\r
275         *\r
276         * @since 2.1\r
277         */\r
278         _CbsMessageImpl(void);\r
279 \r
280         /**\r
281         * The implementation of this copy constructor is intentionally blank and declared as private to prohibit copying of objects.\r
282         *\r
283         * @since 2.1\r
284         *\r
285         * @param[in]    rhs                             An instance of _CbsMessageImpl\r
286         */\r
287         _CbsMessageImpl(const _CbsMessageImpl& rhs);\r
288 \r
289         /**\r
290         * The implementation of this copy assignment operator is intentionally blank and declared as private to prohibit copying of objects. @n\r
291         * -     Use CloneN() to get an exact copy of the instance.\r
292         * -     Use Equals() to compare the contents of one instance with the other.\r
293         *\r
294         * @since 2.1\r
295         *\r
296         * @return               A reference to this instance\r
297         * @param[in]    rhs                             An instance of _CbsMessageImpl\r
298         */\r
299         _CbsMessageImpl& operator =(const _CbsMessageImpl& rhs);\r
300 \r
301         /**\r
302         * Initializes this instance of %_CbsChannelImpl with the specified parameter.\r
303         *\r
304         * @since 2.1\r
305         *\r
306         * @param[in]    dateTime                The date and time (UTC time) when the message is received\r
307         * @param[in]    cbsSerialNumber The cbsSerialNumber of the CBS message\r
308         * @param[in]    text                    The cbs message body text\r
309         * @param[in]    cbsMessageId    The cbsMessageId of the CBS message\r
310         * @param[in]    isEtwsnotification              The Etws notification of the CBS message\r
311         * @exception    E_SUCCESS                       The method is successful.\r
312         * @exception    E_OUT_OF_MEMORY         The memory is insufficient.\r
313         * @exception    E_SYSTEM                        A system error has occurred.\r
314         */\r
315         result SetCbsMessageImpl(const Tizen::Base::DateTime& dateTime, const Tizen::Base::ByteBuffer& cbsSerialNumber, const Tizen::Base::String& text, int cbsMessageId, bool isEtwsNotification, byte dataCodingScheme, const Tizen::Base::String& languageType);\r
316 \r
317 private:\r
318         Tizen::Base::DateTime __cbsMsgTime;\r
319         Tizen::Base::ByteBuffer* __pCbsSerialNumber;\r
320         Tizen::Base::String __cbsSenderMsg;\r
321         Tizen::Base::String __cbslanguageType;\r
322         int __cbsMessageId;\r
323         bool __isEtwsNotification;\r
324         byte __dataCodingScheme;\r
325 }; // _CbsMessageImpl\r
326 \r
327 } } // Tizen::Messaging\r
328 \r
329 #endif // _FMSG_INTERNAL_CBS_MESSAGE_IMPL_H_\r