Modify flora license version.
[platform/core/messaging/msg-service.git] / vobject-engine / include / VMessage.h
1 /*
2 * Copyright 2012-2013  Samsung Electronics Co., Ltd
3 *
4 * Licensed under the Flora License, Version 1.1 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 *    http://floralicense.org/license/
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17 #ifndef _VMSG_H
18 #define _VMSG_H
19
20 #ifdef __cplusplus
21 extern "C" {
22 #endif /* __cplusplus */
23
24 #include "VTypes.h"
25
26 /****************************************************************************************************/
27 /*                                                                                      ENUMERATION DECLARATION                                                                 */
28 /****************************************************************************************************/
29
30 /**
31 * @enum vMsgType
32 * This enumeration defines the property of vcard.
33 */
34 typedef enum
35 {
36         VMSG_TYPE_BEGIN,
37         VMSG_TYPE_END,
38         VMSG_TYPE_TEL,
39         VMSG_TYPE_VBODY,
40         VMSG_TYPE_VCARD,
41         VMSG_TYPE_VMSG,
42         VMSG_TYPE_BODY,
43         VMSG_TYPE_SUBJECT,
44         VMSG_TYPE_MSGBOX,
45         VMSG_TYPE_STATUS,
46         VMSG_TYPE_MSGTYPE,
47         VMSG_TYPE_DATE,
48 }vMsgType;
49
50 #define VMSG_TYPE_NUM   12              /**< number of vcard type */
51
52 /**
53 * @enum vMsgParamName
54 * This enumeration defines the name of vcard parameter.
55 */
56 typedef enum
57 {
58         VMSG_PARAM_CHARSET,             /**<This is charset parameter. */
59         VMSG_PARAM_CONTEXT,             /**<This is context parameter. */
60         VMSG_PARAM_ENCODING,    /**<This is encoding parameter. */
61         VMSG_PARAM_LANGUAGE,    /**<This is language parameter. */
62         VMSG_PARAM_TYPE,                        /**<This is type parameter. */
63         VMSG_PARAM_VALUE                /**<This is value parameter. */
64 }vMsgParamName;
65
66 #define VMSG_PARAM_NUM          6       /**< number of vcard parameter */
67
68 /**
69 * @enum vMsgParamName
70 * This enumeration defines the value of encoding parameter.
71 */
72 typedef enum
73 {
74         VMSG_ENC_PARAM_B,                                       /**<This is b encoding parameter. */
75         VMSG_ENC_PARAM_BASE64,                          /**<This isbase64 encoding parameter. */
76         VMSG_ENC_PARAM_QUOTED_PRINTABLE,        /**<This is quoted printable encoding parameter. */
77         VMSG_ENC_PARAM_7BIT,                            /**<This is 7 bit encoding parameter. */
78         VMSG_ENC_PARAM_8BIT                                     /**<This is 8 bit encoding parameter. */
79 }vMsgEncVal;
80
81 #define VMSG_ENCODE_PARAM_NUM   5       /**< number of vcard encoding parameter */
82
83 /**
84 * @enum vMsgCharsetVal
85 * This enumeration defines the value of charset parameter.
86 */
87 typedef enum
88 {
89         VMSG_CHARSET_PARAM_UTF_8,               /**<This is utf-8 charset parameter. */
90         VMSG_CHARSET_PARAM_UTF_16,              /**<This is utf-16 charset parameter. */
91         VMSG_CHARSET_PARAM_SHIFT_JIS,   /**<This is shift-jis charset parameter. */
92         VMSG_CHARSET_PARAM_ISO_8859_1   /**<This is iso-8859-1 charset parameter. */
93 }vMsgCharsetVal;
94
95 #define VMSG_CHARSET_PARAM_NUM  4       /**< number of vcard charset parameter */
96
97 /**
98 * @enum vMsgValVal
99 * This enumeration defines the value of value parameter.
100 */
101 typedef enum
102 {
103         VMSG_VALUE_PARAM_BINARY,                /**<This is binary value parameter. */
104         VMSG_VALUE_PARAM_BOOLEAN,               /**<This is boolean value parameter. */
105         VMSG_VALUE_PARAM_DATE,                  /**<This is date value parameter. */
106         VMSG_VALUE_PARAM_DATE_TIME,     /**<This is date time value parameter. */
107         VMSG_VALUE_PARAM_FLOAT,         /**<This is float value parameter. */
108         VMSG_VALUE_PARAM_INTEGER,               /**<This is integer value parameter. */
109         VMSG_VALUE_PARAM_PHONE_NUMBER,  /**<This is phone number value parameter. */
110         VMSG_VALUE_PARAM_TEXT,                          /**<This is text value parameter. */
111         VMSG_VALUE_PARAM_TIME,                          /**<This is time value parameter. */
112         VMSG_VALUE_PARAM_URI,                           /**<This is uri value parameter. */
113         VMSG_VALUE_PARAM_URL,                           /**<This is url value parameter. */
114         VMSG_VALUE_PARAM_UTC_OFFSET,            /**<This is utc offset value parameter. */
115         VMSG_VALUE_PARAM_VMSG                           /**<This is vcard value parameter. */
116 }vMsgValVal;
117
118 #define VMSG_VALUE_PARAM_NUM            13              /**< number of vcard value parameter */
119
120 /**
121 * @enum vMsgValVal
122 * This enumeration defines the value of type parameter.
123 */
124 typedef enum
125 {
126         VMSG_TYPE_PARAM_AIFF,           /**<This is aiff type parameter. */
127         VMSG_TYPE_PARAM_BBS,            /**<This is bbs type parameter. */
128         VMSG_TYPE_PARAM_CAR,            /**<This is car type parameter. */
129         VMSG_TYPE_PARAM_CELL,           /**<This is cell type parameter. */
130         VMSG_TYPE_PARAM_DOM,            /**<This is dom type parameter. */
131         VMSG_TYPE_PARAM_WORK,           /**<This is work type parameter. */
132         VMSG_TYPE_PARAM_FAX,            /**<This is fax type parameter. */
133         VMSG_TYPE_PARAM_GIF,            /**<This is gif type parameter. */
134         VMSG_TYPE_PARAM_HOME,           /**<This is home type parameter. */
135         VMSG_TYPE_PARAM_INTL,           /**<This is intl type parameter. */
136         VMSG_TYPE_PARAM_INTERNET,       /**<This is internet type parameter. */
137         VMSG_TYPE_PARAM_ISDN,           /**<This is ISDN type parameter. */
138         VMSG_TYPE_PARAM_JPEG,           /**<This is jpeg type parameter. */
139         VMSG_TYPE_PARAM_MOBILE,         /**<This is mobile type parameter. */
140         VMSG_TYPE_PARAM_MODEM,          /**<This is mpdem type parameter. */
141         VMSG_TYPE_PARAM_MSG,            /**<This is msg type parameter. */
142         VMSG_TYPE_PARAM_PAGER,          /**<This is pager type parameter. */
143         VMSG_TYPE_PARAM_PARCEL,         /**<This is parcel type parameter. */
144         VMSG_TYPE_PARAM_PCM,            /**<This is PCM type parameter. */
145         VMSG_TYPE_PARAM_PCS,            /**<This is PCS type parameter. */
146         VMSG_TYPE_PARAM_PNG,            /**<This is png type parameter. */
147         VMSG_TYPE_PARAM_POSTAL,         /**<This is potsal type parameter. */
148         VMSG_TYPE_PARAM_PREF,           /**<This is pref type parameter. */
149         VMSG_TYPE_PARAM_VIDEO,          /**<This is video type parameter. */
150         VMSG_TYPE_PARAM_VOICE,          /**<This is voice type parameter. */
151         VMSG_TYPE_PARAM_WAVE,           /**<This is wave type parameter. */
152         VMSG_TYPE_PARAM_WBMP,           /**<This is wbmp type parameter. */
153         VMSG_TYPE_PARAM_ETC,            /**<This is etc type parameter. */
154         VMSG_TYPE_PARAM_X400,           /**<This is X400 type parameter. */
155         VMSG_TYPE_PARAM_X_IRMC_N        /**<This is X-IRMC-N type parameter. */
156 }vMsgTypeVal;
157
158 #define VMSG_TYPE_PARAM_NUM             30              /**< number of vcard type parameter */
159
160 /* VCard Encoder/Decoder status. */
161 #define VMSG_TYPE_NAME_STATUS   1       /**< vcard type name status */
162 #define VMSG_PARAM_NAME_STATUS  2       /**< vcard parameter name status */
163 #define VMSG_TYPE_VALUE_STATUS  3       /**< vcard type value status */
164 #define VMSG_PARAM_VALUE_STATUS 4       /**< vcard parameter value status */
165
166
167 /*
168  * Public Function Prototypes
169  */
170
171
172 /**
173 * @fn VTree* vcard_decode(char* pVCardRaw);
174 * This function decodes a vcard string to a vTree.
175 *
176 * @return       This function returns a pointer to VTree.
177 * @param[in] pVCardRaw  Points to the vcard string.
178 * @see vcard_encode
179 */
180 SLPAPI VTree*   vmsg_decode(char* pVMsgRaw);
181
182 /**
183 * @fn char* vcard_encode(VTree* pVTree);
184 * This function encodes a vTree to a string.
185 *
186 * @return       This function returns a pointer to a vcard string.
187 * @param[in] pVTree  Points to a VTree.
188 * @see vcard_decode
189 */
190 SLPAPI char*    vmsg_encode(VTree* pVTree);
191
192 /**
193 * @fn char* vcard_free_vtree_memory(VTree* pTree);
194 * This function free a pTree allocated memory
195 *
196 * @return       This function returns value of success or fail
197 * @param[in] pVTree  Points to a VTree.
198 */
199 SLPAPI bool vmsg_free_vtree_memory(VTree * pTree);
200
201 #ifdef __cplusplus
202 }
203 #endif /* __cplusplus */
204
205 #endif /* _VMSG_H_ */
206
207 /**
208 * @}
209 */