30fee60700b25308cdc298910ba91a5e30ef236a
[framework/security/security-server.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_OK,                 // Operation succeeded
44     ACE_INVALID_ARGUMENTS,  // Invalid input parameters
45     ACE_INTERNAL_ERROR,     // ACE internal error
46     ACE_ACE_UNKNOWN_ERROR   // Unexpected operation
47 } ace_return_t;
48
49 // --------------- Basic types -------------------------------------------------
50
51 typedef size_t  ace_size_t;
52 typedef char*   ace_string_t;           // NULL-terminated string
53 typedef int     ace_widget_handle_t;
54 typedef char*   ace_resource_t;
55 typedef char*   ace_subject_t;
56 typedef char*   ace_session_id_t;
57 typedef void*   ace_private_data_t;
58
59 // --------------- Access requests ---------------------------------------------
60
61 typedef struct
62 {
63     ace_size_t        count;
64     ace_string_t*     items;
65 } ace_feature_list_t;
66
67 typedef struct
68 {
69     ace_string_t name;
70     ace_string_t value;
71 } ace_param_t;
72
73 typedef struct
74 {
75     ace_size_t      count;
76     ace_param_t*    items;
77 } ace_param_list_t;
78
79 typedef struct
80 {
81     ace_string_t     name;
82     ace_param_list_t param_list;
83 } ace_dev_cap_t;
84
85 typedef struct
86 {
87     ace_size_t        count;
88     ace_dev_cap_t*    items;
89 } ace_dev_cap_list_t;
90
91 typedef struct
92 {
93     ace_session_id_t    session_id;         // DEPRECATED will be removed
94     ace_widget_handle_t widget_handle;      // DEPRECATED will be removed
95     ace_feature_list_t  feature_list;
96     ace_dev_cap_list_t  dev_cap_list;
97 } ace_request_t;
98
99 // --------------- Popup data types --------------------------------------------
100
101 /*
102  * Popup types that can be requested to be displayed by ACE
103  */
104 typedef enum
105 {
106     ACE_ONESHOT,
107     ACE_SESSION,
108     ACE_BLANKET
109 } ace_popup_t;
110
111 /*
112  * Validity of answer that can be returned by ACE popup
113  */
114 typedef enum
115 {
116     ACE_ONCE,
117     ACE_PER_SESSION,
118     ACE_ALWAYS
119 } ace_validity_t;
120
121 #ifdef __cplusplus
122 }
123 #endif
124
125 #endif // ACE_API_COMMON_H