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
593 * @see account_get_display_name()
595 int account_set_display_name(account_h account, const char *display_name);
598 * @brief Gets the capability detail of an account.
600 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 3.0 @endif
601 * @param[in] account The account handle
602 * @param[in] capability_type The capability type to get the capability value
603 * @param[out] capability_value The capability value (on/off) of the specified capability_type
605 * @return @c 0 on success,
606 * otherwise a negative error value
607 * @retval #ACCOUNT_ERROR_NONE Successful
608 * @retval #ACCOUNT_ERROR_INVALID_PARAMETER Invalid parameter
609 * @retval #ACCOUNT_ERROR_RECORD_NOT_FOUND There is no given capability_type in the account
610 * @retval #ACCOUNT_ERROR_NOT_SUPPORTED Not supported
612 * @see account_set_capability()
614 int account_get_capability(account_h account, const char *capability_type, account_capability_state_e *capability_value);
617 * @brief Gets all the capabilities of an account.
619 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 3.0 @endif
620 * @param[in] account The account handle
621 * @param[in] callback The callback function
622 * @param[in] user_data The user data to be passed to the callback function
624 * @return @c 0 on success,
625 * otherwise a negative error value
626 * @retval #ACCOUNT_ERROR_NONE Successful
627 * @retval #ACCOUNT_ERROR_INVALID_PARAMETER Invalid parameter
628 * @retval #ACCOUNT_ERROR_NOT_SUPPORTED Not supported
630 * @see account_set_capability()
632 int account_get_capability_all(account_h account, capability_cb callback, void *user_data);
635 * @brief Sets the capability.
637 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 3.0 @endif
638 * @param[in] account The account handle
639 * @param[in] capability_type The capability type
640 * @param[in] capability_state The capability state
642 * @return @c 0 on success,
643 * otherwise a negative error value
644 * @retval #ACCOUNT_ERROR_NONE Successful
645 * @retval #ACCOUNT_ERROR_INVALID_PARAMETER Invalid parameter
646 * @retval #ACCOUNT_ERROR_NOT_SUPPORTED Not supported
648 * @see account_get_capability()
650 int account_set_capability(account_h account, const char *capability_type, account_capability_state_e capability_state);
654 * @brief Gets the icon path.
656 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 3.0 @endif
657 * @remarks You must release @a icon_path using free().
659 * @param[in] account The account handle
660 * @param[out] icon_path The icon path
662 * @return @c 0 on success,
663 * otherwise a negative error value
664 * @retval #ACCOUNT_ERROR_NONE Successful
665 * @retval #ACCOUNT_ERROR_INVALID_PARAMETER Invalid parameter
666 * @retval #ACCOUNT_ERROR_OUT_OF_MEMORY Out of memory
667 * @retval #ACCOUNT_ERROR_NOT_SUPPORTED Not supported
669 * @see account_set_icon_path()
671 int account_get_icon_path(account_h account, char **icon_path);
675 * @brief Sets the icon path.
677 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 3.0 @endif
678 * @param[in] account The account handle
679 * @param[in] icon_path The text string to set as the icon path
681 * @return @c 0 on success,
682 * otherwise a negative error value
683 * @retval #ACCOUNT_ERROR_NONE Successful
684 * @retval #ACCOUNT_ERROR_INVALID_PARAMETER Invalid parameter
685 * @retval #ACCOUNT_ERROR_NOT_SUPPORTED Not supported
687 * @see account_get_icon_path()
689 int account_set_icon_path(account_h account, const char *icon_path);
693 * @brief Gets the domain name.
695 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 3.0 @endif
696 * @remarks You must release @a domain_name using free().
698 * @param[in] account The account handle
699 * @param[out] domain_name The domain name
701 * @return @c 0 on success,
702 * otherwise a negative error value
703 * @retval #ACCOUNT_ERROR_NONE Successful
704 * @retval #ACCOUNT_ERROR_INVALID_PARAMETER Invalid parameter
705 * @retval #ACCOUNT_ERROR_OUT_OF_MEMORY Out of memory
706 * @retval #ACCOUNT_ERROR_NOT_SUPPORTED Not supported
708 * @see account_set_domain_name()
710 int account_get_domain_name(account_h account, char **domain_name);
714 * @brief Sets the domain name.
716 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 3.0 @endif
717 * @param[in] account The account handle
718 * @param[in] domain_name The text string to set as the domain name
720 * @return @c 0 on success,
721 * otherwise a negative error value
722 * @retval #ACCOUNT_ERROR_NONE Successful
723 * @retval #ACCOUNT_ERROR_INVALID_PARAMETER Invalid parameter
724 * @retval #ACCOUNT_ERROR_NOT_SUPPORTED Not supported
726 * @see account_get_domain_name()
728 int account_set_domain_name(account_h account, const char *domain_name);
732 * @brief Gets the email address.
734 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 3.0 @endif
735 * @remarks You must release @a email_address using free().
737 * @param[in] account The account handle
738 * @param[out] email_address The email address
740 * @return @c 0 on success,
741 * otherwise a negative error value
742 * @retval #ACCOUNT_ERROR_NONE Successful
743 * @retval #ACCOUNT_ERROR_INVALID_PARAMETER Invalid parameter
744 * @retval #ACCOUNT_ERROR_OUT_OF_MEMORY Out of memory
745 * @retval #ACCOUNT_ERROR_NOT_SUPPORTED Not supported
747 * @see account_set_email_address()
749 int account_get_email_address(account_h account, char **email_address);
753 * @brief Sets the email address.
755 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 3.0 @endif
756 * @param[in] account The account handle
757 * @param[in] email_address The text string to set as the email address
759 * @return @c 0 on success,
760 * otherwise a negative error value
761 * @retval #ACCOUNT_ERROR_NONE Successful
762 * @retval #ACCOUNT_ERROR_INVALID_PARAMETER Invalid parameter
763 * @retval #ACCOUNT_ERROR_NOT_SUPPORTED Not supported
765 * @see account_get_email_address()
767 int account_set_email_address(account_h account, const char *email_address);
771 * @brief Gets the package name.
773 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 3.0 @endif
774 * @remarks You must release @a package_name using free().
776 * @param[in] account The account handle
777 * @param[out] package_name The package name
779 * @return @c 0 on success,
780 * otherwise a negative error value
781 * @retval #ACCOUNT_ERROR_NONE Successful
782 * @retval #ACCOUNT_ERROR_INVALID_PARAMETER Invalid parameter
783 * @retval #ACCOUNT_ERROR_OUT_OF_MEMORY Out of memory
784 * @retval #ACCOUNT_ERROR_NOT_SUPPORTED Not supported
786 * @see account_set_package_name()
788 int account_get_package_name(account_h account, char **package_name);
792 * @brief Sets the package name.
794 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 3.0 @endif
795 * @param[in] account The account handle
796 * @param[in] package_name The text string to set as the package name
798 * @return @c 0 on success,
799 * otherwise a negative error value
800 * @retval #ACCOUNT_ERROR_NONE Successful
801 * @retval #ACCOUNT_ERROR_INVALID_PARAMETER Invalid parameter
802 * @retval #ACCOUNT_ERROR_NOT_SUPPORTED Not supported
804 * @see account_get_email_address()
806 int account_set_package_name(account_h account, const char *package_name);
810 * @brief Gets the access token. Access token field is used to store account secrets (such as password or master token).
812 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 3.0 @endif
813 * @remarks You must release @a access_token using free().
814 * @remarks Access token field is used for storing account secret (password / master token etc)
816 * @param[in] account The account handle
817 * @param[out] access_token The access token
819 * @return @c 0 on success,
820 * otherwise a negative error value
821 * @retval #ACCOUNT_ERROR_NONE Successful
822 * @retval #ACCOUNT_ERROR_INVALID_PARAMETER Invalid parameter
823 * @retval #ACCOUNT_ERROR_OUT_OF_MEMORY Out of memory
824 * @retval #ACCOUNT_ERROR_NOT_SUPPORTED Not supported
826 * Only account owner application can retrieve account password / access_token. For others this field will be null.
827 * @see account_set_access_token()
829 int account_get_access_token(account_h account, char **access_token);
833 * @brief Sets the access token. Access token field is used to store account secrets (such as password or master token).
835 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 3.0 @endif
836 * @remarks Only account owner application can retrieve account password / access_token. For others this field will be null.
838 * @param[in] account The account handle
839 * @param[in] access_token The text string to set as the access token
841 * @return @c 0 on success,
842 * otherwise a negative error value
843 * @retval #ACCOUNT_ERROR_NONE Successful
844 * @retval #ACCOUNT_ERROR_INVALID_PARAMETER Invalid parameter
845 * @retval #ACCOUNT_ERROR_NOT_SUPPORTED Not supported
846 * @see account_get_access_token()
848 int account_set_access_token(account_h account, const char *access_token);
852 * @brief Gets the user text.
854 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 3.0 @endif
855 * @remarks You must release @a user_text using free().
857 * @param[in] account The account handle
858 * @param[in] user_text_index The index of the user text (range: 0 ~ 4)
859 * @param[out] user_text The user text
861 * @return @c 0 on success,
862 * otherwise a negative error value
863 * @retval #ACCOUNT_ERROR_NONE Successful
864 * @retval #ACCOUNT_ERROR_INVALID_PARAMETER Invalid parameter
865 * @retval #ACCOUNT_ERROR_OUT_OF_MEMORY Out of memory
866 * @retval #ACCOUNT_ERROR_NOT_SUPPORTED Not supported
868 * @see account_set_user_text()
870 int account_get_user_text(account_h account, int user_text_index, char **user_text);
874 * @brief Sets the user text.
876 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 3.0 @endif
877 * @param[in] account The account handle
878 * @param[in] user_text_index The index of the user text (must be in range from @c 0 to @c 4)
879 * @param[in] user_text The text string to set as the user text
881 * @return @c 0 on success,
882 * otherwise a negative error value
883 * @retval #ACCOUNT_ERROR_NONE Successful
884 * @retval #ACCOUNT_ERROR_INVALID_PARAMETER Invalid parameter
885 * @retval #ACCOUNT_ERROR_NOT_SUPPORTED Not supported
887 * @see account_get_user_text()
889 int account_set_user_text(account_h account, int user_text_index, const char *user_text);
893 * @brief Gets the user integer.
895 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 3.0 @endif
896 * @param[in] account The account handle
897 * @param[in] user_int_index The index of the user integer (must be in range from @c 0 to @c 4)
898 * @param[out] user_integer The user integer
900 * @return @c 0 on success,
901 * otherwise a negative error value
902 * @retval #ACCOUNT_ERROR_NONE Successful
903 * @retval #ACCOUNT_ERROR_INVALID_PARAMETER Invalid parameter
904 * @retval #ACCOUNT_ERROR_NOT_SUPPORTED Not supported
906 * @see account_set_user_int()
908 int account_get_user_int(account_h account, int user_int_index, int *user_integer);
912 * @brief Sets the user integer.
914 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 3.0 @endif
915 * @param[in] account The account handle
916 * @param[in] user_int_index The index of the user integer (must be in range from @c 0 to @c 4)
917 * @param[in] user_integer The integer to set as the user integer
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
923 * @retval #ACCOUNT_ERROR_NOT_SUPPORTED Not supported
925 * @see account_get_user_int()
927 int account_set_user_int(account_h account, int user_int_index, int user_integer);
931 * @brief Gets the authentication type.
933 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 3.0 @endif
934 * @param[in] account The account handle
935 * @param[out] auth_type The authentication type
937 * @return @c 0 on success,
938 * otherwise a negative error value
939 * @retval #ACCOUNT_ERROR_NONE Successful
940 * @retval #ACCOUNT_ERROR_INVALID_PARAMETER Invalid parameter
941 * @retval #ACCOUNT_ERROR_NOT_SUPPORTED Not supported
943 * @see account_set_auth_type()
945 int account_get_auth_type(account_h account, account_auth_type_e *auth_type);
949 * @brief Sets the authentication type.
951 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 3.0 @endif
952 * @param[in] account The account handle
953 * @param[in] auth_type The integer to be set as the authentication type
955 * @return @c 0 on success,
956 * otherwise a negative error value
957 * @retval #ACCOUNT_ERROR_NONE Successful
958 * @retval #ACCOUNT_ERROR_INVALID_PARAMETER Invalid parameter
959 * @retval #ACCOUNT_ERROR_NOT_SUPPORTED Not supported
961 * @see account_get_auth_type()
963 int account_set_auth_type(account_h account, const account_auth_type_e auth_type);
967 * @brief Gets the secret.
969 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 3.0 @endif
970 * @param[in] account The account handle
971 * @param[out] secret The secret
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
977 * @retval #ACCOUNT_ERROR_NOT_SUPPORTED Not supported
979 * @see account_set_secret()
981 int account_get_secret(account_h account, account_secrecy_state_e *secret);
985 * @brief Sets the secret.
987 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 3.0 @endif
988 * @param[in] account The account handle
989 * @param[in] secret The secrecy to be set
991 * @return @c 0 on success,
992 * otherwise a negative error value
993 * @retval #ACCOUNT_ERROR_NONE Successful
994 * @retval #ACCOUNT_ERROR_INVALID_PARAMETER Invalid parameter
995 * @retval #ACCOUNT_ERROR_NOT_SUPPORTED Not supported
997 * @see account_get_secret()
999 int account_set_secret(account_h account, const account_secrecy_state_e secret);
1002 * @brief Gets the sync support.
1004 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 3.0 @endif
1005 * @param[in] account The account handle
1006 * @param[out] sync_support The sync support
1008 * @return @c 0 on success,
1009 * otherwise a negative error value
1010 * @retval #ACCOUNT_ERROR_NONE Successful
1011 * @retval #ACCOUNT_ERROR_INVALID_PARAMETER Invalid parameter
1012 * @retval #ACCOUNT_ERROR_NOT_SUPPORTED Not supported
1014 * @see account_set_sync_support()
1016 int account_get_sync_support(account_h account, account_sync_state_e *sync_support);
1020 * @brief Sets the sync support.
1022 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 3.0 @endif
1023 * @param[in] account The account handle
1024 * @param[in] sync_support The sync state to be set
1026 * @return @c 0 on success,
1027 * otherwise a negative error value
1028 * @retval #ACCOUNT_ERROR_NONE Successful
1029 * @retval #ACCOUNT_ERROR_INVALID_PARAMETER Invalid parameter
1030 * @retval #ACCOUNT_ERROR_NOT_SUPPORTED Not supported
1032 * @see account_get_sync_support()
1034 int account_set_sync_support(account_h account, const account_sync_state_e sync_support);
1038 * @brief Gets the source.
1040 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 3.0 @endif
1041 * @remarks You must release @a source using free().
1043 * @param[in] account The account handle
1044 * @param[out] source The source
1046 * @return @c 0 on success,
1047 * otherwise a negative error value
1048 * @retval #ACCOUNT_ERROR_NONE Successful
1049 * @retval #ACCOUNT_ERROR_INVALID_PARAMETER Invalid parameter
1050 * @retval #ACCOUNT_ERROR_OUT_OF_MEMORY Out of memory
1051 * @retval #ACCOUNT_ERROR_NOT_SUPPORTED Not supported
1053 * @see account_set_source()
1055 int account_get_source(account_h account, char **source);
1059 * @brief Sets the source.
1061 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 3.0 @endif
1062 * @param[in] account The account handle
1063 * @param[in] source The text string to set as the source
1065 * @return @c 0 on success,
1066 * otherwise a negative error value
1067 * @retval #ACCOUNT_ERROR_NONE Successful
1068 * @retval #ACCOUNT_ERROR_INVALID_PARAMETER Invalid parameter
1069 * @retval #ACCOUNT_ERROR_NOT_SUPPORTED Not supported
1071 * @see account_get_source()
1073 int account_set_source(account_h account, const char *source);
1076 * @brief Sets the custom.
1078 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 3.0 @endif
1079 * @param[in] account The account handle
1080 * @param[in] key The user custom key for the specific value
1081 * @param[in] value The user custom value about the given key
1083 * @return @c 0 on success,
1084 * otherwise a negative error value
1085 * @retval #ACCOUNT_ERROR_NONE Successful
1086 * @retval #ACCOUNT_ERROR_INVALID_PARAMETER Invalid parameter
1087 * @retval #ACCOUNT_ERROR_NOT_SUPPORTED Not supported
1089 * @see account_get_custom()
1091 int account_set_custom(account_h account, const char *key, const char *value);
1094 * @brief Gets the user specific custom text of an account key.
1096 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 3.0 @endif
1097 * @remarks You must release @a value using free().
1099 * @param[in] account The account handle
1100 * @param[in] key The key to retrieve custom text
1101 * @param[out] value The text of the given key
1103 * @return @c 0 on success,
1104 * otherwise a negative error value
1105 * @retval #ACCOUNT_ERROR_NONE Successful
1106 * @retval #ACCOUNT_ERROR_INVALID_PARAMETER Invalid parameter
1107 * @retval #ACCOUNT_ERROR_RECORD_NOT_FOUND There is no given capability type in the account
1108 * @retval #ACCOUNT_ERROR_NOT_SUPPORTED Not supported
1110 * @see account_set_custom()
1112 int account_get_custom(account_h account, const char *key, char **value);
1116 * @brief Gets all the user custom texts of an account.
1118 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 3.0 @endif
1119 * @param[in] account The account handle
1120 * @param[in] callback The callback function to retrieve all custom text \n
1121 * The callback function gives the key and value.
1122 * @param[in] user_data The user data to be passed to the callback function
1124 * @return @c 0 on success,
1125 * otherwise a negative error value
1126 * @retval #ACCOUNT_ERROR_NONE Successful
1127 * @retval #ACCOUNT_ERROR_INVALID_PARAMETER Invalid parameter
1128 * @retval #ACCOUNT_ERROR_NOT_SUPPORTED Not supported
1130 * @see account_set_custom()
1132 int account_get_custom_all(account_h account, account_custom_cb callback, void *user_data);
1135 * @brief Retrieves all accounts details by invoking the given callback function iteratively.
1137 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 3.0 @endif
1139 * @privilege %http://tizen.org/privilege/account.read
1140 * @param[in] callback The callback function to invoke
1141 * @param[in] user_data The user data to be passed to the callback function
1143 * @return @c 0 on success,
1144 * otherwise a negative error value
1145 * @retval #ACCOUNT_ERROR_NONE Successful
1146 * @retval #ACCOUNT_ERROR_INVALID_PARAMETER Invalid parameter
1147 * @retval #ACCOUNT_ERROR_DB_FAILED Database operation failed
1148 * @retval #ACCOUNT_ERROR_PERMISSION_DENIED DB Access fail by permission
1149 * @retval #ACCOUNT_ERROR_RECORD_NOT_FOUND Related record does not exist
1150 * @retval #ACCOUNT_ERROR_DATABASE_BUSY SQLite handler is busy
1151 * @retval #ACCOUNT_ERROR_DB_NOT_OPENED Account database did not opened
1152 * @retval #ACCOUNT_ERROR_NOT_SUPPORTED Not supported
1154 * @pre This function requires an open connection to an account service by account_connect() on tizen 2.3 (MOBILE).\n
1155 * But the account_connect() is not required to use this function since tizen 2.4.
1156 * @post This function invokes account_cb().
1158 * @see account_query_account_by_account_id()
1159 * @see account_query_account_by_user_name()
1160 * @see account_query_account_by_package_name()
1161 * @see account_query_account_by_capability()
1163 int account_foreach_account_from_db(account_cb callback, void *user_data);
1166 * @brief Retrieves an account with the account ID.
1168 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 3.0 @endif
1170 * @privilege %http://tizen.org/privilege/account.read
1171 * @remarks You must allocate @a account using account_create() and release using account_destroy().
1173 * @param[in] account_db_id The account database ID to search
1174 * @param[out] account The account handle \n
1176 * @return @c 0 on success,
1177 * otherwise a negative error value
1178 * @retval #ACCOUNT_ERROR_NONE Successful
1179 * @retval #ACCOUNT_ERROR_OUT_OF_MEMORY Out of Memory
1180 * @retval #ACCOUNT_ERROR_INVALID_PARAMETER Invalid parameter
1181 * @retval #ACCOUNT_ERROR_DB_FAILED Database operation failed
1182 * @retval #ACCOUNT_ERROR_PERMISSION_DENIED DB Access fail by permission
1183 * @retval #ACCOUNT_ERROR_DATABASE_BUSY SQLite handler is busy
1184 * @retval #ACCOUNT_ERROR_DB_NOT_OPENED Account database did not opened
1185 * @retval #ACCOUNT_ERROR_NOT_SUPPORTED Not supported
1187 * @pre This function requires an open connection to an account service by account_connect() on tizen 2.3 (MOBILE).\n
1188 * But the account_connect() is not required to use this function since tizen 2.4.
1190 * @see account_query_account_by_user_name()
1191 * @see account_query_account_by_package_name()
1192 * @see account_query_account_by_capability()
1194 int account_query_account_by_account_id(int account_db_id, account_h *account);
1197 * @brief Retrieves deleted account with the account ID.
1201 * @privilege %http://tizen.org/privilege/account.read
1202 * @remarks The @a account should be released using account_destroy().
1204 * @param[in] account_db_id The id of the account to find in the database
1205 * @param[out] account The account handle
1207 * @return @c 0 on success,
1208 * otherwise a negative error value
1209 * @retval #ACCOUNT_ERROR_NONE Successful
1210 * @retval #ACCOUNT_ERROR_NOT_SUPPORTED Not supported
1211 * @retval #ACCOUNT_ERROR_PERMISSION_DENIED DB Access fail by permission
1212 * @retval #ACCOUNT_ERROR_INVALID_PARAMETER Invalid parameter
1213 * @retval #ACCOUNT_ERROR_OUT_OF_MEMORY Out of Memory
1214 * @retval #ACCOUNT_ERROR_DB_FAILED Database operation failed
1215 * @retval #ACCOUNT_ERROR_DATABASE_BUSY SQLite handler is busy
1216 * @retval #ACCOUNT_ERROR_DB_NOT_OPENED Account database did not opened
1218 * @see account_query_account_by_account_id()
1219 * @see account_query_account_by_user_name()
1220 * @see account_query_account_by_package_name()
1221 * @see account_query_account_by_capability()
1223 int account_query_deleted_account_info_by_account_id(int account_db_id, account_h *account);
1226 * @brief Retrieves all accounts with the user name.
1228 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 3.0 @endif
1230 * @privilege %http://tizen.org/privilege/account.read
1231 * @param[in] callback The callback function to invoke
1232 * @param[in] user_name The user name to search
1233 * @param[in] user_data The user data to be passed to the callback function
1235 * @return @c 0 on success,
1236 * otherwise a negative error value
1237 * @retval #ACCOUNT_ERROR_NONE Successful
1238 * @retval #ACCOUNT_ERROR_OUT_OF_MEMORY Out of Memory
1239 * @retval #ACCOUNT_ERROR_INVALID_PARAMETER Invalid parameter
1240 * @retval #ACCOUNT_ERROR_DB_FAILED Database operation failed
1241 * @retval #ACCOUNT_ERROR_PERMISSION_DENIED DB Access fail by permission
1242 * @retval #ACCOUNT_ERROR_DATABASE_BUSY SQLite handler is busy
1243 * @retval #ACCOUNT_ERROR_DB_NOT_OPENED Account database did not opened
1244 * @retval #ACCOUNT_ERROR_NOT_SUPPORTED Not supported
1246 * @pre This function requires an open connection to an account service by account_connect() on tizen 2.3 (MOBILE).\n
1247 * But the account_connect() is not required to use this function since tizen 2.4.
1248 * @post This function invokes account_cb().
1250 * @see account_foreach_account_from_db()
1251 * @see account_query_account_by_account_id()
1252 * @see account_query_account_by_package_name()
1253 * @see account_query_account_by_capability()
1256 int account_query_account_by_user_name(account_cb callback, const char *user_name, void *user_data);
1259 * @brief Retrieves all accounts with the package name.
1261 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 3.0 @endif
1263 * @privilege %http://tizen.org/privilege/account.read
1264 * @param[in] callback The callback function to invoke
1265 * @param[in] package_name The package name to search
1266 * @param[in] user_data The user data to be passed to the callback function
1268 * @return @c 0 on success,
1269 * otherwise a negative error value
1270 * @retval #ACCOUNT_ERROR_NONE Successful
1271 * @retval #ACCOUNT_ERROR_OUT_OF_MEMORY Out of Memory
1272 * @retval #ACCOUNT_ERROR_INVALID_PARAMETER Invalid parameter
1273 * @retval #ACCOUNT_ERROR_DB_FAILED Database operation failed
1274 * @retval #ACCOUNT_ERROR_PERMISSION_DENIED DB Access fail by permission
1275 * @retval #ACCOUNT_ERROR_DATABASE_BUSY SQLite handler is busy
1276 * @retval #ACCOUNT_ERROR_DB_NOT_OPENED Account database did not opened
1277 * @retval #ACCOUNT_ERROR_NOT_SUPPORTED Not supported
1279 * @pre This function requires an open connection to an account service by account_connect() on tizen 2.3 (MOBILE).\n
1280 * But the account_connect() is not required to use this function since tizen 2.4.
1281 * @post This function invokes account_cb().
1283 * @see account_foreach_account_from_db()
1284 * @see account_query_account_by_account_id()
1285 * @see account_query_account_by_user_name()
1286 * @see account_query_account_by_capability()
1288 int account_query_account_by_package_name(account_cb callback, const char *package_name, void *user_data);
1291 * @brief Retrieves all accounts with the capability type and capability value.
1293 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 3.0 @endif
1295 * @privilege %http://tizen.org/privilege/account.read
1296 * @param[in] callback The callback function to invoke
1297 * @param[in] capability_type The capability type to search
1298 * @param[in] capability_value The capability value to search
1299 * @param[in] user_data The user data to be passed to the callback function
1301 * @return @c 0 on success,
1302 * otherwise a negative error value
1303 * @retval #ACCOUNT_ERROR_NONE Successful
1304 * @retval #ACCOUNT_ERROR_OUT_OF_MEMORY Out of Memory
1305 * @retval #ACCOUNT_ERROR_INVALID_PARAMETER Invalid parameter
1306 * @retval #ACCOUNT_ERROR_DB_FAILED Database operation failed
1307 * @retval #ACCOUNT_ERROR_PERMISSION_DENIED DB Access fail by permission
1308 * @retval #ACCOUNT_ERROR_DATABASE_BUSY SQLite handler is busy
1309 * @retval #ACCOUNT_ERROR_DB_NOT_OPENED Account database did not opened
1310 * @retval #ACCOUNT_ERROR_NOT_SUPPORTED Not supported
1312 * @pre This function requires an open connection to an account service by account_connect() on tizen 2.3 (MOBILE).\n
1313 * But the account_connect() is not required to use this function since tizen 2.4.
1314 * @post This function invokes account_cb().
1316 * @see account_foreach_account_from_db()
1317 * @see account_query_account_by_account_id()
1318 * @see account_query_account_by_user_name()
1319 * @see account_query_account_by_package_name()
1321 int account_query_account_by_capability(account_cb callback, const char *capability_type, account_capability_state_e capability_value, void *user_data);
1324 * @brief Retrieves all accounts with the capability type.
1326 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 3.0 @endif
1328 * @privilege %http://tizen.org/privilege/account.read
1329 * @param[in] callback The callback function to invoke
1330 * @param[in] capability_type The capability type to search
1331 * @param[in] user_data The user data to be passed to the callback function
1333 * @return @c 0 on success,
1334 * otherwise a negative error value
1335 * @retval #ACCOUNT_ERROR_NONE Successful
1336 * @retval #ACCOUNT_ERROR_OUT_OF_MEMORY Out of Memory
1337 * @retval #ACCOUNT_ERROR_INVALID_PARAMETER Invalid parameter
1338 * @retval #ACCOUNT_ERROR_DB_FAILED Database operation failed
1339 * @retval #ACCOUNT_ERROR_PERMISSION_DENIED DB Access fail by permission
1340 * @retval #ACCOUNT_ERROR_DATABASE_BUSY SQLite handler is busy
1341 * @retval #ACCOUNT_ERROR_DB_NOT_OPENED Account database did not opened
1342 * @retval #ACCOUNT_ERROR_NOT_SUPPORTED Not supported
1344 * @pre This function requires an open connection to an account service by account_connect() on tizen 2.3 (MOBILE).\n
1345 * But the account_connect() is not required to use this function since tizen 2.4.
1346 * @post This function invokes account_cb().
1348 * @see account_foreach_account_from_db()
1349 * @see account_query_account_by_account_id()
1350 * @see account_query_account_by_user_name()
1351 * @see account_query_account_by_package_name()
1353 int account_query_account_by_capability_type(account_cb callback, const char *capability_type, void *user_data);
1356 * @brief Retrieves all capabilities with the account database ID.
1358 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 3.0 @endif
1360 * @privilege %http://tizen.org/privilege/account.read
1361 * @param[in] callback The callback function to invoke
1362 * @param[in] account_db_id The account database ID to search
1363 * @param[in] user_data The user data to be passed to the callback function
1365 * @return @c 0 on success,
1366 * otherwise a negative error value
1367 * @retval #ACCOUNT_ERROR_NONE Successful
1368 * @retval #ACCOUNT_ERROR_OUT_OF_MEMORY Out of Memory
1369 * @retval #ACCOUNT_ERROR_INVALID_PARAMETER Invalid parameter
1370 * @retval #ACCOUNT_ERROR_DB_FAILED Database operation failed
1371 * @retval #ACCOUNT_ERROR_PERMISSION_DENIED DB Access fail by permission
1372 * @retval #ACCOUNT_ERROR_DATABASE_BUSY SQLite handler is busy
1373 * @retval #ACCOUNT_ERROR_DB_NOT_OPENED Account database did not opened
1374 * @retval #ACCOUNT_ERROR_NOT_SUPPORTED Not supported
1376 * @pre This function requires an open connection to an account service by account_connect() on tizen 2.3 (MOBILE).\n
1377 * But the account_connect() is not required to use this function since tizen 2.4.
1378 * @post This function invokes capability_cb().
1380 * @see account_get_capability()
1381 * @see account_set_capability()
1383 int account_query_capability_by_account_id(capability_cb callback, int account_db_id, void *user_data);
1387 * @brief Gets the count of accounts in the account database.
1389 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 3.0 @endif
1391 * @privilege %http://tizen.org/privilege/account.read
1392 * @param[out] count The out parameter for count of all accounts
1394 * @return @c 0 on success,
1395 * otherwise a negative error value
1396 * @retval #ACCOUNT_ERROR_NONE Successful
1397 * @retval #ACCOUNT_ERROR_DB_FAILED Database operation failed
1398 * @retval #ACCOUNT_ERROR_PERMISSION_DENIED DB Access fail by permission
1399 * @retval #ACCOUNT_ERROR_DATABASE_BUSY SQLite handler is busy
1400 * @retval #ACCOUNT_ERROR_DB_NOT_OPENED Account database did not opened
1401 * @retval #ACCOUNT_ERROR_NOT_SUPPORTED Not supported
1403 * @pre This function requires an open connection to an account service by account_connect() on tizen 2.3 (MOBILE).\n
1404 * But the account_connect() is not required to use this function since tizen 2.4.
1406 int account_get_total_count_from_db(int *count);
1409 * @brief Updates the sync status of an account with the given account ID.
1411 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 3.0 @endif
1413 * @privilege %http://tizen.org/privilege/account.read \n
1414 * %http://tizen.org/privilege/account.write
1415 * @remarks This API need both privileges \n
1416 * Only can update an account which was added by same package applications
1417 * @param[in] account_db_id The account ID for which sync status needs to be changed
1418 * @param[in] sync_status The new sync status
1420 * @return @c 0 on success,
1421 * otherwise a negative error value
1422 * @retval #ACCOUNT_ERROR_NONE Successful
1423 * @retval #ACCOUNT_ERROR_OUT_OF_MEMORY Out of Memory
1424 * @retval #ACCOUNT_ERROR_INVALID_PARAMETER Invalid parameter
1425 * @retval #ACCOUNT_ERROR_DB_FAILED Database operation failed
1426 * @retval #ACCOUNT_ERROR_PERMISSION_DENIED DB Access fail by permission
1427 * @retval #ACCOUNT_ERROR_DATABASE_BUSY SQLite handler is busy
1428 * @retval #ACCOUNT_ERROR_DB_NOT_OPENED Account database did not opened
1429 * @retval #ACCOUNT_ERROR_NOT_SUPPORTED Not supported
1431 * @pre This function requires an open connection to an account service by account_connect() on tizen 2.3 (MOBILE).\n
1432 * But the account_connect() is not required to use this function since tizen 2.4.
1434 int account_update_sync_status_by_id(int account_db_id, const account_sync_state_e sync_status);
1437 /* Account type API */
1441 * @brief Creates a handle to the account provider.
1443 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 3.0 @endif
1444 * @remarks You must release @a account_type handle using account_type_destroy().\n
1446 * @param[in] account_type The account provider handle
1448 * @return @c 0 on success,
1449 * otherwise a negative error value
1450 * @retval #ACCOUNT_ERROR_NONE Successful
1451 * @retval #ACCOUNT_ERROR_OUT_OF_MEMORY Out of Memory
1452 * @retval #ACCOUNT_ERROR_INVALID_PARAMETER Invalid parameter
1453 * @retval #ACCOUNT_ERROR_NOT_SUPPORTED Not supported
1455 * @see account_type_destroy()
1457 int account_type_create(account_type_h *account_type);
1460 * @brief Destroys the account provider handle and releases all its resources.
1462 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 3.0 @endif
1464 * @remarks When you get @a account_type using account_type_create(), you must release the handle using account_destroy() to avoid the memory leak.
1466 * @param[in] account_type The account provider handle
1468 * @return @c 0 on success,
1469 * otherwise a negative error value
1470 * @retval #ACCOUNT_ERROR_NONE Successful
1471 * @retval #ACCOUNT_ERROR_INVALID_PARAMETER Invalid parameter
1472 * @retval #ACCOUNT_ERROR_NOT_SUPPORTED Not supported
1474 * @see account_type_create()
1476 int account_type_destroy(account_type_h account_type);
1479 * @brief Retrieves capability information with your application ID.
1481 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 3.0 @endif
1483 * @privilege %http://tizen.org/privilege/account.read
1484 * @param[in] callback The callback function carries the capability name of an app ID
1485 * @param[in] app_id The application ID to search
1486 * @param[in] user_data The user data \n
1487 * If you have your private data to carry into callback function, then you can use it.
1489 * @return @c 0 on success,
1490 * otherwise a negative error value
1491 * @retval #ACCOUNT_ERROR_NONE Successful
1492 * @retval #ACCOUNT_ERROR_INVALID_PARAMETER Invalid parameter
1493 * @retval #ACCOUNT_ERROR_DB_FAILED Database operation failed
1494 * @retval #ACCOUNT_ERROR_PERMISSION_DENIED DB Access fail by permission
1495 * @retval #ACCOUNT_ERROR_DATABASE_BUSY SQLite handler is busy
1496 * @retval #ACCOUNT_ERROR_DB_NOT_OPENED Account database did not opened
1497 * @retval #ACCOUNT_ERROR_NOT_SUPPORTED Not supported
1499 * @pre This function requires an open connection to an account service by account_connect() on tizen 2.3 (MOBILE).\n
1500 * But the account_connect() is not required to use this function since tizen 2.4.
1502 int account_type_query_provider_feature_by_app_id(provider_feature_cb callback, const char *app_id, void *user_data);
1505 * @brief Checks whether the given application ID supports the capability.
1507 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 3.0 @endif
1509 * @privilege %http://tizen.org/privilege/account.read
1510 * @remarks The specific error code can be obtained using the get_last_result() method. Error codes are described in Exception section.
1511 * @param[in] app_id The application ID
1512 * @param[in] capability The capability \n
1513 * For example, ACCOUNT_SUPPORTS_CAPABILITY_CONTACT or "http://tizen.org/account/capability/contact"
1515 * @return @c TRUE if the application supports the given capability, \n
1516 * otherwise @c FALSE if the application does not support the given capability
1517 * @retval @c TRUE means the application supports the given capability
1518 * @retval @c FALSE means the application does not support the given capability
1519 * @exception #ACCOUNT_ERROR_NONE Successful
1520 * @exception #ACCOUNT_ERROR_INVALID_PARAMETER Invalid parameter
1521 * @exception #ACCOUNT_ERROR_RECORD_NOT_FOUND Related record does not exist
1522 * @exception #ACCOUNT_ERROR_DB_FAILED Database operation failed
1523 * @exception #ACCOUNT_ERROR_PERMISSION_DENIED DB access fail by permission
1524 * @exception #ACCOUNT_ERROR_DATABASE_BUSY SQLite handler is busy
1525 * @exception #ACCOUNT_ERROR_DB_NOT_OPENED Account database did not opened
1526 * @exception #ACCOUNT_ERROR_NOT_SUPPORTED Not supported
1528 * @pre This function requires an open connection to an account service by account_connect() on tizen 2.3 (MOBILE).\n
1529 * But the account_connect() is not required to use this function since tizen 2.4.
1531 bool account_type_query_supported_feature(const char *app_id, const char *capability);
1534 * @brief Gets the application ID of an account provider.
1536 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 3.0 @endif
1537 * @remarks You must release @a app_id using free().
1539 * @param[in] account_type The account provider handle \n
1540 * It should be given by account_type_query_* functions or account_type_foreach_account_type_from_db().
1541 * @param[out] app_id The application ID of an account provider item
1543 * @return @c 0 on success,
1544 * otherwise a negative error value
1545 * @retval #ACCOUNT_ERROR_NONE Successful
1546 * @retval #ACCOUNT_ERROR_INVALID_PARAMETER Invalid parameter
1547 * @retval #ACCOUNT_ERROR_OUT_OF_MEMORY Out of memory
1548 * @retval #ACCOUNT_ERROR_NOT_SUPPORTED Not supported
1550 * @see account_type_foreach_account_type_from_db()
1551 * @see account_type_query_by_app_id()
1553 int account_type_get_app_id(account_type_h account_type, char **app_id);
1556 * @brief Gets the service provider ID of an account provider.
1558 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 3.0 @endif
1559 * @remarks You must release @a service_provider_id using free().
1561 * @param[in] account_type The account provider handle \n
1562 * It should be given by account_type_query_* functions or account_type_foreach_account_type_from_db().
1563 * @param[out] service_provider_id The service provider text ID of an account provider item
1565 * @return @c 0 on success,
1566 * otherwise a negative error value
1567 * @retval #ACCOUNT_ERROR_NONE Successful
1568 * @retval #ACCOUNT_ERROR_INVALID_PARAMETER Invalid parameter
1569 * @retval #ACCOUNT_ERROR_OUT_OF_MEMORY Out of memory
1570 * @retval #ACCOUNT_ERROR_NOT_SUPPORTED Not supported
1572 * @see account_type_foreach_account_type_from_db()
1573 * @see account_type_query_by_app_id()
1575 int account_type_get_service_provider_id(account_type_h account_type, char **service_provider_id);
1578 * @brief Gets the icon path of an account provider.
1580 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 3.0 @endif
1581 * @remarks You must release @a icon_path using free().
1583 * @param[in] account_type The account provider handle \n
1584 * It should be given by account_type_query_* functions or account_type_foreach_account_type_from_db().
1585 * @param[out] icon_path The icon path of the account provider item
1587 * @return @c 0 on success,
1588 * otherwise a negative error value
1589 * @retval #ACCOUNT_ERROR_NONE Successful
1590 * @retval #ACCOUNT_ERROR_INVALID_PARAMETER Invalid parameter
1591 * @retval #ACCOUNT_ERROR_OUT_OF_MEMORY Out of memory
1592 * @retval #ACCOUNT_ERROR_NOT_SUPPORTED Not supported
1594 * @see account_type_foreach_account_type_from_db()
1595 * @see account_type_query_by_app_id()
1597 int account_type_get_icon_path(account_type_h account_type, char **icon_path);
1600 * @brief Gets the small icon path of an account provider.
1602 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 3.0 @endif
1603 * @remarks You must release @a small_icon_path using free().
1605 * @param[in] account_type The account provider handle\n
1606 * It should be given by account_type_query_* functions or account_type_foreach_account_type_from_db().
1607 * @param[out] small_icon_path The small icon path of the account provider item
1609 * @return @c 0 on success,
1610 * otherwise a negative error value
1611 * @retval #ACCOUNT_ERROR_NONE Successful
1612 * @retval #ACCOUNT_ERROR_INVALID_PARAMETER Invalid parameter
1613 * @retval #ACCOUNT_ERROR_OUT_OF_MEMORY Out of memory
1614 * @retval #ACCOUNT_ERROR_NOT_SUPPORTED Not supported
1616 * @see account_type_foreach_account_type_from_db()
1617 * @see account_type_query_by_app_id()
1619 int account_type_get_small_icon_path(account_type_h account_type, char **small_icon_path);
1622 * @brief Checks whether the given account provider supports multiple accounts.
1624 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 3.0 @endif
1625 * @param[in] account_type The account provider handle \n
1626 * It should be given by account_type_query_* functions or account_type_foreach_account_type_from_db().
1627 * @param[out] multiple_account_support The flag indicating support for multiple accounts accounts\n
1630 * @return @c 0 on success,
1631 * otherwise a negative error value
1632 * @retval #ACCOUNT_ERROR_NONE Successful
1633 * @retval #ACCOUNT_ERROR_INVALID_PARAMETER Invalid parameter
1634 * @retval #ACCOUNT_ERROR_OUT_OF_MEMORY Out of memory
1635 * @retval #ACCOUNT_ERROR_NOT_SUPPORTED Not supported
1637 * @see account_type_foreach_account_type_from_db()
1638 * @see account_type_query_by_app_id()
1640 int account_type_get_multiple_account_support(account_type_h account_type, int *multiple_account_support);
1643 * @brief Gets capability information with the given account provider handle.
1645 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 3.0 @endif
1646 * @param[in] account_type The account provider handle\n
1647 * It should be given by account_type_query_* functions or account_type_foreach_account_type_from_db().
1648 * @param[in] callback The callback function that carries the capability name of the app ID
1649 * @param[in] user_data The user data \n
1650 * If you have your private data to carry into callback function, then you can use it.
1652 * @return @c 0 on success,
1653 * otherwise a negative error value
1654 * @retval #ACCOUNT_ERROR_NONE Successful
1655 * @retval #ACCOUNT_ERROR_INVALID_PARAMETER Invalid parameter
1656 * @retval #ACCOUNT_ERROR_DB_FAILED Database operation failed
1657 * @retval #ACCOUNT_ERROR_NOT_SUPPORTED Not supported
1659 * @pre This function requires an open connection to an account service by account_connect() on tizen 2.3 (MOBILE).\n
1660 * But the account_connect() is not required to use this function since tizen 2.4.
1662 int account_type_get_provider_feature_all(account_type_h account_type, provider_feature_cb callback, void *user_data);
1665 * @brief Gets the specific label information detail of an account provider.
1667 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 3.0 @endif
1668 * @remarks You must release @a label using free().
1670 * @param[in] account_type The account provider handle\n
1671 * It should be given by account_type_query_* functions or account_type_foreach_account_type_from_db().
1672 * @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
1673 * For example, "ko_KR" or "ko-kr" for Korean, "en_US" or "en-us" for American English.
1674 * @param[out] label The label text given for the locale
1676 * @return @c 0 on success,
1677 * otherwise a negative error value
1678 * @retval #ACCOUNT_ERROR_NONE Successful
1679 * @retval #ACCOUNT_ERROR_RECORD_NOT_FOUND No label for the given locale
1680 * @retval #ACCOUNT_ERROR_INVALID_PARAMETER Invalid parameter
1681 * @retval #ACCOUNT_ERROR_NOT_SUPPORTED Not supported
1683 * @see account_type_foreach_account_type_from_db()
1684 * @see account_type_query_by_app_id()
1687 int account_type_get_label_by_locale(account_type_h account_type, const char *locale, char **label);
1690 * @brief Gets the label information detail of an account provider.
1692 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 3.0 @endif
1693 * @param[in] account_type The account provider handle\n
1694 * It should be given by account_type_query_* functions or account_type_foreach_account_type_from_db().
1695 * @param[in] callback The callback function carrying the label information
1696 * @param[in] user_data The user data to be passed to the callback function
1698 * @return @c 0 on success,
1699 * otherwise a negative error value
1700 * @retval #ACCOUNT_ERROR_NONE Successful
1701 * @retval #ACCOUNT_ERROR_INVALID_PARAMETER Invalid parameter
1702 * @retval #ACCOUNT_ERROR_NOT_SUPPORTED Not supported
1704 * @see account_type_foreach_account_type_from_db()
1705 * @see account_type_query_by_app_id()
1707 int account_type_get_label(account_type_h account_type, account_label_cb callback, void *user_data);
1710 * @brief Retrieves the label information with your application ID.
1712 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 3.0 @endif
1714 * @privilege %http://tizen.org/privilege/account.read
1715 * @param[in] callback The callback function that carries label_h for label information \n
1716 * label_h contains label info as parameter.
1717 * @param[in] app_id The application ID to search
1718 * @param[in] user_data The user data \n
1719 * If you have your private data to carry into callback function, then you can use it.
1721 * @return @c 0 on success,
1722 * otherwise a negative error value
1723 * @retval #ACCOUNT_ERROR_NONE Successful
1724 * @retval #ACCOUNT_ERROR_INVALID_PARAMETER Invalid parameter
1725 * @retval #ACCOUNT_ERROR_DB_FAILED Database operation failed
1726 * @retval #ACCOUNT_ERROR_PERMISSION_DENIED DB Access fail by permission
1727 * @retval #ACCOUNT_ERROR_DATABASE_BUSY SQLite handler is busy
1728 * @retval #ACCOUNT_ERROR_DB_NOT_OPENED Account database did not opened
1729 * @retval #ACCOUNT_ERROR_NOT_SUPPORTED Not supported
1731 * @pre This function requires an open connection to an account service by account_connect() on tizen 2.3 (MOBILE).\n
1732 * But the account_connect() is not required to use this function since tizen 2.4.
1734 * @see account_type_query_by_app_id()
1735 * @see account_type_foreach_account_type_from_db()
1737 int account_type_query_label_by_app_id(account_label_cb callback, const char *app_id, void *user_data);
1740 * @brief Retrieves the account provider information with your application ID.
1742 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 3.0 @endif
1744 * @privilege %http://tizen.org/privilege/account.read
1745 * @param[in] app_id The application ID to search
1746 * @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.
1748 * @return @c 0 on success,
1749 * otherwise a negative error value
1750 * @retval #ACCOUNT_ERROR_NONE Successful
1751 * @retval #ACCOUNT_ERROR_INVALID_PARAMETER Invalid parameter
1752 * @retval #ACCOUNT_ERROR_DB_FAILED Database operation failed
1753 * @retval #ACCOUNT_ERROR_RECORD_NOT_FOUND Queried data does not exist
1754 * @retval #ACCOUNT_ERROR_PERMISSION_DENIED DB Access fail by permission
1755 * @retval #ACCOUNT_ERROR_DATABASE_BUSY SQLite handler is busy
1756 * @retval #ACCOUNT_ERROR_DB_NOT_OPENED Account database did not opened
1757 * @retval #ACCOUNT_ERROR_NOT_SUPPORTED Not supported
1759 * @pre This function requires an open connection to an account service by account_connect() on tizen 2.3 (MOBILE).\n
1760 * But the account_connect() is not required to use this function since tizen 2.4.
1762 * @see account_type_create()
1763 * @see account_type_get_app_id()
1764 * @see account_type_get_service_provider_id()
1765 * @see account_type_get_icon_path()
1766 * @see account_type_get_small_icon_path()
1767 * @see account_type_get_multiple_account_support()
1768 * @see account_type_get_label()
1769 * @see account_type_destroy()
1771 int account_type_query_by_app_id(const char *app_id, account_type_h *account_type);
1774 * @brief Retrieves all account provider information.
1776 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 3.0 @endif
1778 * @privilege %http://tizen.org/privilege/account.read
1779 * @param[in] callback The account provider information \n
1780 * You can get the account information through account_type_get_* with the carried account_type_handle.
1781 * @param[in] user_data The user data \n
1782 * It will be carried through your callback function.
1784 * @return @c 0 on success,
1785 * otherwise a negative error value
1786 * @retval #ACCOUNT_ERROR_NONE Successful
1787 * @retval #ACCOUNT_ERROR_INVALID_PARAMETER Invalid parameter
1788 * @retval #ACCOUNT_ERROR_DB_FAILED Database operation failed
1789 * @retval #ACCOUNT_ERROR_PERMISSION_DENIED DB Access fail by permission
1790 * @retval #ACCOUNT_ERROR_DATABASE_BUSY SQLite handler is busy
1791 * @retval #ACCOUNT_ERROR_DB_NOT_OPENED Account database did not opened
1792 * @retval #ACCOUNT_ERROR_NOT_SUPPORTED Not supported
1794 * @pre This function requires an open connection to an account service by account_connect() on tizen 2.3 (MOBILE).\n
1795 * But the account_connect() is not required to use this function since tizen 2.4.
1797 * @see account_type_create()
1798 * @see account_type_get_app_id()
1799 * @see account_type_get_service_provider_id()
1800 * @see account_type_get_icon_path()
1801 * @see account_type_get_small_icon_path()
1802 * @see account_type_get_multiple_account_support()
1803 * @see account_type_get_label()
1804 * @see account_type_destroy()
1806 int account_type_foreach_account_type_from_db(account_type_cb callback, void *user_data);
1809 * @brief Retrieves the label information with the given application ID and locale.
1811 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 3.0 @endif
1813 * @privilege %http://tizen.org/privilege/account.read
1814 * @param[in] app_id The application ID
1815 * @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
1816 * For example, "ko_KR" or "ko-kr" for Korean, "en_US" or "en-us" for American English.
1817 * @param[out] label The label text corresponding app_id and locale \n
1818 * It must be free text.
1820 * @return @c 0 on success,
1821 * otherwise a negative error value
1822 * @retval #ACCOUNT_ERROR_NONE Successful
1823 * @retval #ACCOUNT_ERROR_INVALID_PARAMETER Invalid parameter
1824 * @retval #ACCOUNT_ERROR_DB_FAILED Database operation failed
1825 * @retval #ACCOUNT_ERROR_PERMISSION_DENIED DB Access fail by permission
1826 * @retval #ACCOUNT_ERROR_DATABASE_BUSY SQLite handler is busy
1827 * @retval #ACCOUNT_ERROR_DB_NOT_OPENED Account database did not opened
1828 * @retval #ACCOUNT_ERROR_NOT_SUPPORTED Not supported
1830 * @pre This function requires an open connection to an account service by account_connect() on tizen 2.3 (MOBILE).\n
1831 * But the account_connect() is not required to use this function since tizen 2.4.
1833 int account_type_query_label_by_locale(const char *app_id, const char *locale, char **label);
1836 * @brief Retrieves account provider information with the capability name.
1838 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 3.0 @endif
1840 * @privilege %http://tizen.org/privilege/account.read
1841 * @param[in] callback The callback function to retrieve account provider information
1842 * @param[in] key The capability value to search account provider \n
1843 * For example, ACCOUNT_SUPPORTS_CAPABILITY_CONTACT or "http://tizen.org/account/capability/contact"
1844 * @param[in] user_data If you have your private data to carry into callback function, then you can use it
1846 * @return @c 0 on success,
1847 * otherwise a negative error value
1848 * @retval #ACCOUNT_ERROR_NONE Successful
1849 * @retval #ACCOUNT_ERROR_RECORD_NOT_FOUND Record not found
1850 * @retval #ACCOUNT_ERROR_INVALID_PARAMETER Invalid parameter
1851 * @retval #ACCOUNT_ERROR_DB_FAILED Database operation failed
1852 * @retval #ACCOUNT_ERROR_PERMISSION_DENIED DB Access fail by permission
1853 * @retval #ACCOUNT_ERROR_DATABASE_BUSY SQLite handler is busy
1854 * @retval #ACCOUNT_ERROR_DB_NOT_OPENED Account database did not opened
1855 * @retval #ACCOUNT_ERROR_NOT_SUPPORTED Not supported
1857 * @pre This function requires an open connection to an account service by account_connect() on tizen 2.3 (MOBILE).\n
1858 * But the account_connect() is not required to use this function since tizen 2.4.
1860 int account_type_query_by_provider_feature(account_type_cb callback, const char *key, void *user_data);
1863 * @brief Checks whether the given app_id exists in the account provider DB.
1865 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 3.0 @endif
1867 * @privilege %http://tizen.org/privilege/account.read
1868 * @param[in] app_id The application ID to check
1870 * @return @c 0 on success,
1871 * otherwise a negative error value
1872 * @retval #ACCOUNT_ERROR_NONE Successful
1873 * @retval #ACCOUNT_ERROR_RECORD_NOT_FOUND Record not found
1874 * @retval #ACCOUNT_ERROR_INVALID_PARAMETER Invalid app ID
1875 * @retval #ACCOUNT_ERROR_DB_FAILED Database operation failed
1876 * @retval #ACCOUNT_ERROR_PERMISSION_DENIED DB Access fail by permission
1877 * @retval #ACCOUNT_ERROR_DATABASE_BUSY SQLite handler is busy
1878 * @retval #ACCOUNT_ERROR_DB_NOT_OPENED Account database did not opened
1879 * @retval #ACCOUNT_ERROR_NOT_SUPPORTED Not supported
1881 * @pre This function requires an open connection to an account service by account_connect() on tizen 2.3 (MOBILE).\n
1882 * But the account_connect() is not required to use this function since tizen 2.4.
1884 * @see account_type_query_by_app_id()
1886 int account_type_query_app_id_exist(const char *app_id);
1890 /* End of account provider API */
1893 * @brief Creates a handle for the account event subscription.
1895 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 3.0 @endif
1896 * @remarks You must release @a account_subscribe handle using account_unsubscribe_notification().
1898 * @param[in] account_subscribe The account subscription handle
1900 * @return @c 0 on success,
1901 * otherwise a negative error value
1902 * @retval #ACCOUNT_ERROR_NONE Successful
1903 * @retval #ACCOUNT_ERROR_OUT_OF_MEMORY Out of Memory
1904 * @retval #ACCOUNT_ERROR_INVALID_PARAMETER Invalid parameter
1905 * @retval #ACCOUNT_ERROR_NOT_SUPPORTED Not supported
1907 * @see account_unsubscribe_notification()
1908 * @see account_subscribe_notification()
1910 int account_subscribe_create(account_subscribe_h *account_subscribe);
1913 * @brief Starts to subscribe account event through the given callback function.
1915 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 3.0 @endif
1917 * @privilege %http://tizen.org/privilege/account.read \n
1918 * @param[in] account_subscribe The account subscription handle
1919 * @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
1920 * It will be called with event message and account ID.
1921 * @param[in] user_data The user_data that is delivered to callback
1923 * @return @c 0 on success,
1924 * otherwise a negative error value
1925 * @retval #ACCOUNT_ERROR_NONE Successful
1926 * @retval #ACCOUNT_ERROR_EVENT_SUBSCRIPTION_FAIL Subscription fail
1927 * @retval #ACCOUNT_ERROR_INVALID_PARAMETER Invalid parameter
1928 * @retval #ACCOUNT_ERROR_NOT_SUPPORTED Not supported
1930 * @see account_unsubscribe_notification()
1931 * @see account_subscribe_notification()
1933 int account_subscribe_notification(account_subscribe_h account_subscribe, account_event_cb callback, void *user_data);
1936 * @brief Destroys the account subscribe handle and releases all its resources.
1938 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 3.0 @endif
1940 * @privilege %http://tizen.org/privilege/account.read \n
1941 * @remarks You must call account_unsubscribe_notification() when you do not need to subscribe account event.
1943 * @param[in] account_subscribe The account subscription handle
1945 * @return @c 0 on success,
1946 * otherwise a negative error value
1947 * @retval #ACCOUNT_ERROR_NONE Successful
1948 * @retval #ACCOUNT_ERROR_INVALID_PARAMETER Invalid parameter
1949 * @retval #ACCOUNT_ERROR_EVENT_SUBSCRIPTION_FAIL Unsubscription failed
1950 * @retval #ACCOUNT_ERROR_NOT_SUPPORTED Not supported
1952 * @see account_create()
1954 int account_unsubscribe_notification(account_subscribe_h account_subscribe);
1957 /* End of Account APIs */
1968 #endif /* __ACCOUNT_H__ */