3 * Copyright (c) 2012 Samsung Electronics Co., Ltd.
5 * Licensed under the Apache License, Version 2.0 (the License);
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
9 * http://www.apache.org/licenses/LICENSE-2.0
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
21 * @brief This file is the header file of interface for utility function
24 #ifndef COMMON_UTIL_H_
25 #define COMMON_UTIL_H_
30 * @par Description: API to create sync_agent_da_config_s structure
34 * @par Typical use case:
35 * @par Method of function operation:
36 * @par Important notes:
37 * @param[in] int type, account id
38 * @param[in] string type, key
39 * @param[in] string type, value(char *)
40 * @param[in] string type, type of value(string, int)
41 * @param[in] string type, name of access(SE, SA...)
42 * @param[out] sync_agent_da_config_s
44 * @return true on success
58 bool create_config_str(int account_id, char *key, char *value, char *type, char *access_name, sync_agent_da_config_s ** config);
61 * @par Description: API to set value into config_tbl(key, value)
65 * @par Typical use case:
66 * @par Method of function operation:
67 * @par Important notes:
68 * @param[in] int type, account id
69 * @param[in] string type, key
70 * @param[in] string type, value(char *)
71 * @param[in] string type, type of value(string, int)
72 * @param[in] string type, name of access(SE, SA...)
75 * @return true on success
89 bool set_config_str(int account_id, char *key, char *value, char *type, char *access_name);
92 * @par Description: API to set value into config_tbl(key, value)
96 * @par Typical use case:
97 * @par Method of function operation:
98 * @par Important notes:
99 * @param[in] int type, account id
100 * @param[in] string type, key
101 * @param[in] int type, value(int)
102 * @param[in] string type, type of value(string, int)
103 * @param[in] string type, name of access(SE, SA...)
106 * @return true on success
120 bool set_config_int(int account_id, char *key, int value, char *type, char *access_name);
123 * @par Description: API to get value from config_tbl(key, value)
127 * @par Typical use case:
128 * @par Method of function operation:
129 * @par Important notes:
130 * @param[in] int type, account id
131 * @param[in] string type, key
132 * @param[out] string type, value
134 * @return true on success
148 bool get_config(int account_id, char *key, char **value);
151 * @par Description: API to get account ID from profileDirName(Sync1...)
155 * @par Typical use case:
156 * @par Method of function operation:
157 * @par Important notes:
158 * @param[in] string type, profileDirName(Sync1, Sync2...)
159 * @param[in] boolean type, already open agent db or not
162 * @return account ID (more than 1) on success
176 int get_account_id(char *profile, bool open);
179 * @brief convert sync type(UI-> Engine)
180 * @param[in] sync type(Full, Update both, Update to server, Update to phone, Refresh from server, Refresh from phone)
182 * @retval value of sync type Success
185 /*int convert_synctype_value(char *syncType_str);*/
186 /*char *convert_synctype_str(char *syncType_value);*/
187 #endif /* COMMON_UTIL_H_ */