upload tizen1.0 source
[pkgs/o/oma-ds-service.git] / include / Common / Common_Util.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_Util.h
39  *   @version                                                                   0.1
40  *   @brief                                                                             This file is the header file of interface for utility function
41  */
42
43 #ifndef COMMON_UTIL_H_
44 #define COMMON_UTIL_H_
45
46 #include <stdbool.h>
47
48 /**
49  * @par Description: API to set value into config_tbl(key, value)
50  *
51  *
52  * @par Purpose:
53  * @par Typical use case:
54  * @par Method of function operation:
55  * @par Important notes:
56  * @param[in]           int type, account id
57  * @param[in]           string type, key
58  * @param[in]           string type, value(char *)
59  * @param[in]           string type, type of value(string, int)
60  * @param[in]           string type, name of access(SE, SA...)
61  * @param[out]
62  *
63  * @return                              true on success
64  *                                                      false on error
65  *
66  * @par Errors:
67  *
68  * @pre None.
69  * @post
70  * @see
71  * @remarks None.
72  *
73  * @par Sample Code:
74  * @code
75  * @endcode
76  */
77 bool set_config_str(int accountID, char *key, char *value, char * type, char *accessName);
78
79 /**
80  * @par Description: API to set value into config_tbl(key, value)
81  *
82  *
83  * @par Purpose:
84  * @par Typical use case:
85  * @par Method of function operation:
86  * @par Important notes:
87  * @param[in]           int type, account id
88  * @param[in]           string type, key
89  * @param[in]           int type, value(int)
90  * @param[in]           string type, type of value(string, int)
91  * @param[in]           string type, name of access(SE, SA...)
92  * @param[out]
93  *
94  * @return                              true on success
95  *                                                      false on error
96  *
97  * @par Errors:
98  *
99  * @pre None.
100  * @post
101  * @see
102  * @remarks None.
103  *
104  * @par Sample Code:
105  * @code
106  * @endcode
107  */
108 bool set_config_int(int accountID, char *key, int value, char * type, char *accessName);
109
110 /**
111  * @par Description: API to get value from config_tbl(key, value)
112  *
113  *
114  * @par Purpose:
115  * @par Typical use case:
116  * @par Method of function operation:
117  * @par Important notes:
118  * @param[in]           int type, account id
119  * @param[in]           string type, key
120  * @param[out]          string type, value
121  *
122  * @return                              true on success
123  *                                                      false on error
124  *
125  * @par Errors:
126  *
127  * @pre None.
128  * @post
129  * @see
130  * @remarks None.
131  *
132  * @par Sample Code:
133  * @code
134  * @endcode
135  */
136 bool get_config(int accountId, char *key, char **value);
137
138 /**
139  * @par Description: API to get account ID from profileDirName(Sync1...)
140  *
141  *
142  * @par Purpose:
143  * @par Typical use case:
144  * @par Method of function operation:
145  * @par Important notes:
146  * @param[in]           string type, profileDirName(Sync1, Sync2...)
147  * @param[in]           boolean type, already open agent db or not
148  * @param[out]
149  *
150  * @return                              account ID      (more than 1)    on success
151  *                                                      -1 on error
152  *
153  * @par Errors:
154  *
155  * @pre None.
156  * @post
157  * @see
158  * @remarks None.
159  *
160  * @par Sample Code:
161  * @code
162  * @endcode
163  */
164 int get_accountid(char *profile, bool open);
165
166
167 /**
168  *  @brief                              convert sync type(UI-> Engine)
169  *  @param[in]          sync type(Full, Update both, Update to server, Update to phone, Refresh from server, Refresh from phone)
170  *  @return                     char *
171  *  @retval                             value of sync type                              Success
172  *                                                      NULL                                                            Error
173  */
174 /*int convert_synctype_value(char *syncType_str);*/
175 /*char *convert_synctype_str(char *syncType_value);*/
176 #endif /* COMMON_UTIL_H_ */