tizen 2.3.1 release
[framework/web/wearable/wrt-security.git] / ace_common / include / ace_api_common.h
1 /*
2  * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
3  *
4  *    Licensed under the Apache License, Version 2.0 (the "License");
5  *    you may not use this file except in compliance with the License.
6  *    You may obtain a copy of the License at
7  *
8  *        http://www.apache.org/licenses/LICENSE-2.0
9  *
10  *    Unless required by applicable law or agreed to in writing, software
11  *    distributed under the License is distributed on an "AS IS" BASIS,
12  *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  *    See the License for the specific language governing permissions and
14  *    limitations under the License.
15  */
16 /*
17  * @file        ace_api_common.h
18  * @author      Tomasz Swierczek (t.swierczek@samsung.com)
19  * @version     1.0
20  * @brief       This is header for basic ACE data types and error codes
21  */
22
23 #ifndef ACE_API_COMMON_H
24 #define ACE_API_COMMON_H
25
26 #ifdef __cplusplus
27 extern "C" {
28 #endif
29
30 // --------------- Boolean type and errors -------------------------------------
31
32 /*
33  * Order and values of enum constants are part of API
34  */
35 typedef enum
36 {
37     ACE_FALSE,
38     ACE_TRUE
39 } ace_bool_t;
40
41 typedef enum
42 {
43     ACE_ACCESS_GRANTED,
44     ACE_PRIVILEGE_DENIED,
45     ACE_PRIVACY_DENIED
46 } ace_check_result_t;
47
48 typedef enum
49 {
50     ACE_OK,                 // Operation succeeded
51     ACE_INVALID_ARGUMENTS,  // Invalid input parameters
52     ACE_INTERNAL_ERROR,     // ACE internal error
53     ACE_ACE_UNKNOWN_ERROR   // Unexpected operation
54 } ace_return_t;
55
56 // --------------- Basic types -------------------------------------------------
57
58 typedef size_t  ace_size_t;
59 typedef char*   ace_string_t;           // NULL-terminated string
60 typedef int     ace_widget_handle_t;
61 typedef char*   ace_resource_t;
62 typedef char*   ace_subject_t;
63 typedef char*   ace_session_id_t;
64 typedef void*   ace_private_data_t;
65
66 // --------------- Access requests ---------------------------------------------
67
68 typedef struct
69 {
70     ace_size_t        count;
71     ace_string_t*     items;
72 } ace_feature_list_t;
73
74 typedef struct
75 {
76     ace_string_t name;
77     ace_string_t value;
78 } ace_param_t;
79
80 typedef struct
81 {
82     ace_size_t      count;
83     ace_param_t*    items;
84 } ace_param_list_t;
85
86 typedef struct
87 {
88     ace_string_t     name;
89     ace_param_list_t param_list;
90 } ace_dev_cap_t;
91
92 typedef struct
93 {
94     ace_size_t        count;
95     ace_dev_cap_t*    items;
96 } ace_dev_cap_list_t;
97
98 typedef struct
99 {
100     ace_session_id_t    session_id;         // DEPRECATED will be removed
101     ace_widget_handle_t widget_handle;      // DEPRECATED will be removed
102     ace_feature_list_t  feature_list;
103     ace_dev_cap_list_t  dev_cap_list;
104 } ace_request_t;
105
106 // --------------- Popup data types --------------------------------------------
107
108 /*
109  * Popup types that can be requested to be displayed by ACE
110  */
111 typedef enum
112 {
113     ACE_ONESHOT,
114     ACE_SESSION,
115     ACE_BLANKET
116 } ace_popup_t;
117
118 /*
119  * Validity of answer that can be returned by ACE popup
120  */
121 typedef enum
122 {
123     ACE_ONCE,
124     ACE_PER_SESSION,
125     ACE_ALWAYS
126 } ace_validity_t;
127
128 #ifdef __cplusplus
129 }
130 #endif
131
132 #endif // ACE_API_COMMON_H