3 * Copyright (c) 2012 - 2016 Samsung Electronics Co., Ltd. All rights reserved.
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.
22 #include <account-types.h>
23 #include <account-error.h>
31 #define ACCOUNT_API __attribute__ ((visibility("default")))
36 * @brief This file contains the Account API for account management.
40 * @addtogroup CAPI_ACCOUNT_MANAGER_MODULE
45 * @brief Called once for each account from the database.
47 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 3.0 @endif
48 * @param[in] account The account handle
49 * @param[in] user_data The user data passed from the foreach function
51 * @return @c true to continue with the next iteration of the loop, \n
52 * otherwise @c false to break out of the loop
54 * @pre account_foreach_account_from_db(), account_query_account_by_account_id(), account_query_account_by_user_name() or account_query_account_by_package_name() must be called.
56 * @see account_foreach_account_from_db()
57 * @see account_query_account_by_account_id()
58 * @see account_query_account_by_user_name()
59 * @see account_query_account_by_package_name()
61 typedef bool (*account_cb)(account_h account, void *user_data);
64 * @brief Called once for each capability of an account in the database.
66 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 3.0 @endif
67 * @param[in] capability_type The capability type
68 * @param[in] capability_state The capability state
69 * @param[in] user_data The user data passed from the foreach function
71 * @return @c true to continue with the next iteration of the loop, \n
72 * otherwise @c false to break out of the loop
74 * @pre account_query_capability_by_account_id() must be called.
76 * @see account_query_capability_by_account_id()
78 typedef bool (*capability_cb)(const char *capability_type, account_capability_state_e capability_state, void *user_data);
81 * @brief Called once for each custom data of an account in the database.
83 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 3.0 @endif
84 * @param[in] key The user custom key
85 * @param[in] value The user custom value of the specific key
86 * @param[in] user_data The user data passed
88 * @return @c true to continue with the next iteration of the loop, \n
89 * otherwise @c false to break out of the loop
91 * @pre account_query_capability_by_account_id() must be called.
93 * @see account_query_capability_by_account_id()
95 typedef bool (*account_custom_cb)(char *key, char *value, void *user_data);
99 * @brief Called once for each account provider in the database.
101 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 3.0 @endif
102 * @param[in] account_type The account provider handle
103 * @param[in] user_data The user data passed
105 * @return @c true to continue with the next iteration of the loop, \n
106 * otherwise @c false to break out of the loop
108 * @pre account_type_foreach_account_type_from_db(), account_type_query_by_provider_feature() must be called.
110 * @see account_type_foreach_account_type_from_db()
111 * @see account_type_query_by_provider_feature()
113 typedef bool (*account_type_cb)(account_type_h account_type, void *user_data);
117 * @brief Called once for each account label.
119 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 3.0 @endif
120 * @param[in] app_id The application ID
121 * @param[in] label The name of the account depends on the specified locale
122 * @param[in] locale The locale is specified as an ISO 3166 alpha-2 two letter country-code followed by ISO 639-1 for the two-letter language code.\n
123 * For example, "ko_KR" for Korean, "en_US" for American English.
124 * @param[in] user_data The user data passed
126 * @return @c true to continue with the next iteration of the loop, \n
127 * otherwise @c false to break out of the loop
129 * @pre account_type_get_label(), account_type_query_label_by_app_id() must be called.
131 * @see account_type_get_label()
132 * @see account_type_query_label_by_app_id()
134 typedef bool (*account_label_cb)(char *app_id, char *label, char *locale, void *user_data);
138 * @brief Called once for each capability of an account provider in the database.
140 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 3.0 @endif
141 * @param[in] app_id The application ID
142 * @param[in] key The user custom key
143 * @param[in] user_data The user data passed
145 * @return @c true to continue with the next iteration of the loop, \n
146 * otherwise @c false to break out of the loop
148 * @pre account_type_query_provider_feature_by_app_id(), account_type_get_provider_feature_all() must be called.
150 * @see account_type_query_provider_feature_by_app_id()
151 * @see account_type_get_provider_feature_all()
153 typedef bool (*provider_feature_cb)(char *app_id, char *key, void *user_data);
157 * @brief Called once when an event occurs.
159 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 3.0 @endif
160 * @param[in] event_type The account event type
161 * @param[in] account_id The account ID to update
162 * @param[in] user_data The user data passed
164 * @return @c true to continue with the next iteration of the loop, \n
165 * otherwise @c false to break out of the loop
167 * @pre account_subscribe_notification() must be called.
169 * @see account_subscribe_notification()
171 typedef bool (*account_event_cb)(const char *event_type, int account_id, void *user_data);
175 * @deprecated Deprecated since Tizen 2.4.\n
176 * This API is not necessary to use since Tizen 2.4.
177 * @brief Connects to the account database by readwrite mode.
179 * @since_tizen @if MOBILE 2.3 @endif
181 * @privilege %http://tizen.org/privilege/account.read \n
182 * %http://tizen.org/privilege/account.write
183 * @remarks This API need both privileges
184 * @return @c 0 on success,
185 * otherwise a negative error value
186 * @retval #ACCOUNT_ERROR_NONE Successful
187 * @retval #ACCOUNT_ERROR_DB_NOT_OPENED DB is not connected
188 * @retval #ACCOUNT_ERROR_PERMISSION_DENIED DB Access fail by permission
190 int account_connect(void) TIZEN_DEPRECATED_API;
194 * @deprecated Deprecated since Tizen 2.4.\n
195 * This API is not necessary to use since Tizen 2.4.
196 * @brief Connects to the account database by readonly mode.
198 * @since_tizen @if MOBILE 2.3 @endif
199 * @return @c 0 on success,
200 * otherwise a negative error value
201 * @retval #ACCOUNT_ERROR_NONE Successful
202 * @retval #ACCOUNT_ERROR_DB_NOT_OPENED DB is not connected
203 * @retval #ACCOUNT_ERROR_PERMISSION_DENIED DB Access fail by permission
205 int account_connect_readonly(void) TIZEN_DEPRECATED_API;
209 * @deprecated Deprecated since Tizen 2.4.\n
210 * This API is not necessary to use since Tizen 2.4.
211 * @brief Disconnects from the account database.
213 * @since_tizen @if MOBILE 2.3 @endif
214 * @return @c 0 on success,
215 * otherwise a negative error value
216 * @retval #ACCOUNT_ERROR_NONE Successful
217 * @retval #ACCOUNT_ERROR_PERMISSION_DENIED DB Access fail by permission
218 * @retval #ACCOUNT_ERROR_DATABASE_BUSY SQLite busy handler expired
220 int account_disconnect(void) TIZEN_DEPRECATED_API;
223 * @brief Creates a handle to the account.
225 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 3.0 @endif
226 * @remarks Release @a account using account_destroy().
227 * @remarks The created handle is not added to the account database until account_insert_to_db() is called.
229 * @param[in] account The account handle
231 * @return @c 0 on success,
232 * otherwise a negative error value
233 * @retval #ACCOUNT_ERROR_NONE Successful
234 * @retval #ACCOUNT_ERROR_OUT_OF_MEMORY Out of Memory
235 * @retval #ACCOUNT_ERROR_INVALID_PARAMETER Invalid parameter
236 * @retval #ACCOUNT_ERROR_NOT_SUPPORTED Not supported
238 * @see account_destroy()
240 int account_create(account_h *account);
244 * @brief Destroys the account handle and releases all its resources.
246 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 3.0 @endif
247 * @param[in] account The account handle
249 * @return @c 0 on success,
250 * otherwise a negative error value
251 * @retval #ACCOUNT_ERROR_NONE Successful
252 * @retval #ACCOUNT_ERROR_INVALID_PARAMETER Invalid parameter
253 * @retval #ACCOUNT_ERROR_NOT_SUPPORTED Not supported
255 * @see account_create()
257 int account_destroy(account_h account);
261 * @brief Inserts the account details to the account database.
263 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 3.0 @endif
265 * @privilege %http://tizen.org/privilege/account.read \n
266 * %http://tizen.org/privilege/account.write
267 * @remarks This API need both privileges
268 * @param[in] account The account handle
269 * @param[out] account_db_id The account ID to be assigned to an account
271 * @return @c 0 on success,
272 * otherwise a negative error value
273 * @retval #ACCOUNT_ERROR_NONE Successful
274 * @retval #ACCOUNT_ERROR_INVALID_PARAMETER Invalid parameter
275 * @retval #ACCOUNT_ERROR_OUT_OF_MEMORY Out of Memory
276 * @retval #ACCOUNT_ERROR_DB_FAILED Database operation failed
277 * @retval #ACCOUNT_ERROR_DUPLICATED Same user name exists in your application
278 * @retval #ACCOUNT_ERROR_NOT_ALLOW_MULTIPLE Tried to add an account in spite of multiple false accounts
279 * @retval #ACCOUNT_ERROR_NOT_REGISTERED_PROVIDER Tried to add an account though you did not register the account type in manifest
280 * @retval #ACCOUNT_ERROR_PERMISSION_DENIED DB Access fail by permission
281 * @retval #ACCOUNT_ERROR_DATABASE_BUSY SQLite handler is busy
282 * @retval #ACCOUNT_ERROR_DB_NOT_OPENED Account database did not opened
283 * @retval #ACCOUNT_ERROR_NOT_SUPPORTED Not supported
285 * @pre This function requires an open connection to an account service by account_connect() on tizen 2.3 (MOBILE).\n
286 * But the account_connect() is not required to use this function since tizen 2.4.
288 * @see account_delete_from_db_by_id()
289 * @see account_delete_from_db_by_user_name()
290 * @see account_delete_from_db_by_package_name()
291 * @see account_update_to_db_by_id()
292 * @see account_update_to_db_by_user_name()
294 int account_insert_to_db(account_h account, int *account_db_id);
298 * @brief Deletes an account from the account database by account DB ID.
300 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 3.0 @endif
302 * @privilege %http://tizen.org/privilege/account.read \n
303 * %http://tizen.org/privilege/account.write
304 * @remarks This API need both privileges \n
305 * Only can delete an account which was added by same package applications
306 * @param[in] account_db_id The account ID to delete
308 * @return @c 0 on success,
309 * otherwise a negative error value
310 * @retval #ACCOUNT_ERROR_NONE Successful
311 * @retval #ACCOUNT_ERROR_INVALID_PARAMETER Invalid parameter
312 * @retval #ACCOUNT_ERROR_OUT_OF_MEMORY Out of Memory
313 * @retval #ACCOUNT_ERROR_DB_FAILED Database operation failed
314 * @retval #ACCOUNT_ERROR_PERMISSION_DENIED The account owner is different from the caller or DB Access fail by permission
315 * @retval #ACCOUNT_ERROR_DATABASE_BUSY SQLite handler is busy
316 * @retval #ACCOUNT_ERROR_DB_NOT_OPENED Account database did not opened
317 * @retval #ACCOUNT_ERROR_NOT_SUPPORTED Not supported
319 * @pre This function requires an open connection to an account service by account_connect() on tizen 2.3 (MOBILE).\n
320 * But the account_connect() is not required to use this function since tizen 2.4.
322 * @see account_insert_to_db()
323 * @see account_delete_from_db_by_user_name()
324 * @see account_delete_from_db_by_package_name()
325 * @see account_update_to_db_by_id()
326 * @see account_update_to_db_by_user_name()
328 int account_delete_from_db_by_id(int account_db_id);
332 * @brief Deletes an account from the account database by user name.
334 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 3.0 @endif
336 * @privilege %http://tizen.org/privilege/account.read \n
337 * %http://tizen.org/privilege/account.write
338 * @remarks This API need both privileges \n
339 * Only can delete accounts which were added by same package applications
340 * @param[in] user_name The user name of the account to delete
341 * @param[in] package_name The package name of the account to delete
343 * @return @c 0 on success,
344 * otherwise a negative error value
345 * @retval #ACCOUNT_ERROR_NONE Successful
346 * @retval #ACCOUNT_ERROR_OUT_OF_MEMORY Out of Memory
347 * @retval #ACCOUNT_ERROR_INVALID_PARAMETER Invalid parameter
348 * @retval #ACCOUNT_ERROR_DB_FAILED Database operation failed
349 * @retval #ACCOUNT_ERROR_PERMISSION_DENIED DB Access fail by permission
350 * @retval #ACCOUNT_ERROR_DATABASE_BUSY SQLite handler is busy
351 * @retval #ACCOUNT_ERROR_DB_NOT_OPENED Account database did not opened
352 * @retval #ACCOUNT_ERROR_NOT_SUPPORTED Not supported
354 * @pre This function requires an open connection to an account service by account_connect() on tizen 2.3 (MOBILE).\n
355 * But the account_connect() is not required to use this function since tizen 2.4.
357 * @see account_insert_to_db()
358 * @see account_delete_from_db_by_id()
359 * @see account_delete_from_db_by_package_name()
360 * @see account_update_to_db_by_id()
361 * @see account_update_to_db_by_user_name()
363 int account_delete_from_db_by_user_name(char *user_name, char *package_name);
367 * @brief Deletes an account from the account database by package name.
369 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 3.0 @endif
371 * @privilege %http://tizen.org/privilege/account.read \n
372 * %http://tizen.org/privilege/account.write
373 * @remarks This API need both privileges \n
374 * Only can delete accounts which was added by same package applications
375 * @param[in] package_name The package name of account(s) to delete
377 * @return @c 0 on success,
378 * otherwise a negative error value
379 * @retval #ACCOUNT_ERROR_NONE Successful
380 * @retval #ACCOUNT_ERROR_INVALID_PARAMETER Invalid parameter
381 * @retval #ACCOUNT_ERROR_DB_FAILED Database operation failed
382 * @retval #ACCOUNT_ERROR_PERMISSION_DENIED DB Access fail by permission
383 * @retval #ACCOUNT_ERROR_DATABASE_BUSY SQLite handler is busy
384 * @retval #ACCOUNT_ERROR_DB_NOT_OPENED Account database did not opened
385 * @retval #ACCOUNT_ERROR_NOT_SUPPORTED Not supported
387 * @pre This function requires an open connection to an account service by account_connect() on tizen 2.3 (MOBILE).\n
388 * But the account_connect() is not required to use this function since tizen 2.4.
390 * @see account_insert_to_db()
391 * @see account_delete_from_db_by_id()
392 * @see account_delete_from_db_by_user_name()
393 * @see account_update_to_db_by_id()
394 * @see account_update_to_db_by_user_name()
396 int account_delete_from_db_by_package_name(const char *package_name);
399 * @brief Updates the account details to the account database.
401 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 3.0 @endif
403 * @privilege %http://tizen.org/privilege/account.read \n
404 * %http://tizen.org/privilege/account.write
405 * @remarks This API need both privileges \n
406 * Only can update an account which was added by same package applications
407 * @param[in] account The account handle
408 * @param[in] account_id The account ID to update
410 * @return @c 0 on success,
411 * otherwise a negative error value
412 * @retval #ACCOUNT_ERROR_NONE Successful
413 * @retval #ACCOUNT_ERROR_INVALID_PARAMETER Invalid parameter
414 * @retval #ACCOUNT_ERROR_DB_FAILED Database operation failed
415 * @retval #ACCOUNT_ERROR_RECORD_NOT_FOUND The account to update does not exist
416 * @retval #ACCOUNT_ERROR_PERMISSION_DENIED DB Access fail by permission
417 * @retval #ACCOUNT_ERROR_DATABASE_BUSY SQLite handler is busy
418 * @retval #ACCOUNT_ERROR_DB_NOT_OPENED Account database did not opened
419 * @retval #ACCOUNT_ERROR_NOT_SUPPORTED Not supported
421 * @pre This function requires an open connection to an account service by account_connect() on tizen 2.3 (MOBILE).\n
422 * But the account_connect() is not required to use this function since tizen 2.4.
424 * @see account_insert_to_db()
425 * @see account_delete_from_db_by_id()
426 * @see account_delete_from_db_by_user_name()
427 * @see account_delete_from_db_by_package_name()
428 * @see account_update_to_db_by_user_name()
430 int account_update_to_db_by_id(account_h account, int account_id);
433 * @brief Updates the account details to the account database.
434 * The provider permission check has been added since tizen 2.4.
436 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 3.0 @endif
438 * @privilege %http://tizen.org/privilege/account.read \n
439 * %http://tizen.org/privilege/account.write
440 * @remarks This API need both privileges \n
441 * Only can update an account which was added by same package applications
442 * @param[in] account The account handle
443 * @param[in] account_id The account ID to update
445 * @return @c 0 on success,
446 * otherwise a negative error value
447 * @retval #ACCOUNT_ERROR_NONE Successful
448 * @retval #ACCOUNT_ERROR_OUT_OF_MEMORY Out of Memory
449 * @retval #ACCOUNT_ERROR_INVALID_PARAMETER Invalid parameter
450 * @retval #ACCOUNT_ERROR_DB_FAILED Database operation failed
451 * @retval #ACCOUNT_ERROR_RECORD_NOT_FOUND The account to update does not exist
452 * @retval #ACCOUNT_ERROR_PERMISSION_DENIED DB Access fail by permission
453 * @retval #ACCOUNT_ERROR_DATABASE_BUSY SQLite handler is busy
454 * @retval #ACCOUNT_ERROR_DB_NOT_OPENED Account database did not opened
455 * @retval #ACCOUNT_ERROR_NOT_SUPPORTED Not supported
457 * @pre This function requires an open connection to an account service by account_connect() on tizen 2.3 (MOBILE).\n
458 * But the account_connect() is not required to use this function since tizen 2.4.
460 * @see account_insert_to_db()
461 * @see account_delete_from_db_by_id()
462 * @see account_delete_from_db_by_user_name()
463 * @see account_delete_from_db_by_package_name()
464 * @see account_update_to_db_by_user_name()
466 int account_update_to_db_by_id_ex(account_h account, int account_id);
469 * @brief Updates the account details to the account database.
471 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 3.0 @endif
473 * @privilege %http://tizen.org/privilege/account.read \n
474 * %http://tizen.org/privilege/account.write
475 * @remarks This API need both privileges \n
476 * Only can update accounts which were added by same package applications
477 * @param[in] account The account handle
478 * @param[in] user_name The user name of the account to update
479 * @param[in] package_name The package name for the user name
481 * @return @c 0 on success,
482 * otherwise a negative error value
483 * @retval #ACCOUNT_ERROR_NONE Successful
484 * @retval #ACCOUNT_ERROR_INVALID_PARAMETER Invalid parameter
485 * @retval #ACCOUNT_ERROR_DB_FAILED Database operation failed
486 * @retval #ACCOUNT_ERROR_RECORD_NOT_FOUND The account to update does not exist
487 * @retval #ACCOUNT_ERROR_PERMISSION_DENIED DB Access fail by permission
488 * @retval #ACCOUNT_ERROR_DATABASE_BUSY SQLite handler is busy
489 * @retval #ACCOUNT_ERROR_DB_NOT_OPENED Account database did not opened
490 * @retval #ACCOUNT_ERROR_NOT_SUPPORTED Not supported
492 * @pre This function requires an open connection to an account service by account_connect() on tizen 2.3 (MOBILE).\n
493 * But the account_connect() is not required to use this function since tizen 2.4.
495 * @see account_insert_to_db()
496 * @see account_delete_from_db_by_id()
497 * @see account_delete_from_db_by_user_name()
498 * @see account_delete_from_db_by_package_name()
499 * @see account_update_to_db_by_id()
502 int account_update_to_db_by_user_name(account_h account, const char *user_name, const char *package_name);
505 * @brief Gets the ID of an account.
507 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 3.0 @endif
508 * @param[in] account The account handle
509 * @param[out] account_id The account ID
511 * @return @c 0 on success,
512 * otherwise a negative error value
513 * @retval #ACCOUNT_ERROR_NONE Successful
514 * @retval #ACCOUNT_ERROR_INVALID_PARAMETER Invalid parameter
515 * @retval #ACCOUNT_ERROR_NOT_SUPPORTED Not supported
518 int account_get_account_id(account_h account, int *account_id);
521 * @brief Gets the user name of an account.
523 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 3.0 @endif
524 * @remarks You must release @a user_name using free().
526 * @param[in] account The account handle
527 * @param[out] user_name The user name of the account
529 * @return @c 0 on success,
530 * otherwise a negative error value
531 * @retval #ACCOUNT_ERROR_NONE Successful
532 * @retval #ACCOUNT_ERROR_INVALID_PARAMETER Invalid parameter
533 * @retval #ACCOUNT_ERROR_OUT_OF_MEMORY Out of memory
534 * @retval #ACCOUNT_ERROR_NOT_SUPPORTED Not supported
536 * @see account_set_user_name()
538 int account_get_user_name(account_h account, char **user_name);
542 * @brief Sets the user name of an account.
544 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 3.0 @endif
545 * @param[in] account The account handle
546 * @param[in] user_name The string to set as user name
548 * @return @c 0 on success,
549 * otherwise a negative error value
550 * @retval #ACCOUNT_ERROR_NONE Successful
551 * @retval #ACCOUNT_ERROR_INVALID_PARAMETER Invalid parameter
552 * @retval #ACCOUNT_ERROR_NOT_SUPPORTED Not supported
554 * @see account_get_user_name()
556 int account_set_user_name(account_h account, const char *user_name);
560 * @brief Gets the display name of an account.
562 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 3.0 @endif
563 * @remarks You must release @a display_name using free().
565 * @param[in] account The account handle
566 * @param[out] display_name The display name of the account
568 * @return @c 0 on success,
569 * otherwise a negative error value
570 * @retval #ACCOUNT_ERROR_NONE Successful
571 * @retval #ACCOUNT_ERROR_INVALID_PARAMETER Invalid parameter
572 * @retval #ACCOUNT_ERROR_OUT_OF_MEMORY Out of memory
573 * @retval #ACCOUNT_ERROR_NOT_SUPPORTED Not supported
575 * @see account_set_display_name()
577 int account_get_display_name(account_h account, char **display_name);
581 * @brief Sets the display name of an account.
583 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 3.0 @endif
584 * @param[in] account The account handle
585 * @param[in] display_name The text string to set as the display name
587 * @return @c 0 on success,
588 * otherwise a negative error value
589 * @retval #ACCOUNT_ERROR_NONE Successful
590 * @retval #ACCOUNT_ERROR_INVALID_PARAMETER Invalid parameter
591 * @retval #ACCOUNT_ERROR_NOT_SUPPORTED Not supported
594 int account_set_display_name(account_h account, const char *display_name);
597 * @brief Gets the capability detail of an account.
599 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 3.0 @endif
600 * @param[in] account The account handle
601 * @param[in] capability_type The capability type to get the capability value
602 * @param[out] capability_value The capability value (on/off) of the specified capability_type
604 * @return @c 0 on success,
605 * otherwise a negative error value
606 * @retval #ACCOUNT_ERROR_NONE Successful
607 * @retval #ACCOUNT_ERROR_INVALID_PARAMETER Invalid parameter
608 * @retval #ACCOUNT_ERROR_RECORD_NOT_FOUND There is no given capability_type in the account
609 * @retval #ACCOUNT_ERROR_NOT_SUPPORTED Not supported
611 * @see account_set_capability()
613 int account_get_capability(account_h account, const char *capability_type, account_capability_state_e *capability_value);
616 * @brief Gets all the capabilities of an account.
618 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 3.0 @endif
619 * @param[in] account The account handle
620 * @param[in] callback The callback function
621 * @param[in] user_data The user data to be passed to the callback function
623 * @return @c 0 on success,
624 * otherwise a negative error value
625 * @retval #ACCOUNT_ERROR_NONE Successful
626 * @retval #ACCOUNT_ERROR_INVALID_PARAMETER Invalid parameter
627 * @retval #ACCOUNT_ERROR_NOT_SUPPORTED Not supported
629 * @see account_set_capability()
631 int account_get_capability_all(account_h account, capability_cb callback, void *user_data);
634 * @brief Sets the capability.
636 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 3.0 @endif
637 * @param[in] account The account handle
638 * @param[in] capability_type The capability type
639 * @param[in] capability_state The capability state
641 * @return @c 0 on success,
642 * otherwise a negative error value
643 * @retval #ACCOUNT_ERROR_NONE Successful
644 * @retval #ACCOUNT_ERROR_INVALID_PARAMETER Invalid parameter
645 * @retval #ACCOUNT_ERROR_NOT_SUPPORTED Not supported
647 * @see account_get_capability()
649 int account_set_capability(account_h account, const char *capability_type, account_capability_state_e capability_state);
653 * @brief Gets the icon path.
655 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 3.0 @endif
656 * @remarks You must release @a icon_path using free().
658 * @param[in] account The account handle
659 * @param[out] icon_path The icon path
661 * @return @c 0 on success,
662 * otherwise a negative error value
663 * @retval #ACCOUNT_ERROR_NONE Successful
664 * @retval #ACCOUNT_ERROR_INVALID_PARAMETER Invalid parameter
665 * @retval #ACCOUNT_ERROR_OUT_OF_MEMORY Out of memory
666 * @retval #ACCOUNT_ERROR_NOT_SUPPORTED Not supported
668 * @see account_set_icon_path()
670 int account_get_icon_path(account_h account, char **icon_path);
674 * @brief Sets the icon path.
676 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 3.0 @endif
677 * @param[in] account The account handle
678 * @param[in] icon_path The text string to set as the icon path
680 * @return @c 0 on success,
681 * otherwise a negative error value
682 * @retval #ACCOUNT_ERROR_NONE Successful
683 * @retval #ACCOUNT_ERROR_INVALID_PARAMETER Invalid parameter
684 * @retval #ACCOUNT_ERROR_NOT_SUPPORTED Not supported
686 * @see account_get_icon_path()
688 int account_set_icon_path(account_h account, const char *icon_path);
692 * @brief Gets the domain name.
694 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 3.0 @endif
695 * @remarks You must release @a domain_name using free().
697 * @param[in] account The account handle
698 * @param[out] domain_name The domain name
700 * @return @c 0 on success,
701 * otherwise a negative error value
702 * @retval #ACCOUNT_ERROR_NONE Successful
703 * @retval #ACCOUNT_ERROR_INVALID_PARAMETER Invalid parameter
704 * @retval #ACCOUNT_ERROR_OUT_OF_MEMORY Out of memory
705 * @retval #ACCOUNT_ERROR_NOT_SUPPORTED Not supported
707 * @see account_set_domain_name()
709 int account_get_domain_name(account_h account, char **domain_name);
713 * @brief Sets the domain name.
715 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 3.0 @endif
716 * @param[in] account The account handle
717 * @param[in] domain_name The text string to set as the domain name
719 * @return @c 0 on success,
720 * otherwise a negative error value
721 * @retval #ACCOUNT_ERROR_NONE Successful
722 * @retval #ACCOUNT_ERROR_INVALID_PARAMETER Invalid parameter
723 * @retval #ACCOUNT_ERROR_NOT_SUPPORTED Not supported
725 * @see account_get_domain_name()
727 int account_set_domain_name(account_h account, const char *domain_name);
731 * @brief Gets the email address.
733 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 3.0 @endif
734 * @remarks You must release @a email_address using free().
736 * @param[in] account The account handle
737 * @param[out] email_address The email address
739 * @return @c 0 on success,
740 * otherwise a negative error value
741 * @retval #ACCOUNT_ERROR_NONE Successful
742 * @retval #ACCOUNT_ERROR_INVALID_PARAMETER Invalid parameter
743 * @retval #ACCOUNT_ERROR_OUT_OF_MEMORY Out of memory
744 * @retval #ACCOUNT_ERROR_NOT_SUPPORTED Not supported
746 * @see account_set_email_address()
748 int account_get_email_address(account_h account, char **email_address);
752 * @brief Sets the email address.
754 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 3.0 @endif
755 * @param[in] account The account handle
756 * @param[in] email_address The text string to set as the email address
758 * @return @c 0 on success,
759 * otherwise a negative error value
760 * @retval #ACCOUNT_ERROR_NONE Successful
761 * @retval #ACCOUNT_ERROR_INVALID_PARAMETER Invalid parameter
762 * @retval #ACCOUNT_ERROR_NOT_SUPPORTED Not supported
764 * @see account_get_email_address()
766 int account_set_email_address(account_h account, const char *email_address);
770 * @brief Gets the package name.
772 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 3.0 @endif
773 * @remarks You must release @a package_name using free().
775 * @param[in] account The account handle
776 * @param[out] package_name The package name
778 * @return @c 0 on success,
779 * otherwise a negative error value
780 * @retval #ACCOUNT_ERROR_NONE Successful
781 * @retval #ACCOUNT_ERROR_INVALID_PARAMETER Invalid parameter
782 * @retval #ACCOUNT_ERROR_OUT_OF_MEMORY Out of memory
783 * @retval #ACCOUNT_ERROR_NOT_SUPPORTED Not supported
785 * @see account_set_package_name()
787 int account_get_package_name(account_h account, char **package_name);
791 * @brief Sets the package name.
793 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 3.0 @endif
794 * @param[in] account The account handle
795 * @param[in] package_name The text string to set as the package name
797 * @return @c 0 on success,
798 * otherwise a negative error value
799 * @retval #ACCOUNT_ERROR_NONE Successful
800 * @retval #ACCOUNT_ERROR_INVALID_PARAMETER Invalid parameter
801 * @retval #ACCOUNT_ERROR_NOT_SUPPORTED Not supported
803 * @see account_get_email_address()
805 int account_set_package_name(account_h account, const char *package_name);
809 * @brief Gets the access token. Access token field is used to store account secrets (such as password or master token).
811 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 3.0 @endif
812 * @remarks You must release @a access_token using free().
813 * @remarks Access token field is used for storing account secret (password / master token etc)
815 * @param[in] account The account handle
816 * @param[out] access_token The access token
818 * @return @c 0 on success,
819 * otherwise a negative error value
820 * @retval #ACCOUNT_ERROR_NONE Successful
821 * @retval #ACCOUNT_ERROR_INVALID_PARAMETER Invalid parameter
822 * @retval #ACCOUNT_ERROR_OUT_OF_MEMORY Out of memory
823 * @retval #ACCOUNT_ERROR_NOT_SUPPORTED Not supported
825 * Only account owner application can retrieve account password / access_token. For others this field will be null.
826 * @see account_set_access_token()
828 int account_get_access_token(account_h account, char **access_token);
832 * @brief Sets the access token. Access token field is used to store account secrets (such as password or master token).
834 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 3.0 @endif
835 * @remarks Only account owner application can retrieve account password / access_token. For others this field will be null.
837 * @param[in] account The account handle
838 * @param[in] access_token The text string to set as the access token
840 * @return @c 0 on success,
841 * otherwise a negative error value
842 * @retval #ACCOUNT_ERROR_NONE Successful
843 * @retval #ACCOUNT_ERROR_INVALID_PARAMETER Invalid parameter
844 * @retval #ACCOUNT_ERROR_NOT_SUPPORTED Not supported
845 * @see account_get_access_token()
847 int account_set_access_token(account_h account, const char *access_token);
851 * @brief Gets the user text.
853 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 3.0 @endif
854 * @remarks You must release @a user_text using free().
856 * @param[in] account The account handle
857 * @param[in] user_text_index The index of the user text (range: 0 ~ 4)
858 * @param[out] user_text The user text
860 * @return @c 0 on success,
861 * otherwise a negative error value
862 * @retval #ACCOUNT_ERROR_NONE Successful
863 * @retval #ACCOUNT_ERROR_INVALID_PARAMETER Invalid parameter
864 * @retval #ACCOUNT_ERROR_OUT_OF_MEMORY Out of memory
865 * @retval #ACCOUNT_ERROR_NOT_SUPPORTED Not supported
867 * @see account_set_user_text()
869 int account_get_user_text(account_h account, int user_text_index, char **user_text);
873 * @brief Sets the user text.
875 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 3.0 @endif
876 * @param[in] account The account handle
877 * @param[in] user_text_index The index of the user text (must be in range from @c 0 to @c 4)
878 * @param[in] user_text The text string to set as the user text
880 * @return @c 0 on success,
881 * otherwise a negative error value
882 * @retval #ACCOUNT_ERROR_NONE Successful
883 * @retval #ACCOUNT_ERROR_INVALID_PARAMETER Invalid parameter
884 * @retval #ACCOUNT_ERROR_NOT_SUPPORTED Not supported
886 * @see account_get_user_text()
888 int account_set_user_text(account_h account, int user_text_index, const char *user_text);
892 * @brief Gets the user integer.
894 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 3.0 @endif
895 * @param[in] account The account handle
896 * @param[in] user_int_index The index of the user integer (must be in range from @c 0 to @c 4)
897 * @param[out] user_integer The user integer
899 * @return @c 0 on success,
900 * otherwise a negative error value
901 * @retval #ACCOUNT_ERROR_NONE Successful
902 * @retval #ACCOUNT_ERROR_INVALID_PARAMETER Invalid parameter
903 * @retval #ACCOUNT_ERROR_NOT_SUPPORTED Not supported
905 * @see account_set_user_int()
907 int account_get_user_int(account_h account, int user_int_index, int *user_integer);
911 * @brief Sets the user integer.
913 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 3.0 @endif
914 * @param[in] account The account handle
915 * @param[in] user_int_index The index of the user integer (must be in range from @c 0 to @c 4)
916 * @param[in] user_integer The integer to set as the user integer
918 * @return @c 0 on success,
919 * otherwise a negative error value
920 * @retval #ACCOUNT_ERROR_NONE Successful
921 * @retval #ACCOUNT_ERROR_INVALID_PARAMETER Invalid parameter
922 * @retval #ACCOUNT_ERROR_NOT_SUPPORTED Not supported
924 * @see account_get_user_int()
926 int account_set_user_int(account_h account, int user_int_index, int user_integer);
930 * @brief Gets the authentication type.
932 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 3.0 @endif
933 * @param[in] account The account handle
934 * @param[out] auth_type The authentication type
936 * @return @c 0 on success,
937 * otherwise a negative error value
938 * @retval #ACCOUNT_ERROR_NONE Successful
939 * @retval #ACCOUNT_ERROR_INVALID_PARAMETER Invalid parameter
940 * @retval #ACCOUNT_ERROR_NOT_SUPPORTED Not supported
942 * @see account_set_auth_type()
944 int account_get_auth_type(account_h account, account_auth_type_e *auth_type);
948 * @brief Sets the authentication type.
950 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 3.0 @endif
951 * @param[in] account The account handle
952 * @param[in] auth_type The integer to be set as the authentication type
954 * @return @c 0 on success,
955 * otherwise a negative error value
956 * @retval #ACCOUNT_ERROR_NONE Successful
957 * @retval #ACCOUNT_ERROR_INVALID_PARAMETER Invalid parameter
958 * @retval #ACCOUNT_ERROR_NOT_SUPPORTED Not supported
960 * @see account_get_auth_type()
962 int account_set_auth_type(account_h account, const account_auth_type_e auth_type);
966 * @brief Gets the secret.
968 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 3.0 @endif
969 * @param[in] account The account handle
970 * @param[out] secret The secret
972 * @return @c 0 on success,
973 * otherwise a negative error value
974 * @retval #ACCOUNT_ERROR_NONE Successful
975 * @retval #ACCOUNT_ERROR_INVALID_PARAMETER Invalid parameter
976 * @retval #ACCOUNT_ERROR_NOT_SUPPORTED Not supported
978 * @see account_set_secret()
980 int account_get_secret(account_h account, account_secrecy_state_e *secret);
984 * @brief Sets the secret.
986 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 3.0 @endif
987 * @param[in] account The account handle
988 * @param[in] secret The secrecy to be set
990 * @return @c 0 on success,
991 * otherwise a negative error value
992 * @retval #ACCOUNT_ERROR_NONE Successful
993 * @retval #ACCOUNT_ERROR_INVALID_PARAMETER Invalid parameter
994 * @retval #ACCOUNT_ERROR_NOT_SUPPORTED Not supported
996 * @see account_get_secret()
998 int account_set_secret(account_h account, const account_secrecy_state_e secret);
1001 * @brief Gets the sync support.
1003 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 3.0 @endif
1004 * @param[in] account The account handle
1005 * @param[out] sync_support The sync support
1007 * @return @c 0 on success,
1008 * otherwise a negative error value
1009 * @retval #ACCOUNT_ERROR_NONE Successful
1010 * @retval #ACCOUNT_ERROR_INVALID_PARAMETER Invalid parameter
1011 * @retval #ACCOUNT_ERROR_NOT_SUPPORTED Not supported
1013 * @see account_set_sync_support()
1015 int account_get_sync_support(account_h account, account_sync_state_e *sync_support);
1019 * @brief Sets the sync support.
1021 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 3.0 @endif
1022 * @param[in] account The account handle
1023 * @param[in] sync_support The sync state to be set
1025 * @return @c 0 on success,
1026 * otherwise a negative error value
1027 * @retval #ACCOUNT_ERROR_NONE Successful
1028 * @retval #ACCOUNT_ERROR_INVALID_PARAMETER Invalid parameter
1029 * @retval #ACCOUNT_ERROR_NOT_SUPPORTED Not supported
1031 * @see account_get_sync_support()
1033 int account_set_sync_support(account_h account, const account_sync_state_e sync_support);
1037 * @brief Gets the source.
1039 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 3.0 @endif
1040 * @remarks You must release @a source using free().
1042 * @param[in] account The account handle
1043 * @param[out] source The source
1045 * @return @c 0 on success,
1046 * otherwise a negative error value
1047 * @retval #ACCOUNT_ERROR_NONE Successful
1048 * @retval #ACCOUNT_ERROR_INVALID_PARAMETER Invalid parameter
1049 * @retval #ACCOUNT_ERROR_OUT_OF_MEMORY Out of memory
1050 * @retval #ACCOUNT_ERROR_NOT_SUPPORTED Not supported
1052 * @see account_set_source()
1054 int account_get_source(account_h account, char **source);
1058 * @brief Sets the source.
1060 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 3.0 @endif
1061 * @param[in] account The account handle
1062 * @param[in] source The text string to set as the source
1064 * @return @c 0 on success,
1065 * otherwise a negative error value
1066 * @retval #ACCOUNT_ERROR_NONE Successful
1067 * @retval #ACCOUNT_ERROR_INVALID_PARAMETER Invalid parameter
1068 * @retval #ACCOUNT_ERROR_NOT_SUPPORTED Not supported
1070 * @see account_get_source()
1072 int account_set_source(account_h account, const char *source);
1075 * @brief Sets the custom.
1077 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 3.0 @endif
1078 * @param[in] account The account handle
1079 * @param[in] key The user custom key for the specific value
1080 * @param[in] value The user custom value about the given key
1082 * @return @c 0 on success,
1083 * otherwise a negative error value
1084 * @retval #ACCOUNT_ERROR_NONE Successful
1085 * @retval #ACCOUNT_ERROR_INVALID_PARAMETER Invalid parameter
1086 * @retval #ACCOUNT_ERROR_NOT_SUPPORTED Not supported
1088 * @see account_get_custom()
1090 int account_set_custom(account_h account, const char *key, const char *value);
1093 * @brief Gets the user specific custom text of an account key.
1095 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 3.0 @endif
1096 * @remarks You must release @a value using free().
1098 * @param[in] account The account handle
1099 * @param[in] key The key to retrieve custom text
1100 * @param[out] value The text of the given key
1102 * @return @c 0 on success,
1103 * otherwise a negative error value
1104 * @retval #ACCOUNT_ERROR_NONE Successful
1105 * @retval #ACCOUNT_ERROR_INVALID_PARAMETER Invalid parameter
1106 * @retval #ACCOUNT_ERROR_RECORD_NOT_FOUND There is no given capability type in the account
1107 * @retval #ACCOUNT_ERROR_NOT_SUPPORTED Not supported
1109 * @see account_set_custom()
1111 int account_get_custom(account_h account, const char *key, char **value);
1115 * @brief Gets all the user custom texts of an account.
1117 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 3.0 @endif
1118 * @param[in] account The account handle
1119 * @param[in] callback The callback function to retrieve all custom text \n
1120 * The callback function gives the key and value.
1121 * @param[in] user_data The user data to be passed to the callback function
1123 * @return @c 0 on success,
1124 * otherwise a negative error value
1125 * @retval #ACCOUNT_ERROR_NONE Successful
1126 * @retval #ACCOUNT_ERROR_INVALID_PARAMETER Invalid parameter
1127 * @retval #ACCOUNT_ERROR_NOT_SUPPORTED Not supported
1129 * @see account_set_custom()
1131 int account_get_custom_all(account_h account, account_custom_cb callback, void *user_data);
1134 * @brief Retrieves all accounts details by invoking the given callback function iteratively.
1136 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 3.0 @endif
1138 * @privilege %http://tizen.org/privilege/account.read
1139 * @param[in] callback The callback function to invoke
1140 * @param[in] user_data The user data to be passed to the callback function
1142 * @return @c 0 on success,
1143 * otherwise a negative error value
1144 * @retval #ACCOUNT_ERROR_NONE Successful
1145 * @retval #ACCOUNT_ERROR_INVALID_PARAMETER Invalid parameter
1146 * @retval #ACCOUNT_ERROR_DB_FAILED Database operation failed
1147 * @retval #ACCOUNT_ERROR_PERMISSION_DENIED DB Access fail by permission
1148 * @retval #ACCOUNT_ERROR_RECORD_NOT_FOUND Related record does not exist
1149 * @retval #ACCOUNT_ERROR_DATABASE_BUSY SQLite handler is busy
1150 * @retval #ACCOUNT_ERROR_DB_NOT_OPENED Account database did not opened
1151 * @retval #ACCOUNT_ERROR_NOT_SUPPORTED Not supported
1153 * @pre This function requires an open connection to an account service by account_connect() on tizen 2.3 (MOBILE).\n
1154 * But the account_connect() is not required to use this function since tizen 2.4.
1155 * @post This function invokes account_cb().
1157 * @see account_query_account_by_account_id()
1158 * @see account_query_account_by_user_name()
1159 * @see account_query_account_by_package_name()
1160 * @see account_query_account_by_capability()
1162 int account_foreach_account_from_db(account_cb callback, void *user_data);
1165 * @brief Retrieves an account with the account ID.
1167 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 3.0 @endif
1169 * @privilege %http://tizen.org/privilege/account.read
1170 * @remarks You must allocate @a account using account_create() and release using account_destroy().
1172 * @param[in] account_db_id The account database ID to search
1173 * @param[out] account The account handle \n
1175 * @return @c 0 on success,
1176 * otherwise a negative error value
1177 * @retval #ACCOUNT_ERROR_NONE Successful
1178 * @retval #ACCOUNT_ERROR_OUT_OF_MEMORY Out of Memory
1179 * @retval #ACCOUNT_ERROR_INVALID_PARAMETER Invalid parameter
1180 * @retval #ACCOUNT_ERROR_DB_FAILED Database operation failed
1181 * @retval #ACCOUNT_ERROR_PERMISSION_DENIED DB Access fail by permission
1182 * @retval #ACCOUNT_ERROR_DATABASE_BUSY SQLite handler is busy
1183 * @retval #ACCOUNT_ERROR_DB_NOT_OPENED Account database did not opened
1184 * @retval #ACCOUNT_ERROR_NOT_SUPPORTED Not supported
1186 * @pre This function requires an open connection to an account service by account_connect() on tizen 2.3 (MOBILE).\n
1187 * But the account_connect() is not required to use this function since tizen 2.4.
1189 * @see account_query_account_by_user_name()
1190 * @see account_query_account_by_package_name()
1191 * @see account_query_account_by_capability()
1193 int account_query_account_by_account_id(int account_db_id, account_h *account);
1196 * @brief Retrieves deleted account with the account ID.
1200 * @privilege %http://tizen.org/privilege/account.read
1201 * @remarks The @a account should be released using account_destroy().
1203 * @param[in] account_db_id The id of the account to find in the database
1204 * @param[out] account The account handle
1206 * @return @c 0 on success,
1207 * otherwise a negative error value
1208 * @retval #ACCOUNT_ERROR_NONE Successful
1209 * @retval #ACCOUNT_ERROR_NOT_SUPPORTED Not supported
1210 * @retval #ACCOUNT_ERROR_PERMISSION_DENIED DB Access fail by permission
1211 * @retval #ACCOUNT_ERROR_INVALID_PARAMETER Invalid parameter
1212 * @retval #ACCOUNT_ERROR_OUT_OF_MEMORY Out of Memory
1213 * @retval #ACCOUNT_ERROR_DB_FAILED Database operation failed
1214 * @retval #ACCOUNT_ERROR_DATABASE_BUSY SQLite handler is busy
1215 * @retval #ACCOUNT_ERROR_DB_NOT_OPENED Account database did not opened
1217 * @see account_query_account_by_account_id()
1218 * @see account_query_account_by_user_name()
1219 * @see account_query_account_by_package_name()
1220 * @see account_query_account_by_capability()
1222 int account_query_deleted_account_info_by_account_id(int account_db_id, account_h *account);
1225 * @brief Retrieves all accounts with the user name.
1227 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 3.0 @endif
1229 * @privilege %http://tizen.org/privilege/account.read
1230 * @param[in] callback The callback function to invoke
1231 * @param[in] user_name The user name to search
1232 * @param[in] user_data The user data to be passed to the callback function
1234 * @return @c 0 on success,
1235 * otherwise a negative error value
1236 * @retval #ACCOUNT_ERROR_NONE Successful
1237 * @retval #ACCOUNT_ERROR_OUT_OF_MEMORY Out of Memory
1238 * @retval #ACCOUNT_ERROR_INVALID_PARAMETER Invalid parameter
1239 * @retval #ACCOUNT_ERROR_DB_FAILED Database operation failed
1240 * @retval #ACCOUNT_ERROR_PERMISSION_DENIED DB Access fail by permission
1241 * @retval #ACCOUNT_ERROR_DATABASE_BUSY SQLite handler is busy
1242 * @retval #ACCOUNT_ERROR_DB_NOT_OPENED Account database did not opened
1243 * @retval #ACCOUNT_ERROR_NOT_SUPPORTED Not supported
1245 * @pre This function requires an open connection to an account service by account_connect() on tizen 2.3 (MOBILE).\n
1246 * But the account_connect() is not required to use this function since tizen 2.4.
1247 * @post This function invokes account_cb().
1249 * @see account_foreach_account_from_db()
1250 * @see account_query_account_by_account_id()
1251 * @see account_query_account_by_package_name()
1252 * @see account_query_account_by_capability()
1255 int account_query_account_by_user_name(account_cb callback, const char *user_name, void *user_data);
1258 * @brief Retrieves all accounts with the package name.
1260 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 3.0 @endif
1262 * @privilege %http://tizen.org/privilege/account.read
1263 * @param[in] callback The callback function to invoke
1264 * @param[in] package_name The package name to search
1265 * @param[in] user_data The user data to be passed to the callback function
1267 * @return @c 0 on success,
1268 * otherwise a negative error value
1269 * @retval #ACCOUNT_ERROR_NONE Successful
1270 * @retval #ACCOUNT_ERROR_OUT_OF_MEMORY Out of Memory
1271 * @retval #ACCOUNT_ERROR_INVALID_PARAMETER Invalid parameter
1272 * @retval #ACCOUNT_ERROR_DB_FAILED Database operation failed
1273 * @retval #ACCOUNT_ERROR_PERMISSION_DENIED DB Access fail by permission
1274 * @retval #ACCOUNT_ERROR_DATABASE_BUSY SQLite handler is busy
1275 * @retval #ACCOUNT_ERROR_DB_NOT_OPENED Account database did not opened
1276 * @retval #ACCOUNT_ERROR_NOT_SUPPORTED Not supported
1278 * @pre This function requires an open connection to an account service by account_connect() on tizen 2.3 (MOBILE).\n
1279 * But the account_connect() is not required to use this function since tizen 2.4.
1280 * @post This function invokes account_cb().
1282 * @see account_foreach_account_from_db()
1283 * @see account_query_account_by_account_id()
1284 * @see account_query_account_by_user_name()
1285 * @see account_query_account_by_capability()
1287 int account_query_account_by_package_name(account_cb callback, const char *package_name, void *user_data);
1290 * @brief Retrieves all accounts with the capability type and capability value.
1292 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 3.0 @endif
1294 * @privilege %http://tizen.org/privilege/account.read
1295 * @param[in] callback The callback function to invoke
1296 * @param[in] capability_type The capability type to search
1297 * @param[in] capability_value The capability value to search
1298 * @param[in] user_data The user data to be passed to the callback function
1300 * @return @c 0 on success,
1301 * otherwise a negative error value
1302 * @retval #ACCOUNT_ERROR_NONE Successful
1303 * @retval #ACCOUNT_ERROR_OUT_OF_MEMORY Out of Memory
1304 * @retval #ACCOUNT_ERROR_INVALID_PARAMETER Invalid parameter
1305 * @retval #ACCOUNT_ERROR_DB_FAILED Database operation failed
1306 * @retval #ACCOUNT_ERROR_PERMISSION_DENIED DB Access fail by permission
1307 * @retval #ACCOUNT_ERROR_DATABASE_BUSY SQLite handler is busy
1308 * @retval #ACCOUNT_ERROR_DB_NOT_OPENED Account database did not opened
1309 * @retval #ACCOUNT_ERROR_NOT_SUPPORTED Not supported
1311 * @pre This function requires an open connection to an account service by account_connect() on tizen 2.3 (MOBILE).\n
1312 * But the account_connect() is not required to use this function since tizen 2.4.
1313 * @post This function invokes account_cb().
1315 * @see account_foreach_account_from_db()
1316 * @see account_query_account_by_account_id()
1317 * @see account_query_account_by_user_name()
1318 * @see account_query_account_by_package_name()
1320 int account_query_account_by_capability(account_cb callback, const char *capability_type, account_capability_state_e capability_value, void *user_data);
1323 * @brief Retrieves all accounts with the capability type.
1325 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 3.0 @endif
1327 * @privilege %http://tizen.org/privilege/account.read
1328 * @param[in] callback The callback function to invoke
1329 * @param[in] capability_type The capability type to search
1330 * @param[in] user_data The user data to be passed to the callback function
1332 * @return @c 0 on success,
1333 * otherwise a negative error value
1334 * @retval #ACCOUNT_ERROR_NONE Successful
1335 * @retval #ACCOUNT_ERROR_OUT_OF_MEMORY Out of Memory
1336 * @retval #ACCOUNT_ERROR_INVALID_PARAMETER Invalid parameter
1337 * @retval #ACCOUNT_ERROR_DB_FAILED Database operation failed
1338 * @retval #ACCOUNT_ERROR_PERMISSION_DENIED DB Access fail by permission
1339 * @retval #ACCOUNT_ERROR_DATABASE_BUSY SQLite handler is busy
1340 * @retval #ACCOUNT_ERROR_DB_NOT_OPENED Account database did not opened
1341 * @retval #ACCOUNT_ERROR_NOT_SUPPORTED Not supported
1343 * @pre This function requires an open connection to an account service by account_connect() on tizen 2.3 (MOBILE).\n
1344 * But the account_connect() is not required to use this function since tizen 2.4.
1345 * @post This function invokes account_cb().
1347 * @see account_foreach_account_from_db()
1348 * @see account_query_account_by_account_id()
1349 * @see account_query_account_by_user_name()
1350 * @see account_query_account_by_package_name()
1352 int account_query_account_by_capability_type(account_cb callback, const char *capability_type, void *user_data);
1355 * @brief Retrieves all capabilities with the account database ID.
1357 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 3.0 @endif
1359 * @privilege %http://tizen.org/privilege/account.read
1360 * @param[in] callback The callback function to invoke
1361 * @param[in] account_db_id The account database ID to search
1362 * @param[in] user_data The user data to be passed to the callback function
1364 * @return @c 0 on success,
1365 * otherwise a negative error value
1366 * @retval #ACCOUNT_ERROR_NONE Successful
1367 * @retval #ACCOUNT_ERROR_OUT_OF_MEMORY Out of Memory
1368 * @retval #ACCOUNT_ERROR_INVALID_PARAMETER Invalid parameter
1369 * @retval #ACCOUNT_ERROR_DB_FAILED Database operation failed
1370 * @retval #ACCOUNT_ERROR_PERMISSION_DENIED DB Access fail by permission
1371 * @retval #ACCOUNT_ERROR_DATABASE_BUSY SQLite handler is busy
1372 * @retval #ACCOUNT_ERROR_DB_NOT_OPENED Account database did not opened
1373 * @retval #ACCOUNT_ERROR_NOT_SUPPORTED Not supported
1375 * @pre This function requires an open connection to an account service by account_connect() on tizen 2.3 (MOBILE).\n
1376 * But the account_connect() is not required to use this function since tizen 2.4.
1377 * @post This function invokes capability_cb().
1379 * @see account_get_capability()
1380 * @see account_set_capability()
1382 int account_query_capability_by_account_id(capability_cb callback, int account_db_id, void *user_data);
1386 * @brief Gets the count of accounts in the account database.
1388 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 3.0 @endif
1390 * @privilege %http://tizen.org/privilege/account.read
1391 * @param[out] count The out parameter for count of all accounts
1393 * @return @c 0 on success,
1394 * otherwise a negative error value
1395 * @retval #ACCOUNT_ERROR_NONE Successful
1396 * @retval #ACCOUNT_ERROR_DB_FAILED Database operation failed
1397 * @retval #ACCOUNT_ERROR_PERMISSION_DENIED DB Access fail by permission
1398 * @retval #ACCOUNT_ERROR_DATABASE_BUSY SQLite handler is busy
1399 * @retval #ACCOUNT_ERROR_DB_NOT_OPENED Account database did not opened
1400 * @retval #ACCOUNT_ERROR_NOT_SUPPORTED Not supported
1402 * @pre This function requires an open connection to an account service by account_connect() on tizen 2.3 (MOBILE).\n
1403 * But the account_connect() is not required to use this function since tizen 2.4.
1405 int account_get_total_count_from_db(int *count);
1408 * @brief Updates the sync status of an account with the given account ID.
1410 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 3.0 @endif
1412 * @privilege %http://tizen.org/privilege/account.read \n
1413 * %http://tizen.org/privilege/account.write
1414 * @remarks This API need both privileges \n
1415 * Only can update an account which was added by same package applications
1416 * @param[in] account_db_id The account ID for which sync status needs to be changed
1417 * @param[in] sync_status The new sync status
1419 * @return @c 0 on success,
1420 * otherwise a negative error value
1421 * @retval #ACCOUNT_ERROR_NONE Successful
1422 * @retval #ACCOUNT_ERROR_OUT_OF_MEMORY Out of Memory
1423 * @retval #ACCOUNT_ERROR_INVALID_PARAMETER Invalid parameter
1424 * @retval #ACCOUNT_ERROR_DB_FAILED Database operation failed
1425 * @retval #ACCOUNT_ERROR_PERMISSION_DENIED DB Access fail by permission
1426 * @retval #ACCOUNT_ERROR_DATABASE_BUSY SQLite handler is busy
1427 * @retval #ACCOUNT_ERROR_DB_NOT_OPENED Account database did not opened
1428 * @retval #ACCOUNT_ERROR_NOT_SUPPORTED Not supported
1430 * @pre This function requires an open connection to an account service by account_connect() on tizen 2.3 (MOBILE).\n
1431 * But the account_connect() is not required to use this function since tizen 2.4.
1433 int account_update_sync_status_by_id(int account_db_id, const account_sync_state_e sync_status);
1436 /* Account type API */
1440 * @brief Creates a handle to the account provider.
1442 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 3.0 @endif
1443 * @remarks You must release @a account_type handle using account_type_destroy().\n
1445 * @param[in] account_type The account provider handle
1447 * @return @c 0 on success,
1448 * otherwise a negative error value
1449 * @retval #ACCOUNT_ERROR_NONE Successful
1450 * @retval #ACCOUNT_ERROR_OUT_OF_MEMORY Out of Memory
1451 * @retval #ACCOUNT_ERROR_INVALID_PARAMETER Invalid parameter
1452 * @retval #ACCOUNT_ERROR_NOT_SUPPORTED Not supported
1454 * @see account_type_destroy()
1456 int account_type_create(account_type_h *account_type);
1459 * @brief Destroys the account provider handle and releases all its resources.
1461 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 3.0 @endif
1463 * @remarks When you get @a account_type using account_type_create(), you must release the handle using account_destroy() to avoid the memory leak.
1465 * @param[in] account_type The account provider handle
1467 * @return @c 0 on success,
1468 * otherwise a negative error value
1469 * @retval #ACCOUNT_ERROR_NONE Successful
1470 * @retval #ACCOUNT_ERROR_INVALID_PARAMETER Invalid parameter
1471 * @retval #ACCOUNT_ERROR_NOT_SUPPORTED Not supported
1473 * @see account_type_create()
1475 int account_type_destroy(account_type_h account_type);
1478 * @brief Retrieves capability information with your application ID.
1480 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 3.0 @endif
1482 * @privilege %http://tizen.org/privilege/account.read
1483 * @param[in] callback The callback function carries the capability name of an app ID
1484 * @param[in] app_id The application ID to search
1485 * @param[in] user_data The user data \n
1486 * If you have your private data to carry into callback function, then you can use it.
1488 * @return @c 0 on success,
1489 * otherwise a negative error value
1490 * @retval #ACCOUNT_ERROR_NONE Successful
1491 * @retval #ACCOUNT_ERROR_INVALID_PARAMETER Invalid parameter
1492 * @retval #ACCOUNT_ERROR_DB_FAILED Database operation failed
1493 * @retval #ACCOUNT_ERROR_PERMISSION_DENIED DB Access fail by permission
1494 * @retval #ACCOUNT_ERROR_DATABASE_BUSY SQLite handler is busy
1495 * @retval #ACCOUNT_ERROR_DB_NOT_OPENED Account database did not opened
1496 * @retval #ACCOUNT_ERROR_NOT_SUPPORTED Not supported
1498 * @pre This function requires an open connection to an account service by account_connect() on tizen 2.3 (MOBILE).\n
1499 * But the account_connect() is not required to use this function since tizen 2.4.
1501 int account_type_query_provider_feature_by_app_id(provider_feature_cb callback, const char *app_id, void *user_data);
1504 * @brief Checks whether the given application ID supports the capability.
1506 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 3.0 @endif
1508 * @privilege %http://tizen.org/privilege/account.read
1509 * @remarks The specific error code can be obtained using the get_last_result() method. Error codes are described in Exception section.
1510 * @param[in] app_id The application ID
1511 * @param[in] capability The capability \n
1512 * For example, ACCOUNT_SUPPORTS_CAPABILITY_CONTACT or "http://tizen.org/account/capability/contact"
1514 * @return @c TRUE if the application supports the given capability, \n
1515 * otherwise @c FALSE if the application does not support the given capability
1516 * @retval @c TRUE means the application supports the given capability
1517 * @retval @c FALSE means the application does not support the given capability
1518 * @exception #ACCOUNT_ERROR_NONE Successful
1519 * @exception #ACCOUNT_ERROR_INVALID_PARAMETER Invalid parameter
1520 * @exception #ACCOUNT_ERROR_RECORD_NOT_FOUND Related record does not exist
1521 * @exception #ACCOUNT_ERROR_DB_FAILED Database operation failed
1522 * @exception #ACCOUNT_ERROR_PERMISSION_DENIED DB access fail by permission
1523 * @exception #ACCOUNT_ERROR_DATABASE_BUSY SQLite handler is busy
1524 * @exception #ACCOUNT_ERROR_DB_NOT_OPENED Account database did not opened
1525 * @exception #ACCOUNT_ERROR_NOT_SUPPORTED Not supported
1527 * @pre This function requires an open connection to an account service by account_connect() on tizen 2.3 (MOBILE).\n
1528 * But the account_connect() is not required to use this function since tizen 2.4.
1530 bool account_type_query_supported_feature(const char *app_id, const char *capability);
1533 * @brief Gets the application ID of an account provider.
1535 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 3.0 @endif
1536 * @remarks You must release @a app_id using free().
1538 * @param[in] account_type The account provider handle \n
1539 * It should be given by account_type_query_* functions or account_type_foreach_account_type_from_db().
1540 * @param[out] app_id The application ID of an account provider item
1542 * @return @c 0 on success,
1543 * otherwise a negative error value
1544 * @retval #ACCOUNT_ERROR_NONE Successful
1545 * @retval #ACCOUNT_ERROR_INVALID_PARAMETER Invalid parameter
1546 * @retval #ACCOUNT_ERROR_OUT_OF_MEMORY Out of memory
1547 * @retval #ACCOUNT_ERROR_NOT_SUPPORTED Not supported
1549 * @see account_type_foreach_account_type_from_db()
1550 * @see account_type_query_by_app_id()
1552 int account_type_get_app_id(account_type_h account_type, char **app_id);
1555 * @brief Gets the service provider ID of an account provider.
1557 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 3.0 @endif
1558 * @remarks You must release @a service_provider_id using free().
1560 * @param[in] account_type The account provider handle \n
1561 * It should be given by account_type_query_* functions or account_type_foreach_account_type_from_db().
1562 * @param[out] service_provider_id The service provider text ID of an account provider item
1564 * @return @c 0 on success,
1565 * otherwise a negative error value
1566 * @retval #ACCOUNT_ERROR_NONE Successful
1567 * @retval #ACCOUNT_ERROR_INVALID_PARAMETER Invalid parameter
1568 * @retval #ACCOUNT_ERROR_OUT_OF_MEMORY Out of memory
1569 * @retval #ACCOUNT_ERROR_NOT_SUPPORTED Not supported
1571 * @see account_type_foreach_account_type_from_db()
1572 * @see account_type_query_by_app_id()
1574 int account_type_get_service_provider_id(account_type_h account_type, char **service_provider_id);
1577 * @brief Gets the icon path of an account provider.
1579 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 3.0 @endif
1580 * @remarks You must release @a icon_path using free().
1582 * @param[in] account_type The account provider handle \n
1583 * It should be given by account_type_query_* functions or account_type_foreach_account_type_from_db().
1584 * @param[out] icon_path The icon path of the account provider item
1586 * @return @c 0 on success,
1587 * otherwise a negative error value
1588 * @retval #ACCOUNT_ERROR_NONE Successful
1589 * @retval #ACCOUNT_ERROR_INVALID_PARAMETER Invalid parameter
1590 * @retval #ACCOUNT_ERROR_OUT_OF_MEMORY Out of memory
1591 * @retval #ACCOUNT_ERROR_NOT_SUPPORTED Not supported
1593 * @see account_type_foreach_account_type_from_db()
1594 * @see account_type_query_by_app_id()
1596 int account_type_get_icon_path(account_type_h account_type, char **icon_path);
1599 * @brief Gets the small icon path of an account provider.
1601 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 3.0 @endif
1602 * @remarks You must release @a small_icon_path using free().
1604 * @param[in] account_type The account provider handle\n
1605 * It should be given by account_type_query_* functions or account_type_foreach_account_type_from_db().
1606 * @param[out] small_icon_path The small icon path of the account provider item
1608 * @return @c 0 on success,
1609 * otherwise a negative error value
1610 * @retval #ACCOUNT_ERROR_NONE Successful
1611 * @retval #ACCOUNT_ERROR_INVALID_PARAMETER Invalid parameter
1612 * @retval #ACCOUNT_ERROR_OUT_OF_MEMORY Out of memory
1613 * @retval #ACCOUNT_ERROR_NOT_SUPPORTED Not supported
1615 * @see account_type_foreach_account_type_from_db()
1616 * @see account_type_query_by_app_id()
1618 int account_type_get_small_icon_path(account_type_h account_type, char **small_icon_path);
1621 * @brief Checks whether the given account provider supports multiple accounts.
1623 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 3.0 @endif
1624 * @param[in] account_type The account provider handle \n
1625 * It should be given by account_type_query_* functions or account_type_foreach_account_type_from_db().
1626 * @param[out] multiple_account_support The flag indicating support for multiple accounts accounts\n
1629 * @return @c 0 on success,
1630 * otherwise a negative error value
1631 * @retval #ACCOUNT_ERROR_NONE Successful
1632 * @retval #ACCOUNT_ERROR_INVALID_PARAMETER Invalid parameter
1633 * @retval #ACCOUNT_ERROR_OUT_OF_MEMORY Out of memory
1634 * @retval #ACCOUNT_ERROR_NOT_SUPPORTED Not supported
1636 * @see account_type_foreach_account_type_from_db()
1637 * @see account_type_query_by_app_id()
1639 int account_type_get_multiple_account_support(account_type_h account_type, int *multiple_account_support);
1642 * @brief Gets capability information with the given account provider handle.
1644 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 3.0 @endif
1645 * @param[in] account_type The account provider handle\n
1646 * It should be given by account_type_query_* functions or account_type_foreach_account_type_from_db().
1647 * @param[in] callback The callback function that carries the capability name of the app ID
1648 * @param[in] user_data The user data \n
1649 * If you have your private data to carry into callback function, then you can use it.
1651 * @return @c 0 on success,
1652 * otherwise a negative error value
1653 * @retval #ACCOUNT_ERROR_NONE Successful
1654 * @retval #ACCOUNT_ERROR_INVALID_PARAMETER Invalid parameter
1655 * @retval #ACCOUNT_ERROR_DB_FAILED Database operation failed
1656 * @retval #ACCOUNT_ERROR_NOT_SUPPORTED Not supported
1658 * @pre This function requires an open connection to an account service by account_connect() on tizen 2.3 (MOBILE).\n
1659 * But the account_connect() is not required to use this function since tizen 2.4.
1661 int account_type_get_provider_feature_all(account_type_h account_type, provider_feature_cb callback, void *user_data);
1664 * @brief Gets the specific label information detail of an account provider.
1666 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 3.0 @endif
1667 * @remarks You must release @a label using free().
1669 * @param[in] account_type The account provider handle\n
1670 * It should be given by account_type_query_* functions or account_type_foreach_account_type_from_db().
1671 * @param[in] locale The locale is specified as an ISO 3166 alpha-2 two letter country-code followed by ISO 639-1 for the two-letter language code.\n
1672 * For example, "ko_KR" or "ko-kr" for Korean, "en_US" or "en-us" for American English.
1673 * @param[out] label The label text given for the locale
1675 * @return @c 0 on success,
1676 * otherwise a negative error value
1677 * @retval #ACCOUNT_ERROR_NONE Successful
1678 * @retval #ACCOUNT_ERROR_RECORD_NOT_FOUND No label for the given locale
1679 * @retval #ACCOUNT_ERROR_INVALID_PARAMETER Invalid parameter
1680 * @retval #ACCOUNT_ERROR_NOT_SUPPORTED Not supported
1682 * @see account_type_foreach_account_type_from_db()
1683 * @see account_type_query_by_app_id()
1686 int account_type_get_label_by_locale(account_type_h account_type, const char *locale, char **label);
1689 * @brief Gets the label information detail of an account provider.
1691 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 3.0 @endif
1692 * @param[in] account_type The account provider handle\n
1693 * It should be given by account_type_query_* functions or account_type_foreach_account_type_from_db().
1694 * @param[in] callback The callback function carrying the label information
1695 * @param[in] user_data The user data to be passed to the callback function
1697 * @return @c 0 on success,
1698 * otherwise a negative error value
1699 * @retval #ACCOUNT_ERROR_NONE Successful
1700 * @retval #ACCOUNT_ERROR_INVALID_PARAMETER Invalid parameter
1701 * @retval #ACCOUNT_ERROR_NOT_SUPPORTED Not supported
1703 * @see account_type_foreach_account_type_from_db()
1704 * @see account_type_query_by_app_id()
1706 int account_type_get_label(account_type_h account_type, account_label_cb callback, void *user_data);
1709 * @brief Retrieves the label information with your application ID.
1711 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 3.0 @endif
1713 * @privilege %http://tizen.org/privilege/account.read
1714 * @param[in] callback The callback function that carries label_h for label information \n
1715 * label_h contains label info as parameter.
1716 * @param[in] app_id The application ID to search
1717 * @param[in] user_data The user data \n
1718 * If you have your private data to carry into callback function, then you can use it.
1720 * @return @c 0 on success,
1721 * otherwise a negative error value
1722 * @retval #ACCOUNT_ERROR_NONE Successful
1723 * @retval #ACCOUNT_ERROR_INVALID_PARAMETER Invalid parameter
1724 * @retval #ACCOUNT_ERROR_DB_FAILED Database operation failed
1725 * @retval #ACCOUNT_ERROR_PERMISSION_DENIED DB Access fail by permission
1726 * @retval #ACCOUNT_ERROR_DATABASE_BUSY SQLite handler is busy
1727 * @retval #ACCOUNT_ERROR_DB_NOT_OPENED Account database did not opened
1728 * @retval #ACCOUNT_ERROR_NOT_SUPPORTED Not supported
1730 * @pre This function requires an open connection to an account service by account_connect() on tizen 2.3 (MOBILE).\n
1731 * But the account_connect() is not required to use this function since tizen 2.4.
1733 * @see account_type_query_by_app_id()
1734 * @see account_type_foreach_account_type_from_db()
1736 int account_type_query_label_by_app_id(account_label_cb callback, const char *app_id, void *user_data);
1739 * @brief Retrieves the account provider information with your application ID.
1741 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 3.0 @endif
1743 * @privilege %http://tizen.org/privilege/account.read
1744 * @param[in] app_id The application ID to search
1745 * @param[in,out] account_type The account handle which has to be created by account_type_create() before calling this function and released by account_type_destroy() after calling this function.
1747 * @return @c 0 on success,
1748 * otherwise a negative error value
1749 * @retval #ACCOUNT_ERROR_NONE Successful
1750 * @retval #ACCOUNT_ERROR_INVALID_PARAMETER Invalid parameter
1751 * @retval #ACCOUNT_ERROR_DB_FAILED Database operation failed
1752 * @retval #ACCOUNT_ERROR_RECORD_NOT_FOUND Queried data does not exist
1753 * @retval #ACCOUNT_ERROR_PERMISSION_DENIED DB Access fail by permission
1754 * @retval #ACCOUNT_ERROR_DATABASE_BUSY SQLite handler is busy
1755 * @retval #ACCOUNT_ERROR_DB_NOT_OPENED Account database did not opened
1756 * @retval #ACCOUNT_ERROR_NOT_SUPPORTED Not supported
1758 * @pre This function requires an open connection to an account service by account_connect() on tizen 2.3 (MOBILE).\n
1759 * But the account_connect() is not required to use this function since tizen 2.4.
1761 * @see account_type_create()
1762 * @see account_type_get_app_id()
1763 * @see account_type_get_service_provider_id()
1764 * @see account_type_get_icon_path()
1765 * @see account_type_get_small_icon_path()
1766 * @see account_type_get_multiple_account_support()
1767 * @see account_type_get_label()
1768 * @see account_type_destroy()
1770 int account_type_query_by_app_id(const char *app_id, account_type_h *account_type);
1773 * @brief Retrieves all account provider information.
1775 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 3.0 @endif
1777 * @privilege %http://tizen.org/privilege/account.read
1778 * @param[in] callback The account provider information \n
1779 * You can get the account information through account_type_get_* with the carried account_type_handle.
1780 * @param[in] user_data The user data \n
1781 * It will be carried through your callback function.
1783 * @return @c 0 on success,
1784 * otherwise a negative error value
1785 * @retval #ACCOUNT_ERROR_NONE Successful
1786 * @retval #ACCOUNT_ERROR_INVALID_PARAMETER Invalid parameter
1787 * @retval #ACCOUNT_ERROR_DB_FAILED Database operation failed
1788 * @retval #ACCOUNT_ERROR_PERMISSION_DENIED DB Access fail by permission
1789 * @retval #ACCOUNT_ERROR_DATABASE_BUSY SQLite handler is busy
1790 * @retval #ACCOUNT_ERROR_DB_NOT_OPENED Account database did not opened
1791 * @retval #ACCOUNT_ERROR_NOT_SUPPORTED Not supported
1793 * @pre This function requires an open connection to an account service by account_connect() on tizen 2.3 (MOBILE).\n
1794 * But the account_connect() is not required to use this function since tizen 2.4.
1796 * @see account_type_create()
1797 * @see account_type_get_app_id()
1798 * @see account_type_get_service_provider_id()
1799 * @see account_type_get_icon_path()
1800 * @see account_type_get_small_icon_path()
1801 * @see account_type_get_multiple_account_support()
1802 * @see account_type_get_label()
1803 * @see account_type_destroy()
1805 int account_type_foreach_account_type_from_db(account_type_cb callback, void *user_data);
1808 * @brief Retrieves the label information with the given application ID and locale.
1810 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 3.0 @endif
1812 * @privilege %http://tizen.org/privilege/account.read
1813 * @param[in] app_id The application ID
1814 * @param[in] locale The locale is specified as an ISO 3166 alpha-2 two letter country-code followed by ISO 639-1 for the two-letter language code.\n
1815 * For example, "ko_KR" or "ko-kr" for Korean, "en_US" or "en-us" for American English.
1816 * @param[out] label The label text corresponding app_id and locale \n
1817 * It must be free text.
1819 * @return @c 0 on success,
1820 * otherwise a negative error value
1821 * @retval #ACCOUNT_ERROR_NONE Successful
1822 * @retval #ACCOUNT_ERROR_INVALID_PARAMETER Invalid parameter
1823 * @retval #ACCOUNT_ERROR_DB_FAILED Database operation failed
1824 * @retval #ACCOUNT_ERROR_PERMISSION_DENIED DB Access fail by permission
1825 * @retval #ACCOUNT_ERROR_DATABASE_BUSY SQLite handler is busy
1826 * @retval #ACCOUNT_ERROR_DB_NOT_OPENED Account database did not opened
1827 * @retval #ACCOUNT_ERROR_NOT_SUPPORTED Not supported
1829 * @pre This function requires an open connection to an account service by account_connect() on tizen 2.3 (MOBILE).\n
1830 * But the account_connect() is not required to use this function since tizen 2.4.
1832 int account_type_query_label_by_locale(const char *app_id, const char *locale, char **label);
1835 * @brief Retrieves account provider information with the capability name.
1837 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 3.0 @endif
1839 * @privilege %http://tizen.org/privilege/account.read
1840 * @param[in] callback The callback function to retrieve account provider information
1841 * @param[in] key The capability value to search account provider \n
1842 * For example, ACCOUNT_SUPPORTS_CAPABILITY_CONTACT or "http://tizen.org/account/capability/contact"
1843 * @param[in] user_data If you have your private data to carry into callback function, then you can use it
1845 * @return @c 0 on success,
1846 * otherwise a negative error value
1847 * @retval #ACCOUNT_ERROR_NONE Successful
1848 * @retval #ACCOUNT_ERROR_RECORD_NOT_FOUND Record not found
1849 * @retval #ACCOUNT_ERROR_INVALID_PARAMETER Invalid parameter
1850 * @retval #ACCOUNT_ERROR_DB_FAILED Database operation failed
1851 * @retval #ACCOUNT_ERROR_PERMISSION_DENIED DB Access fail by permission
1852 * @retval #ACCOUNT_ERROR_DATABASE_BUSY SQLite handler is busy
1853 * @retval #ACCOUNT_ERROR_DB_NOT_OPENED Account database did not opened
1854 * @retval #ACCOUNT_ERROR_NOT_SUPPORTED Not supported
1856 * @pre This function requires an open connection to an account service by account_connect() on tizen 2.3 (MOBILE).\n
1857 * But the account_connect() is not required to use this function since tizen 2.4.
1859 int account_type_query_by_provider_feature(account_type_cb callback, const char *key, void *user_data);
1862 * @brief Checks whether the given app_id exists in the account provider DB.
1864 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 3.0 @endif
1866 * @privilege %http://tizen.org/privilege/account.read
1867 * @param[in] app_id The application ID to check
1869 * @return @c 0 on success,
1870 * otherwise a negative error value
1871 * @retval #ACCOUNT_ERROR_NONE Successful
1872 * @retval #ACCOUNT_ERROR_RECORD_NOT_FOUND Record not found
1873 * @retval #ACCOUNT_ERROR_INVALID_PARAMETER Invalid app ID
1874 * @retval #ACCOUNT_ERROR_DB_FAILED Database operation failed
1875 * @retval #ACCOUNT_ERROR_PERMISSION_DENIED DB Access fail by permission
1876 * @retval #ACCOUNT_ERROR_DATABASE_BUSY SQLite handler is busy
1877 * @retval #ACCOUNT_ERROR_DB_NOT_OPENED Account database did not opened
1878 * @retval #ACCOUNT_ERROR_NOT_SUPPORTED Not supported
1880 * @pre This function requires an open connection to an account service by account_connect() on tizen 2.3 (MOBILE).\n
1881 * But the account_connect() is not required to use this function since tizen 2.4.
1883 * @see account_type_query_by_app_id()
1885 int account_type_query_app_id_exist(const char *app_id);
1889 /* End of account provider API */
1892 * @brief Creates a handle for the account event subscription.
1894 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 3.0 @endif
1895 * @remarks You must release @a account_subscribe handle using account_unsubscribe_notification().
1897 * @param[in] account_subscribe The account subscription handle
1899 * @return @c 0 on success,
1900 * otherwise a negative error value
1901 * @retval #ACCOUNT_ERROR_NONE Successful
1902 * @retval #ACCOUNT_ERROR_OUT_OF_MEMORY Out of Memory
1903 * @retval #ACCOUNT_ERROR_INVALID_PARAMETER Invalid parameter
1904 * @retval #ACCOUNT_ERROR_NOT_SUPPORTED Not supported
1906 * @see account_unsubscribe_notification()
1907 * @see account_subscribe_notification()
1909 int account_subscribe_create(account_subscribe_h *account_subscribe);
1912 * @brief Starts to subscribe account event through the given callback function.
1914 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 3.0 @endif
1916 * @privilege %http://tizen.org/privilege/account.read \n
1917 * @param[in] account_subscribe The account subscription handle
1918 * @param[in] callback The callback function that is called when an account is removed and a data of account is updated from the account database \n
1919 * It will be called with event message and account ID.
1920 * @param[in] user_data The user_data that is delivered to callback
1922 * @return @c 0 on success,
1923 * otherwise a negative error value
1924 * @retval #ACCOUNT_ERROR_NONE Successful
1925 * @retval #ACCOUNT_ERROR_EVENT_SUBSCRIPTION_FAIL Subscription fail
1926 * @retval #ACCOUNT_ERROR_INVALID_PARAMETER Invalid parameter
1927 * @retval #ACCOUNT_ERROR_NOT_SUPPORTED Not supported
1929 * @see account_unsubscribe_notification()
1931 int account_subscribe_notification(account_subscribe_h account_subscribe, account_event_cb callback, void *user_data);
1934 * @brief Destroys the account subscribe handle and releases all its resources.
1936 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 3.0 @endif
1938 * @privilege %http://tizen.org/privilege/account.read \n
1939 * @remarks You must call account_unsubscribe_notification() when you do not need to subscribe account event.
1941 * @param[in] account_subscribe The account subscription handle
1943 * @return @c 0 on success,
1944 * otherwise a negative error value
1945 * @retval #ACCOUNT_ERROR_NONE Successful
1946 * @retval #ACCOUNT_ERROR_INVALID_PARAMETER Invalid parameter
1947 * @retval #ACCOUNT_ERROR_EVENT_SUBSCRIPTION_FAIL Unsubscription failed
1948 * @retval #ACCOUNT_ERROR_NOT_SUPPORTED Not supported
1950 * @see account_create()
1952 int account_unsubscribe_notification(account_subscribe_h account_subscribe);
1955 /* End of Account APIs */
1966 #endif /* __ACCOUNT_H__ */