tizen 2.4 release
[framework/account/libaccounts-svc.git] / include / account-types.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_TYPES_H__
20 #define __ACCOUNT_TYPES_H__
21
22 #ifdef __cplusplus
23 extern "C"
24 {
25 #endif
26
27
28 /**
29  * @addtogroup CAPI_ACCOUNT_MANAGER_MODULE
30  * @{
31  */
32
33 /**
34  * @file     account-types.h
35  * @ingroup  CAPI_ACCOUNT
36  * @brief    This file defines common types and enums of ACCOUNT.
37  */
38
39 /**
40  * @brief  Enumeration for the state of capability.
41  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.4 @endif
42  */
43 typedef enum
44 {
45     ACCOUNT_CAPABILITY_STATE_INVALID = 0, /**< Account capability is invalid */
46     ACCOUNT_CAPABILITY_DISABLED, /**< Account capability is disabled */
47     ACCOUNT_CAPABILITY_ENABLED, /**< Account capability is enabled */
48     ACCOUNT_CAPABILITY_STATE_MAX
49 }
50 account_capability_state_e;
51
52 /**
53  * @brief  Enumeration for the state of account secrecy.
54  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.4 @endif
55  */
56 typedef enum
57 {
58     ACCOUNT_SECRECY_INVALID = 0, /**< Account secrecy is invalid */
59     ACCOUNT_SECRECY_INVISIBLE, /**< Account is not visible */
60     ACCOUNT_SECRECY_VISIBLE, /**< Account is visible */
61     ACCOUNT_SECRECY_MAX
62 }
63 account_secrecy_state_e;
64
65 /**
66  * @brief  Enumeration for the account sync status.
67  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.4 @endif
68  */
69 typedef enum
70 {
71     ACCOUNT_SYNC_INVALID = 0, /**< Account sync is invalid */
72     ACCOUNT_SYNC_NOT_SUPPORT,  /**< Account sync not supported */
73     ACCOUNT_SYNC_STATUS_OFF, /**< Account sync supported but all synchronization functionalities are off */
74     ACCOUNT_SYNC_STATUS_IDLE, /**< Account sync support and sync status is idle */
75     ACCOUNT_SYNC_STATUS_RUNNING, /**< Account sync support and sync status is running */
76     ACCOUNT_SUPPORTS_SYNC, /**<  NOT USED, WILL BE REMOVED TO PREVENT BUILD ERROR */
77     ACCOUNT_NOT_SUPPORTS_SYNC, /**<  NOT USED, WILL BE REMOVED TO PREVENT BUILD ERROR */
78     ACCOUNT_SYNC_MAX
79 }
80 account_sync_state_e;
81
82 /**
83  * @brief  Enumeration for the account auth type.
84  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.4 @endif
85  */
86 typedef enum
87 {
88     ACCOUNT_AUTH_TYPE_INVALID = 0, /**< Auth type is invalid */
89     ACCOUNT_AUTH_TYPE_XAUTH, /**< XAuth type */
90     ACCOUNT_AUTH_TYPE_OAUTH, /**< OAuth type */
91     ACCOUNT_AUTH_TYPE_CLIENT_LOGIN, /**< Client-Login type */
92     ACCOUNT_AUTH_TYPE_MAX
93 }account_auth_type_e;
94
95 /**
96  * @brief  The structure type for the Account handle.
97  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.4 @endif
98  */
99 typedef struct account_s* account_h;
100
101 /**
102  * @brief  The structure type for the Account provider handle.
103  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.4 @endif
104  */
105 typedef struct account_type_s* account_type_h;
106
107 /**
108  * @brief  The structure type for the Account handle.
109  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.4 @endif
110  */
111 typedef struct label_s* label_h;
112
113 /**
114  * @brief  The structure type for the Account subscribe handle.
115  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.4 @endif
116  */
117 typedef struct account_subscribe_s* account_subscribe_h;
118
119 /**
120  * @brief        The insert notification type.
121  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.4 @endif
122  * @remarks      When the account database is changed, You can distinguish one event type from the other which are set for subscribing notification.
123  *
124  * @see account_subscribe_notification()
125  */
126 #define ACCOUNT_NOTI_NAME_INSERT        "insert"
127
128 /**
129  * @brief        The update notification type.
130  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.4 @endif
131  * @remarks      When the account database is changed, You can distinguish one event type from the other which are set for subscribing notification.
132  *
133  * @see account_subscribe_notification()
134  */
135 #define ACCOUNT_NOTI_NAME_UPDATE        "update"
136
137 /**
138  * @brief        The delete notification type.
139  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.4 @endif
140  * @remarks      When the account database is changed, You can distinguish one event type from the other which are set for subscribing notification.
141  *
142  * @see account_subscribe_notification()
143  */
144 #define ACCOUNT_NOTI_NAME_DELETE        "delete"
145
146 /**
147  * @brief        The sync_update notification type.
148  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.4 @endif
149  * @remarks      When the account database is changed, You can distinguish one event type from the other which are set for subscribing notification.
150  *
151  * @see account_subscribe_notification()
152  */
153 #define ACCOUNT_NOTI_NAME_SYNC_UPDATE   "sync_update"
154
155
156 /**
157  * @brief        This is a key of app_control_h’s extra data. The value of the key is a user account name.
158  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.4 @endif
159  * @remarks      You can retrieve the value like this, app_control_get_extra_data(app_control, ACCOUNT_DATA_USERNAME, &username).\n
160                  This value will be sent with ACCOUNT_OPERATION_VIEW.
161  */
162 #define ACCOUNT_DATA_USERNAME                             "http://tizen.org/account/data/username"
163
164 /**
165  * @brief        This is a key of app_control_h’s extra data. The value of the key is account DB ID of the user’s account information.
166  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.4 @endif
167  * @remarks      You can retrieve the value like this, app_control_get_extra_data(app_control, ACCOUNT_DATA_ID, &id).\n
168                  This value will be sent with ACCOUNT_OPERATION_VIEW.
169  */
170 #define ACCOUNT_DATA_ID                                   "http://tizen.org/appcontrol/data/account/id"
171
172 /**
173  * @brief        This is an application launch operation name.
174  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.4 @endif
175  * @remarks      This operation will be sent when a user selects your account in add account view.
176  */
177 #define ACCOUNT_OPERATION_SIGNIN                          "http://tizen.org/appcontrol/operation/account/add"
178
179 /**
180  * @brief        This is an application launch operation name.
181  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.4 @endif
182  * @remarks      This operation will be sent when a user selects your account in account list view.
183  */
184 #define ACCOUNT_OPERATION_VIEW                            "http://tizen.org/appcontrol/operation/account/configure"
185
186 /**
187  * @brief        This is contact capability string.
188  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.4 @endif
189  * @remarks      If your provider service has contact information and contact information is provided another application, register this capability through manifest file.
190  */
191 #define ACCOUNT_SUPPORTS_CAPABILITY_CONTACT               "http://tizen.org/account/capability/contact"
192
193 /**
194  * @brief        This is calendar capability string.
195  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.4 @endif
196  * @remarks      If your provider service has calendar information and calendar information is provided another application, register this capability through manifest file.
197  */
198 #define ACCOUNT_SUPPORTS_CAPABILITY_CALENDAR              "http://tizen.org/account/capability/calendar"
199
200 /**
201  * @brief        This is email capability string.
202  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.4 @endif
203  * @remarks      If your provider service have email service and email is provided another application, register this capability through manifest file.
204  */
205 #define ACCOUNT_SUPPORTS_CAPABILITY_EMAIL                 "http://tizen.org/account/capability/email"
206
207 /**
208  * @brief        This is photo capability string.
209  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.4 @endif
210  * @remarks      If your provider service has photo and photo is provided another application, register this capability through manifest file.
211  */
212 #define ACCOUNT_SUPPORTS_CAPABILITY_PHOTO                 "http://tizen.org/account/capability/photo"
213
214 /**
215  * @brief        This is video capability string.
216  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.4 @endif
217  * @remarks      If your provider service has video and video is provided another application, register this capability through manifest file.
218  */
219 #define ACCOUNT_SUPPORTS_CAPABILITY_VIDEO                 "http://tizen.org/account/capability/video"
220
221 /**
222  * @brief        This is music capability string.
223  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.4 @endif
224  * @remarks      If your provider service has music and music is provided another application, register this capability through manifest file.
225  */
226 #define ACCOUNT_SUPPORTS_CAPABILITY_MUSIC                 "http://tizen.org/account/capability/music"
227
228 /**
229  * @brief        This is document capability string.
230  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.4 @endif
231  * @remarks      If your provider service has document and document is provided another application, register this capability through manifest file.
232  */
233 #define ACCOUNT_SUPPORTS_CAPABILITY_DOCUMENT                 "http://tizen.org/account/capability/document"
234
235 /**
236  * @brief        This is message capability string.
237  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.4 @endif
238  * @remarks      This capability will be exploited to use SMS, MMS.
239  */
240 #define ACCOUNT_SUPPORTS_CAPABILITY_MESSAGE               "http://tizen.org/account/capability/message"
241
242 /**
243  * @brief        This is game capability string.
244  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.4 @endif
245  * @remarks      This capability will be exploited to use game data.
246  */
247 #define ACCOUNT_SUPPORTS_CAPABILITY_GAME               "http://tizen.org/account/capability/game"
248
249 /**
250  * @}
251  */
252
253 #ifdef __cplusplus
254 }
255 #endif
256
257 #endif /* __ACCOUNT_TYPES_H__*/
258