f06dfcff7da3da9b142644d3dca612d823efb8a6
[framework/security/security-server.git] / ace_popup_validation / include / ace_api_popup_validation.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_popup_validation_api.h
18  * @author      Tomasz Swierczek (t.swierczek@samsung.com)
19  * @version     1.0
20  * @brief       This is C api for Access Control Engine (ACE), popup
21  *              validation library.
22  *
23  */
24
25 #ifndef ACE_API_H
26 #define ACE_API_H
27
28 #include <ace_api_common.h>
29
30 #ifdef __cplusplus
31 extern "C" {
32 #endif
33
34 // --------------- Initialization and deinitialization -------------------------
35
36 /*
37  * Initializes the library.
38  *
39  * Returns error or ACE_OK.
40  */
41 ace_return_t ace_popup_validation_initialize(void);
42
43 /*
44  * Deinitializes the library.
45  *
46  * Returns error or ACE_OK.
47  */
48 ace_return_t ace_popup_validation_shutdown(void);
49
50 // --------------- Popup answer validation API ---------------------------------
51
52 /*
53  * Validation of popup answer. This API must be called by implementation of
54  * UI handler. The call must be made from safe process, specially labelled by
55  * SMACK. If returned value is ACE_OK, 'validation_result' holds validation
56  * result that needs to be passed by UI handler as validation result. Otherwise
57  * value of 'validation_result' is undefined.
58  *
59  * See header ace_api_client.h for more details on where this function needs to
60  * be called and what arguments need to be passed here.
61  *
62  * Returns error or ACE_OK.
63  */
64 ace_return_t ace_validate_answer(ace_bool_t answer,
65                                  ace_validity_t validity,
66                                  const ace_resource_t resource_name,
67                                  const ace_session_id_t session_id,
68                                  const ace_param_list_t* param_list,
69                                  ace_widget_handle_t handle,
70                                  ace_bool_t* validation_result);
71
72 #ifdef __cplusplus
73 }
74 #endif
75
76 #endif // ACE_API_H