Macros | |
#define | ELM_DISKSELECTOR_CLASS elm_diskselector_class_get() |
Elementary diskselector class. | |
Functions | |
EINA_DEPRECATED void | elm_diskselector_bounce_set (Evas_Object *obj, Eina_Bool h_bounce, Eina_Bool v_bounce) |
Set bouncing behaviour when the scrolled content reaches an edge. More... | |
EINA_DEPRECATED void | elm_diskselector_bounce_get (const Evas_Object *obj, Eina_Bool *h_bounce, Eina_Bool *v_bounce) |
Get the bouncing behaviour of the internal scroller. More... | |
EINA_DEPRECATED void | elm_diskselector_scroller_policy_get (const Evas_Object *obj, Elm_Scroller_Policy *policy_h, Elm_Scroller_Policy *policy_v) |
Get the scrollbar policy. More... | |
EINA_DEPRECATED void | elm_diskselector_scroller_policy_set (Evas_Object *obj, Elm_Scroller_Policy policy_h, Elm_Scroller_Policy policy_v) |
Set the scrollbar policy. More... | |
EOAPI void | elm_obj_diskselector_side_text_max_length_set (Eo *obj, int len) |
Set the side labels max length. More... | |
EOAPI int | elm_obj_diskselector_side_text_max_length_get (const Eo *obj) |
Get the side labels max length. More... | |
EOAPI void | elm_obj_diskselector_round_enabled_set (Eo *obj, Eina_Bool enabled) |
Enable or disable round mode. More... | |
EOAPI Eina_Bool | elm_obj_diskselector_round_enabled_get (const Eo *obj) |
Get a value whether round mode is enabled or not. More... | |
EOAPI void | elm_obj_diskselector_display_item_num_set (Eo *obj, int num) |
Set the number of items to be displayed. More... | |
EOAPI int | elm_obj_diskselector_display_item_num_get (const Eo *obj) |
Get the number of items in the diskselector object. More... | |
EOAPI Elm_Widget_Item * | elm_obj_diskselector_first_item_get (const Eo *obj) |
Get the first item of the diskselector. More... | |
EOAPI const Eina_List * | elm_obj_diskselector_items_get (const Eo *obj) |
Get a list of all the diskselector items. More... | |
EOAPI Elm_Widget_Item * | elm_obj_diskselector_last_item_get (const Eo *obj) |
Get the last item of the diskselector. More... | |
EOAPI Elm_Widget_Item * | elm_obj_diskselector_selected_item_get (const Eo *obj) |
Get the selected item. More... | |
EOAPI Elm_Widget_Item * | elm_obj_diskselector_item_append (Eo *obj, const char *label, Efl_Canvas_Object *icon, Evas_Smart_Cb func, const void *data) |
Appends a new item to the diskselector object. More... | |
EOAPI void | elm_obj_diskselector_clear (Eo *obj) |
Remove all diskselector's items. More... | |
Evas_Object * | elm_diskselector_add (Evas_Object *parent) |
Add a new diskselector widget to the given parent Elementary (container) object. More... | |
EINA_DEPRECATED int | elm_diskselector_side_label_lenght_get (const Evas_Object *obj) |
Get the side labels max length. More... | |
EINA_DEPRECATED void | elm_diskselector_side_label_lenght_set (Evas_Object *obj, int len) |
Set the side labels max length. More... | |
EINA_DEPRECATED void * | elm_diskselector_item_data_get (const Elm_Object_Item *it) |
Get the data associated to the item. More... | |
EINA_DEPRECATED void | elm_diskselector_item_icon_set (Elm_Object_Item *it, Evas_Object *icon) |
Set the icon associated to the item. More... | |
Evas_Object * | elm_diskselector_item_icon_get (const Elm_Object_Item *it) |
Get the icon associated to the item. More... | |
EINA_DEPRECATED void | elm_diskselector_item_label_set (Elm_Object_Item *it, const char *label) |
Set the label of item. More... | |
EINA_DEPRECATED const char * | elm_diskselector_item_label_get (const Elm_Object_Item *it) |
Get the label of item. More... | |
EINA_DEPRECATED void | elm_diskselector_item_del_cb_set (Elm_Object_Item *it, Evas_Smart_Cb func) |
Set the function called when a diskselector item is freed. More... | |
EINA_DEPRECATED void | elm_diskselector_item_del (Elm_Object_Item *it) |
Delete them item from the diskselector. More... | |
EINA_DEPRECATED void | elm_diskselector_item_tooltip_text_set (Elm_Object_Item *it, const char *text) |
Set the text to be shown in the diskselector item. More... | |
EINA_DEPRECATED void | elm_diskselector_item_tooltip_content_cb_set (Elm_Object_Item *it, Elm_Tooltip_Item_Content_Cb func, const void *data, Evas_Smart_Cb del_cb) |
Set the content to be shown in the tooltip item. More... | |
EINA_DEPRECATED void | elm_diskselector_item_tooltip_unset (Elm_Object_Item *it) |
Unset tooltip from item. More... | |
EINA_DEPRECATED void | elm_diskselector_item_tooltip_style_set (Elm_Object_Item *it, const char *style) |
Sets a different style for this item tooltip. More... | |
EINA_DEPRECATED const char * | elm_diskselector_item_tooltip_style_get (const Elm_Object_Item *it) |
Get the style for this item tooltip. More... | |
EINA_DEPRECATED void | elm_diskselector_item_cursor_set (Elm_Object_Item *it, const char *cursor) |
Set the cursor to be shown when mouse is over the diskselector item. More... | |
EINA_DEPRECATED const char * | elm_diskselector_item_cursor_get (const Elm_Object_Item *it) |
Get the cursor to be shown when mouse is over the diskselector item. More... | |
EINA_DEPRECATED void | elm_diskselector_item_cursor_unset (Elm_Object_Item *it) |
Unset the cursor to be shown when mouse is over the diskselector item. More... | |
EINA_DEPRECATED void | elm_diskselector_item_cursor_style_set (Elm_Object_Item *it, const char *style) |
Sets a different style for this item cursor. More... | |
EINA_DEPRECATED const char * | elm_diskselector_item_cursor_style_get (const Elm_Object_Item *it) |
Get the style for this item cursor. More... | |
EINA_DEPRECATED void | elm_diskselector_item_cursor_engine_only_set (Elm_Object_Item *it, Eina_Bool engine_only) |
Set if the cursor set should be searched on the theme or should use the provided by the engine, only. More... | |
EINA_DEPRECATED Eina_Bool | elm_diskselector_item_cursor_engine_only_get (const Elm_Object_Item *it) |
Get the cursor engine only usage for this item cursor. More... | |
A diskselector is a kind of list widget. It scrolls horizontally, and can contain label and icon objects. Three items are displayed with the selected one in the middle.
It can act like a circular list with round mode and labels can be reduced for a defined length for side items.
This widget implements the The Elementary Scrollable Interface interface, so that all (non-deprecated) functions for the base Scroller widget also work for diskselectors.
Some calls on the diskselector's API are marked as deprecated, as they just wrap the scrollable widgets counterpart functions. Use the ones we point you to, for each case of deprecation here, instead – eventually the deprecated ones will be discarded (next major release).
This widget emits the following signals, besides the ones sent from Layout :
"selected"
- when item is selected, i.e. scroller stops. "clicked"
- This is called when a user clicks an item (since 1.8) "scroll,anim,start"
- scrolling animation has started "scroll,anim,stop"
- scrolling animation has stopped "scroll,drag,start"
- dragging the diskselector has started "scroll,drag,stop"
- dragging the diskselector has stopped "focused"
- When the diskselector has received focus. (since 1.8) "unfocused"
- When the diskselector has lost focus. (since 1.8) "language,changed"
- the program's language changed (since 1.9)Available styles for it:
"default"
Default content parts of the diskselector items that you can use for are:
Default text parts of the diskselector items that you can use for are:
Supported elm_object_item common APIs.
List of examples:
EINA_DEPRECATED void elm_diskselector_bounce_set | ( | Evas_Object * | obj, |
Eina_Bool | h_bounce, | ||
Eina_Bool | v_bounce | ||
) |
Set bouncing behaviour when the scrolled content reaches an edge.
Tell the internal scroller object whether it should bounce or not when it reaches the respective edges for each axis.
obj | The diskselector object. |
h_bounce | Whether to bounce or not in the horizontal axis. |
v_bounce | Whether to bounce or not in the vertical axis. |
EINA_DEPRECATED void elm_diskselector_bounce_get | ( | const Evas_Object * | obj, |
Eina_Bool * | h_bounce, | ||
Eina_Bool * | v_bounce | ||
) |
Get the bouncing behaviour of the internal scroller.
Get whether the internal scroller should bounce when the edge of each axis is reached scrolling.
obj | The diskselector object. |
h_bounce | Pointer to store the bounce state of the horizontal axis. |
v_bounce | Pointer to store the bounce state of the vertical axis. |
EINA_DEPRECATED void elm_diskselector_scroller_policy_get | ( | const Evas_Object * | obj, |
Elm_Scroller_Policy * | policy_h, | ||
Elm_Scroller_Policy * | policy_v | ||
) |
Get the scrollbar policy.
obj | The diskselector object. |
policy_h | Pointer to store horizontal scrollbar policy. |
policy_v | Pointer to store vertical scrollbar policy. |
EINA_DEPRECATED void elm_diskselector_scroller_policy_set | ( | Evas_Object * | obj, |
Elm_Scroller_Policy | policy_h, | ||
Elm_Scroller_Policy | policy_v | ||
) |
Set the scrollbar policy.
obj | The diskselector object. |
policy_h | Horizontal scrollbar policy. |
policy_v | Vertical scrollbar policy. |
This sets the scrollbar visibility policy for the given scroller. ELM_SCROLLER_POLICY_AUTO means the scrollbar is made visible if it is needed, and otherwise kept hidden. ELM_SCROLLER_POLICY_ON turns it on all the time, and ELM_SCROLLER_POLICY_OFF always keeps it off. This applies respectively for the horizontal and vertical scrollbars.
The both are disabled by default, i.e., are set to ELM_SCROLLER_POLICY_OFF.
EOAPI void elm_obj_diskselector_side_text_max_length_set | ( | Eo * | obj, |
int | len | ||
) |
Set the side labels max length.
Length is the number of characters of items' label that will be visible when it's set on side positions. It will just crop the string after defined size. E.g.:
An item with label "January" would be displayed on side position as "Jan" if max length is set to 3, or "Janu", if this property is set to 4.
When it's selected, the entire label will be displayed, except for width restrictions. In this case label will be cropped and "..." will be concatenated.
Default side label max length is 3.
This property will be applied over all items, included before or later this function call.
[in] | obj | The object. |
[in] | len | The max length defined for side labels. |
EOAPI int elm_obj_diskselector_side_text_max_length_get | ( | const Eo * | obj | ) |
Get the side labels max length.
See also elm_obj_diskselector_side_text_max_length_set for details.
[in] | obj | The object. |
EOAPI void elm_obj_diskselector_round_enabled_set | ( | Eo * | obj, |
Eina_Bool | enabled | ||
) |
Enable or disable round mode.
Disabled by default. If round mode is enabled the items list will work like a circular list, so when the user reaches the last item, the first one will popup.
See also elm_obj_diskselector_round_enabled_get.
[in] | obj | The object. |
[in] | enabled | true to enable round mode or false to disable it. |
EOAPI Eina_Bool elm_obj_diskselector_round_enabled_get | ( | const Eo * | obj | ) |
Get a value whether round mode is enabled or not.
See also elm_obj_diskselector_round_enabled_set for details.
[in] | obj | The object. |
true
to enable round mode or false
to disable it. EOAPI void elm_obj_diskselector_display_item_num_set | ( | Eo * | obj, |
int | num | ||
) |
Set the number of items to be displayed.
Default value is 3, and also it's the minimum. If num
is less than 3, it will be set to 3.
Also, it can be set on theme, using data item display_item_num
on group "elm/diskselector/item/X", where X is style set.
[in] | obj | The object. |
[in] | num | The number of items the diskselector will display. |
EOAPI int elm_obj_diskselector_display_item_num_get | ( | const Eo * | obj | ) |
Get the number of items in the diskselector object.
[in] | obj | The object. |
EOAPI Elm_Widget_Item * elm_obj_diskselector_first_item_get | ( | const Eo * | obj | ) |
Get the first item of the diskselector.
The list of items follows append order. So it will return the first item appended to the widget that wasn't deleted.
See also elm_obj_diskselector_item_append, elm_obj_diskselector_items_get.
[in] | obj | The object. |
null
if none. EOAPI const Eina_List * elm_obj_diskselector_items_get | ( | const Eo * | obj | ) |
Get a list of all the diskselector items.
See also elm_obj_diskselector_item_append, elm_object_item_del, elm_obj_diskselector_clear.
[in] | obj | The object. |
list
of diskselector items, or ull
on failure. EOAPI Elm_Widget_Item * elm_obj_diskselector_last_item_get | ( | const Eo * | obj | ) |
Get the last item of the diskselector.
The list of items follows append order. So it will return last first item appended to the widget that wasn't deleted.
See also elm_obj_diskselector_item_append, elm_obj_diskselector_items_get.
[in] | obj | The object. |
null
if none. EOAPI Elm_Widget_Item * elm_obj_diskselector_selected_item_get | ( | const Eo * | obj | ) |
Get the selected item.
The selected item can be unselected with elm_obj_diskselector_item_selected_set, and the first item of diskselector will be selected.
The selected item always will be centered on diskselector, with full label displayed, i.e., max length set to side labels won't apply on the selected item. More details on elm_obj_diskselector_side_text_max_length_set.
[in] | obj | The object. |
EOAPI Elm_Widget_Item * elm_obj_diskselector_item_append | ( | Eo * | obj, |
const char * | label, | ||
Efl_Canvas_Object * | icon, | ||
Evas_Smart_Cb | func, | ||
const void * | data | ||
) |
Appends a new item to the diskselector object.
A new item will be created and appended to the diskselector, i.e., will be set as last item. Also, if there is no selected item, it will be selected. This will always happens for the first appended item.
If no icon is set, label will be centered on item position, otherwise the icon will be placed at left of the label, that will be shifted to the right.
Items created with this method can be deleted with elm_object_item_del.
Associated data
can be properly freed when item is deleted if a callback function is set with elm_object_item_del_cb_set.
If a function is passed as argument, it will be called every time this item is selected, i.e., the user stops the diskselector with this item on center position. If such function isn't needed, just passing null
as func
is enough. The same should be done for data
.
See also elm_object_item_del, elm_obj_diskselector_clear, elm_icon_add.
[in] | obj | The object. |
[in] | label | The label of the diskselector item. |
[in] | icon | The icon object to use at left side of the item. An icon can be any Evas object, but usually it is an icon created with elm_icon_add(). |
[in] | func | The function to call when the item is selected. |
[in] | data | The data to associate with the item for related callbacks. |
EOAPI void elm_obj_diskselector_clear | ( | Eo * | obj | ) |
Remove all diskselector's items.
See also elm_object_item_del, elm_obj_diskselector_item_append.
[in] | obj | The object. |
Evas_Object * elm_diskselector_add | ( | Evas_Object * | parent | ) |
Add a new diskselector widget to the given parent Elementary (container) object.
parent | The parent object. |
NULL
, on errors.This function inserts a new diskselector widget on the canvas.
References EINA_SAFETY_ON_NULL_RETURN_VAL.
EINA_DEPRECATED int elm_diskselector_side_label_lenght_get | ( | const Evas_Object * | obj | ) |
Get the side labels max length.
obj | The diskselector object. |
EINA_DEPRECATED void elm_diskselector_side_label_lenght_set | ( | Evas_Object * | obj, |
int | len | ||
) |
Set the side labels max length.
obj | The diskselector object. |
len | The max length defined for side labels. |
EINA_DEPRECATED void * elm_diskselector_item_data_get | ( | const Elm_Object_Item * | it | ) |
Get the data associated to the item.
it | The diskselector item |
it
The return value is a pointer to data associated to item
when it was created, with function elm_diskselector_item_append(). If no data was passed as argument, it will return NULL
.
EINA_DEPRECATED void elm_diskselector_item_icon_set | ( | Elm_Object_Item * | it, |
Evas_Object * | icon | ||
) |
Set the icon associated to the item.
it | The diskselector item |
icon | The icon object to associate with it |
The icon object to use at left side of the item. An icon can be any Evas object, but usually it is an icon created with elm_icon_add().
Once the icon object is set, a previously set one will be deleted.
If an icon was passed as argument on item creation, with function elm_diskselector_item_append(), it will be already associated to the item.
Evas_Object * elm_diskselector_item_icon_get | ( | const Elm_Object_Item * | it | ) |
Get the icon associated to the item.
it | The diskselector item |
it
The return value is a pointer to the icon associated to item
when it was created, with function elm_diskselector_item_append(), or later with function elm_diskselector_item_icon_set. If no icon was passed as argument, it will return NULL
.
EINA_DEPRECATED void elm_diskselector_item_label_set | ( | Elm_Object_Item * | it, |
const char * | label | ||
) |
Set the label of item.
it | The item of diskselector. |
label | The label of item. |
The label to be displayed by the item.
If no icon is set, label will be centered on item position, otherwise the icon will be placed at left of the label, that will be shifted to the right.
An item with label "January" would be displayed on side position as "Jan" if max length is set to 3 with function elm_diskselector_side_label_length_set(), or "Janu", if this property is set to 4.
When this item
is selected, the entire label will be displayed, except for width restrictions. In this case label will be cropped and "..." will be concatenated, but only for display purposes. It will keep the entire string, so if diskselector is resized the remaining characters will be displayed.
If a label was passed as argument on item creation, with function elm_diskselector_item_append(), it will be already displayed by the item.
EINA_DEPRECATED const char * elm_diskselector_item_label_get | ( | const Elm_Object_Item * | it | ) |
Get the label of item.
it | The item of diskselector. |
The return value is a pointer to the label associated to item
when it was created, with function elm_diskselector_item_append(), or later with function elm_diskselector_item_label_set. If no label was passed as argument, it will return NULL
.
EINA_DEPRECATED void elm_diskselector_item_del_cb_set | ( | Elm_Object_Item * | it, |
Evas_Smart_Cb | func | ||
) |
Set the function called when a diskselector item is freed.
it | The item to set the callback on |
func | The function called |
If there is a func
, then it will be called prior item's memory release. That will be called with the following arguments:
This way, a data associated to a diskselector item could be properly freed.
EINA_DEPRECATED void elm_diskselector_item_del | ( | Elm_Object_Item * | it | ) |
Delete them item from the diskselector.
it | The item of diskselector to be deleted. |
If deleting all diskselector items is required, elm_diskselector_clear() should be used instead of getting items list and deleting each one.
EINA_DEPRECATED void elm_diskselector_item_tooltip_text_set | ( | Elm_Object_Item * | it, |
const char * | text | ||
) |
Set the text to be shown in the diskselector item.
it | Target item |
text | The text to set in the content |
Setup the text as tooltip to object. The item can have only one tooltip, so any previous tooltip data is removed.
EINA_DEPRECATED void elm_diskselector_item_tooltip_content_cb_set | ( | Elm_Object_Item * | it, |
Elm_Tooltip_Item_Content_Cb | func, | ||
const void * | data, | ||
Evas_Smart_Cb | del_cb | ||
) |
Set the content to be shown in the tooltip item.
Setup the tooltip to item. The item can have only one tooltip, so any previous tooltip data is removed. func
(with data
) will be called every time that need show the tooltip and it should return a valid Evas_Object. This object is then managed fully by tooltip system and is deleted when the tooltip is gone.
it | the diskselector item being attached a tooltip. |
func | the function used to create the tooltip contents. |
data | what to provide to func as callback data/context. |
del_cb | called when data is not needed anymore, either when another callback replaces func , the tooltip is unset with elm_diskselector_item_tooltip_unset() or the owner item dies. This callback receives as the first parameter the given data, and event_info is the item. |
EINA_DEPRECATED void elm_diskselector_item_tooltip_unset | ( | Elm_Object_Item * | it | ) |
Unset tooltip from item.
it | diskselector item to remove previously set tooltip. |
Remove tooltip from item. The callback provided as del_cb to elm_diskselector_item_tooltip_content_cb_set() will be called to notify it is not used anymore.
EINA_DEPRECATED void elm_diskselector_item_tooltip_style_set | ( | Elm_Object_Item * | it, |
const char * | style | ||
) |
Sets a different style for this item tooltip.
it | diskselector item with tooltip already set. |
style | the theme style to use (default, transparent, ...) |
EINA_DEPRECATED const char * elm_diskselector_item_tooltip_style_get | ( | const Elm_Object_Item * | it | ) |
Get the style for this item tooltip.
it | diskselector item with tooltip already set. |
EINA_DEPRECATED void elm_diskselector_item_cursor_set | ( | Elm_Object_Item * | it, |
const char * | cursor | ||
) |
Set the cursor to be shown when mouse is over the diskselector item.
it | Target item |
cursor | the cursor name to be used. |
EINA_DEPRECATED const char * elm_diskselector_item_cursor_get | ( | const Elm_Object_Item * | it | ) |
Get the cursor to be shown when mouse is over the diskselector item.
it | diskselector item with cursor already set. |
EINA_DEPRECATED void elm_diskselector_item_cursor_unset | ( | Elm_Object_Item * | it | ) |
Unset the cursor to be shown when mouse is over the diskselector item.
it | Target item |
EINA_DEPRECATED void elm_diskselector_item_cursor_style_set | ( | Elm_Object_Item * | it, |
const char * | style | ||
) |
Sets a different style for this item cursor.
it | diskselector item with cursor already set. |
style | the theme style to use (default, transparent, ...) |
EINA_DEPRECATED const char * elm_diskselector_item_cursor_style_get | ( | const Elm_Object_Item * | it | ) |
Get the style for this item cursor.
it | diskselector item with cursor already set. |
NULL
is returned.EINA_DEPRECATED void elm_diskselector_item_cursor_engine_only_set | ( | Elm_Object_Item * | it, |
Eina_Bool | engine_only | ||
) |
Set if the cursor set should be searched on the theme or should use the provided by the engine, only.
it | widget item with cursor already set. |
engine_only | boolean to define if cursors set with elm_diskselector_item_cursor_set() should be searched only between cursors provided by the engine or searched on widget's theme as well. |
EINA_DEPRECATED Eina_Bool elm_diskselector_item_cursor_engine_only_get | ( | const Elm_Object_Item * | it | ) |
Get the cursor engine only usage for this item cursor.
it | widget item with cursor already set. |
EINA_FALSE
is returned.