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.
18 #ifndef __TIZEN_UI_EFL_UTIL_H__
19 #define __TIZEN_UI_EFL_UTIL_H__
29 * @addtogroup CAPI_EFL_UTIL_MODULE
33 // Duplicated from utilX.h, should be moved to somewhere common in the future
36 #define KEY_VOLUMEUP "XF86AudioRaiseVolume" /**< this macro means the XKeySym (XServer Key Symbol) corresponds to 'Volume Up' key */
39 #ifndef KEY_VOLUMEDOWN
40 #define KEY_VOLUMEDOWN "XF86AudioLowerVolume" /**< this macro means the XKeySym (XServer Key Symbol) corresponds to 'Volume Down' key */
44 #define KEY_CAMERA "XF86WebCam" /**< this macro means the XKeySym (XServer Key Symbol) corresponds to 'Half-Press of Camera' key */
48 #define KEY_CONFIG "XF86Pictures" /**< this macro means the XKeySym (XServer Key Symbol) corresponds to 'Full-Press of Camera' key */
52 #define KEY_POWER "XF86PowerOff" /**< this macro means the XKeySym (XServer Key Symbol) corresponds to 'Power' key */
56 #define KEY_PAUSE "XF86Standby" /**< this macro means the XKeySym (XServer Key Symbol) corresponds to 'Pause' key */
60 #define KEY_CANCEL "Cancel" /**< this macro means the XKeySym (XServer Key Symbol) corresponds to 'Cancel' key */
63 // Earjack/BT Headset/Multimedia keys
65 #define KEY_PLAYCD "XF86AudioPlay" /**< this macro means the XKeySym (XServer Key Symbol) corresponds to 'Play Audio' key */
69 #define KEY_STOPCD "XF86AudioStop" /**< this macro means the XKeySym (XServer Key Symbol) corresponds to 'Stop Audio' key */
73 #define KEY_PAUSECD "XF86AudioPause" /**< this macro means the XKeySym (XServer Key Symbol) corresponds to 'Pause Audio' key */
77 #define KEY_NEXTSONG "XF86AudioNext" /**< this macro means the XKeySym (XServer Key Symbol) corresponds to 'Next Song' key */
80 #ifndef KEY_PREVIOUSSONG
81 #define KEY_PREVIOUSSONG "XF86AudioPrev" /**< this macro means the XKeySym (XServer Key Symbol) corresponds to 'Previous Song' key */
85 #define KEY_REWIND "XF86AudioRewind" /**< this macro means the XKeySym (XServer Key Symbol) corresponds to 'Rewind Song' key */
88 #ifndef KEY_FASTFORWARD
89 #define KEY_FASTFORWARD "XF86AudioForward" /**< this macro means the XKeySym (XServer Key Symbol) corresponds to 'Forward Song' key */
93 #define KEY_MEDIA "XF86AudioMedia" /**< this macro means the XKeySym (XServer Key Symbol) corresponds to 'Media' key */
98 #define KEY_SEND "XF86Send" /**< this macro means the XKeySym (XServer Key Symbol) corresponds to 'Send' key */
102 #define KEY_SELECT "XF86Phone" /**< this macro means the XKeySym (XServer Key Symbol) corresponds to 'Home' key */
106 #define KEY_END "XF86Stop" /**< this macro means the XKeySym (XServer Key Symbol) corresponds to 'End' key */
109 // Renamed 3-Touch key
111 #define KEY_MENU "XF86Send" /**< this macro means the XKeySym (XServer Key Symbol) corresponds to 'Send' key */
115 #define KEY_HOME "XF86Phone" /**< this macro means the XKeySym (XServer Key Symbol) corresponds to 'Home' key */
119 #define KEY_BACK "XF86Stop" /**< this macro means the XKeySym (XServer Key Symbol) corresponds to 'End' key */
122 #ifndef OR_EXCLUSIVE_GRAB
123 #define OR_EXCLUSIVE_GRAB 0xf00000 /**< this means that the client window will always get the grabbed-key exclusively regardless of the position on the window stack but the grab is overridable by the other client window */
126 #ifndef EXCLUSIVE_GRAB
127 #define EXCLUSIVE_GRAB 0x0f0000 /**< this means that the client window will always get the grabbed-key exclusively regardless of the position on the window stack */
130 #ifndef TOP_POSITION_GRAB
131 #define TOP_POSITION_GRAB 0x00f000 /**< this means that the client window will get the grabbed-key only when on the top of the grabbing-window stack */
135 #define SHARED_GRAB 0x000f00 /**< this means that the client window will get the grabbed-key together with the other client window(s) */
138 #ifndef GRAB_MODE_MASK
139 #define GRAB_MODE_MASK 0xffff00 /**< this mask will be used for getting the key-grab mode of a client window */
142 typedef enum _Efl_Util_Window_Type
144 EFL_UTIL_WINDOW_TYPE_NORMAL = 8, /**< ecore_x compatible, ECORE_X_WINDOW_TYPE_NORMAL */
145 EFL_UTIL_WINDOW_TYPE_NOTIFICATION = 12, /**< ecore_x compatible, ECORE_X_WINDOW_TYPE_NOTIFICATION */
146 } Efl_Util_Window_Type;
148 typedef enum _Efl_Util_Notification_Level
150 EFL_UTIL_NOTIFICATION_LEVEL_LOW, /**< low level notification */
151 EFL_UTIL_NOTIFICATION_LEVEL_NORMAL, /**< normal level notification*/
152 EFL_UTIL_NOTIFICATION_LEVEL_HIGH, /**< high level notification */
153 EFL_UTIL_NOTIFICATION_LEVEL_UNKNOWN
154 } Efl_Util_Notification_Level;
157 * @brief Enumerations of error code for EFL UTIL
161 EFL_UTIL_ERROR_NONE = TIZEN_ERROR_NONE, /**< Successful */
162 EFL_UTIL_ERROR_INVALID_PARAMETER = TIZEN_ERROR_INVALID_PARAMETER, /**< Invalid parameter */
163 EFL_UTIL_ERROR_NOT_SUPPORTED_WINDOW_TYPE = TIZEN_ERROR_APPLICATION_CLASS | 0x08 /**< Not supported window type */
166 // TODO: are we going to have more states than on/off shouldn't we move it to a bool in the API's
167 typedef enum _Efl_Util_Opaque_State
169 EFL_UTIL_OPAQUE_STATE_OFF = 0, /**< Transparent state */
170 EFL_UTIL_OPAQUE_STATE_ON = 1, /**< Opaque state */
171 } Efl_Util_Opaque_State;
174 * @brief Enumeration of notification window's priority level
179 EFL_UTIL_NOTIFICATION_LEVEL_1, /**< Default notification level*/
180 EFL_UTIL_NOTIFICATION_LEVEL_2, /**< Higher notification level than default*/
181 } efl_util_notification_level_e;
183 typedef enum _Efl_Util_Effect_Type
185 EFL_UTIL_EFFECT_TYPE_MAP, /**< Effect for Window's Map Notify Event */
186 EFL_UTIL_EFFECT_TYPE_UNMAP, /**< Effect for Window's UnMap Notify Event */
187 EFL_UTIL_EFFECT_TYPE_RAISEABOVE, /**< Effect for Window's Configure Notify ( RaiseAbove case ) Event */
188 EFL_UTIL_EFFECT_TYPE_ROTATION, /**< Effect for Window's Rotation Property Change Notify Event ( X Property: ECORE_X_ATOM_E_ILLUME_ROTATE_WINDOW_ANGLE ) */
189 EFL_UTIL_EFFECT_TYPE_FOCUSIN, /**< Effect for Window's FocusIn Event ( E17's Event: E_EVENT_BORDER_FOCUS_IN ) */
190 EFL_UTIL_EFFECT_TYPE_FOCUSOUT /**< Effect for Window's FocusOut Event ( E17's Event : E_EVENT_BORDER_FOCUS_OUT ) */
191 } Efl_Util_Effect_Type;
193 typedef enum _Efl_Util_Effect_Style
195 EFL_UTIL_EFFECT_STYLE_DEFAULT, /**< Default Effect Style for Effect Type */
196 EFL_UTIL_EFFECT_STYLE_NONE, /**< None of Effect Style for Effect Type */
197 EFL_UTIL_EFFECT_STYLE_CUSTOM0, /**< Custom0 Effect Style for Effect Type */
198 EFL_UTIL_EFFECT_STYLE_CUSTOM1, /**< Custom1 Effect Style for Effect Type */
199 EFL_UTIL_EFFECT_STYLE_CUSTOM2, /**< Custom2 Effect Style for Effect Type */
200 EFL_UTIL_EFFECT_STYLE_CUSTOM3, /**< Custom3 Effect Style for Effect Type */
201 EFL_UTIL_EFFECT_STYLE_CUSTOM4, /**< Custom4 Effect Style for Effect Type */
202 EFL_UTIL_EFFECT_STYLE_CUSTOM5, /**< Custom5 Effect Style for Effect Type */
203 EFL_UTIL_EFFECT_STYLE_CUSTOM6, /**< Custom6 Effect Style for Effect Type */
204 EFL_UTIL_EFFECT_STYLE_CUSTOM7, /**< Custom7 Effect Style for Effect Type */
205 EFL_UTIL_EFFECT_STYLE_CUSTOM8, /**< Custom8 Effect Style for Effect Type */
206 EFL_UTIL_EFFECT_STYLE_CUSTOM9 /**< Custom9 Effect Style for Effect Type */
207 } Efl_Util_Effect_Style;
210 * @brief Sets the priority level for the specified notification window, asynchronously.
212 * @remark This API can be used for notification type window only
213 * @param [in] window EFL window
214 * @param [in] level The notification window level
215 * @return 0 on success, otherwise a negative error value.
216 * @retval #EFL_UTIL_ERROR_NONE Successful
217 * @retval #EFL_UTIL_ERROR_INVALID_PARAMETER Invalid parameter
218 * @retval #EFL_UTIL_ERROR_NOT_SUPPORTED_WINDOW_TYPE Not supported window type
220 int efl_util_set_notification_window_level (Evas_Object *window, efl_util_notification_level_e level);
224 * @brief Gets the priority level for the specified notification window, asynchronously.
226 * @remark This API can be used for notification type window only
227 * @param [in] window EFL window
228 * @param [out] level The notification window level
229 * @return 0 on success, otherwise a negative error value.
230 * @retval #EFL_UTIL_ERROR_NONE Successful
231 * @retval #EFL_UTIL_ERROR_INVALID_PARAMETER Invalid parameter
232 * @retval #EFL_UTIL_ERROR_NOT_SUPPORTED_WINDOW_TYPE Not supported window type
234 int efl_util_get_notification_window_level (Evas_Object *window, efl_util_notification_level_e* level);
237 * @brief Grabs a key specfied by key_name for obj in grab_mode.
239 * @param obj The Evas_Object representing the window to set the key grab to.
240 * @param key The key of interest.
241 * @param grab_mode EXCLUSIVE_GRAB, TOP_POSITION_GRAB, SHARED_GRAB, EXCLUSIVE_GRAB
243 * @return 0 on Success, fail othrewise.
244 * @see efl_util_ungrab_key()
246 int efl_util_grab_key (Evas_Object *obj, const char* key, int grab_mode);
249 * @brief Ungrabs a key specfied by key_name for win
251 * @param obj The Evas_Object representing the window to ungrab the key.
252 * @param key The key of interest.
254 * @return 0 on Success, fail otherwise.
255 * @see efl_util_grab_key()
257 int efl_util_ungrab_key (Evas_Object *obj, const char* key);
260 * @brief Sets the priority level for the specified notification window
262 * @param obj The Evas_Object representing the window to set the notification level.
263 * @param level The notification level.
265 * @see Efl_Util_Notification_Level
267 void efl_util_set_system_notification_level (Evas_Object *obj, Efl_Util_Notification_Level level);
270 * @brief Gets the priority level for the specified notification window.
272 * @param obj The Evas_Object representing the window to get the system notification level
275 * @return current notication level (EFL_UTIL_NOTIFICATION_LEVEL_LOW,
276 * EFL_UTIL_NOTIFICATION_LEVEL_NORMAL, EFL_UTIL_NOTIFICATION_LEVEL_HIGH)
278 Efl_Util_Notification_Level efl_util_get_system_notification_level (Evas_Object *obj);
281 * @brief Set the functional type of window by sending _NET_WM_WINDOW_TYPE property to window.
283 * @param obj The Evas_Object representing the window to set the net_wm to.
284 * @param type The type to be set.
286 void efl_util_netwm_window_type_set(Evas_Object *obj, Efl_Util_Window_Type type);
289 * @brief Sets a window's effect style with effect type.
291 * @param win The window to set the style to.
292 * @param type type Specifies the window's effect type ( ex. EFL_UTIL_EFFECT_TYPE_MAP, EFL_UTIL_EFFECT_TYPE_UNMAP, etc )
293 * @param style Specifies the window's effect style ( ex. EFL_UTIL_EFFECT_STYLE_DEFAULT, EFL_UTIL_EFFECT_STYLE_NONE, EFL_UTIL_EFFECT_STYLE_CUSTOM0, etc )
295 void efl_util_set_window_effect_style(Evas_Object *win, Efl_Util_Effect_Type type, Efl_Util_Effect_Style style);
298 * @brief Sets the window's opaque state
300 * @param win The window to set the opaque state to.
301 * @param state The state (EFL_UTIL_OPAQUE_STATE_ON, EFL_UTIL_OPAQUE_STATE_OFF).
303 * @return 0 on failure
305 int efl_util_set_window_opaque_state (Evas_Object *win, Efl_Util_Opaque_State state);
314 #endif /* __TIZEN_UI_EFL_UTIL_H__ */