Modify flora license version.
[platform/core/messaging/msg-service.git] / vobject-engine / include / VCard.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 _VCARD_H
18 #define _VCARD_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 vCardType
32 * This enumeration defines the property of vcard.
33 */
34 typedef enum
35 {
36         VCARD_TYPE_ADR,                 /**<This is address of vcard. */
37         VCARD_TYPE_AGENT,                       /**<This is agent of vcard. */
38         VCARD_TYPE_BDAY,                        /**<This is bday of vcard. */
39         VCARD_TYPE_BEGIN,                       /**<This is begin of vcard. */
40         VCARD_TYPE_CATEGORIES,  /**<This is categories of vcard. */
41         VCARD_TYPE_CLASS,                       /**<This is class of vcard. */
42         VCARD_TYPE_EMAIL,                       /**<This is email of vcard. */
43         VCARD_TYPE_END,                 /**<This is end of vcard. */
44         VCARD_TYPE_FN,                          /**<This is FN  of vcard. */
45         VCARD_TYPE_GEO,                 /**<This is GEO of vcard. */
46         VCARD_TYPE_KEY,                 /**<This is key of vcard. */
47         VCARD_TYPE_LABEL,                       /**<This is label of vcard. */
48         VCARD_TYPE_LOGO,                        /**<This is logo of vcard. */
49         VCARD_TYPE_MAILER,              /**<This is mailer of vcar. */
50         VCARD_TYPE_N,                           /**<This is N of vcard. */
51         VCARD_TYPE_NAME,                        /**<This is name of vcard. */
52         VCARD_TYPE_NICKNAME,            /**<This is nick name of vcard. */
53         VCARD_TYPE_NOTE,                        /**<This is note of vcard. */
54         VCARD_TYPE_ORG,                 /**<This is ORG of vcard. */
55         VCARD_TYPE_PHOTO,                       /**<This is photo of vcard. */
56         VCARD_TYPE_PRODID,              /**<This is PRODID of vcard. */
57         VCARD_TYPE_PROFILE,             /**<This is profile of vcard. */
58         VCARD_TYPE_REV,                 /**<This is REV of vcard. */
59         VCARD_TYPE_ROLE,                        /**<This is ROLE of vcard. */
60         VCARD_TYPE_SORT_STRING, /**<This is sort string of vcard. */
61         VCARD_TYPE_SOUND,                       /**<This is sound of vcard. */
62         VCARD_TYPE_SOURCE,              /**<This is source of vcard. */
63         VCARD_TYPE_TEL,                 /**<This is tel of vcard. */
64         VCARD_TYPE_TITLE,                       /**<This is title of vcard. */
65         VCARD_TYPE_TZ,                          /**<This is TZ of vcard. */
66         VCARD_TYPE_UID,                 /**<This is uid of vcard. */
67         VCARD_TYPE_URL,                 /**<This is url of vcard. */
68         VCARD_TYPE_VERSION,             /**<This is version of vcard. */
69         VCARD_TYPE_XIRMCLUID            /**<This is xirmcl uid of vcard. */
70 }vCardType;
71
72 #define VCARD_TYPE_NUM  34              /**< number of vcard type */
73
74 /**
75 * @enum vCardParamName
76 * This enumeration defines the name of vcard parameter.
77 */
78 typedef enum
79 {
80         VCARD_PARAM_CHARSET,            /**<This is charset parameter. */
81         VCARD_PARAM_CONTEXT,            /**<This is context parameter. */
82         VCARD_PARAM_ENCODING,   /**<This is encoding parameter. */
83         VCARD_PARAM_LANGUAGE,   /**<This is language parameter. */
84         VCARD_PARAM_TYPE,                       /**<This is type parameter. */
85         VCARD_PARAM_VALUE               /**<This is value parameter. */
86 }vCardParamName;
87
88 #define VCARD_PARAM_NUM         6       /**< number of vcard parameter */
89
90 /**
91 * @enum vCardParamName
92 * This enumeration defines the value of encoding parameter.
93 */
94 typedef enum
95 {
96         VCARD_ENC_PARAM_B,                                      /**<This is b encoding parameter. */
97         VCARD_ENC_PARAM_BASE64,                         /**<This isbase64 encoding parameter. */
98         VCARD_ENC_PARAM_QUOTED_PRINTABLE,       /**<This is quoted printable encoding parameter. */
99         VCARD_ENC_PARAM_7BIT,                           /**<This is 7 bit encoding parameter. */
100         VCARD_ENC_PARAM_8BIT                                    /**<This is 8 bit encoding parameter. */
101 }vCardEncVal;
102
103 #define VCARD_ENCODE_PARAM_NUM  5       /**< number of vcard encoding parameter */
104
105 /**
106 * @enum vCardCharsetVal
107 * This enumeration defines the value of charset parameter.
108 */
109 typedef enum
110 {
111         VCARD_CHARSET_PARAM_UTF_8,              /**<This is utf-8 charset parameter. */
112         VCARD_CHARSET_PARAM_UTF_16,             /**<This is utf-16 charset parameter. */
113         VCARD_CHARSET_PARAM_SHIFT_JIS,  /**<This is shift-jis charset parameter. */
114         VCARD_CHARSET_PARAM_ISO_8859_1  /**<This is iso-8859-1 charset parameter. */
115 }vCardCharsetVal;
116
117 #define VCARD_CHARSET_PARAM_NUM  4      /**< number of vcard charset parameter */
118
119 /**
120 * @enum vCardValVal
121 * This enumeration defines the value of value parameter.
122 */
123 typedef enum
124 {
125         VCARD_VALUE_PARAM_BINARY,               /**<This is binary value parameter. */
126         VCARD_VALUE_PARAM_BOOLEAN,              /**<This is boolean value parameter. */
127         VCARD_VALUE_PARAM_DATE,                 /**<This is date value parameter. */
128         VCARD_VALUE_PARAM_DATE_TIME,    /**<This is date time value parameter. */
129         VCARD_VALUE_PARAM_FLOAT,                /**<This is float value parameter. */
130         VCARD_VALUE_PARAM_INTEGER,              /**<This is integer value parameter. */
131         VCARD_VALUE_PARAM_PHONE_NUMBER, /**<This is phone number value parameter. */
132         VCARD_VALUE_PARAM_TEXT,                         /**<This is text value parameter. */
133         VCARD_VALUE_PARAM_TIME,                         /**<This is time value parameter. */
134         VCARD_VALUE_PARAM_URI,                          /**<This is uri value parameter. */
135         VCARD_VALUE_PARAM_URL,                          /**<This is url value parameter. */
136         VCARD_VALUE_PARAM_UTC_OFFSET,           /**<This is utc offset value parameter. */
137         VCARD_VALUE_PARAM_VCARD                         /**<This is vcard value parameter. */
138 }vCardValVal;
139
140 #define VCARD_VALUE_PARAM_NUM           13              /**< number of vcard value parameter */
141
142 /**
143 * @enum vCardValVal
144 * This enumeration defines the value of type parameter.
145 */
146 typedef enum
147 {
148         VCARD_TYPE_PARAM_AIFF,          /**<This is aiff type parameter. */
149         VCARD_TYPE_PARAM_BBS,           /**<This is bbs type parameter. */
150         VCARD_TYPE_PARAM_CAR,           /**<This is car type parameter. */
151         VCARD_TYPE_PARAM_CELL,          /**<This is cell type parameter. */
152         VCARD_TYPE_PARAM_DOM,           /**<This is dom type parameter. */
153         VCARD_TYPE_PARAM_WORK,          /**<This is work type parameter. */
154         VCARD_TYPE_PARAM_FAX,           /**<This is fax type parameter. */
155         VCARD_TYPE_PARAM_GIF,           /**<This is gif type parameter. */
156         VCARD_TYPE_PARAM_HOME,          /**<This is home type parameter. */
157         VCARD_TYPE_PARAM_INTL,          /**<This is intl type parameter. */
158         VCARD_TYPE_PARAM_INTERNET,      /**<This is internet type parameter. */
159         VCARD_TYPE_PARAM_ISDN,          /**<This is ISDN type parameter. */
160         VCARD_TYPE_PARAM_JPEG,          /**<This is jpeg type parameter. */
161         VCARD_TYPE_PARAM_MOBILE,                /**<This is mobile type parameter. */
162         VCARD_TYPE_PARAM_MODEM,         /**<This is mpdem type parameter. */
163         VCARD_TYPE_PARAM_MSG,           /**<This is msg type parameter. */
164         VCARD_TYPE_PARAM_PAGER,         /**<This is pager type parameter. */
165         VCARD_TYPE_PARAM_PARCEL,                /**<This is parcel type parameter. */
166         VCARD_TYPE_PARAM_PCM,           /**<This is PCM type parameter. */
167         VCARD_TYPE_PARAM_PCS,           /**<This is PCS type parameter. */
168         VCARD_TYPE_PARAM_PNG,           /**<This is png type parameter. */
169         VCARD_TYPE_PARAM_POSTAL,                /**<This is potsal type parameter. */
170         VCARD_TYPE_PARAM_PREF,          /**<This is pref type parameter. */
171         VCARD_TYPE_PARAM_VIDEO,         /**<This is video type parameter. */
172         VCARD_TYPE_PARAM_VOICE,         /**<This is voice type parameter. */
173         VCARD_TYPE_PARAM_WAVE,          /**<This is wave type parameter. */
174         VCARD_TYPE_PARAM_WBMP,          /**<This is wbmp type parameter. */
175         VCARD_TYPE_PARAM_ETC,           /**<This is etc type parameter. */
176         VCARD_TYPE_PARAM_X400,          /**<This is X400 type parameter. */
177         VCARD_TYPE_PARAM_X_IRMC_N       /**<This is X-IRMC-N type parameter. */
178 }vCardTypeVal;
179
180 #define VCARD_TYPE_PARAM_NUM            30              /**< number of vcard type parameter */
181
182 /* VCard Encoder/Decoder status. */
183 #define VCARD_TYPE_NAME_STATUS  1       /**< vcard type name status */
184 #define VCARD_PARAM_NAME_STATUS 2       /**< vcard parameter name status */
185 #define VCARD_TYPE_VALUE_STATUS 3       /**< vcard type value status */
186 #define VCARD_PARAM_VALUE_STATUS 4      /**< vcard parameter value status */
187
188
189 /*
190  * Public Function Prototypes
191  */
192
193
194 /**
195 * @fn VTree* vcard_decode(char* pVCardRaw);
196 * This function decodes a vcard string to a vTree.
197 *
198 * @return       This function returns a pointer to VTree.
199 * @param[in] pVCardRaw  Points to the vcard string.
200 * @see vcard_encode
201 */
202 SLPAPI VTree*   vcard_decode(char* pVCardRaw);
203
204 /**
205 * @fn char* vcard_encode(VTree* pVTree);
206 * This function encodes a vTree to a string.
207 *
208 * @return       This function returns a pointer to a vcard string.
209 * @param[in] pVTree  Points to a VTree.
210 * @see vcard_decode
211 */
212 SLPAPI char*    vcard_encode(VTree* pVTree);
213
214 /**
215 * @fn char* vcard_free_vtree_memory(VTree* pTree);
216 * This function free a pTree allocated memory
217 *
218 * @return       This function returns value of success or fail
219 * @param[in] pVTree  Points to a VTree.
220 */
221 SLPAPI bool vcard_free_vtree_memory(VTree * pTree);
222
223 #ifdef __cplusplus
224 }
225 #endif /* __cplusplus */
226
227 #endif /* _VCARD_H_ */
228
229 /**
230 * @}
231 */