upload tizen1.0 source
[pkgs/o/oma-ds-service.git] / include / Common / Common_Vconf.h
1 /*
2  * oma-ds-service
3  *
4  * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
5  *
6  * Contact: JuHak Park <juhaki.park@samsung.com>,
7  *          JuneHyuk Lee <junhyuk7.lee@samsung.com>,
8  *          SunBong Ha <sunbong.ha@samsung.com>
9  *
10  * Licensed under the Apache License, Version 2.0 (the "License");
11  * you may not use this file except in compliance with the License.
12  * You may obtain a copy of the License at
13  *
14  * http://www.apache.org/licenses/LICENSE-2.0
15  *
16  * Unless required by applicable law or agreed to in writing, software
17  * distributed under the License is distributed on an "AS IS" BASIS,
18  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19  * See the License for the specific language governing permissions and
20  * limitations under the License.
21  *
22  */
23
24
25
26
27
28 /*
29  * For any sort of issue you concern as to this software,
30  * you may use following point of contact.
31  * All resources contributed on this software
32  * are orinigally written by S-Core Inc., a member of Samsung Group.
33  *
34  * SeongWon Shim <seongwon.shim@samsung.com>
35  */
36
37 /**
38  *   @Common_Vconf.h
39  *   @version                                                                   0.1
40  *   @brief                                                                             This file is the header file of defined vconf value
41  */
42
43 #ifndef COMMON_VCONF_H_
44 #define COMMON_VCONF_H_
45
46 #include <stdbool.h>
47
48 /*TODO have to be removed after removing vconf*/
49 /*! Here are some global macros representing Settings Paths for AS/DS/DM*/
50 #define AS_SETTINGS_PATH "db/Apps/ActiveSync-service"
51 #define DS_SETTINGS_DEFAULT_PATH "db/syncml-service/DS"
52 #define DS_SETTINGS_PATH DS_SETTINGS_DEFAULT_PATH"/Accounts"
53 #define DM_SETTINGS_PATH "db/syncml-service/DM"
54
55 /* Vconf key names for SyncML DS profile setting.*/
56 #define DS_SETTING_CONTACT_CHANGETIME   "/Contact/ChangeTime"           /*int*/
57 #define DS_SETTING_CALENDAR_CHANGETIME  "/Calendar/ChangeTime"          /*int*/
58 #define DS_SETTING_MEMO_CHANGETIME      "/Note/ChangeTime"              /*int*/
59 #ifdef FILE_SYNC
60 #define DS_SETTING_FILE_CHANGETIME      "/File/ChangeTime"              /*int*/
61 #endif
62 /* Keys for each profile */
63 #define DS_SETTING_NAME                 "/Name"                         /*string*/
64 #define DS_SETTING_ADDRTYPE             "/AppAddr/AddrType"             /*int*/
65 #define DS_SETTING_ADDR                 "/AppAddr/Addr"                 /*string*/
66 #define DS_SETTING_PORTNBR              "/AppAddr/PortNbr"              /*int*/
67 #define DS_SETTING_CLIENT_AUTHNONCE     "/AuthInfo/Client/AuthNonce"    /*string*/
68 #define DS_SETTING_CLIENT_AUTHTYPE      "/AuthInfo/Client/AuthType"     /*int*/
69 #define DS_SETTING_CLIENT_AUTHPWD       "/AuthInfo/Client/AuthPWD"      /*string*/
70 #define DS_SETTING_CLIENT_AUTHNAME      "/AuthInfo/Client/AuthName"     /*string*/
71 #define DS_SETTING_LASTSESSIONTIME      "/GUI/LastSessionTime"          /*int*/
72 #define DS_SETTING_LASTSESSIONSTATUS    "/GUI/LastSessionStatus"        /*int*/
73 #define DS_SETTING_SYNCMODE             "/GUI/SyncMode"                 /*string*/
74 #define DS_SETTING_INTERVAL             "/GUI/Interval"                 /*string*/
75 #define DS_SETTING_SYNCTYPE             "/GUI/SyncType"                 /*string*/
76 #define DS_SETTING_AUTOSYNC_BEGINTIME   "/GUI/AutoSync/BeginTime"       /*int*/
77 /* Keys for each resource type */
78 /* Contact */
79 #define DS_SETTING_CONTACT_ENABLED          "/Resource/Contacts/Enabled"                                /*int*/
80 #define DS_SETTING_CONTACT_TGTURI           "/Resource/Contacts/TgtURI"                                 /*string*/
81 #define DS_SETTING_CONTACT_SRCURI           "/Resource/Contacts/SrcURI"                                 /*string*/
82 #define DS_SETTING_CONTACT_MEMSYNC          "/Resource/Contacts/MemSync"                                /*string*/
83 #define DS_SETTING_CONTACT_MEMSYNCBACKUP    "/Resource/Contacts/MemSync_backup"                         /*string*/
84 #define DS_SETTING_CONTACT_AUTHNONCE        "/Resource/Contacts/AuthInfo/Client/AuthNonce"              /*string*/
85 #define DS_SETTING_CONTACT_AUTHTYPE         "/Resource/Contacts/AuthInfo/Client/AuthType"               /*int*/
86 #define DS_SETTING_CONTACT_AUTHPWD          "/Resource/Contacts/AuthInfo/Client/AuthPWD"                /*string*/
87 #define DS_SETTING_CONTACT_AUTHNAME         "/Resource/Contacts/AuthInfo/Client/AuthName"               /*string*/
88 #define DS_SETTING_CONTACT_DBSYNCED         "/Resource/Contacts/Statistics/DBSynced"                    /*string*/
89 #define DS_SETTING_CONTACT_LASTANCHOR       "/Resource/Contacts/Statistics/LastAnchor"                  /*string*/
90 #define DS_SETTING_CONTACT_LASTSESSIONTIME  "/Resource/Contacts/Statistics/LastSessionTime"             /*int*/
91 #define DS_SETTING_CONTACT_C2S_TOTAL        "/Resource/Contacts/Statistics/Client2Server_Total"         /*int*/
92 #define DS_SETTING_CONTACT_S2C_TOTAL        "/Resource/Contacts/Statistics/Server2Client_Total"         /*int*/
93 #define DS_SETTING_CONTACT_C2S_REPLACE      "/Resource/Contacts/Statistics/Client2Server_NrOfReplace"   /*int*/
94 #define DS_SETTING_CONTACT_S2C_REPLACE      "/Resource/Contacts/Statistics/Server2Client_NrOfReplace"   /*int*/
95 #define DS_SETTING_CONTACT_C2S_ADD          "/Resource/Contacts/Statistics/Client2Server_NrOfAdd"       /*int*/
96 #define DS_SETTING_CONTACT_S2C_ADD          "/Resource/Contacts/Statistics/Server2Client_NrOfAdd"       /*int*/
97 #define DS_SETTING_CONTACT_S2C_DELETE       "/Resource/Contacts/Statistics/Server2Client_NrOfDelete"    /*int*/
98 #define DS_SETTING_CONTACT_C2S_DELETE       "/Resource/Contacts/Statistics/Client2Server_NrOfDelete"    /*int*/
99 /* Calendar */
100 #define DS_SETTING_CALENDAR_ENABLED         "/Resource/Organizer/Enabled"                               /*int*/
101 #define DS_SETTING_CALENDAR_TGTURI          "/Resource/Organizer/TgtURI"                                /*string*/
102 #define DS_SETTING_CALENDAR_SRCURI          "/Resource/Organizer/SrcURI"                                /*string*/
103 #define DS_SETTING_CALENDAR_AUTHNONCE       "/Resource/Organizer/AuthInfo/Client/AuthNonce"             /*string*/
104 #define DS_SETTING_CALENDAR_AUTHTYPE        "/Resource/Organizer/AuthInfo/Client/AuthType"              /*int*/
105 #define DS_SETTING_CALENDAR_AUTHPWD         "/Resource/Organizer/AuthInfo/Client/AuthPWD"               /*string*/
106 #define DS_SETTING_CALENDAR_AUTHNAME        "/Resource/Organizer/AuthInfo/Client/AuthName"              /*string*/
107 #define DS_SETTING_CALENDAR_DBSYNCED        "/Resource/Organizer/Statistics/DBSynced"                   /*string*/
108 #define DS_SETTING_CALENDAR_LASTANCHOR      "/Resource/Organizer/Statistics/LastAnchor"                 /*string*/
109 #define DS_SETTING_CALENDAR_LASTSESSIONTIME "/Resource/Organizer/Statistics/LastSessionTime"            /*int*/
110 #define DS_SETTING_CALENDAR_C2S_TOTAL       "/Resource/Organizer/Statistics/Client2Server_Total"        /*int*/
111 #define DS_SETTING_CALENDAR_S2C_TOTAL       "/Resource/Organizer/Statistics/Server2Client_Total"        /*int*/
112 #define DS_SETTING_CALENDAR_C2S_REPLACE     "/Resource/Organizer/Statistics/Client2Server_NrOfReplace"  /*int*/
113 #define DS_SETTING_CALENDAR_S2C_REPLACE     "/Resource/Organizer/Statistics/Server2Client_NrOfReplace"  /*int*/
114 #define DS_SETTING_CALENDAR_C2S_ADD         "/Resource/Organizer/Statistics/Client2Server_NrOfAdd"      /*int*/
115 #define DS_SETTING_CALENDAR_S2C_ADD         "/Resource/Organizer/Statistics/Server2Client_NrOfAdd"      /*int*/
116 #define DS_SETTING_CALENDAR_S2C_DELETE      "/Resource/Organizer/Statistics/Server2Client_NrOfDelete"   /*int*/
117 #define DS_SETTING_CALENDAR_C2S_DELETE      "/Resource/Organizer/Statistics/Client2Server_NrOfDelete"   /*int*/
118 /* Memo */
119 #define DS_SETTING_MEMO_ENABLED             "/Resource/Memo/Enabled"                                    /*int*/
120 #define DS_SETTING_MEMO_TGTURI              "/Resource/Memo/TgtURI"                                     /*string*/
121 #define DS_SETTING_MEMO_SRCURI              "/Resource/Memo/SrcURI"                                     /*string*/
122 #define DS_SETTING_MEMO_AUTHNONCE           "/Resource/Memo/AuthInfo/Client/AuthNonce"                  /*string*/
123 #define DS_SETTING_MEMO_AUTHTYPE            "/Resource/Memo/AuthInfo/Client/AuthType"                   /*int*/
124 #define DS_SETTING_MEMO_AUTHPWD             "/Resource/Memo/AuthInfo/Client/AuthPWD"                    /*string*/
125 #define DS_SETTING_MEMO_AUTHNAME            "/Resource/Memo/AuthInfo/Client/AuthName"                   /*string*/
126 #define DS_SETTING_MEMO_DBSYNCED            "/Resource/Memo/Statistics/DBSynced"                        /*string*/
127 #define DS_SETTING_MEMO_LASTANCHOR          "/Resource/Memo/Statistics/LastAnchor"                      /*string*/
128 #define DS_SETTING_MEMO_LASTSESSIONTIME     "/Resource/Memo/Statistics/LastSessionTime"                 /*int*/
129 #define DS_SETTING_MEMO_C2S_TOTAL           "/Resource/Memo/Statistics/Client2Server_Total"             /*int*/
130 #define DS_SETTING_MEMO_S2C_TOTAL           "/Resource/Memo/Statistics/Server2Client_Total"             /*int*/
131 #define DS_SETTING_MEMO_C2S_REPLACE         "/Resource/Memo/Statistics/Client2Server_NrOfReplace"       /*int*/
132 #define DS_SETTING_MEMO_S2C_REPLACE         "/Resource/Memo/Statistics/Server2Client_NrOfReplace"       /*int*/
133 #define DS_SETTING_MEMO_C2S_ADD             "/Resource/Memo/Statistics/Client2Server_NrOfAdd"           /*int*/
134 #define DS_SETTING_MEMO_S2C_ADD             "/Resource/Memo/Statistics/Server2Client_NrOfAdd"           /*int*/
135 #define DS_SETTING_MEMO_S2C_DELETE          "/Resource/Memo/Statistics/Server2Client_NrOfDelete"        /*int*/
136 #define DS_SETTING_MEMO_C2S_DELETE          "/Resource/Memo/Statistics/Client2Server_NrOfDelete"        /*int*/
137 #ifdef FILE_SYNC
138 #define DS_SETTING_FILE_ENABLED             "/Resource/File/Enabled"                                    /*int*/
139 #define DS_SETTING_FILE_TGTURI              "/Resource/File/TgtURI"                                     /*string*/
140 #define DS_SETTING_FILE_SRCURI              "/Resource/File/SrcURI"                                     /*string*/
141 #define DS_SETTING_FILE_AUTHNONCE           "/Resource/File/AuthInfo/Client/AuthNonce"                  /*string*/
142 #define DS_SETTING_FILE_AUTHTYPE            "/Resource/File/AuthInfo/Client/AuthType"                   /*int*/
143 #define DS_SETTING_FILE_AUTHPWD             "/Resource/File/AuthInfo/Client/AuthPWD"                    /*string*/
144 #define DS_SETTING_FILE_AUTHNAME            "/Resource/File/AuthInfo/Client/AuthName"                   /*string*/
145 #define DS_SETTING_FILE_DBSYNCED            "/Resource/File/Statistics/DBSynced"                        /*string*/
146 #define DS_SETTING_FILE_LASTANCHOR          "/Resource/File/Statistics/LastAnchor"                      /*string*/
147 #define DS_SETTING_FILE_LASTSESSIONTIME     "/Resource/File/Statistics/LastSessionTime"                 /*int*/
148 #define DS_SETTING_FILE_C2S_TOTAL           "/Resource/File/Statistics/Client2Server_Total"             /*int*/
149 #define DS_SETTING_FILE_S2C_TOTAL           "/Resource/File/Statistics/Server2Client_Total"             /*int*/
150 #define DS_SETTING_FILE_C2S_REPLACE         "/Resource/File/Statistics/Client2Server_NrOfReplace"       /*int*/
151 #define DS_SETTING_FILE_S2C_REPLACE         "/Resource/File/Statistics/Server2Client_NrOfReplace"       /*int*/
152 #define DS_SETTING_FILE_C2S_ADD             "/Resource/File/Statistics/Client2Server_NrOfAdd"           /*int*/
153 #define DS_SETTING_FILE_S2C_ADD             "/Resource/File/Statistics/Server2Client_NrOfAdd"           /*int*/
154 #define DS_SETTING_FILE_S2C_DELETE          "/Resource/File/Statistics/Server2Client_NrOfDelete"        /*int*/
155 #define DS_SETTING_FILE_C2S_DELETE          "/Resource/File/Statistics/Client2Server_NrOfDelete"        /*int*/
156 #endif
157 ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
158
159 /**
160  * @par Description: API to get value(char*) from vconf
161  *
162  *
163  * @par Purpose:
164  * @par Typical use case:
165  * @par Method of function operation:
166  * @par Important notes:
167  * @param[in]           string type, base key
168  * @param[in]           string type, key
169  * @param[out]
170  *
171  * @return                              value on success
172  *                                                      NULL on error
173  *
174  * @par Errors:
175  *
176  * @pre None.
177  * @post
178  * @see
179  * @remarks None.
180  *
181  * @par Sample Code:
182  * @code
183  * @endcode
184  */
185 char *get_vconf_str(char *baseKey, char *key);
186
187 /**
188  * @par Description: API to get value(char*) from vconf
189  *
190  *
191  * @par Purpose:
192  * @par Typical use case:
193  * @par Method of function operation:
194  * @par Important notes:
195  * @param[in]           string type, key
196  * @param[out]
197  *
198  * @return                              value on success
199  *                                                      NULL on error
200  *
201  * @par Errors:
202  *
203  * @pre None.
204  * @post
205  * @see
206  * @remarks None.
207  *
208  * @par Sample Code:
209  * @code
210  * @endcode
211  */
212 char *get_vconf_str_key(char *key);
213
214 /**
215  * @par Description: API to get value(int) from vconf
216  *
217  *
218  * @par Purpose:
219  * @par Typical use case:
220  * @par Method of function operation:
221  * @par Important notes:
222  * @param[in]           string type, base key
223  * @param[in]           string type, key
224  * @param[out]          int type, value
225  *
226  * @return                              true on success
227  *                                                      false on error
228  *
229  * @par Errors:
230  *
231  * @pre None.
232  * @post
233  * @see
234  * @remarks None.
235  *
236  * @par Sample Code:
237  * @code
238  * @endcode
239  */
240 bool get_vconf_int(char *baseKey, char *key, int *value);
241
242
243 /**
244  * @par Description: API to get value(int) from vconf
245  *
246  *
247  * @par Purpose:
248  * @par Typical use case:
249  * @par Method of function operation:
250  * @par Important notes:
251  * @param[in]           string type, key
252  * @param[out]          int type, value
253  *
254  * @return                              true on success
255  *                                                      false on error
256  *
257  * @par Errors:
258  *
259  * @pre None.
260  * @post
261  * @see
262  * @remarks None.
263  *
264  * @par Sample Code:
265  * @code
266  * @endcode
267  */
268 bool get_vconf_Int_key(char *key, int *value);
269
270
271 /**
272  * @par Description: API to set value(char*) into vconf
273  *
274  *
275  * @par Purpose:
276  * @par Typical use case:
277  * @par Method of function operation:
278  * @par Important notes:
279  * @param[in]           string type, basekey
280  * @param[in]           string type, key
281  * @param[in]           string type, value
282  *
283  * @return                              true on success
284  *                                                      false on error
285  *
286  * @par Errors:
287  *
288  * @pre None.
289  * @post
290  * @see
291  * @remarks None.
292  *
293  * @par Sample Code:
294  * @code
295  * @endcode
296  */
297 bool set_vconf_str(char *baseKey, char *key, char *value);
298
299 /**
300  * @par Description: API to set value(char*) into vconf
301  *
302  *
303  * @par Purpose:
304  * @par Typical use case:
305  * @par Method of function operation:
306  * @par Important notes:
307  * @param[in]           string type, key
308  * @param[in]           string type, value
309  *
310  * @return                              true on success
311  *                                                      false on error
312  *
313  * @par Errors:
314  *
315  * @pre None.
316  * @post
317  * @see
318  * @remarks None.
319  *
320  * @par Sample Code:
321  * @code
322  * @endcode
323  */
324 bool set_vconf_str_key(char *key, char *value);
325
326 /**
327  * @par Description: API to set value(int) into vconf
328  *
329  *
330  * @par Purpose:
331  * @par Typical use case:
332  * @par Method of function operation:
333  * @par Important notes:
334  * @param[in]           string type, basekey
335  * @param[in]           string type, key
336  * @param[in]           int type, value
337  *
338  * @return                              true on success
339  *                                                      false on error
340  *
341  * @par Errors:
342  *
343  * @pre None.
344  * @post
345  * @see
346  * @remarks None.
347  *
348  * @par Sample Code:
349  * @code
350  * @endcode
351  */
352 bool set_vconf_int(char *baseKey, char *key, int value);
353
354 /**
355  * @par Description: API to set value(int) into vconf
356  *
357  *
358  * @par Purpose:
359  * @par Typical use case:
360  * @par Method of function operation:
361  * @par Important notes:
362  * @param[in]           string type, key
363  * @param[in]           int type, value
364  *
365  * @return                              true on success
366  *                                                      false on error
367  *
368  * @par Errors:
369  *
370  * @pre None.
371  * @post
372  * @see
373  * @remarks None.
374  *
375  * @par Sample Code:
376  * @code
377  * @endcode
378  */
379 bool set_vconf_int_key(char *key, int value);
380
381 #endif /* COMMON_VCONF_H_ */