revert cd59af8f9aceab2b2cef52ac2fc122cb5e028702
[platform/core/api/efl-util.git] / include / efl_util.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
18 #ifndef __TIZEN_UI_EFL_UTIL_H__
19 #define __TIZEN_UI_EFL_UTIL_H__
20
21 #include <tizen.h>
22 #include <Evas.h>
23
24 #ifdef __cplusplus
25 extern "C" {
26 #endif
27
28 /**
29  * @file efl_util.h
30  */
31
32 /**
33  * @addtogroup CAPI_EFL_UTIL_MODULE
34  * @{
35  */
36
37 /**
38  * @brief Enumeration for EFL UTIL ERROR.
39  * @since_tizen 2.3
40  */
41 typedef enum
42 {
43         EFL_UTIL_ERROR_NONE = TIZEN_ERROR_NONE, /**< Successful */
44         EFL_UTIL_ERROR_INVALID_PARAMETER = TIZEN_ERROR_INVALID_PARAMETER, /**< Invalid parameter */
45         EFL_UTIL_ERROR_OUT_OF_MEMORY = TIZEN_ERROR_OUT_OF_MEMORY, /**< Out of memory */
46         EFL_UTIL_ERROR_PERMISSION_DENIED = TIZEN_ERROR_PERMISSION_DENIED, /**< Permisson denied */
47         EFL_UTIL_ERROR_NOT_SUPPORTED_WINDOW_TYPE = -0x02800000 | 0x01  /**< Window type not supported */
48         //EFL_UTIL_ERROR_NOT_SUPPORTED_WINDOW_TYPE = TIZEN_ERROR_EFL_UTIL | 0x01  /**< Window type not supported */
49 } efl_util_error_e;
50
51 /**
52  * @brief Enumeration of notification window's priority level.
53  * @since_tizen 2.3
54  */
55 typedef enum
56 {
57         EFL_UTIL_NOTIFICATION_LEVEL_1, /**< Default notification level */
58         EFL_UTIL_NOTIFICATION_LEVEL_2, /**< Higher notification level than default */
59         EFL_UTIL_NOTIFICATION_LEVEL_3, /**< The highest notification level */
60 } efl_util_notification_level_e; 
61
62
63 /**
64  * @brief Sets the priority level for the specified notification window, asynchronously.
65  * @since_tizen 2.3
66  * @privlevel public
67  * @privilege %http://tizen.org/privilege/window.priority.set
68  * @remarks This API can be used for a notification type window only.
69  * @param[in] window The EFL window
70  * @param[in] level The notification window level
71  * @return @c 0 on success,
72  *         otherwise a negative error value
73  * @retval #EFL_UTIL_ERROR_NONE Successful
74  * @retval #EFL_UTIL_ERROR_INVALID_PARAMETER Invalid parameter
75  * @retval #EFL_UTIL_ERROR_NOT_SUPPORTED_WINDOW_TYPE Window type not supported
76  */
77 int efl_util_set_notification_window_level (Evas_Object *window, efl_util_notification_level_e level);
78
79
80 /**
81  * @brief Gets the priority level for the specified notification window, asynchronously.
82  * @since_tizen 2.3
83  *
84  * @remarks This API can be used for a notification type window only.
85  * @param[in] window The EFL window
86  * @param[out] level The notification window level
87  * @return @c 0 on success,
88  *         otherwise a negative error value
89  * @retval #EFL_UTIL_ERROR_NONE Successful
90  * @retval #EFL_UTIL_ERROR_INVALID_PARAMETER Invalid parameter
91  * @retval #EFL_UTIL_ERROR_NOT_SUPPORTED_WINDOW_TYPE Window type not supported
92  */
93 int efl_util_get_notification_window_level (Evas_Object *window, efl_util_notification_level_e* level);
94
95
96 /**
97  * @brief Called when an error occurs for setting notification window level
98  * @since_tizen 2.3
99  * @param[in]   window  The EFL window
100  * @param[in]   error_code      The error code (#EFL_UTIL_ERROR_PERMISSION_DENIED)
101  * @param[in]   user_data       The user data passed from the callback registration function
102  * @see efl_util_set_notification_window_level_error_cb()
103  * @see efl_util_unset_notification_window_level_error_cb()
104  */
105 typedef void (*efl_util_notification_window_level_error_cb)(Evas_Object *window, int error_code, void *user_data);
106
107
108 /**
109  * @brief Registers a callback function to be invoked when an error which set the notification level occurs.
110  * @since_tizen 2.3
111  * @param[in] window    The EFL window
112  * @param[in] callback  The callback function to register
113  * @param[in] user_data The user data to be passed to the callback function
114  * @return @c 0 on success,
115  *                 otherwise a negative error value
116  * @retval #EFL_UTIL_ERROR_NONE Successful
117  * @retval #EFL_UTIL_ERROR_INVALID_PARAMETER Invalid parameter
118  * @retval #EFL_UTIL_ERROR_OUT_OF_MEMORY Out of memory
119  * @post  efl_util_notification_window_level_error_cb() will be invoked.
120  * @see efl_util_unset_notification_window_level_error_cb()
121  * @see efl_util_notification_window_level_error_cb()
122  */
123 int efl_util_set_notification_window_level_error_cb(Evas_Object *window, efl_util_notification_window_level_error_cb callback, void *user_data);
124
125
126 /**
127  * @brief Unregisters the callback function.
128  * @since_tizen 2.3
129  * @param[in] window The EFL window
130  * @return @c 0 on success,
131  *                 otherwise a negative error value
132  * @retval #EFL_UTIL_ERROR_NONE Successful
133  * @retval #EFL_UTIL_ERROR_INVALID_PARAMETER Invalid parameter
134  * @see efl_util_set_notification_window_level_error_cb()
135  */
136 int efl_util_unset_notification_window_level_error_cb(Evas_Object *window);
137
138
139 /**
140  * @}
141  */
142
143 #ifdef __cplusplus
144 }
145 #endif
146 #endif                          /* __TIZEN_UI_EFL_UTIL_H__ */