3 * Copyright (c) 2012 - 2013 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.
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.
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.
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.
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.
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.
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.
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);
174 * @brief Creates a handle to the account.
177 * @remarks Release @a account using account_destroy().
178 * @remarks The created handle is not added to the account database until account_insert_to_db() is called.
180 * @param[in] account The account handle
182 * @return @c 0 on success,
183 * otherwise a negative error value
184 * @retval #ACCOUNT_ERROR_NONE Successful
185 * @retval #ACCOUNT_ERROR_OUT_OF_MEMORY Out of Memory
186 * @retval #ACCOUNT_ERROR_INVALID_PARAMETER Invalid parameter
188 * @see account_destroy()
190 int account_create(account_h *account);
194 * @brief Destroys the account handle and releases all its resources.
197 * @param[in] account The account handle
199 * @return @c 0 on success,
200 * otherwise a negative error value
201 * @retval #ACCOUNT_ERROR_NONE Successful
202 * @retval #ACCOUNT_ERROR_INVALID_PARAMETER Invalid parameter
204 * @see account_create()
206 int account_destroy(account_h account);
210 * @brief Inserts the account details to the account database.
214 * @privilege %http://tizen.org/privilege/account.read \n
215 * %http://tizen.org/privilege/account.write
216 * @remarks This API need both privileges
217 * @param[in] account The account handle
218 * @param[out] account_db_id The account ID to be assigned to an account
220 * @return @c 0 on success,
221 * otherwise a negative error value
222 * @retval #ACCOUNT_ERROR_NONE Successful
223 * @retval #ACCOUNT_ERROR_INVALID_PARAMETER Invalid parameter
224 * @retval #ACCOUNT_ERROR_OUT_OF_MEMORY Out of Memory
225 * @retval #ACCOUNT_ERROR_DB_FAILED Database operation failed
226 * @retval #ACCOUNT_ERROR_DUPLICATED Same user name exists in your application
227 * @retval #ACCOUNT_ERROR_NOT_ALLOW_MULTIPLE Tried to add an account in spite of multiple false accounts
228 * @retval #ACCOUNT_ERROR_NOT_REGISTERED_PROVIDER Tried to add an account though you did not register the account type in manifest
229 * @retval #ACCOUNT_ERROR_PERMISSION_DENIED DB Access fail by permission
230 * @retval #ACCOUNT_ERROR_DATABASE_BUSY SQLite handler is busy
231 * @retval #ACCOUNT_ERROR_DB_NOT_OPENED Account database did not opened
233 * @see account_delete_from_db_by_id()
234 * @see account_delete_from_db_by_user_name()
235 * @see account_delete_from_db_by_package_name()
236 * @see account_update_to_db_by_id()
237 * @see account_update_to_db_by_user_name()
239 int account_insert_to_db(account_h account, int *account_db_id);
243 * @brief Deletes an account from the account database by account DB ID.
247 * @privilege %http://tizen.org/privilege/account.read \n
248 * %http://tizen.org/privilege/account.write
249 * @remarks This API need both privileges \n
250 * Only can delete an account which was added by same package applications
251 * @param[in] account_db_id The account ID to delete
253 * @return @c 0 on success,
254 * otherwise a negative error value
255 * @retval #ACCOUNT_ERROR_NONE Successful
256 * @retval #ACCOUNT_ERROR_INVALID_PARAMETER Invalid parameter
257 * @retval #ACCOUNT_ERROR_OUT_OF_MEMORY Out of Memory
258 * @retval #ACCOUNT_ERROR_DB_FAILED Database operation failed
259 * @retval #ACCOUNT_ERROR_PERMISSION_DENIED The account owner is different from the caller or DB Access fail by permission
260 * @retval #ACCOUNT_ERROR_DATABASE_BUSY SQLite handler is busy
261 * @retval #ACCOUNT_ERROR_DB_NOT_OPENED Account database did not opened
263 * @see account_insert_to_db()
264 * @see account_delete_from_db_by_user_name()
265 * @see account_delete_from_db_by_package_name()
266 * @see account_update_to_db_by_id()
267 * @see account_update_to_db_by_user_name()
269 int account_delete_from_db_by_id(int account_db_id);
273 * @brief Deletes an account from the account database by user name.
277 * @privilege %http://tizen.org/privilege/account.read \n
278 * %http://tizen.org/privilege/account.write
279 * @remarks This API need both privileges \n
280 * Only can delete accounts which were added by same package applications
281 * @param[in] user_name The user name of the account to delete
282 * @param[in] package_name The package name of the account to delete
284 * @return @c 0 on success,
285 * otherwise a negative error value
286 * @retval #ACCOUNT_ERROR_NONE Successful
287 * @retval #ACCOUNT_ERROR_OUT_OF_MEMORY Out of Memory
288 * @retval #ACCOUNT_ERROR_INVALID_PARAMETER Invalid parameter
289 * @retval #ACCOUNT_ERROR_DB_FAILED Database operation failed
290 * @retval #ACCOUNT_ERROR_PERMISSION_DENIED DB Access fail by permission
291 * @retval #ACCOUNT_ERROR_DATABASE_BUSY SQLite handler is busy
292 * @retval #ACCOUNT_ERROR_DB_NOT_OPENED Account database did not opened
294 * @see account_insert_to_db()
295 * @see account_delete_from_db_by_id()
296 * @see account_delete_from_db_by_package_name()
297 * @see account_update_to_db_by_id()
298 * @see account_update_to_db_by_user_name()
300 int account_delete_from_db_by_user_name(char *user_name, char *package_name);
304 * @brief Deletes an account from the account database by package name.
308 * @privilege %http://tizen.org/privilege/account.read \n
309 * %http://tizen.org/privilege/account.write
310 * @remarks This API need both privileges \n
311 * Only can delete accounts which was added by same package applications
312 * @param[in] package_name The package name of account(s) to delete
314 * @return @c 0 on success,
315 * otherwise a negative error value
316 * @retval #ACCOUNT_ERROR_NONE Successful
317 * @retval #ACCOUNT_ERROR_INVALID_PARAMETER Invalid parameter
318 * @retval #ACCOUNT_ERROR_DB_FAILED Database operation failed
319 * @retval #ACCOUNT_ERROR_PERMISSION_DENIED DB Access fail by permission
320 * @retval #ACCOUNT_ERROR_DATABASE_BUSY SQLite handler is busy
321 * @retval #ACCOUNT_ERROR_DB_NOT_OPENED Account database did not opened
323 * @see account_insert_to_db()
324 * @see account_delete_from_db_by_id()
325 * @see account_delete_from_db_by_user_name()
326 * @see account_update_to_db_by_id()
327 * @see account_update_to_db_by_user_name()
329 int account_delete_from_db_by_package_name(const char *package_name);
332 * @brief Updates the account details to the account database.
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 update an account which was added by same package applications
340 * @param[in] account The account handle
341 * @param[in] account_id The account ID to update
343 * @return @c 0 on success,
344 * otherwise a negative error value
345 * @retval #ACCOUNT_ERROR_NONE Successful
346 * @retval #ACCOUNT_ERROR_INVALID_PARAMETER Invalid parameter
347 * @retval #ACCOUNT_ERROR_DB_FAILED Database operation failed
348 * @retval #ACCOUNT_ERROR_RECORD_NOT_FOUND The account to update does not exist
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
353 * @see account_insert_to_db()
354 * @see account_delete_from_db_by_id()
355 * @see account_delete_from_db_by_user_name()
356 * @see account_delete_from_db_by_package_name()
357 * @see account_update_to_db_by_user_name()
359 int account_update_to_db_by_id(account_h account, int account_id);
362 * @brief Updates the account details to the account database.
363 * The provider permission check has been added since tizen 3.0.
367 * @privilege %http://tizen.org/privilege/account.read \n
368 * %http://tizen.org/privilege/account.write
369 * @remarks This API need both privileges \n
370 * Only can update an account which was added by same package applications
371 * @param[in] account The account handle
372 * @param[in] account_id The account ID to update
374 * @return @c 0 on success,
375 * otherwise a negative error value
376 * @retval #ACCOUNT_ERROR_NONE Successful
377 * @retval #ACCOUNT_ERROR_OUT_OF_MEMORY Out of Memory
378 * @retval #ACCOUNT_ERROR_INVALID_PARAMETER Invalid parameter
379 * @retval #ACCOUNT_ERROR_DB_FAILED Database operation failed
380 * @retval #ACCOUNT_ERROR_RECORD_NOT_FOUND The account to update does not exist
381 * @retval #ACCOUNT_ERROR_PERMISSION_DENIED DB Access fail by permission
382 * @retval #ACCOUNT_ERROR_DATABASE_BUSY SQLite handler is busy
383 * @retval #ACCOUNT_ERROR_DB_NOT_OPENED Account database did not opened
385 * @see account_insert_to_db()
386 * @see account_delete_from_db_by_id()
387 * @see account_delete_from_db_by_user_name()
388 * @see account_delete_from_db_by_package_name()
389 * @see account_update_to_db_by_user_name()
391 int account_update_to_db_by_id_ex(account_h account, int account_id);
394 * @brief Updates the account details to the account database.
398 * @privilege %http://tizen.org/privilege/account.read \n
399 * %http://tizen.org/privilege/account.write
400 * @remarks This API need both privileges \n
401 * Only can update accounts which were added by same package applications
402 * @param[in] account The account handle
403 * @param[in] user_name The user name of the account to update
404 * @param[in] package_name The package name for the user name
406 * @return @c 0 on success,
407 * otherwise a negative error value
408 * @retval #ACCOUNT_ERROR_NONE Successful
409 * @retval #ACCOUNT_ERROR_INVALID_PARAMETER Invalid parameter
410 * @retval #ACCOUNT_ERROR_DB_FAILED Database operation failed
411 * @retval #ACCOUNT_ERROR_RECORD_NOT_FOUND The account to update does not exist
412 * @retval #ACCOUNT_ERROR_PERMISSION_DENIED DB Access fail by permission
413 * @retval #ACCOUNT_ERROR_DATABASE_BUSY SQLite handler is busy
414 * @retval #ACCOUNT_ERROR_DB_NOT_OPENED Account database did not opened
416 * @see account_insert_to_db()
417 * @see account_delete_from_db_by_id()
418 * @see account_delete_from_db_by_user_name()
419 * @see account_delete_from_db_by_package_name()
420 * @see account_update_to_db_by_id()
423 int account_update_to_db_by_user_name(account_h account, const char *user_name, const char *package_name);
426 * @brief Gets the ID of an account.
429 * @param[in] account The account handle
430 * @param[out] account_id The account ID
432 * @return @c 0 on success,
433 * otherwise a negative error value
434 * @retval #ACCOUNT_ERROR_NONE Successful
435 * @retval #ACCOUNT_ERROR_INVALID_PARAMETER Invalid parameter
438 int account_get_account_id(account_h account, int *account_id);
441 * @brief Gets the user name of an account.
444 * @remarks You must release @a user_name using free().
446 * @param[in] account The account handle
447 * @param[out] user_name The user name of the account
449 * @return @c 0 on success,
450 * otherwise a negative error value
451 * @retval #ACCOUNT_ERROR_NONE Successful
452 * @retval #ACCOUNT_ERROR_INVALID_PARAMETER Invalid parameter
453 * @retval #ACCOUNT_ERROR_OUT_OF_MEMORY Out of memory
455 * @see account_set_user_name()
457 int account_get_user_name(account_h account, char **user_name);
461 * @brief Sets the user name of an account.
464 * @param[in] account The account handle
465 * @param[in] user_name The string to set as user name
467 * @return @c 0 on success,
468 * otherwise a negative error value
469 * @retval #ACCOUNT_ERROR_NONE Successful
470 * @retval #ACCOUNT_ERROR_INVALID_PARAMETER Invalid parameter
472 * @see account_get_user_name()
474 int account_set_user_name(account_h account, const char *user_name);
478 * @brief Gets the display name of an account.
481 * @remarks You must release @a display_name using free().
483 * @param[in] account The account handle
484 * @param[out] display_name The display name of the account
486 * @return @c 0 on success,
487 * otherwise a negative error value
488 * @retval #ACCOUNT_ERROR_NONE Successful
489 * @retval #ACCOUNT_ERROR_INVALID_PARAMETER Invalid parameter
490 * @retval #ACCOUNT_ERROR_OUT_OF_MEMORY Out of memory
492 * @see account_get_display_name()
494 int account_get_display_name(account_h account, char **display_name);
498 * @brief Sets the display name of an account.
501 * @param[in] account The account handle
502 * @param[in] display_name The text string to set as the display name
504 * @return @c 0 on success,
505 * otherwise a negative error value
506 * @retval #ACCOUNT_ERROR_NONE Successful
507 * @retval #ACCOUNT_ERROR_INVALID_PARAMETER Invalid parameter
509 * @see account_get_display_name()
511 int account_set_display_name(account_h account, const char *display_name);
514 * @brief Gets the capability detail of an account.
517 * @param[in] account The account handle
518 * @param[in] capability_type The capability type to get the capability value
519 * @param[out] capability_value The capability value (on/off) of the specified capability_type
521 * @return @c 0 on success,
522 * otherwise a negative error value
523 * @retval #ACCOUNT_ERROR_NONE Successful
524 * @retval #ACCOUNT_ERROR_INVALID_PARAMETER Invalid parameter
525 * @retval #ACCOUNT_ERROR_RECORD_NOT_FOUND There is no given capability_type in the account
527 * @see account_set_capability()
529 int account_get_capability(account_h account, const char *capability_type, account_capability_state_e *capability_value);
532 * @brief Gets all the capabilities of an account.
535 * @param[in] account The account handle
536 * @param[in] callback The callback function
537 * @param[in] user_data The user data to be passed to the callback function
539 * @return @c 0 on success,
540 * otherwise a negative error value
541 * @retval #ACCOUNT_ERROR_NONE Successful
542 * @retval #ACCOUNT_ERROR_INVALID_PARAMETER Invalid parameter
544 * @see account_set_capability()
546 int account_get_capability_all(account_h account, capability_cb callback, void *user_data);
549 * @brief Sets the capability.
552 * @param[in] account The account handle
553 * @param[in] capability_type The capability type
554 * @param[in] capability_state The capability state
556 * @return @c 0 on success,
557 * otherwise a negative error value
558 * @retval #ACCOUNT_ERROR_NONE Successful
559 * @retval #ACCOUNT_ERROR_INVALID_PARAMETER Invalid parameter
561 * @see account_get_capability()
563 int account_set_capability(account_h account, const char *capability_type, account_capability_state_e capability_state);
567 * @brief Gets the icon path.
570 * @remarks You must release @a icon_path using free().
572 * @param[in] account The account handle
573 * @param[out] icon_path The icon path
575 * @return @c 0 on success,
576 * otherwise a negative error value
577 * @retval #ACCOUNT_ERROR_NONE Successful
578 * @retval #ACCOUNT_ERROR_INVALID_PARAMETER Invalid parameter
579 * @retval #ACCOUNT_ERROR_OUT_OF_MEMORY Out of memory
581 * @see account_set_icon_path()
583 int account_get_icon_path(account_h account, char **icon_path);
587 * @brief Sets the icon path.
590 * @param[in] account The account handle
591 * @param[in] icon_path The text string to set as the icon path
593 * @return @c 0 on success,
594 * otherwise a negative error value
595 * @retval #ACCOUNT_ERROR_NONE Successful
596 * @retval #ACCOUNT_ERROR_INVALID_PARAMETER Invalid parameter
598 * @see account_get_icon_path()
600 int account_set_icon_path(account_h account, const char *icon_path);
604 * @brief Gets the domain name.
607 * @remarks You must release @a domain_name using free().
609 * @param[in] account The account handle
610 * @param[out] domain_name The domain name
612 * @return @c 0 on success,
613 * otherwise a negative error value
614 * @retval #ACCOUNT_ERROR_NONE Successful
615 * @retval #ACCOUNT_ERROR_INVALID_PARAMETER Invalid parameter
616 * @retval #ACCOUNT_ERROR_OUT_OF_MEMORY Out of memory
618 * @see account_set_domain_name()
620 int account_get_domain_name(account_h account, char **domain_name);
624 * @brief Sets the domain name.
627 * @param[in] account The account handle
628 * @param[in] domain_name The text string to set as the domain name
630 * @return @c 0 on success,
631 * otherwise a negative error value
632 * @retval #ACCOUNT_ERROR_NONE Successful
633 * @retval #ACCOUNT_ERROR_INVALID_PARAMETER Invalid parameter
635 * @see account_get_domain_name()
637 int account_set_domain_name(account_h account, const char *domain_name);
641 * @brief Gets the email address.
644 * @remarks You must release @a email_address using free().
646 * @param[in] account The account handle
647 * @param[out] email_address The email address
649 * @return @c 0 on success,
650 * otherwise a negative error value
651 * @retval #ACCOUNT_ERROR_NONE Successful
652 * @retval #ACCOUNT_ERROR_INVALID_PARAMETER Invalid parameter
653 * @retval #ACCOUNT_ERROR_OUT_OF_MEMORY Out of memory
655 * @see account_set_email_address()
657 int account_get_email_address(account_h account, char **email_address);
661 * @brief Sets the email address.
664 * @param[in] account The account handle
665 * @param[in] email_address The text string to set as the email address
667 * @return @c 0 on success,
668 * otherwise a negative error value
669 * @retval #ACCOUNT_ERROR_NONE Successful
670 * @retval #ACCOUNT_ERROR_INVALID_PARAMETER Invalid parameter
672 * @see account_get_email_address()
674 int account_set_email_address(account_h account, const char *email_address);
678 * @brief Gets the package name.
681 * @remarks You must release @a package_name using free().
683 * @param[in] account The account handle
684 * @param[out] package_name The package name
686 * @return @c 0 on success,
687 * otherwise a negative error value
688 * @retval #ACCOUNT_ERROR_NONE Successful
689 * @retval #ACCOUNT_ERROR_INVALID_PARAMETER Invalid parameter
690 * @retval #ACCOUNT_ERROR_OUT_OF_MEMORY Out of memory
692 * @see account_set_package_name()
694 int account_get_package_name(account_h account, char **package_name);
698 * @brief Sets the package name.
701 * @param[in] account The account handle
702 * @param[in] package_name The text string to set as the package name
704 * @return @c 0 on success,
705 * otherwise a negative error value
706 * @retval #ACCOUNT_ERROR_NONE Successful
707 * @retval #ACCOUNT_ERROR_INVALID_PARAMETER Invalid parameter
709 * @see account_get_email_address()
711 int account_set_package_name(account_h account, const char *package_name);
715 * @brief Gets the access token. Access token field is used to store account secrets (such as password or master token).
718 * @remarks You must release @a access_token using free().
720 * @param[in] account The account handle
721 * @param[out] access_token The access token
723 * @return @c 0 on success,
724 * otherwise a negative error value
725 * @retval #ACCOUNT_ERROR_NONE Successful
726 * @retval #ACCOUNT_ERROR_INVALID_PARAMETER Invalid parameter
727 * @retval #ACCOUNT_ERROR_OUT_OF_MEMORY Out of memory
729 * @remarks Access token field is used for storing account secret (password / master token etc)
730 * Only account owner application can retrieve account password / access_token. For others this field will be null.
731 * @see account_set_access_token()
733 int account_get_access_token(account_h account, char **access_token);
737 * @brief Sets the access token. Access token field is used to store account secrets (such as password or master token).
740 * @param[in] account The account handle
741 * @param[in] access_token The text string to set as the access token
743 * @return @c 0 on success,
744 * otherwise a negative error value
745 * @retval #ACCOUNT_ERROR_NONE Successful
746 * @retval #ACCOUNT_ERROR_INVALID_PARAMETER Invalid parameter
747 * @remarks Only account owner application can retrieve account password / access_token. For others this field will be null.
748 * @see account_get_access_token()
750 int account_set_access_token(account_h account, const char *access_token);
754 * @brief Gets the user text.
757 * @remarks You must release @a user_text using free().
759 * @param[in] account The account handle
760 * @param[in] user_text_index The index of the user text (range: 0 ~ 4)
761 * @param[out] user_text The user text
763 * @return @c 0 on success,
764 * otherwise a negative error value
765 * @retval #ACCOUNT_ERROR_NONE Successful
766 * @retval #ACCOUNT_ERROR_INVALID_PARAMETER Invalid parameter
767 * @retval #ACCOUNT_ERROR_OUT_OF_MEMORY Out of memory
769 * @see account_set_user_text()
771 int account_get_user_text(account_h account, int user_text_index, char **user_text);
775 * @brief Sets the user text.
778 * @param[in] account The account handle
779 * @param[in] user_text_index The index of the user text (must be in range from @c 0 to @c 4)
780 * @param[in] user_text The text string to set as the user text
782 * @return @c 0 on success,
783 * otherwise a negative error value
784 * @retval #ACCOUNT_ERROR_NONE Successful
785 * @retval #ACCOUNT_ERROR_INVALID_PARAMETER Invalid parameter
787 * @see account_get_user_text()
789 int account_set_user_text(account_h account, int user_text_index, const char *user_text);
793 * @brief Gets the user integer.
796 * @param[in] account The account handle
797 * @param[in] user_int_index The index of the user integer (must be in range from @c 0 to @c 4)
798 * @param[out] user_integer The user integer
800 * @return @c 0 on success,
801 * otherwise a negative error value
802 * @retval #ACCOUNT_ERROR_NONE Successful
803 * @retval #ACCOUNT_ERROR_INVALID_PARAMETER Invalid parameter
805 * @see account_set_user_int()
807 int account_get_user_int(account_h account, int user_int_index, int *user_integer);
811 * @brief Sets the user integer.
814 * @param[in] account The account handle
815 * @param[in] user_int_index The index of the user integer (must be in range from @c 0 to @c 4)
816 * @param[in] user_integer The integer to set as the user integer
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
823 * @see account_get_user_int()
825 int account_set_user_int(account_h account, int user_int_index, int user_integer);
829 * @brief Gets the auth type.
832 * @param[in] account The account handle
833 * @param[out] auth_type The auth type
835 * @return @c 0 on success,
836 * otherwise a negative error value
837 * @retval #ACCOUNT_ERROR_NONE Successful
838 * @retval #ACCOUNT_ERROR_INVALID_PARAMETER Invalid parameter
840 * @see account_set_auth_type()
842 int account_get_auth_type(account_h account, account_auth_type_e *auth_type);
846 * @brief Sets the auth type.
849 * @param[in] account The account handle
850 * @param[in] auth_type The integer to be set as the auth type
852 * @return @c 0 on success,
853 * otherwise a negative error value
854 * @retval #ACCOUNT_ERROR_NONE Successful
855 * @retval #ACCOUNT_ERROR_INVALID_PARAMETER Invalid parameter
857 * @see account_get_auth_type()
859 int account_set_auth_type(account_h account, const account_auth_type_e auth_type);
863 * @brief Gets the secret.
866 * @param[in] account The account handle
867 * @param[out] secret The secret
869 * @return @c 0 on success,
870 * otherwise a negative error value
871 * @retval #ACCOUNT_ERROR_NONE Successful
872 * @retval #ACCOUNT_ERROR_INVALID_PARAMETER Invalid parameter
874 * @see account_set_secret()
876 int account_get_secret(account_h account, account_secrecy_state_e *secret);
880 * @brief Sets the secret.
883 * @param[in] account The account handle
884 * @param[in] secret The secrecy to be set
886 * @return @c 0 on success,
887 * otherwise a negative error value
888 * @retval #ACCOUNT_ERROR_NONE Successful
889 * @retval #ACCOUNT_ERROR_INVALID_PARAMETER Invalid parameter
891 * @see account_get_secret()
893 int account_set_secret(account_h account, const account_secrecy_state_e secret);
896 * @brief Gets the sync support.
899 * @param[in] account The account handle
900 * @param[out] sync_support The sync support
902 * @return @c 0 on success,
903 * otherwise a negative error value
904 * @retval #ACCOUNT_ERROR_NONE Successful
905 * @retval #ACCOUNT_ERROR_INVALID_PARAMETER Invalid parameter
907 * @see account_set_sync_support()
909 int account_get_sync_support(account_h account, account_sync_state_e *sync_support);
913 * @brief Sets the sync support.
916 * @param[in] account The account handle
917 * @param[in] sync_support The sync state to be set
919 * @return @c 0 on success,
920 * otherwise a negative error value
921 * @retval #ACCOUNT_ERROR_NONE Successful
922 * @retval #ACCOUNT_ERROR_INVALID_PARAMETER Invalid parameter
924 * @see account_get_sync_support()
926 int account_set_sync_support(account_h account, const account_sync_state_e sync_support);
930 * @brief Gets the source.
933 * @remarks You must release @a user_text using free().
935 * @param[in] account The account handle
936 * @param[out] source The source
938 * @return @c 0 on success,
939 * otherwise a negative error value
940 * @retval #ACCOUNT_ERROR_NONE Successful
941 * @retval #ACCOUNT_ERROR_INVALID_PARAMETER Invalid parameter
942 * @retval #ACCOUNT_ERROR_OUT_OF_MEMORY Out of memory
944 * @see account_set_source()
946 int account_get_source(account_h account, char **source);
950 * @brief Sets the source.
953 * @param[in] account The account handle
954 * @param[in] source The text string to set as the source
956 * @return @c 0 on success,
957 * otherwise a negative error value
958 * @retval #ACCOUNT_ERROR_NONE Successful
959 * @retval #ACCOUNT_ERROR_INVALID_PARAMETER Invalid parameter
961 * @see account_get_source()
963 int account_set_source(account_h account, const char *source);
966 * @brief Sets the custom.
969 * @param[in] account The account handle
970 * @param[in] key The user custom key for the specific value
971 * @param[in] value The user custom value about the given key
973 * @return @c 0 on success,
974 * otherwise a negative error value
975 * @retval #ACCOUNT_ERROR_NONE Successful
976 * @retval #ACCOUNT_ERROR_INVALID_PARAMETER Invalid parameter
978 * @see account_get_custom()
980 int account_set_custom(account_h account, const char *key, const char *value);
983 * @brief Gets the user specific custom text of an account key.
986 * @param[in] account The account handle
987 * @param[in] key The key to retrieve custom text
988 * @param[out] value The text of the given key
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_RECORD_NOT_FOUND There is no given capability type in the account
996 * @see account_set_custom()
998 int account_get_custom(account_h account, const char *key, char **value);
1002 * @brief Gets all the user custom texts of an account.
1005 * @param[in] account The account handle
1006 * @param[in] callback The callback function to retrieve all custom text \n
1007 * The callback function gives the key and value.
1008 * @param[in] user_data The user data to be passed to the callback function
1010 * @return @c 0 on success,
1011 * otherwise a negative error value
1012 * @retval #ACCOUNT_ERROR_NONE Successful
1013 * @retval #ACCOUNT_ERROR_INVALID_PARAMETER Invalid parameter
1015 * @see account_set_custom()
1017 int account_get_custom_all(account_h account, account_custom_cb callback, void *user_data);
1020 * @brief Retrieves all accounts details by invoking the given callback function iteratively.
1024 * @privilege %http://tizen.org/privilege/account.read
1025 * @param[in] callback The callback function to invoke
1026 * @param[in] user_data The user data to be passed to the callback function
1028 * @return @c 0 on success,
1029 * otherwise a negative error value
1030 * @retval #ACCOUNT_ERROR_NONE Successful
1031 * @retval #ACCOUNT_ERROR_INVALID_PARAMETER Invalid parameter
1032 * @retval #ACCOUNT_ERROR_DB_FAILED Database operation failed
1033 * @retval #ACCOUNT_ERROR_PERMISSION_DENIED DB Access fail by permission
1034 * @retval #ACCOUNT_ERROR_RECORD_NOT_FOUND Related record does not exist
1035 * @retval #ACCOUNT_ERROR_DATABASE_BUSY SQLite handler is busy
1036 * @retval #ACCOUNT_ERROR_DB_NOT_OPENED Account database did not opened
1038 * @post This function invokes account_cb().
1040 * @see account_query_account_by_account_id()
1041 * @see account_query_account_by_user_name()
1042 * @see account_query_account_by_package_name()
1043 * @see account_query_account_by_capability()
1045 int account_foreach_account_from_db(account_cb callback, void *user_data);
1049 * @brief Retrieve an account with the account ID.
1053 * @privilege %http://tizen.org/privilege/account.read
1054 * @param[in] account_db_id The account database ID to search
1055 * @param[out] account The account handle \n
1056 * Must be allocated by account_create() and freed after using by account_destroy().
1058 * @return @c 0 on success,
1059 * otherwise a negative error value
1060 * @retval #ACCOUNT_ERROR_NONE Successful
1061 * @retval #ACCOUNT_ERROR_OUT_OF_MEMORY Out of Memory
1062 * @retval #ACCOUNT_ERROR_INVALID_PARAMETER Invalid parameter
1063 * @retval #ACCOUNT_ERROR_DB_FAILED Database operation failed
1064 * @retval #ACCOUNT_ERROR_PERMISSION_DENIED DB Access fail by permission
1065 * @retval #ACCOUNT_ERROR_DATABASE_BUSY SQLite handler is busy
1066 * @retval #ACCOUNT_ERROR_DB_NOT_OPENED Account database did not opened
1068 * @see account_query_account_by_user_name()
1069 * @see account_query_account_by_package_name()
1070 * @see account_query_account_by_capability()
1072 int account_query_account_by_account_id(int account_db_id, account_h *account);
1075 * @brief Retrieves all accounts with the user name.
1079 * @privilege %http://tizen.org/privilege/account.read
1080 * @param[in] callback The callback function to invoke
1081 * @param[in] user_name The user name to search
1082 * @param[in] user_data The user data to be passed to the callback function
1084 * @return @c 0 on success,
1085 * otherwise a negative error value
1086 * @retval #ACCOUNT_ERROR_NONE Successful
1087 * @retval #ACCOUNT_ERROR_OUT_OF_MEMORY Out of Memory
1088 * @retval #ACCOUNT_ERROR_INVALID_PARAMETER Invalid parameter
1089 * @retval #ACCOUNT_ERROR_DB_FAILED Database operation failed
1090 * @retval #ACCOUNT_ERROR_PERMISSION_DENIED DB Access fail by permission
1091 * @retval #ACCOUNT_ERROR_DATABASE_BUSY SQLite handler is busy
1092 * @retval #ACCOUNT_ERROR_DB_NOT_OPENED Account database did not opened
1094 * @post This function invokes account_cb().
1096 * @see account_foreach_account_from_db()
1097 * @see account_query_account_by_account_id()
1098 * @see account_query_account_by_package_name()
1099 * @see account_query_account_by_capability()
1102 int account_query_account_by_user_name(account_cb callback, const char *user_name, void *user_data);
1105 * @brief Retrieves all accounts with the package name.
1109 * @privilege %http://tizen.org/privilege/account.read
1110 * @param[in] callback The callback function to invoke
1111 * @param[in] package_name The package name to search
1112 * @param[in] user_data The user data to be passed to the callback function
1114 * @return @c 0 on success,
1115 * otherwise a negative error value
1116 * @retval #ACCOUNT_ERROR_NONE Successful
1117 * @retval #ACCOUNT_ERROR_OUT_OF_MEMORY Out of Memory
1118 * @retval #ACCOUNT_ERROR_INVALID_PARAMETER Invalid parameter
1119 * @retval #ACCOUNT_ERROR_DB_FAILED Database operation failed
1120 * @retval #ACCOUNT_ERROR_PERMISSION_DENIED DB Access fail by permission
1121 * @retval #ACCOUNT_ERROR_DATABASE_BUSY SQLite handler is busy
1122 * @retval #ACCOUNT_ERROR_DB_NOT_OPENED Account database did not opened
1124 * @post This function invokes account_cb().
1126 * @see account_foreach_account_from_db()
1127 * @see account_query_account_by_account_id()
1128 * @see account_query_account_by_user_name()
1129 * @see account_query_account_by_capability()
1131 int account_query_account_by_package_name(account_cb callback, const char *package_name, void *user_data);
1134 * @brief Retrieves all accounts with the capability type and capability value.
1138 * @privilege %http://tizen.org/privilege/account.read
1139 * @param[in] callback The callback function to invoke
1140 * @param[in] capability_type The capability type to search
1141 * @param[in] capability_value The capability value to search
1142 * @param[in] user_data The user data to be passed to the callback function
1144 * @return @c 0 on success,
1145 * otherwise a negative error value
1146 * @retval #ACCOUNT_ERROR_NONE Successful
1147 * @retval #ACCOUNT_ERROR_OUT_OF_MEMORY Out of Memory
1148 * @retval #ACCOUNT_ERROR_INVALID_PARAMETER Invalid parameter
1149 * @retval #ACCOUNT_ERROR_DB_FAILED Database operation failed
1150 * @retval #ACCOUNT_ERROR_PERMISSION_DENIED DB Access fail by permission
1151 * @retval #ACCOUNT_ERROR_DATABASE_BUSY SQLite handler is busy
1152 * @retval #ACCOUNT_ERROR_DB_NOT_OPENED Account database did not opened
1154 * @post This function invokes account_cb().
1156 * @see account_foreach_account_from_db()
1157 * @see account_query_account_by_account_id()
1158 * @see account_query_account_by_user_name()
1159 * @see account_query_account_by_package_name()
1161 int account_query_account_by_capability(account_cb callback, const char *capability_type, account_capability_state_e capability_value, void *user_data);
1164 * @brief Retrieves all accounts with the capability type.
1168 * @privilege %http://tizen.org/privilege/account.read
1169 * @param[in] callback The callback function to invoke
1170 * @param[in] capability_type The capability type to search
1171 * @param[in] user_data The user data to be passed to the callback function
1173 * @return @c 0 on success,
1174 * otherwise a negative error value
1175 * @retval #ACCOUNT_ERROR_NONE Successful
1176 * @retval #ACCOUNT_ERROR_OUT_OF_MEMORY Out of Memory
1177 * @retval #ACCOUNT_ERROR_INVALID_PARAMETER Invalid parameter
1178 * @retval #ACCOUNT_ERROR_DB_FAILED Database operation failed
1179 * @retval #ACCOUNT_ERROR_PERMISSION_DENIED DB Access fail by permission
1180 * @retval #ACCOUNT_ERROR_DATABASE_BUSY SQLite handler is busy
1181 * @retval #ACCOUNT_ERROR_DB_NOT_OPENED Account database did not opened
1183 * @post This function invokes account_cb().
1185 * @see account_foreach_account_from_db()
1186 * @see account_query_account_by_account_id()
1187 * @see account_query_account_by_user_name()
1188 * @see account_query_account_by_package_name()
1190 int account_query_account_by_capability_type(account_cb callback, const char *capability_type, void *user_data);
1193 * @brief Retrieves all capabilities with the account database ID.
1197 * @privilege %http://tizen.org/privilege/account.read
1198 * @param[in] callback The callback function to invoke
1199 * @param[in] account_db_id The account database ID to search
1200 * @param[in] user_data The user data to be passed to the callback function
1202 * @return @c 0 on success,
1203 * otherwise a negative error value
1204 * @retval #ACCOUNT_ERROR_NONE Successful
1205 * @retval #ACCOUNT_ERROR_OUT_OF_MEMORY Out of Memory
1206 * @retval #ACCOUNT_ERROR_INVALID_PARAMETER Invalid parameter
1207 * @retval #ACCOUNT_ERROR_DB_FAILED Database operation failed
1208 * @retval #ACCOUNT_ERROR_PERMISSION_DENIED DB Access fail by permission
1209 * @retval #ACCOUNT_ERROR_DATABASE_BUSY SQLite handler is busy
1210 * @retval #ACCOUNT_ERROR_DB_NOT_OPENED Account database did not opened
1212 * @post This function invokes capability_cb().
1214 * @see account_get_capability()
1215 * @see account_set_capability()
1217 int account_query_capability_by_account_id(capability_cb callback, int account_db_id, void *user_data);
1221 * @brief Gets the count of accounts in the account database.
1225 * @privilege %http://tizen.org/privilege/account.read
1226 * @param[out] count The out parameter for count of all accounts
1228 * @return @c 0 on success,
1229 * otherwise a negative error value
1230 * @retval #ACCOUNT_ERROR_NONE Successful
1231 * @retval #ACCOUNT_ERROR_DB_FAILED Database operation failed
1232 * @retval #ACCOUNT_ERROR_PERMISSION_DENIED DB Access fail by permission
1233 * @retval #ACCOUNT_ERROR_DATABASE_BUSY SQLite handler is busy
1234 * @retval #ACCOUNT_ERROR_DB_NOT_OPENED Account database did not opened
1237 int account_get_total_count_from_db(int *count);
1240 * @brief Updates the sync status of an account with the given account ID.
1244 * @privilege %http://tizen.org/privilege/account.read \n
1245 * %http://tizen.org/privilege/account.write
1246 * @remarks This API need both privileges \n
1247 * Only can update an account which was added by same package applications
1248 * @param[in] account_db_id The account ID for which sync status needs to be changed
1249 * @param[in] sync_status The new sync status
1251 * @return @c 0 on success,
1252 * otherwise a negative error value
1253 * @retval #ACCOUNT_ERROR_NONE Successful
1254 * @retval #ACCOUNT_ERROR_OUT_OF_MEMORY Out of Memory
1255 * @retval #ACCOUNT_ERROR_INVALID_PARAMETER Invalid parameter
1256 * @retval #ACCOUNT_ERROR_DB_FAILED Database operation failed
1257 * @retval #ACCOUNT_ERROR_PERMISSION_DENIED DB Access fail by permission
1258 * @retval #ACCOUNT_ERROR_DATABASE_BUSY SQLite handler is busy
1259 * @retval #ACCOUNT_ERROR_DB_NOT_OPENED Account database did not opened
1262 int account_update_sync_status_by_id(int account_db_id, const account_sync_state_e sync_status);
1265 /* Account type API */
1269 * @brief Creates a handle to the account provider.
1272 * @remarks You must release @a account_type handle using account_type_destroy().\n
1274 * @param[in] account_type The account provider handle
1276 * @return @c 0 on success,
1277 * otherwise a negative error value
1278 * @retval #ACCOUNT_ERROR_NONE Successful
1279 * @retval #ACCOUNT_ERROR_OUT_OF_MEMORY Out of Memory
1280 * @retval #ACCOUNT_ERROR_INVALID_PARAMETER Invalid parameter
1282 * @see account_type_destroy()
1284 int account_type_create(account_type_h *account_type);
1287 * @brief Destroys the account provider handle and releases all its resources.
1291 * @remarks When you get @a account_type_h using account_type_create(), you must release the handle using account_destroy() to avoid the memory leak.
1293 * @param[in] account_type The account provider handle
1295 * @return @c 0 on success,
1296 * otherwise a negative error value
1297 * @retval #ACCOUNT_ERROR_NONE Successful
1298 * @retval #ACCOUNT_ERROR_INVALID_PARAMETER Invalid parameter
1300 * @see account_type_create()
1302 int account_type_destroy(account_type_h account_type);
1305 * @brief Retrieves capability information with your application ID.
1309 * @privilege %http://tizen.org/privilege/account.read
1310 * @param[in] callback The callback function carries the capability name of an app ID
1311 * @param[in] app_id The application ID to search
1312 * @param[in] user_data The user data \n
1313 * If you have your private data to carry into callback function, then you can use it.
1315 * @return @c 0 on success,
1316 * otherwise a negative error value
1317 * @retval #ACCOUNT_ERROR_NONE Successful
1318 * @retval #ACCOUNT_ERROR_INVALID_PARAMETER Invalid parameter
1319 * @retval #ACCOUNT_ERROR_DB_FAILED Database operation failed
1320 * @retval #ACCOUNT_ERROR_PERMISSION_DENIED DB Access fail by permission
1321 * @retval #ACCOUNT_ERROR_DATABASE_BUSY SQLite handler is busy
1322 * @retval #ACCOUNT_ERROR_DB_NOT_OPENED Account database did not opened
1325 int account_type_query_provider_feature_by_app_id(provider_feature_cb callback, const char *app_id, void *user_data);
1328 * @brief Checks whether the given application ID supports the capability.
1332 * @privilege %http://tizen.org/privilege/account.read
1333 * @remarks The specific error code can be obtained using the get_last_result() method. Error codes are described in Exception section.
1334 * @param[in] app_id The application ID
1335 * @param[in] capability The capability \n
1336 * For example, ACCOUNT_SUPPORTS_CAPABILITY_CONTACT or "http://tizen.org/account/capability/contact"
1338 * @return @c TRUE if the application supports the given capability, \n
1339 * otherwise @c FALSE if the application does not support the given capability
1340 * @retval @c TRUE means the application supports the given capability
1341 * @retval @c FALSE means the application does not support the given capability
1342 * @exception #ACCOUNT_ERROR_NONE Successful
1343 * @exception #ACCOUNT_ERROR_INVALID_PARAMETER Invalid parameter
1344 * @exception #ACCOUNT_ERROR_RECORD_NOT_FOUND Related record does not exist
1345 * @exception #ACCOUNT_ERROR_DB_FAILED Database operation failed
1346 * @exception #ACCOUNT_ERROR_PERMISSION_DENIED DB access fail by permission
1347 * @exception #ACCOUNT_ERROR_DATABASE_BUSY SQLite handler is busy
1348 * @exception #ACCOUNT_ERROR_DB_NOT_OPENED Account database did not opened
1351 bool account_type_query_supported_feature(const char *app_id, const char *capability);
1354 * @brief Gets the application ID of an account provider.
1357 * @remarks You must release @a app_id using free().
1359 * @param[in] account_type The account provider handle \n
1360 * It should be given by account_type_query_* functions or account_type_foreach_account_type_from_db().
1361 * @param[out] app_id The application ID of an account provider item
1363 * @return @c 0 on success,
1364 * otherwise a negative error value
1365 * @retval #ACCOUNT_ERROR_NONE Successful
1366 * @retval #ACCOUNT_ERROR_INVALID_PARAMETER Invalid parameter
1367 * @retval #ACCOUNT_ERROR_OUT_OF_MEMORY Out of memory
1369 * @see account_type_foreach_account_type_from_db()
1370 * @see account_type_query_by_app_id()
1372 int account_type_get_app_id(account_type_h account_type, char **app_id);
1375 * @brief Gets the service provider ID of an account provider.
1378 * @remarks You must release @a service_provider_id using free().
1380 * @param[in] account_type The account provider handle \n
1381 * It should be given by account_type_query_* functions or account_type_foreach_account_type_from_db().
1382 * @param[out] service_provider_id The service provider text ID of an account provider item
1384 * @return @c 0 on success,
1385 * otherwise a negative error value
1386 * @retval #ACCOUNT_ERROR_NONE Successful
1387 * @retval #ACCOUNT_ERROR_INVALID_PARAMETER Invalid parameter
1388 * @retval #ACCOUNT_ERROR_OUT_OF_MEMORY Out of memory
1390 * @see account_type_foreach_account_type_from_db()
1391 * @see account_type_query_by_app_id()
1393 int account_type_get_service_provider_id(account_type_h account_type, char **service_provider_id);
1396 * @brief Gets the icon path of an account provider.
1399 * @remarks You must release @a icon_path using free().
1401 * @param[in] account_type The account provider handle \n
1402 * It should be given by account_type_query_* functions or account_type_foreach_account_type_from_db().
1403 * @param[out] icon_path The icon path of the account provider item
1405 * @return @c 0 on success,
1406 * otherwise a negative error value
1407 * @retval #ACCOUNT_ERROR_NONE Successful
1408 * @retval #ACCOUNT_ERROR_INVALID_PARAMETER Invalid parameter
1409 * @retval #ACCOUNT_ERROR_OUT_OF_MEMORY Out of memory
1411 * @see account_type_foreach_account_type_from_db()
1412 * @see account_type_query_by_app_id()
1414 int account_type_get_icon_path(account_type_h account_type, char **icon_path);
1417 * @brief Gets the small icon path of an account provider.
1420 * @remarks You must release @a small_icon_path using free().
1422 * @param[in] account_type The account provider handle\n
1423 * It should be given by account_type_query_* functions or account_type_foreach_account_type_from_db().
1424 * @param[out] small_icon_path The small icon path of the account provider item
1426 * @return @c 0 on success,
1427 * otherwise a negative error value
1428 * @retval #ACCOUNT_ERROR_NONE Successful
1429 * @retval #ACCOUNT_ERROR_INVALID_PARAMETER Invalid parameter
1430 * @retval #ACCOUNT_ERROR_OUT_OF_MEMORY Out of memory
1432 * @see account_type_foreach_account_type_from_db()
1433 * @see account_type_query_by_app_id()
1435 int account_type_get_small_icon_path(account_type_h account_type, char **small_icon_path);
1438 * @brief Checks whether the given account provider supports multiple accounts.
1441 * @param[in] account_type The account provider handle \n
1442 * It should be given by account_type_query_* functions or account_type_foreach_account_type_from_db.
1443 * @param[out] multiple_account_support The flag indicating support for multiple accounts accounts\n
1446 * @return @c 0 on success,
1447 * otherwise a negative error value
1448 * @retval #ACCOUNT_ERROR_NONE Successful
1449 * @retval #ACCOUNT_ERROR_INVALID_PARAMETER Invalid parameter
1450 * @retval #ACCOUNT_ERROR_OUT_OF_MEMORY Out of memory
1452 * @see account_type_foreach_account_type_from_db()
1453 * @see account_type_query_by_app_id()
1455 int account_type_get_multiple_account_support(account_type_h account_type, int *multiple_account_support);
1458 * @brief Gets capability information with the given account provider handle.
1461 * @param[in] account_type The account provider handle\n
1462 * It should be given by account_type_query_* functions or account_type_foreach_account_type_from_db().
1463 * @param[in] callback The callback function that carries the capability name of the app ID
1464 * @param[in] user_data The user data \n
1465 * If you have your private data to carry into callback function, then you can use it.
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_DB_FAILED Database operation failed
1474 int account_type_get_provider_feature_all(account_type_h account_type, provider_feature_cb callback, void *user_data);
1477 * @brief Gets the specific label information detail of an account provider.
1480 * @param[in] account_type The account provider handle\n
1481 * It should be given by account_type_query_* functions or account_type_foreach_account_type_from_db().
1482 * @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
1483 * For example, "ko_KR" or "ko-kr" for Korean, "en_US" or "en-us" for American English.
1484 * @param[out] label The label text given for the locale
1486 * @return @c 0 on success,
1487 * otherwise a negative error value
1488 * @retval #ACCOUNT_ERROR_NONE Successful
1489 * @retval #ACCOUNT_ERROR_RECORD_NOT_FOUND No label for the given locale
1490 * @retval #ACCOUNT_ERROR_INVALID_PARAMETER Invalid parameter
1492 * @see account_type_foreach_account_type_from_db()
1493 * @see account_type_query_by_app_id()
1496 int account_type_get_label_by_locale(account_type_h account_type, const char *locale, char **label);
1499 * @brief Gets the label information detail of an account provider.
1502 * @param[in] account_type The account provider handle\n
1503 * It should be given by account_type_query_* functions or account_type_foreach_account_type_from_db().
1504 * @param[in] callback The callback function carrying the label information
1505 * @param[in] user_data The user data to be passed to the callback function
1507 * @return @c 0 on success,
1508 * otherwise a negative error value
1509 * @retval #ACCOUNT_ERROR_NONE Successful
1510 * @retval #ACCOUNT_ERROR_INVALID_PARAMETER Invalid parameter
1512 * @see account_type_foreach_account_type_from_db()
1513 * @see account_type_query_by_app_id()
1515 int account_type_get_label(account_type_h account_type, account_label_cb callback, void *user_data);
1518 * @brief Retrieves the label information with your application ID.
1522 * @privilege %http://tizen.org/privilege/account.read
1523 * @param[in] callback The callback function that carries label_h for label information \n
1524 * label_h contains label info as parameter.
1525 * @param[in] app_id The application ID to search
1526 * @param[in] user_data The user data \n
1527 * If you have your private data to carry into callback function, then you can use it.
1529 * @return @c 0 on success,
1530 * otherwise a negative error value
1531 * @retval #ACCOUNT_ERROR_NONE Successful
1532 * @retval #ACCOUNT_ERROR_INVALID_PARAMETER Invalid parameter
1533 * @retval #ACCOUNT_ERROR_DB_FAILED Database operation failed
1534 * @retval #ACCOUNT_ERROR_PERMISSION_DENIED DB Access fail by permission
1535 * @retval #ACCOUNT_ERROR_DATABASE_BUSY SQLite handler is busy
1536 * @retval #ACCOUNT_ERROR_DB_NOT_OPENED Account database did not opened
1538 * @see account_type_query_by_app_id()
1539 * @see account_type_foreach_account_type_from_db()
1541 int account_type_query_label_by_app_id(account_label_cb callback, const char *app_id, void *user_data);
1544 * @brief Retrieves the account provider information with your application ID.
1548 * @privilege %http://tizen.org/privilege/account.read
1549 * @param[in] app_id The application ID to search
1550 * @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.
1553 * @return @c 0 on success,
1554 * otherwise a negative error value
1555 * @retval #ACCOUNT_ERROR_NONE Successful
1556 * @retval #ACCOUNT_ERROR_INVALID_PARAMETER Invalid parameter
1557 * @retval #ACCOUNT_ERROR_DB_FAILED Database operation failed
1558 * @retval #ACCOUNT_ERROR_RECORD_NOT_FOUND Queried data does not exist
1559 * @retval #ACCOUNT_ERROR_PERMISSION_DENIED DB Access fail by permission
1560 * @retval #ACCOUNT_ERROR_DATABASE_BUSY SQLite handler is busy
1561 * @retval #ACCOUNT_ERROR_DB_NOT_OPENED Account database did not opened
1563 * @see account_type_create()
1564 * @see account_type_get_app_id()
1565 * @see account_type_get_service_provider_id()
1566 * @see account_type_get_icon_path()
1567 * @see account_type_get_small_icon_path()
1568 * @see account_type_get_multiple_account_support()
1569 * @see account_type_get_label()
1570 * @see account_type_destroy()
1572 int account_type_query_by_app_id(const char *app_id, account_type_h *account_type);
1575 * @brief Retrieves all account priovider information.
1579 * @privilege %http://tizen.org/privilege/account.read
1580 * @param[in] callback The account provider information \n
1581 * You can get the account information through account_type_get_* with the carried account_type_handle.
1582 * @param[in] user_data The user data \n
1583 * It will be carried through your callback function.
1585 * @return @c 0 on success,
1586 * otherwise a negative error value
1587 * @retval #ACCOUNT_ERROR_NONE Successful
1588 * @retval #ACCOUNT_ERROR_INVALID_PARAMETER Invalid parameter
1589 * @retval #ACCOUNT_ERROR_DB_FAILED Database operation failed
1590 * @retval #ACCOUNT_ERROR_PERMISSION_DENIED DB Access fail by permission
1591 * @retval #ACCOUNT_ERROR_DATABASE_BUSY SQLite handler is busy
1592 * @retval #ACCOUNT_ERROR_DB_NOT_OPENED Account database did not opened
1594 * @see account_type_create()
1595 * @see account_type_get_app_id()
1596 * @see account_type_get_service_provider_id()
1597 * @see account_type_get_icon_path()
1598 * @see account_type_get_small_icon_path()
1599 * @see account_type_get_multiple_account_support()
1600 * @see account_type_get_label()
1601 * @see account_type_destroy()
1603 int account_type_foreach_account_type_from_db(account_type_cb callback, void *user_data);
1606 * @brief Retrieves the label information with the given application ID and locale.
1610 * @privilege %http://tizen.org/privilege/account.read
1611 * @param[in] app_id The application ID
1612 * @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
1613 * For example, "ko_KR" or "ko-kr" for Korean, "en_US" or "en-us" for American English.
1614 * @param[out] label The label text corresponding app_id and locale \n
1615 * It must be free text.
1617 * @return @c 0 on success,
1618 * otherwise a negative error value
1619 * @retval #ACCOUNT_ERROR_NONE Successful
1620 * @retval #ACCOUNT_ERROR_INVALID_PARAMETER Invalid parameter
1621 * @retval #ACCOUNT_ERROR_DB_FAILED Database operation failed
1622 * @retval #ACCOUNT_ERROR_PERMISSION_DENIED DB Access fail by permission
1623 * @retval #ACCOUNT_ERROR_DATABASE_BUSY SQLite handler is busy
1624 * @retval #ACCOUNT_ERROR_DB_NOT_OPENED Account database did not opened
1627 int account_type_query_label_by_locale(const char *app_id, const char *locale, char **label);
1630 * @brief Retrieves account provider information with the capability name.
1634 * @privilege %http://tizen.org/privilege/account.read
1635 * @param[in] callback The callback function to retrieve account provider information
1636 * @param[in] key The capability value to search account provider \n
1637 * For example, ACCOUNT_SUPPORTS_CAPABILITY_CONTACT or "http://tizen.org/account/capability/contact"
1638 * @param[in] user_data If you have your private data to carry into callback function, then you can use it
1640 * @return @c 0 on success,
1641 * otherwise a negative error value
1642 * @retval #ACCOUNT_ERROR_NONE Successful
1643 * @retval #ACCOUNT_ERROR_RECORD_NOT_FOUND Record not found
1644 * @retval #ACCOUNT_ERROR_INVALID_PARAMETER Invalid parameter
1645 * @retval #ACCOUNT_ERROR_DB_FAILED Database operation failed
1646 * @retval #ACCOUNT_ERROR_PERMISSION_DENIED DB Access fail by permission
1647 * @retval #ACCOUNT_ERROR_DATABASE_BUSY SQLite handler is busy
1648 * @retval #ACCOUNT_ERROR_DB_NOT_OPENED Account database did not opened
1651 int account_type_query_by_provider_feature(account_type_cb callback, const char *key, void *user_data);
1654 * @brief Checks whether the given app_id exists in the account provider DB.
1658 * @privilege %http://tizen.org/privilege/account.read
1659 * @param[in] app_id The application ID to check
1661 * @return @c 0 on success,
1662 * otherwise a negative error value
1663 * @retval #ACCOUNT_ERROR_NONE Successful
1664 * @retval #ACCOUNT_ERROR_RECORD_NOT_FOUND Record not found
1665 * @retval #ACCOUNT_ERROR_INVALID_PARAMETER Invalid app ID
1666 * @retval #ACCOUNT_ERROR_DB_FAILED Database operation failed
1667 * @retval #ACCOUNT_ERROR_PERMISSION_DENIED DB Access fail by permission
1668 * @retval #ACCOUNT_ERROR_DATABASE_BUSY SQLite handler is busy
1669 * @retval #ACCOUNT_ERROR_DB_NOT_OPENED Account database did not opened
1671 * @see account_type_query_by_app_id()
1673 int account_type_query_app_id_exist(const char *app_id);
1677 /* End of account provider API */
1680 * @brief Creates a handle for the account event subscription.
1683 * @remarks You must release @a account_subscribe handle using account_unsubscribe_notification().
1685 * @param[in] account_subscribe The account subscription handle
1687 * @return @c 0 on success,
1688 * otherwise a negative error value
1689 * @retval #ACCOUNT_ERROR_NONE Successful
1690 * @retval #ACCOUNT_ERROR_OUT_OF_MEMORY Out of Memory
1691 * @retval #ACCOUNT_ERROR_INVALID_PARAMETER Invalid parameter
1693 * @see account_unsubscribe_notification()
1694 * @see account_subscribe_notification()
1696 int account_subscribe_create(account_subscribe_h *account_subscribe);
1699 * @brief Starts to subscribe account event through the given callback function.
1703 * @privilege %http://tizen.org/privilege/account.read \n
1704 * @param[in] account_subscribe The account subscription handle
1705 * @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
1706 * It will be called with event message and account ID.
1707 * @param[in] user_data The user_data that is delivered to callback
1709 * @return @c 0 on success,
1710 * otherwise a negative error value
1711 * @retval #ACCOUNT_ERROR_NONE Successful
1712 * @retval #ACCOUNT_ERROR_EVENT_SUBSCRIPTION_FAIL Subscription fail
1713 * @retval #ACCOUNT_ERROR_INVALID_PARAMETER Invalid parameter
1715 * @pre account_subscribe_create()
1717 * @see account_unsubscribe_notification()
1718 * @see account_subscribe_notification()
1720 int account_subscribe_notification(account_subscribe_h account_subscribe, account_event_cb callback, void *user_data);
1723 * @brief Destroys the account subscribe handle and releases all its resources.
1727 * @privilege %http://tizen.org/privilege/account.read \n
1728 * @remarks You must call @a account_unsubscribe_notification when you do not need to subscribe account event.
1730 * @param[in] account_subscribe The account subscription handle
1732 * @return @c 0 on success,
1733 * otherwise a negative error value
1734 * @retval #ACCOUNT_ERROR_NONE Successful
1735 * @retval #ACCOUNT_ERROR_INVALID_PARAMETER Invalid parameter
1736 * @retval #ACCOUNT_ERROR_EVENT_SUBSCRIPTION_FAIL Unsubscription failed
1738 * @see account_create()
1740 int account_unsubscribe_notification(account_subscribe_h account_subscribe);
1743 /* End of Account APIs */
1754 #endif /* __ACCOUNT_H__ */