- Elementary
- Main
- Authors
- Examples
- Files
- Pages
- Types
- Modules

Macros | Functions
Diskselector

## Macros
#define | elm_obj_diskselector_round_enabled_set(enabled) ELM_OBJ_DISKSELECTOR_ID(ELM_OBJ_DISKSELECTOR_SUB_ID_ROUND_ENABLED_SET), EO_TYPECHECK(Eina_Bool, enabled)
#define | elm_obj_diskselector_side_text_max_length_get(ret) ELM_OBJ_DISKSELECTOR_ID(ELM_OBJ_DISKSELECTOR_SUB_ID_SIDE_TEXT_MAX_LENGTH_GET), EO_TYPECHECK(int *, ret)
#define | elm_obj_diskselector_side_text_max_length_set(len) ELM_OBJ_DISKSELECTOR_ID(ELM_OBJ_DISKSELECTOR_SUB_ID_SIDE_TEXT_MAX_LENGTH_SET), EO_TYPECHECK(int, len)
#define | elm_obj_diskselector_clear() ELM_OBJ_DISKSELECTOR_ID(ELM_OBJ_DISKSELECTOR_SUB_ID_CLEAR)
#define | elm_obj_diskselector_items_get(ret) ELM_OBJ_DISKSELECTOR_ID(ELM_OBJ_DISKSELECTOR_SUB_ID_ITEMS_GET), EO_TYPECHECK(const Eina_List **, ret)
#define | elm_obj_diskselector_item_append(label, icon, func, data, ret) ELM_OBJ_DISKSELECTOR_ID(ELM_OBJ_DISKSELECTOR_SUB_ID_ITEM_APPEND), EO_TYPECHECK(const char *, label), EO_TYPECHECK(Evas_Object *, icon), EO_TYPECHECK(Evas_Smart_Cb, func), EO_TYPECHECK(const void *, data), EO_TYPECHECK(Elm_Object_Item **, ret)
#define | elm_obj_diskselector_selected_item_get(ret) ELM_OBJ_DISKSELECTOR_ID(ELM_OBJ_DISKSELECTOR_SUB_ID_SELECTED_ITEM_GET), EO_TYPECHECK(Elm_Object_Item **, ret)
#define | elm_obj_diskselector_first_item_get(ret) ELM_OBJ_DISKSELECTOR_ID(ELM_OBJ_DISKSELECTOR_SUB_ID_FIRST_ITEM_GET), EO_TYPECHECK(Elm_Object_Item **, ret)
#define | elm_obj_diskselector_last_item_get(ret) ELM_OBJ_DISKSELECTOR_ID(ELM_OBJ_DISKSELECTOR_SUB_ID_LAST_ITEM_GET), EO_TYPECHECK(Elm_Object_Item **, ret)
#define | elm_obj_diskselector_display_item_num_set(num) ELM_OBJ_DISKSELECTOR_ID(ELM_OBJ_DISKSELECTOR_SUB_ID_DISPLAY_ITEM_NUM_SET), EO_TYPECHECK(int, num)
#define | elm_obj_diskselector_display_item_num_get(ret) ELM_OBJ_DISKSELECTOR_ID(ELM_OBJ_DISKSELECTOR_SUB_ID_DISPLAY_ITEM_NUM_GET), EO_TYPECHECK(int *, ret)

## 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...
void | elm_diskselector_item_selected_set (Elm_Object_Item *it, Eina_Bool selected)
| Set the selected state of an item. More...
Elm_Object_Item * | elm_diskselector_item_prev_get (const Elm_Object_Item *it)
| Get the item before `item` in diskselector. More...
Elm_Object_Item * | elm_diskselector_item_next_get (const Elm_Object_Item *it)
| Get the item after `item` in diskselector. More...
Evas_Object * | elm_diskselector_add (Evas_Object *parent)
| Add a new diskselector widget to the given parent Elementary (container) object. More...
Eina_Bool | elm_diskselector_round_enabled_get (const Evas_Object *obj)
| Get a value whether round mode is enabled or not. More...
void | elm_diskselector_round_enabled_set (Evas_Object *obj, Eina_Bool enabled)
| Enable or disable round mode. More...
int | elm_diskselector_side_text_max_length_get (const Evas_Object *obj)
| Get the side labels max length. More...
void | elm_diskselector_side_text_max_length_set (Evas_Object *obj, int len)
| Set the side labels max length. More...
void | elm_diskselector_clear (Evas_Object *obj)
| Remove all diskselector's items. More...
const Eina_List * | elm_diskselector_items_get (const Evas_Object *obj)
| Get a list of all the diskselector items. More...
Elm_Object_Item * | elm_diskselector_item_append (Evas_Object *obj, const char *label, Evas_Object *icon, Evas_Smart_Cb func, const void *data)
| Appends a new item to the diskselector object. More...
Elm_Object_Item * | elm_diskselector_selected_item_get (const Evas_Object *obj)
| Get the selected item. More...
Elm_Object_Item * | elm_diskselector_first_item_get (const Evas_Object *obj)
| Get the first item of the diskselector. More...
Elm_Object_Item * | elm_diskselector_last_item_get (const Evas_Object *obj)
| Get the last item of the diskselector. More...
void | elm_diskselector_display_item_num_set (Evas_Object *obj, int num)
| Set the number of items to be displayed. More...
int | elm_diskselector_display_item_num_get (const Evas_Object *obj)
| Get the number of items in the diskselector object. More...

## Detailed Description

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 elm-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)

Note
  The "scroll,anim,*" and "scroll,drag,*" signals are only emitted by user intervention.

Available styles for it:

- `"default"`

Default content parts of the diskselector items that you can use for are:

- "icon" - An icon in the diskselector item

Default text parts of the diskselector items that you can use for are:

- "default" - Label of the diskselector item

Supported elm_object_item common APIs.

- elm_object_item_del
- elm_object_item_part_text_set
- elm_object_item_part_text_get
- elm_object_item_part_content_set
- elm_object_item_part_content_get

List of examples:

- Diskselector widget example
- Diskselector - Items management

## Macro Definition Documentation

#define elm_obj_diskselector_clear | ( |  | ) | ELM_OBJ_DISKSELECTOR_ID(ELM_OBJ_DISKSELECTOR_SUB_ID_CLEAR)

Since
  1.8

Remove all diskselector's items.

See Also
  elm_diskselector_clear

Referenced by elm_diskselector_clear().

#define elm_obj_diskselector_display_item_num_get | ( |  | ret | ) | ELM_OBJ_DISKSELECTOR_ID(ELM_OBJ_DISKSELECTOR_SUB_ID_DISPLAY_ITEM_NUM_GET), EO_TYPECHECK(int *, ret)

Since
  1.8

Get the number of items in the diskselector object.

Parameters

  [out] | ret |

See Also
  elm_diskselector_display_item_num_get

Referenced by elm_diskselector_display_item_num_get().

#define elm_obj_diskselector_display_item_num_set | ( |  | num | ) | ELM_OBJ_DISKSELECTOR_ID(ELM_OBJ_DISKSELECTOR_SUB_ID_DISPLAY_ITEM_NUM_SET), EO_TYPECHECK(int, num)

Since
  1.8

Set the number of items to be displayed.

Parameters

  [in] | num |

See Also
  elm_diskselector_display_item_num_set

Referenced by elm_diskselector_display_item_num_set().

#define elm_obj_diskselector_first_item_get | ( |  | ret | ) | ELM_OBJ_DISKSELECTOR_ID(ELM_OBJ_DISKSELECTOR_SUB_ID_FIRST_ITEM_GET), EO_TYPECHECK(Elm_Object_Item **, ret)

Since
  1.8

Get the first item of the diskselector.

Parameters

  [out] | ret |

See Also
  elm_diskselector_first_item_get

Referenced by elm_diskselector_first_item_get().

#define elm_obj_diskselector_item_append | ( |  | label,
|  |  | icon,
|  |  | func,
|  |  | data,
|  |  | ret
| ) |  | ELM_OBJ_DISKSELECTOR_ID(ELM_OBJ_DISKSELECTOR_SUB_ID_ITEM_APPEND), EO_TYPECHECK(const char *, label), EO_TYPECHECK(Evas_Object *, icon), EO_TYPECHECK(Evas_Smart_Cb, func), EO_TYPECHECK(const void *, data), EO_TYPECHECK(Elm_Object_Item **, ret)

Since
  1.8

Appends a new item to the diskselector object.

Parameters

  [in] | label |
  [in] | icon |
  [in] | func |
  [in] | data |
  [out] | ret |

See Also
  elm_diskselector_item_append

Referenced by elm_diskselector_item_append().

#define elm_obj_diskselector_items_get | ( |  | ret | ) | ELM_OBJ_DISKSELECTOR_ID(ELM_OBJ_DISKSELECTOR_SUB_ID_ITEMS_GET), EO_TYPECHECK(const Eina_List **, ret)

Since
  1.8

Get a list of all the diskselector items.

Parameters

  [out] | ret |

See Also
  elm_diskselector_items_get

Referenced by elm_diskselector_items_get().

#define elm_obj_diskselector_last_item_get | ( |  | ret | ) | ELM_OBJ_DISKSELECTOR_ID(ELM_OBJ_DISKSELECTOR_SUB_ID_LAST_ITEM_GET), EO_TYPECHECK(Elm_Object_Item **, ret)

Since
  1.8

Get the last item of the diskselector.

Parameters

  [out] | ret |

See Also
  elm_diskselector_last_item_get

Referenced by elm_diskselector_last_item_get().

#define elm_obj_diskselector_round_enabled_set | ( |  | enabled | ) | ELM_OBJ_DISKSELECTOR_ID(ELM_OBJ_DISKSELECTOR_SUB_ID_ROUND_ENABLED_SET), EO_TYPECHECK(Eina_Bool, enabled)

Since
  1.8

Enable or disable round mode.

Parameters

  [in] | enabled |

See Also
  elm_diskselector_round_enabled_set

Referenced by elm_diskselector_round_enabled_set().

#define elm_obj_diskselector_selected_item_get | ( |  | ret | ) | ELM_OBJ_DISKSELECTOR_ID(ELM_OBJ_DISKSELECTOR_SUB_ID_SELECTED_ITEM_GET), EO_TYPECHECK(Elm_Object_Item **, ret)

Since
  1.8

Get the selected item.

Parameters

  [out] | ret |

See Also
  elm_diskselector_selected_item_get

Referenced by elm_diskselector_selected_item_get().

#define elm_obj_diskselector_side_text_max_length_get | ( |  | ret | ) | ELM_OBJ_DISKSELECTOR_ID(ELM_OBJ_DISKSELECTOR_SUB_ID_SIDE_TEXT_MAX_LENGTH_GET), EO_TYPECHECK(int *, ret)

Since
  1.8

Get the side labels max length.

Parameters

  [out] | ret |

See Also
  elm_diskselector_side_text_max_length_get

Referenced by elm_diskselector_side_text_max_length_get().

#define elm_obj_diskselector_side_text_max_length_set | ( |  | len | ) | ELM_OBJ_DISKSELECTOR_ID(ELM_OBJ_DISKSELECTOR_SUB_ID_SIDE_TEXT_MAX_LENGTH_SET), EO_TYPECHECK(int, len)

Since
  1.8

Set the side labels max length.

Parameters

  [in] | len |

See Also
  elm_diskselector_side_text_max_length_set

Referenced by elm_diskselector_side_text_max_length_set().

## Function Documentation

Evas_Object* elm_diskselector_add | ( | Evas_Object * | parent | ) |

Add a new diskselector widget to the given parent Elementary (container) object.

Parameters

  parent | The parent object.

Returns
  a new diskselector widget handle or `NULL`, on errors.

This function inserts a new diskselector widget on the canvas.

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.

Parameters

  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.

Deprecated:
  Use elm_scroller_bounce_get() instead.

See Also
  elm_scroller_bounce_get()
  elm_diskselector_bounce_set()

References elm_scrollable_interface_bounce_allow_get.

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.

Parameters

  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.

Deprecated:
  Use elm_scroller_bounce_set() instead.

See Also
  elm_scroller_bounce_set()

References elm_scrollable_interface_bounce_allow_set.

void elm_diskselector_clear | ( | Evas_Object * | obj | ) |

Remove all diskselector's items.

Parameters

  obj | The diskselector object.

See Also
  elm_object_item_del()
  elm_diskselector_item_append()

References elm_obj_diskselector_clear.

int elm_diskselector_display_item_num_get | ( | const Evas_Object * | obj | ) |

Get the number of items in the diskselector object.

Parameters

  obj | The diskselector object.

References elm_obj_diskselector_display_item_num_get.

void elm_diskselector_display_item_num_set | ( | Evas_Object * | obj,
|  | int | num
| ) |  |

Set the number of items to be displayed.

Parameters

  obj | The diskselector object.
  num | The number of items the diskselector will display.

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. E.g.:

group { name: "elm/diskselector/item/X"; data { item: "display_item_num" "5"; }

References elm_obj_diskselector_display_item_num_set.

Elm_Object_Item* elm_diskselector_first_item_get | ( | const Evas_Object * | obj | ) |

Get the first item of the diskselector.

Parameters

  obj | The diskselector object.

Returns
  The first item, or `NULL` if none.

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_diskselector_item_append()
  elm_diskselector_items_get()

References elm_obj_diskselector_first_item_get.

Elm_Object_Item* elm_diskselector_item_append | ( | Evas_Object * | obj,
|  | const char * | label,
|  | Evas_Object * | icon,
|  | Evas_Smart_Cb | func,
|  | const void * | data
| ) |  |

Appends a new item to the diskselector object.

Parameters

  obj | The diskselector object.
  label | The label of the diskselector item.
  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().
  func | The function to call when the item is selected.
  data | The data to associate with the item for related callbacks.

Returns
  The created item or `NULL` upon failure.

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`.

Simple example (with no function callback or data associated):

disk = elm_diskselector_add(win);
ic = elm_icon_add(win);
elm_image_file_set(ic, "path/to/image", NULL);
elm_icon_resizable_set(ic, EINA_TRUE, EINA_TRUE);
elm_diskselector_item_append(disk, "label", ic, NULL, NULL);

See Also
  elm_object_item_del()
  elm_diskselector_clear()
  elm_icon_add()

References elm_obj_diskselector_item_append.

Elm_Object_Item* elm_diskselector_item_next_get | ( | const Elm_Object_Item * | it | ) |

Get the item after `item` in diskselector.

Parameters

  it | The diskselector item.

Returns
  The item after `item`, or `NULL` if none or on failure.

The list of items follows append order. So it will return item appended just after `item` and that wasn't deleted.

If it is the last item, `NULL` will be returned. Last item can be get by elm_diskselector_last_item_get().

See Also
  elm_diskselector_item_append()
  elm_diskselector_items_get()

Elm_Object_Item* elm_diskselector_item_prev_get | ( | const Elm_Object_Item * | it | ) |

Get the item before `item` in diskselector.

Parameters

  it | The diskselector item.

Returns
  The item before `item`, or `NULL` if none or on failure.

The list of items follows append order. So it will return item appended just before `item` and that wasn't deleted.

If it is the first item, `NULL` will be returned. First item can be get by elm_diskselector_first_item_get().

See Also
  elm_diskselector_item_append()
  elm_diskselector_items_get()

void elm_diskselector_item_selected_set | ( | Elm_Object_Item * | it,
|  | Eina_Bool | selected
| ) |  |

Set the selected state of an item.

Parameters

  it | The diskselector item
  selected | The selected state

This sets the selected state of the given item `it`. `EINA_TRUE` for selected, `EINA_FALSE` for not selected.

If a new item is selected the previously selected will be unselected. Previously selected item can be get with function elm_diskselector_selected_item_get().

If the item `it` is unselected, the first item of diskselector will be selected.

Selected items will be visible on center position of diskselector. So if it was on another position before selected, or was invisible, diskselector will animate items until the selected item reaches center position.

See Also
  elm_diskselector_item_selected_get()
  elm_diskselector_selected_item_get()

const Eina_List* elm_diskselector_items_get | ( | const Evas_Object * | obj | ) |

Get a list of all the diskselector items.

Parameters

  obj | The diskselector object.

Returns
  An `Eina_List` of diskselector items, Elm_Object_Item, or `NULL` on failure.

See Also
  elm_diskselector_item_append()
  elm_object_item_del()
  elm_diskselector_clear()

References elm_obj_diskselector_items_get.

Elm_Object_Item* elm_diskselector_last_item_get | ( | const Evas_Object * | obj | ) |

Get the last item of the diskselector.

Parameters

  obj | The diskselector object.

Returns
  The last item, or `NULL` if none.

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_diskselector_item_append()
  elm_diskselector_items_get()

References elm_obj_diskselector_last_item_get.

Eina_Bool elm_diskselector_round_enabled_get | ( | const Evas_Object * | obj | ) |

Get a value whether round mode is enabled or not.

See Also
  elm_diskselector_round_enabled_set() for details.

Parameters

  obj | The diskselector object.

Returns
  `EINA_TRUE` means round mode is enabled. `EINA_FALSE` indicates it's disabled. If `obj` is `NULL`, `EINA_FALSE` is returned.

void elm_diskselector_round_enabled_set | ( | Evas_Object * | obj,
|  | Eina_Bool | enabled
| ) |  |

Enable or disable round mode.

Parameters

  obj | The diskselector object.
  enabled | `EINA_TRUE` to enable round mode or `EINA_FALSE` to disable it.

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_diskselector_round_enabled_get()

References elm_obj_diskselector_round_enabled_set.

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.

See Also
  elm_diskselector_scroller_policy_get() for details.

Parameters

  obj | The diskselector object.
  policy_h | Pointer to store horizontal scrollbar policy.
  policy_v | Pointer to store vertical scrollbar policy.

Deprecated:
  Use elm_scroller_policy_get() instead.

See Also
  elm_scroller_policy_get()

References elm_scrollable_interface_policy_get.

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.

Parameters

  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.

Deprecated:
  Use elm_scroller_policy_set() instead.

See Also
  elm_scroller_policy_set()

References elm_scrollable_interface_policy_set.

Elm_Object_Item* elm_diskselector_selected_item_get | ( | const Evas_Object * | obj | ) |

Get the selected item.

Parameters

  obj | The diskselector object.

Returns
  The selected diskselector item.

The selected item can be unselected with function elm_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_diskselector_side_text_max_length_set().

References elm_obj_diskselector_selected_item_get.

int elm_diskselector_side_text_max_length_get | ( | const Evas_Object * | obj | ) |

Get the side labels max length.

See Also
  elm_diskselector_side_text_max_length_set() for details.

Parameters

  obj | The diskselector object.

Returns
  The max length defined for side labels, or 0 if not a valid diskselector.

References elm_obj_diskselector_side_text_max_length_get.

void elm_diskselector_side_text_max_length_set | ( | Evas_Object * | obj,
|  | int | len
| ) |  |

Set the side labels max length.

Parameters

  obj | The diskselector object.
  len | The max length defined for side labels.

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.

References elm_obj_diskselector_side_text_max_length_set.

Copyright ©2000-2014 Enlightenment.org - Samsung Electronics supports the EFL Documentation Project - Generated Wed Jan 8 2014 20:51:13