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_settings.h
18 * @author Tomasz Swierczek (t.swierczek@samsung.com)
20 * @brief This is header for ACE settings API (RW part).
23 #ifndef ACE_API_SETTINGS_H
24 #define ACE_API_SETTINGS_H
26 #include <ace_api_common.h>
33 * API defined in this header should be used only from one thread. If used
34 * otherwise, unexpected behaviour may occur, including segmentation faults and
35 * escalation of global warming. Be warned.
38 // --------------- Initialization ----------------------------------------------
41 * Initializes ACE - connects (RW) to the database. Must be called only once.
42 * Returns ACE_OK or error
44 ace_return_t ace_settings_initialize(void);
47 * Deinitializes ACE - deinitialize internal structures, detach DB, etc.
48 * Must be called only once.
49 * Returns ACE_OK or error
51 ace_return_t ace_settings_shutdown(void);
53 // --------------- Resource settings API ---------------------------------------
56 * Order and values of enum constants are part of API
60 ACE_PREFERENCE_PERMIT,
62 ACE_PREFERENCE_DEFAULT, // means: not set
63 ACE_PREFERENCE_BLANKET_PROMPT,
64 ACE_PREFERENCE_SESSION_PROMPT,
65 ACE_PREFERENCE_ONE_SHOT_PROMPT
69 * Returns error or ACE_OK
70 * If return value is ACE_OK, 'prerefence' value is the queried one, otherwise
71 * 'preference' value is undefined
73 ace_return_t ace_get_widget_resource_preference(ace_widget_handle_t handle,
74 const ace_resource_t resource,
75 ace_preference_t* preference);
78 * Returns error or ACE_OK
79 * If return value is ACE_OK, 'prerefence' value is the queried one, otherwise
80 * 'preference' value is undefined
82 ace_return_t ace_get_global_resource_preference(const ace_resource_t resource,
83 ace_preference_t* preference);
86 * To reset setting, pass ACE_PREFERENCE_DEFAULT
87 * Returns error or ACE_OK
89 ace_return_t ace_set_widget_resource_preference(ace_widget_handle_t handle,
90 const ace_resource_t resource,
91 ace_preference_t preference);
94 * To reset setting, pass ACE_PREFERENCE_DEFAULT
95 * Returns error or ACE_OK
97 ace_return_t ace_set_global_resource_preference(const ace_resource_t resource,
98 ace_preference_t preference);
101 * Resets per widget resource settings to ACE_PREFERENCE_DEFAULT
103 ace_return_t ace_reset_widget_resource_settings(void);
106 * Resets global resource settings to ACE_PREFERENCE_DEFAULT
108 ace_return_t ace_reset_global_resource_settings(void);
111 * After execution, is_privacy_api is ACE_TRUE if resource_name is the name
114 ace_return_t ace_is_private_api(const ace_resource_t resource_name,
115 ace_bool_t* is_private_api);
121 #endif // ACE_API_SETTINGS_H