An Elementary application has, at all times, one (and only one) focused object. More...
Functions | |
Elm_Focus_Autoscroll_Mode | elm_config_focus_autoscroll_mode_get (void) |
Get focus auto scroll mode. More... | |
void | elm_config_focus_autoscroll_mode_set (Elm_Focus_Autoscroll_Mode mode) |
Set focus auto scroll mode. More... | |
Eina_Bool | elm_config_focus_highlight_enabled_get (void) |
Get the enable status of the focus highlight. More... | |
void | elm_config_focus_highlight_enabled_set (Eina_Bool enable) |
Set the enable status of the focus highlight. More... | |
Eina_Bool | elm_config_focus_highlight_animate_get (void) |
Get the enable status of the focus highlight animation. More... | |
void | elm_config_focus_highlight_animate_set (Eina_Bool animate) |
Set the enable status of the highlight animation. More... | |
Eina_Bool | elm_config_focus_highlight_clip_disabled_get (void) |
Get the disable status of the focus highlight clip feature. More... | |
void | elm_config_focus_highlight_clip_disabled_set (Eina_Bool disable) |
Set the disable status of the focus highlight clip feature. More... | |
Elm_Focus_Move_Policy | elm_config_focus_move_policy_get (void) |
Get the focus movement policy. More... | |
void | elm_config_focus_move_policy_set (Elm_Focus_Move_Policy policy) |
Set elementary focus movement policy. More... | |
Eina_Bool | elm_config_item_select_on_focus_disabled_get (void) |
Get disable status of item select on focus feature. More... | |
void | elm_config_item_select_on_focus_disabled_set (Eina_Bool disabled) |
Set the disable status of the item select on focus feature. More... | |
Eina_Bool | elm_config_first_item_focus_on_first_focusin_get (void) |
Get status of first item focus on first focusin feature. More... | |
void | elm_config_first_item_focus_on_first_focusin_set (Eina_Bool enabled) |
Set the first item focus on first focusin feature. More... | |
Eina_Bool | elm_object_focus_get (const Evas_Object *obj) |
Get the whether an Elementary object has the focus or not. More... | |
void | elm_object_focus_set (Evas_Object *obj, Eina_Bool focus) |
Set/unset focus to a given Elementary object. More... | |
void | elm_object_focus_allow_set (Evas_Object *obj, Eina_Bool enable) |
Set the ability for an Elementary object to be focused. More... | |
Eina_Bool | elm_object_focus_allow_get (const Evas_Object *obj) |
Get whether an Elementary object is focusable or not. More... | |
void | elm_object_focus_custom_chain_set (Evas_Object *obj, Eina_List *objs) |
Set custom focus chain. More... | |
void | elm_object_focus_custom_chain_unset (Evas_Object *obj) |
Unset a custom focus chain on a given Elementary widget. More... | |
const Eina_List * | elm_object_focus_custom_chain_get (const Evas_Object *obj) |
Get custom focus chain. More... | |
void | elm_object_focus_custom_chain_append (Evas_Object *obj, Evas_Object *child, Evas_Object *relative_child) |
Append object to custom focus chain. More... | |
void | elm_object_focus_custom_chain_prepend (Evas_Object *obj, Evas_Object *child, Evas_Object *relative_child) |
Prepend object to custom focus chain. More... | |
void | elm_object_focus_next (Evas_Object *obj, Elm_Focus_Direction dir) |
Give focus to next object in object tree. More... | |
Evas_Object * | elm_object_focus_next_object_get (const Evas_Object *obj, Elm_Focus_Direction dir) |
Get next object which was set with specific focus direction. More... | |
void | elm_object_focus_next_object_set (Evas_Object *obj, Evas_Object *next, Elm_Focus_Direction dir) |
Set next object with specific focus direction. More... | |
Evas_Object * | elm_object_focused_object_get (const Evas_Object *obj) |
Get focused object in object tree. More... | |
void | elm_object_tree_focus_allow_set (Evas_Object *obj, Eina_Bool focusable) |
Make the elementary object and its children to be focusable (or unfocusable). More... | |
Eina_Bool | elm_object_tree_focus_allow_get (const Evas_Object *obj) |
Get whether an Elementary object and its children are focusable or not. More... | |
Eina_Bool | elm_object_focus_highlight_style_set (Evas_Object *obj, const char *style) |
Set the focus highlight style to be used by a given widget. More... | |
const char * | elm_object_focus_highlight_style_get (const Evas_Object *obj) |
Get the focus highlight style to be used by a given widget. More... | |
void | elm_object_focus_move_policy_set (Evas_Object *obj, Elm_Focus_Move_Policy policy) |
Set the focus movement policy to a given Elementary object. More... | |
Elm_Focus_Move_Policy | elm_object_focus_move_policy_get (const Evas_Object *obj) |
Get the focus movement policy from a given Elementary object. More... | |
void | elm_object_focus_region_show_mode_set (Evas_Object *obj, Elm_Focus_Region_Show_Mode mode) |
Set the focus region show mode to a given Elementary object. More... | |
Elm_Focus_Region_Show_Mode | elm_object_focus_region_show_mode_get (const Evas_Object *obj) |
Get the focus region show mode to a given Elementary object. More... | |
Elm_Object_Item * | elm_object_focused_item_get (const Evas_Object *obj) |
Get the focused object item. More... | |
Elm_Object_Item * | elm_object_focus_next_item_get (const Evas_Object *obj, Elm_Focus_Direction dir) |
Get next object item which was set with specific focus direction. More... | |
void | elm_object_focus_next_item_set (Evas_Object *obj, Elm_Object_Item *next_item, Elm_Focus_Direction dir) |
Set next object item with specific focus direction. More... | |
EINA_DEPRECATED void | elm_object_focus (Evas_Object *obj) |
Make a given Elementary object the focused one. More... | |
EINA_DEPRECATED void | elm_object_focus_cycle (Evas_Object *obj, Elm_Focus_Direction dir) |
Give focus to next object in object tree. More... | |
EINA_DEPRECATED void | elm_object_unfocus (Evas_Object *obj) |
Remove the focus from an Elementary object. More... | |
EINA_DEPRECATED void | elm_object_focus_direction_go (Evas_Object *obj, int x, int y) |
Give focus to near object in one direction. More... | |
An Elementary application has, at all times, one (and only one) focused object.
This is what determines where the input events go to within the application's window. Also, focused objects can be decorated differently, in order to signal to the user where the input is, at a given moment.
Elementary applications also have the concept of focus chain: one can cycle through all the windows' focusable objects by input (tab key) or programmatically. The default focus chain for an application is the one define by the order in which the widgets where added in code. One will cycle through top level widgets, and, for each one containing sub-objects, cycle through them all, before returning to the level above. Elementary also allows one to set custom focus chains for their applications.
Besides the focused decoration a widget may exhibit, when it gets focus, Elementary has a global focus highlight object that can be enabled for a window. If one chooses to do so, this extra highlight effect will surround the current focused object, too.
This example contemplates some of these functions.
Elm_Focus_Autoscroll_Mode elm_config_focus_autoscroll_mode_get | ( | void | ) |
Get focus auto scroll mode.
When a region or an item is focused and it resides inside any scroller, elementary will automatically scroll the focused area to the visible viewport.
References _Elm_Config::focus_autoscroll_mode.
void elm_config_focus_autoscroll_mode_set | ( | Elm_Focus_Autoscroll_Mode | mode | ) |
Set focus auto scroll mode.
mode | focus auto scroll mode. This can be one of the Elm_Focus_Autoscroll_Mode enum values. |
When a region or an item is focused and it resides inside any scroller, elementary will automatically scroll the focused area to the visible viewport. Focus auto scroll mode is set to ELM_FOCUS_AUTOSCROLL_MODE_SHOW by default historically.
References EINA_TRUE, and _Elm_Config::focus_autoscroll_mode.
Eina_Bool elm_config_focus_highlight_enabled_get | ( | void | ) |
Get the enable status of the focus highlight.
This gets whether the highlight on focused objects is enabled or not
EINA_TRUE
if the focus highlight is enabled, EINA_FALSE
otherwise.void elm_config_focus_highlight_enabled_set | ( | Eina_Bool | enable | ) |
Set the enable status of the focus highlight.
enable | Enable highlight if EINA_TRUE , disable otherwise |
Set whether to show or not the highlight on focused objects
Note that it will take effect only to Elementary windows created after this is called.
References EINA_TRUE.
Eina_Bool elm_config_focus_highlight_animate_get | ( | void | ) |
Get the enable status of the focus highlight animation.
EINA_TRUE
if the focus highlight animation is enabled, EINA_FALSE
otherwise.Get whether the focus highlight, if enabled, will animate its switch from one object to the next
void elm_config_focus_highlight_animate_set | ( | Eina_Bool | animate | ) |
Set the enable status of the highlight animation.
animate | Enable animation if EINA_TRUE , disable otherwise |
Set whether the focus highlight, if enabled, will animate its switch from one object to the next
Note that it will take effect only to Elementary windows created after this is called.
References EINA_TRUE.
Eina_Bool elm_config_focus_highlight_clip_disabled_get | ( | void | ) |
Get the disable status of the focus highlight clip feature.
Get whether the focus highlight clip feature is disabled. If disabled return EINA_TRUE
, else return EINA_FALSE
. If the return is EINA_TRUE
, focus highlight clip feature is not disabled so the focus highlight can be clipped.
References _Elm_Config::focus_highlight_clip_disable.
void elm_config_focus_highlight_clip_disabled_set | ( | Eina_Bool | disable | ) |
Set the disable status of the focus highlight clip feature.
disable | Disable focus highlight clip feature if EINA_TRUE , enable it otherwise. |
References EINA_TRUE, and _Elm_Config::focus_highlight_clip_disable.
Elm_Focus_Move_Policy elm_config_focus_move_policy_get | ( | void | ) |
Get the focus movement policy.
Get how the focus is moved to another object. It can be ELM_FOCUS_MOVE_POLICY_CLICK or ELM_FOCUS_MOVE_POLICY_IN. The first means elementary focus is moved on elementary object click. The second means elementary focus is moved on elementary object mouse in.
References _Elm_Config::focus_move_policy.
void elm_config_focus_move_policy_set | ( | Elm_Focus_Move_Policy | policy | ) |
Set elementary focus movement policy.
policy | A policy to apply for the focus movement |
References EINA_TRUE, and _Elm_Config::focus_move_policy.
Eina_Bool elm_config_item_select_on_focus_disabled_get | ( | void | ) |
Get disable status of item select on focus feature.
References _Elm_Config::item_select_on_focus_disable.
void elm_config_item_select_on_focus_disabled_set | ( | Eina_Bool | disabled | ) |
Set the disable status of the item select on focus feature.
disabled | Disable item select on focus if EINA_TRUE , enable otherwise |
References EINA_TRUE, and _Elm_Config::item_select_on_focus_disable.
Eina_Bool elm_config_first_item_focus_on_first_focusin_get | ( | void | ) |
Get status of first item focus on first focusin feature.
References _Elm_Config::first_item_focus_on_first_focus_in.
void elm_config_first_item_focus_on_first_focusin_set | ( | Eina_Bool | enabled | ) |
Set the first item focus on first focusin feature.
enabled | first_item_focus_on_first_focusin if EINA_TRUE , enable otherwise |
References EINA_TRUE, and _Elm_Config::first_item_focus_on_first_focus_in.
Eina_Bool elm_object_focus_get | ( | const Evas_Object * | obj | ) |
Get the whether an Elementary object has the focus or not.
obj | The Elementary object to get the information from |
EINA_TRUE
, if the object is focused, EINA_FALSE
if not (and on errors).References EINA_FALSE, and evas_object_focus_get().
void elm_object_focus_set | ( | Evas_Object * | obj, |
Eina_Bool | focus | ||
) |
Set/unset focus to a given Elementary object.
obj | The Elementary object to operate on. |
focus | EINA_TRUE Set focus to a given object, EINA_FALSE Unset focus to a given object. |
obj
, passing it back to the previous element in the focus chain list.References elm_win_inlined_image_object_get(), and evas_object_focus_set().
void elm_object_focus_allow_set | ( | Evas_Object * | obj, |
Eina_Bool | enable | ||
) |
Set the ability for an Elementary object to be focused.
obj | The Elementary object to operate on |
enable | EINA_TRUE if the object can be focused, EINA_FALSE if not (and on errors) |
This sets whether the object obj
is able to take focus or not. Unfocusable objects do nothing when programmatically focused, being the nearest focusable parent object the one really getting focus. Also, when they receive mouse input, they will get the event, but not take away the focus from where it was previously.
References EINA_SAFETY_ON_NULL_RETURN.
Eina_Bool elm_object_focus_allow_get | ( | const Evas_Object * | obj | ) |
Get whether an Elementary object is focusable or not.
obj | The Elementary object to operate on |
EINA_TRUE
if the object is allowed to be focused, EINA_FALSE
if not (and on errors)References EINA_FALSE, and EINA_SAFETY_ON_NULL_RETURN_VAL.
void elm_object_focus_custom_chain_set | ( | Evas_Object * | obj, |
Eina_List * | objs | ||
) |
Set custom focus chain.
This function overwrites any previous custom focus chain within the list of objects. The previous list will be deleted and this list will be managed by elementary. After it is set, don't modify it.
obj | The container object |
objs | Chain of objects to pass focus |
void elm_object_focus_custom_chain_unset | ( | Evas_Object * | obj | ) |
Unset a custom focus chain on a given Elementary widget.
obj | The container object to remove focus chain from |
Any focus chain previously set on obj
(for its child objects) is removed entirely after this call.
const Eina_List * elm_object_focus_custom_chain_get | ( | const Evas_Object * | obj | ) |
Get custom focus chain.
obj | The container object |
void elm_object_focus_custom_chain_append | ( | Evas_Object * | obj, |
Evas_Object * | child, | ||
Evas_Object * | relative_child | ||
) |
Append object to custom focus chain.
obj | The container object |
child | The child to be added in custom chain |
relative_child | The relative object to position the child |
References eina_list_append_relative(), and eina_list_clone().
void elm_object_focus_custom_chain_prepend | ( | Evas_Object * | obj, |
Evas_Object * | child, | ||
Evas_Object * | relative_child | ||
) |
Prepend object to custom focus chain.
obj | The container object |
child | The child to be added in custom chain |
relative_child | The relative object to position the child |
References eina_list_clone(), and eina_list_prepend_relative().
void elm_object_focus_next | ( | Evas_Object * | obj, |
Elm_Focus_Direction | dir | ||
) |
Give focus to next object in object tree.
Give focus to next object in focus chain of one object sub-tree. If the last object of chain already have focus, the focus will go to the first object of chain.
obj | The object root of sub-tree |
dir | Direction to move the focus |
References eina_array_count(), eina_array_data_get(), eina_array_free(), eina_array_pop(), EINA_FALSE, EINA_SAFETY_ON_FALSE_RETURN, EINA_TRUE, elm_object_focused_object_get(), elm_object_top_widget_get(), and ERR.
Referenced by elm_object_focus_cycle().
Evas_Object * elm_object_focus_next_object_get | ( | const Evas_Object * | obj, |
Elm_Focus_Direction | dir | ||
) |
Get next object which was set with specific focus direction.
Get next object which was set by elm_object_focus_next_object_set with specific focus direction.
obj | The Elementary object |
dir | Focus direction |
NULL
, if there is no focus next object.References EINA_FALSE, and elm_object_top_widget_get().
void elm_object_focus_next_object_set | ( | Evas_Object * | obj, |
Evas_Object * | next, | ||
Elm_Focus_Direction | dir | ||
) |
Set next object with specific focus direction.
When focus next object is set with specific focus direction, this object will be the first candidate when finding next focusable object. Focus next object can be registered with six directions that are previous, next, up, down, right, and left.
obj | The Elementary object |
next | Focus next object |
dir | Focus direction |
References EINA_SAFETY_ON_FALSE_RETURN.
Evas_Object * elm_object_focused_object_get | ( | const Evas_Object * | obj | ) |
Get focused object in object tree.
This function returns current focused object in one object sub-tree.
obj | The object root of sub-tree |
NULL
, if there is no focused object.References ELM_GENGRID_CLASS, ELM_GENLIST_CLASS, elm_object_top_widget_get(), and ELM_TOOLBAR_CLASS.
Referenced by elm_object_focus_next().
void elm_object_tree_focus_allow_set | ( | Evas_Object * | obj, |
Eina_Bool | focusable | ||
) |
Make the elementary object and its children to be focusable (or unfocusable).
obj | The Elementary object to operate on |
focusable | EINA_TRUE for focusable, EINA_FALSE for unfocusable. |
This sets whether the object obj
and its children objects are able to take focus or not. If the tree is set as unfocusable, newest focused object which is not in this tree will get focus. This API can be helpful for an object to be deleted. When an object will be deleted soon, it and its children may not want to get focus (by focus reverting or by other focus controls). Then, just use this API before deleting.
References EINA_SAFETY_ON_NULL_RETURN.
Eina_Bool elm_object_tree_focus_allow_get | ( | const Evas_Object * | obj | ) |
Get whether an Elementary object and its children are focusable or not.
obj | The Elementary object to get the information from |
EINA_TRUE
, if the tree is focusable, EINA_FALSE
if not (and on errors).References EINA_FALSE, and EINA_SAFETY_ON_NULL_RETURN_VAL.
Eina_Bool elm_object_focus_highlight_style_set | ( | Evas_Object * | obj, |
const char * | style | ||
) |
Set the focus highlight style to be used by a given widget.
obj | The Elementary widget for which focus style needs to be set. |
style | The name of the focus style to use on it. |
EINA_TRUE
on success, EINA_FALSE
otherwise.References EINA_FALSE, EINA_SAFETY_ON_NULL_RETURN_VAL, and elm_win_focus_highlight_style_set().
const char * elm_object_focus_highlight_style_get | ( | const Evas_Object * | obj | ) |
Get the focus highlight style to be used by a given widget.
obj | The Elementary widget to query for its focus highlight style. |
References EINA_SAFETY_ON_NULL_RETURN_VAL, and elm_win_focus_highlight_style_get().
void elm_object_focus_move_policy_set | ( | Evas_Object * | obj, |
Elm_Focus_Move_Policy | policy | ||
) |
Set the focus movement policy to a given Elementary object.
obj | The Elementary object to operate on |
policy | A policy to apply for the focus movement |
References EINA_SAFETY_ON_NULL_RETURN.
Elm_Focus_Move_Policy elm_object_focus_move_policy_get | ( | const Evas_Object * | obj | ) |
Get the focus movement policy from a given Elementary object.
obj | The Elementary widget to get the information from |
Get how the focus is moved to the give Elementary object. It can be ELM_FOCUS_MOVE_POLICY_CLICK, ELM_FOCUS_MOVE_POLICY_IN, or ELM_FOCUS_MOVE_POLICY_KEY_ONLY. The first means elementary focus is moved on elementary object click. The second means elementary focus is moved on elementary object mouse in. The last means elementary focus is moved only by key input like Left, Right, Up, Down, Tab, or Shift+Tab.
References EINA_FALSE, and EINA_SAFETY_ON_NULL_RETURN_VAL.
void elm_object_focus_region_show_mode_set | ( | Evas_Object * | obj, |
Elm_Focus_Region_Show_Mode | mode | ||
) |
Set the focus region show mode to a given Elementary object.
obj | The Elementary object to operate on |
mode | A mode to show the focus region |
When the focus is move to the object in scroller, it is scrolled to show the focus region as a widget. If the focus region want to be shown as an item, set the mode ELM_FOCUS_REGION_SHOW_ITEM. If then, it will be scrolled as an item.
This API is only implemented for Elm_Gengrid widgets. Every other widgets will always automatically show the widget.
References ELM_GENGRID_CLASS, and _Elm_Gengrid_Data::mode.
Elm_Focus_Region_Show_Mode elm_object_focus_region_show_mode_get | ( | const Evas_Object * | obj | ) |
Get the focus region show mode to a given Elementary object.
obj | The Elementary object to get the information from |
References ELM_FOCUS_REGION_SHOW_WIDGET, ELM_GENGRID_CLASS, and _Elm_Gengrid_Data::mode.
Elm_Object_Item * elm_object_focused_item_get | ( | const Evas_Object * | obj | ) |
Get the focused object item.
This returns the focused object item.
obj | The container object |
NULL
if noneThe focused item can be unfocused with function elm_object_item_focus_set().
References EINA_SAFETY_ON_NULL_RETURN_VAL.
Elm_Object_Item * elm_object_focus_next_item_get | ( | const Evas_Object * | obj, |
Elm_Focus_Direction | dir | ||
) |
Get next object item which was set with specific focus direction.
Get next object item which was set by elm_object_focus_next_item_set with specific focus direction.
obj | The Elementary object |
dir | Focus direction |
NULL
, if there is no focus next object item.void elm_object_focus_next_item_set | ( | Evas_Object * | obj, |
Elm_Object_Item * | next_item, | ||
Elm_Focus_Direction | dir | ||
) |
Set next object item with specific focus direction.
When focus next object item is set with specific focus direction, this object item will be the first candidate when finding next focusable object or item. If the focus next object item is set, it is preference to focus next object. Focus next object item can be registered with six directions that are previous, next, up, down, right, and left.
obj | The Elementary object |
next_item | Focus next object item |
dir | Focus direction |
EINA_DEPRECATED void elm_object_focus | ( | Evas_Object * | obj | ) |
Make a given Elementary object the focused one.
obj | The Elementary object to make focused. |
EINA_DEPRECATED void elm_object_focus_cycle | ( | Evas_Object * | obj, |
Elm_Focus_Direction | dir | ||
) |
Give focus to next object in object tree.
Give focus to next object in focus chain of one object sub-tree. If the last object of chain already have focus, the focus will go to the first object of chain.
obj | The object root of sub-tree |
dir | Direction to cycle the focus |
References elm_object_focus_next().
EINA_DEPRECATED void elm_object_unfocus | ( | Evas_Object * | obj | ) |
Remove the focus from an Elementary object.
obj | The Elementary to take focus from |
This removes the focus from obj
, passing it back to the previous element in the focus chain list.
EINA_DEPRECATED void elm_object_focus_direction_go | ( | Evas_Object * | obj, |
int | x, | ||
int | y | ||
) |
Give focus to near object in one direction.
Give focus to near object in direction of one object. If none focusable object in given direction, the focus will not change.
obj | The reference object |
x | Horizontal component of direction to focus |
y | Vertical component of direction to focus |