fix api doc for in,out param
[platform/core/api/libaccount-service.git] / include / wearable / account.h
1 /*
2  *
3  * Copyright (c) 2012 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
4  *
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
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
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.
16  *
17  */
18
19 #ifndef __ACCOUNT_H__
20 #define __ACCOUNT_H__
21
22 #include <account-types.h>
23 #include <account-error.h>
24
25 #ifdef __cplusplus
26 extern "C"
27 {
28 #endif
29
30 #ifndef ACCOUNT_API
31 #define ACCOUNT_API __attribute__ ((visibility("default")))
32 #endif
33
34 /**
35  * @file        account.h
36  * @brief       This file contains the Account API for account management.
37  */
38
39 /**
40  * @addtogroup CAPI_ACCOUNT_MANAGER_MODULE
41  * @{
42  */
43
44 /**
45  * @brief   Called once for each account from the database.
46  *
47  * @since_tizen 3.0
48  * @param[in]  account    The account handle
49  * @param[in]  user_data  The user data passed from the foreach function
50  *
51  * @return     @c true to continue with the next iteration of the loop, \n
52  *             otherwise @c false to break out of the loop
53  *
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.
55  *
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()
60  */
61 typedef bool (*account_cb)(account_h account, void *user_data);
62
63 /**
64  * @brief  Called once for each capability of an account in the database.
65  *
66  * @since_tizen 3.0
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
70  *
71  * @return      @c true to continue with the next iteration of the loop, \n
72  *              otherwise @c false to break out of the loop
73  *
74  * @pre account_query_capability_by_account_id() must be called.
75  *
76  * @see account_query_capability_by_account_id()
77  */
78 typedef bool (*capability_cb)(const char *capability_type, account_capability_state_e capability_state, void *user_data);
79
80 /**
81  * @brief  Called once for each custom data of an account in the database.
82  *
83  * @since_tizen 3.0
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
87  *
88  * @return     @c true to continue with the next iteration of the loop, \n
89  *             otherwise @c false to break out of the loop
90  *
91  * @pre account_query_capability_by_account_id() must be called.
92  *
93  * @see account_query_capability_by_account_id()
94  */
95 typedef bool (*account_custom_cb)(char *key, char *value, void *user_data);
96
97
98 /**
99  * @brief  Called once for each account provider in the database.
100  *
101  * @since_tizen 3.0
102  * @param[in]  account_type  The account provider handle
103  * @param[in]  user_data     The user data passed
104  *
105  * @return     @c true to continue with the next iteration of the loop, \n
106  *             otherwise @c false to break out of the loop
107  *
108  * @pre account_type_foreach_account_type_from_db(), account_type_query_by_provider_feature() must be called.
109  *
110  * @see account_type_foreach_account_type_from_db()
111  * @see account_type_query_by_provider_feature()
112  */
113 typedef bool (*account_type_cb)(account_type_h account_type, void *user_data);
114
115
116 /**
117  * @brief  Called once for each account label.
118  *
119  * @since_tizen 3.0
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
125  *
126  * @return     @c true to continue with the next iteration of the loop, \n
127  *             otherwise @c false to break out of the loop
128  *
129  * @pre account_type_get_label(), account_type_query_label_by_app_id() must be called.
130  *
131  * @see account_type_get_label()
132  * @see account_type_query_label_by_app_id()
133  */
134 typedef bool (*account_label_cb)(char *app_id, char *label, char *locale, void *user_data);
135
136
137 /**
138  * @brief  Called once for each capability of an account provider in the database.
139  *
140  * @since_tizen 3.0
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
144  *
145  * @return     @c true to continue with the next iteration of the loop, \n
146  *             otherwise @c false to break out of the loop
147  *
148  * @pre account_type_query_provider_feature_by_app_id(), account_type_get_provider_feature_all() must be called.
149  *
150  * @see account_type_query_provider_feature_by_app_id()
151  * @see account_type_get_provider_feature_all()
152  */
153 typedef bool (*provider_feature_cb)(char *app_id, char *key, void *user_data);
154
155
156 /**
157  * @brief Called once when an event occurs.
158  *
159  * @since_tizen 3.0
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
163  *
164  * @return     @c true to continue with the next iteration of the loop, \n
165  *             otherwise @c false to break out of the loop
166  *
167  * @pre account_subscribe_notification() must be called.
168  *
169  * @see account_subscribe_notification()
170  */
171 typedef bool (*account_event_cb)(const char *event_type, int account_id, void *user_data);
172
173 /**
174  * @brief  Creates a handle to the account.
175  *
176  * @since_tizen 3.0
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.
179  *
180  * @param[in]  account  The account handle
181  *
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
187  *
188  * @see account_destroy()
189  */
190 int account_create(account_h *account);
191
192
193 /**
194  * @brief  Destroys the account handle and releases all its resources.
195  *
196  * @since_tizen 3.0
197  * @param[in]  account  The account handle
198  *
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
203  *
204  * @see account_create()
205  */
206 int account_destroy(account_h account);
207
208
209 /**
210  * @brief  Inserts the account details to the account database.
211  *
212  * @since_tizen 3.0
213  * @privlevel   public
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
219  *
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
232  *
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()
238  */
239 int account_insert_to_db(account_h account, int *account_db_id);
240
241
242 /**
243  * @brief  Deletes an account from the account database by account DB ID.
244  *
245  * @since_tizen 3.0
246  * @privlevel  public
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
252  *
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
262  *
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()
268  */
269 int account_delete_from_db_by_id(int account_db_id);
270
271
272 /**
273  * @brief  Deletes an account from the account database by user name.
274  *
275  * @since_tizen 3.0
276  * @privlevel  public
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
283  *
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
293  *
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()
299  */
300 int account_delete_from_db_by_user_name(char *user_name, char *package_name);
301
302
303 /**
304  * @brief  Deletes an account from the account database by package name.
305  *
306  * @since_tizen 3.0
307  * @privlevel  public
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
313  *
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
322  *
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()
328  */
329 int account_delete_from_db_by_package_name(const char *package_name);
330
331 /**
332  * @brief  Updates the account details to the account database.
333  *
334  * @since_tizen 3.0
335  * @privlevel  public
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
342  *
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
352  *
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()
358  */
359 int account_update_to_db_by_id(account_h account, int account_id);
360
361 /**
362  * @brief      Updates the account details to the account database.
363  *             The provider permission check has been added since tizen 3.0.
364  *
365  * @since_tizen 3.0
366  * @privlevel  public
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
373  *
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
384  *
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()
390  */
391 int account_update_to_db_by_id_ex(account_h account, int account_id);
392
393 /**
394  * @brief  Updates the account details to the account database.
395  *
396  * @since_tizen 3.0
397  * @privlevel  public
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
405  *
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
415  *
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()
421  *
422  */
423 int account_update_to_db_by_user_name(account_h account, const char *user_name, const char *package_name);
424
425 /**
426  * @brief  Gets the ID of an account.
427  *
428  * @since_tizen 3.0
429  * @param[in]   account     The account handle
430  * @param[out]  account_id  The account ID
431  *
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
436  *
437  */
438 int account_get_account_id(account_h account, int *account_id);
439
440 /**
441  * @brief  Gets the user name of an account.
442  *
443  * @since_tizen 3.0
444  * @remarks    You must release @a user_name using free().
445  *
446  * @param[in]   account    The account handle
447  * @param[out]  user_name  The user name of the account
448  *
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
454  *
455  * @see account_set_user_name()
456  */
457 int account_get_user_name(account_h account, char **user_name);
458
459
460 /**
461  * @brief  Sets the user name of an account.
462  *
463  * @since_tizen 3.0
464  * @param[in]  account    The account handle
465  * @param[in]  user_name  The string to set as user name
466  *
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
471  *
472  * @see account_get_user_name()
473  */
474 int account_set_user_name(account_h account, const char *user_name);
475
476
477 /**
478  * @brief  Gets the display name of an account.
479  *
480  * @since_tizen 3.0
481  * @remarks    You must release @a display_name using free().
482  *
483  * @param[in]   account       The account handle
484  * @param[out]  display_name  The display name of the account
485  *
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
491  *
492  * @see account_get_display_name()
493  */
494 int account_get_display_name(account_h account, char **display_name);
495
496
497 /**
498  * @brief  Sets the display name of an account.
499  *
500  * @since_tizen 3.0
501  * @param[in]  account      The account handle
502  * @param[in]  display_name The text string to set as the display name
503  *
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
508  *
509  * @see account_get_display_name()
510  */
511 int account_set_display_name(account_h account, const char *display_name);
512
513 /**
514  * @brief  Gets the capability detail of an account.
515  *
516  * @since_tizen 3.0
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
520  *
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
526  *
527  * @see account_set_capability()
528  */
529 int account_get_capability(account_h account, const char *capability_type, account_capability_state_e *capability_value);
530
531 /**
532  * @brief  Gets all the capabilities of an account.
533  *
534  * @since_tizen 3.0
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
538  *
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
543  *
544  * @see account_set_capability()
545  */
546 int account_get_capability_all(account_h account, capability_cb callback, void *user_data);
547
548 /**
549  * @brief  Sets the capability.
550  *
551  * @since_tizen 3.0
552  * @param[in]  account           The account handle
553  * @param[in]  capability_type   The capability type
554  * @param[in]  capability_state  The capability state
555  *
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
560  *
561  * @see account_get_capability()
562  */
563 int account_set_capability(account_h account, const char *capability_type, account_capability_state_e capability_state);
564
565
566 /**
567  * @brief  Gets the icon path.
568  *
569  * @since_tizen 3.0
570  * @remarks    You must release @a icon_path using free().
571  *
572  * @param[in]   account    The account handle
573  * @param[out]  icon_path  The icon path
574  *
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
580  *
581  * @see account_set_icon_path()
582  */
583 int account_get_icon_path(account_h account, char **icon_path);
584
585
586 /**
587  * @brief  Sets the icon path.
588  *
589  * @since_tizen 3.0
590  * @param[in]  account    The account handle
591  * @param[in]  icon_path  The text string to set as the icon path
592  *
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
597  *
598  * @see account_get_icon_path()
599  */
600 int account_set_icon_path(account_h account, const char *icon_path);
601
602
603 /**
604  * @brief  Gets the domain name.
605  *
606  * @since_tizen 3.0
607  * @remarks    You must release @a domain_name using free().
608  *
609  * @param[in]   account      The account handle
610  * @param[out]  domain_name  The domain name
611  *
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
617  *
618  * @see account_set_domain_name()
619  */
620 int account_get_domain_name(account_h account, char **domain_name);
621
622
623 /**
624  * @brief  Sets the domain name.
625  *
626  * @since_tizen 3.0
627  * @param[in]  account      The account handle
628  * @param[in]  domain_name  The text string to set as the domain name
629  *
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
634  *
635  * @see account_get_domain_name()
636  */
637 int account_set_domain_name(account_h account, const char *domain_name);
638
639
640 /**
641  * @brief  Gets the email address.
642  *
643  * @since_tizen 3.0
644  * @remarks    You must release @a email_address using free().
645  *
646  * @param[in]   account        The account handle
647  * @param[out]  email_address  The email address
648  *
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
654  *
655  * @see account_set_email_address()
656  */
657 int account_get_email_address(account_h account, char **email_address);
658
659
660 /**
661  * @brief  Sets the email address.
662  *
663  * @since_tizen 3.0
664  * @param[in]  account        The account handle
665  * @param[in]  email_address  The text string to set as the email address
666  *
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
671  *
672  * @see account_get_email_address()
673  */
674 int account_set_email_address(account_h account, const char *email_address);
675
676
677 /**
678  * @brief  Gets the package name.
679  *
680  * @since_tizen 3.0
681  * @remarks    You must release @a package_name using free().
682  *
683  * @param[in]   account       The account handle
684  * @param[out]  package_name  The package name
685  *
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
691  *
692  * @see account_set_package_name()
693  */
694 int account_get_package_name(account_h account, char **package_name);
695
696
697 /**
698  * @brief  Sets the package name.
699  *
700  * @since_tizen 3.0
701  * @param[in]  account       The account handle
702  * @param[in]  package_name  The text string to set as the package name
703  *
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
708  *
709  * @see account_get_email_address()
710  */
711 int account_set_package_name(account_h account, const char *package_name);
712
713
714 /**
715  * @brief  Gets the access token. Access token field is used to store account secrets (such as password or master token).
716  *
717  * @since_tizen 3.0
718  * @remarks    You must release @a access_token using free().
719  *
720  * @param[in]   account       The account handle
721  * @param[out]  access_token  The access token
722  *
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
728  *
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()
732  */
733 int account_get_access_token(account_h account, char **access_token);
734
735
736 /**
737  * @brief  Sets the access token. Access token field is used to store account secrets (such as password or master token).
738  *
739  * @since_tizen 3.0
740  * @param[in]  account       The account handle
741  * @param[in]  access_token  The text string to set as the access token
742  *
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()
749  */
750 int account_set_access_token(account_h account, const char *access_token);
751
752
753 /**
754  * @brief  Gets the user text.
755  *
756  * @since_tizen 3.0
757  * @remarks    You must release @a user_text using free().
758  *
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
762  *
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
768  *
769  * @see account_set_user_text()
770  */
771 int account_get_user_text(account_h account, int user_text_index, char **user_text);
772
773
774 /**
775  * @brief  Sets the user text.
776  *
777  * @since_tizen 3.0
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
781  *
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
786  *
787  * @see account_get_user_text()
788  */
789 int account_set_user_text(account_h account, int user_text_index, const char *user_text);
790
791
792 /**
793  * @brief  Gets the user integer.
794  *
795  * @since_tizen 3.0
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
799  *
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
804  *
805  * @see account_set_user_int()
806  */
807 int account_get_user_int(account_h account, int user_int_index, int *user_integer);
808
809
810 /**
811  * @brief  Sets the user integer.
812  *
813  * @since_tizen 3.0
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
817  *
818  * @return  @c 0 on success,
819  *          otherwise a negative error value
820  * @retval  #ACCOUNT_ERROR_NONE               Successful
821  * @retval  #ACCOUNT_ERROR_INVALID_PARAMETER  Invalid parameter
822  *
823  * @see account_get_user_int()
824  */
825 int account_set_user_int(account_h account, int user_int_index, int user_integer);
826
827
828 /**
829  * @brief  Gets the auth type.
830  *
831  * @since_tizen 3.0
832  * @param[in]   account    The account handle
833  * @param[out]  auth_type  The auth type
834  *
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
839  *
840  * @see account_set_auth_type()
841  */
842 int account_get_auth_type(account_h account, account_auth_type_e *auth_type);
843
844
845 /**
846  * @brief  Sets the auth type.
847  *
848  * @since_tizen 3.0
849  * @param[in]  account    The account handle
850  * @param[in]  auth_type  The integer to be set as the auth type
851  *
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
856  *
857  * @see account_get_auth_type()
858  */
859 int account_set_auth_type(account_h account, const account_auth_type_e auth_type);
860
861
862 /**
863  * @brief  Gets the secret.
864  *
865  * @since_tizen 3.0
866  * @param[in]   account  The account handle
867  * @param[out]  secret   The secret
868  *
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
873  *
874  * @see account_set_secret()
875  */
876 int account_get_secret(account_h account, account_secrecy_state_e *secret);
877
878
879 /**
880  * @brief  Sets the secret.
881  *
882  * @since_tizen 3.0
883  * @param[in]  account  The account handle
884  * @param[in]  secret   The secrecy to be set
885  *
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
890  *
891  * @see account_get_secret()
892  */
893 int account_set_secret(account_h account, const account_secrecy_state_e secret);
894
895 /**
896  * @brief  Gets the sync support.
897  *
898  * @since_tizen 3.0
899  * @param[in]   account       The account handle
900  * @param[out]  sync_support  The sync support
901  *
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
906  *
907  * @see account_set_sync_support()
908  */
909 int account_get_sync_support(account_h account, account_sync_state_e *sync_support);
910
911
912 /**
913  * @brief  Sets the sync support.
914  *
915  * @since_tizen 3.0
916  * @param[in]  account       The account handle
917  * @param[in]  sync_support  The sync state to be set
918  *
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  *
924  * @see account_get_sync_support()
925  */
926 int account_set_sync_support(account_h account, const account_sync_state_e sync_support);
927
928
929 /**
930  * @brief  Gets the source.
931  *
932  * @since_tizen 3.0
933  * @remarks    You must release @a user_text using free().
934  *
935  * @param[in]   account  The account handle
936  * @param[out]  source   The source
937  *
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
943  *
944  * @see account_set_source()
945  */
946 int account_get_source(account_h account, char **source);
947
948
949 /**
950  * @brief  Sets the source.
951  *
952  * @since_tizen 3.0
953  * @param[in]  account  The account handle
954  * @param[in]  source   The text string to set as the source
955  *
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
960  *
961  * @see account_get_source()
962  */
963 int account_set_source(account_h account, const char *source);
964
965 /**
966  * @brief  Sets the custom.
967  *
968  * @since_tizen 3.0
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
972  *
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  *
978  * @see account_get_custom()
979  */
980 int account_set_custom(account_h account, const char *key, const char *value);
981
982 /**
983  * @brief  Gets the user specific custom text of an account key.
984  *
985  * @since_tizen 3.0
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
989  *
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
995  *
996  * @see account_set_custom()
997  */
998 int account_get_custom(account_h account, const char *key, char **value);
999
1000
1001 /**
1002  * @brief  Gets all the user custom texts of an account.
1003  *
1004  * @since_tizen 3.0
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
1009  *
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
1014  *
1015  * @see account_set_custom()
1016  */
1017 int account_get_custom_all(account_h account, account_custom_cb callback, void *user_data);
1018
1019 /**
1020  * @brief  Retrieves all accounts details by invoking the given callback function iteratively.
1021  *
1022  * @since_tizen 3.0
1023  * @privlevel   public
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
1027  *
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
1037  *
1038  * @post  This function invokes account_cb().
1039  *
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()
1044  */
1045 int account_foreach_account_from_db(account_cb callback, void *user_data);
1046
1047
1048 /**
1049  * @brief  Retrieve an account with the account ID.
1050  *
1051  * @since_tizen 3.0
1052  * @privlevel   public
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().
1057  *
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
1067  *
1068  * @see account_query_account_by_user_name()
1069  * @see account_query_account_by_package_name()
1070  * @see account_query_account_by_capability()
1071  */
1072 int account_query_account_by_account_id(int account_db_id, account_h *account);
1073
1074 /**
1075  * @brief  Retrieves all accounts with the user name.
1076  *
1077  * @since_tizen 3.0
1078  * @privlevel   public
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
1083  *
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
1093  *
1094  * @post  This function invokes account_cb().
1095  *
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()
1100  *
1101  */
1102 int account_query_account_by_user_name(account_cb callback, const char *user_name, void *user_data);
1103
1104 /**
1105  * @brief  Retrieves all accounts with the package name.
1106  *
1107  * @since_tizen 3.0
1108  * @privlevel  public
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
1113  *
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
1123  *
1124  * @post  This function invokes account_cb().
1125  *
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()
1130  */
1131 int account_query_account_by_package_name(account_cb callback, const char *package_name, void *user_data);
1132
1133 /**
1134  * @brief  Retrieves all accounts with the capability type and capability value.
1135  *
1136  * @since_tizen 3.0
1137  * @privlevel   public
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
1143  *
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
1153  *
1154  * @post  This function invokes account_cb().
1155  *
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()
1160  */
1161 int account_query_account_by_capability(account_cb callback, const char *capability_type, account_capability_state_e capability_value, void *user_data);
1162
1163 /**
1164  * @brief  Retrieves all accounts with the capability type.
1165  *
1166  * @since_tizen 3.0
1167  * @privlevel   public
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
1172  *
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
1182  *
1183  * @post  This function invokes account_cb().
1184  *
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()
1189  */
1190 int account_query_account_by_capability_type(account_cb callback, const char *capability_type, void *user_data);
1191
1192 /**
1193  * @brief  Retrieves all capabilities with the account database ID.
1194  *
1195  * @since_tizen 3.0
1196  * @privlevel   public
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
1201  *
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
1211  *
1212  * @post  This function invokes capability_cb().
1213  *
1214  * @see account_get_capability()
1215  * @see account_set_capability()
1216  */
1217 int account_query_capability_by_account_id(capability_cb callback, int account_db_id, void *user_data);
1218
1219
1220 /**
1221  * @brief  Gets the count of accounts in the account database.
1222  *
1223  * @since_tizen 3.0
1224  * @privlevel   public
1225  * @privilege   %http://tizen.org/privilege/account.read
1226  * @param[out]  count  The out parameter for count of all accounts
1227  *
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
1235  *
1236  */
1237 int account_get_total_count_from_db(int *count);
1238
1239 /**
1240  * @brief  Updates the sync status of an account with the given account ID.
1241  *
1242  * @since_tizen 3.0
1243  * @privlevel   public
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
1250  *
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
1260  *
1261  */
1262 int account_update_sync_status_by_id(int account_db_id, const account_sync_state_e sync_status);
1263
1264
1265 /* Account type API */
1266
1267
1268 /**
1269  * @brief  Creates a handle to the account provider.
1270  *
1271  * @since_tizen 3.0
1272  * @remarks     You must release @a account_type handle using account_type_destroy().\n
1273  *
1274  * @param[in]  account_type  The account provider handle
1275  *
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
1281  *
1282  * @see account_type_destroy()
1283  */
1284 int account_type_create(account_type_h *account_type);
1285
1286 /**
1287  * @brief  Destroys the account provider handle and releases all its resources.
1288  *
1289  * @since_tizen 3.0
1290  *
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.
1292  *
1293  * @param[in]  account_type  The account provider handle
1294  *
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
1299  *
1300  * @see account_type_create()
1301  */
1302 int account_type_destroy(account_type_h account_type);
1303
1304 /**
1305  * @brief  Retrieves capability information with your application ID.
1306  *
1307  * @since_tizen 3.0
1308  * @privlevel   public
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.
1314  *
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
1323  *
1324  */
1325 int account_type_query_provider_feature_by_app_id(provider_feature_cb callback, const char *app_id, void *user_data);
1326
1327 /**
1328  * @brief   Checks whether the given application ID supports the capability.
1329  *
1330  * @since_tizen 3.0
1331  * @privlevel   public
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"
1337  *
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
1349  *
1350  */
1351 bool account_type_query_supported_feature(const char *app_id, const char *capability);
1352
1353 /**
1354  * @brief  Gets the application ID of an account provider.
1355  *
1356  * @since_tizen 3.0
1357  * @remarks     You must release @a app_id using free().
1358  *
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
1362  *
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
1368  *
1369  * @see account_type_foreach_account_type_from_db()
1370  * @see account_type_query_by_app_id()
1371  */
1372 int account_type_get_app_id(account_type_h account_type, char **app_id);
1373
1374 /**
1375  * @brief  Gets the service provider ID of an account provider.
1376  *
1377  * @since_tizen 3.0
1378  * @remarks     You must release @a service_provider_id using free().
1379  *
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
1383  *
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
1389  *
1390  * @see account_type_foreach_account_type_from_db()
1391  * @see account_type_query_by_app_id()
1392  */
1393 int account_type_get_service_provider_id(account_type_h account_type, char **service_provider_id);
1394
1395 /**
1396  * @brief  Gets the icon path of an account provider.
1397  *
1398  * @since_tizen 3.0
1399  * @remarks     You must release @a icon_path using free().
1400  *
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
1404  *
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
1410  *
1411  * @see account_type_foreach_account_type_from_db()
1412  * @see account_type_query_by_app_id()
1413  */
1414 int account_type_get_icon_path(account_type_h account_type, char **icon_path);
1415
1416 /**
1417  * @brief  Gets the small icon path of an account provider.
1418  *
1419  * @since_tizen 3.0
1420  * @remarks    You must release @a small_icon_path using free().
1421  *
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
1425  *
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
1431  *
1432  * @see account_type_foreach_account_type_from_db()
1433  * @see account_type_query_by_app_id()
1434  */
1435 int account_type_get_small_icon_path(account_type_h account_type, char **small_icon_path);
1436
1437 /**
1438  * @brief  Checks whether the given account provider supports multiple accounts.
1439  *
1440  * @since_tizen 3.0
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
1444  *                                        TRUE or FALSE.
1445  *
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
1451  *
1452  * @see account_type_foreach_account_type_from_db()
1453  * @see account_type_query_by_app_id()
1454  */
1455 int account_type_get_multiple_account_support(account_type_h account_type, int *multiple_account_support);
1456
1457 /**
1458  * @brief  Gets capability information with the given account provider handle.
1459  *
1460  * @since_tizen 3.0
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.
1466  *
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
1472  *
1473  */
1474 int account_type_get_provider_feature_all(account_type_h account_type, provider_feature_cb callback, void *user_data);
1475
1476 /**
1477  * @brief  Gets the specific label information detail of an account provider.
1478  *
1479  * @since_tizen 3.0
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
1485  *
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
1491  *
1492  * @see account_type_foreach_account_type_from_db()
1493  * @see account_type_query_by_app_id()
1494  */
1495
1496 int account_type_get_label_by_locale(account_type_h account_type, const char *locale, char **label);
1497
1498 /**
1499  * @brief  Gets the label information detail of an account provider.
1500  *
1501  * @since_tizen 3.0
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
1506  *
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
1511  *
1512  * @see account_type_foreach_account_type_from_db()
1513  * @see account_type_query_by_app_id()
1514  */
1515 int account_type_get_label(account_type_h account_type, account_label_cb callback, void *user_data);
1516
1517 /**
1518  * @brief  Retrieves the label information with your application ID.
1519  *
1520  * @since_tizen 3.0
1521  * @privlevel   public
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.
1528  *
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
1537  *
1538  * @see account_type_query_by_app_id()
1539  * @see account_type_foreach_account_type_from_db()
1540  */
1541 int account_type_query_label_by_app_id(account_label_cb callback, const char *app_id, void *user_data);
1542
1543 /**
1544  * @brief  Retrieves the account provider information with your application ID.
1545  *
1546  * @since_tizen 3.0
1547  * @privlevel     public
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.
1551
1552  *
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
1562  *
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()
1571  */
1572 int account_type_query_by_app_id(const char *app_id, account_type_h *account_type);
1573
1574 /**
1575  * @brief  Retrieves all account priovider information.
1576  *
1577  * @since_tizen 3.0
1578  * @privlevel   public
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.
1584  *
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
1593  *
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()
1602  */
1603 int account_type_foreach_account_type_from_db(account_type_cb callback, void *user_data);
1604
1605 /**
1606  * @brief  Retrieves the label information with the given application ID and locale.
1607  *
1608  * @since_tizen 3.0
1609  * @privlevel   public
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.
1616  *
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
1625  *
1626  */
1627 int account_type_query_label_by_locale(const char *app_id, const char *locale, char **label);
1628
1629 /**
1630  * @brief  Retrieves account provider information with the capability name.
1631  *
1632  * @since_tizen 3.0
1633  * @privlevel   public
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
1639  *
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
1649  *
1650  */
1651 int account_type_query_by_provider_feature(account_type_cb callback, const char *key, void *user_data);
1652
1653 /**
1654  * @brief  Checks whether the given app_id exists in the account provider DB.
1655  *
1656  * @since_tizen 3.0
1657  * @privlevel   public
1658  * @privilege   %http://tizen.org/privilege/account.read
1659  * @param[in]   app_id  The application ID to check
1660  *
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
1670  *
1671  * @see account_type_query_by_app_id()
1672  */
1673 int account_type_query_app_id_exist(const char *app_id);
1674
1675
1676
1677 /* End of account provider API  */
1678
1679 /**
1680  * @brief  Creates a handle for the account event subscription.
1681  *
1682  * @since_tizen 3.0
1683  * @remarks     You must release @a account_subscribe handle using account_unsubscribe_notification().
1684  *
1685  * @param[in]   account_subscribe  The account subscription handle
1686  *
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
1692  *
1693  * @see account_unsubscribe_notification()
1694  * @see account_subscribe_notification()
1695  */
1696 int account_subscribe_create(account_subscribe_h *account_subscribe);
1697
1698 /**
1699  * @brief  Starts to subscribe account event through the given callback function.
1700  *
1701  * @since_tizen 3.0
1702  * @privlevel   public
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
1708  *
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
1714  *
1715  * @pre account_subscribe_create()
1716  *
1717  * @see account_unsubscribe_notification()
1718  * @see account_subscribe_notification()
1719  */
1720 int account_subscribe_notification(account_subscribe_h account_subscribe, account_event_cb callback, void *user_data);
1721
1722 /**
1723  * @brief  Destroys the account subscribe handle and releases all its resources.
1724  *
1725  * @since_tizen 3.0
1726  * @privlevel   public
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.
1729  *
1730  * @param[in]   account_subscribe  The account subscription handle
1731  *
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
1737  *
1738  * @see account_create()
1739  */
1740 int account_unsubscribe_notification(account_subscribe_h account_subscribe);
1741
1742
1743 /* End of Account APIs */
1744 /**
1745  * @}
1746  */
1747
1748
1749 #ifdef __cplusplus
1750 }
1751 #endif
1752
1753
1754 #endif /* __ACCOUNT_H__ */