2 * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
17 * @file ace_api_setup.h
18 * @author Tomasz Swierczek (t.swierczek@samsung.com)
20 * @brief This is C api for Access Control Engine (ACE), installer mode
28 #include <ace_api_common.h>
35 * API defined in this header should be used only from one thread. If used
36 * otherwise, unexpected behaviour may occur, including segmentation faults and
37 * escalation of global warming. Be warned.
40 // --------------- Initialization and policy update ----------------------------
43 * Initializes ACE - connects (RW) to the database. Must be called only once.
44 * Returns ACE_OK or error
46 ace_return_t ace_install_initialize(void);
49 * Deinitializes ACE - deinitialize internal structures, detach DB, etc.
50 * Must be called only once.
51 * Returns ACE_OK or error
53 ace_return_t ace_install_shutdown(void);
56 * Updates policy - parses XML files from known locations (reason for no arguments),
57 * also clears policy and prompt caches.
58 * Returns ACE_OK or error
60 ace_return_t ace_update_policy(void);
62 // --------------- Requested device capabilities API for installer -------------
66 ace_string_t device_capability;
67 ace_bool_t smack_granted;
68 } ace_requested_dev_cap_t;
73 ace_requested_dev_cap_t* items;
74 } ace_requested_dev_cap_list_t;
77 * Deletes data allocated by ace_get_requested_dev_caps - a helper function
79 ace_return_t ace_free_requested_dev_caps(ace_requested_dev_cap_list_t* caps);
82 * Returns ACE_OK or error; 'caps' will hold device capabilities information.
83 * To free allcated resources in 'caps', use ace_free_requested_dev_caps
85 ace_return_t ace_get_requested_dev_caps(ace_widget_handle_t handle,
86 ace_requested_dev_cap_list_t* caps);
89 * Returns error or ACE_OK
91 ace_return_t ace_set_requested_dev_caps(ace_widget_handle_t handle,
92 const ace_requested_dev_cap_list_t* caps);
94 // ---------------- Accepted Api featuresk API for installer ----------------
97 ace_return_t ace_set_accepted_feature(ace_widget_handle_t handle,
98 const ace_feature_list_t* flist);
100 ace_return_t ace_rem_accepted_feature(ace_widget_handle_t handle);
102 // --------------- Widget data setup for installation --------------------------
111 * Sets widget type. Use in installer to determine which policy will be used
112 * by ACE for this widget.
113 * Returns error or ACE_OK
115 ace_return_t ace_set_widget_type(ace_widget_handle_t handle,
116 ace_widget_type_t type);
119 * Gets widget type in 'type'. Use in installer to determine which policy will be used
120 * by ACE for this widget.
121 * Returns error or ACE_OK
123 ace_return_t ace_get_widget_type(ace_widget_handle_t handle,
124 ace_widget_type_t* type);
126 // --------------- Installation time policy check ------------------------------
134 } ace_policy_result_t;
137 * Gets current policy evaluation for given device capability and given widget.
138 * Returns error or ACE_OK
140 ace_return_t ace_get_policy_result(const ace_resource_t,
141 ace_widget_handle_t handle,
142 ace_policy_result_t* result);