2016-12-09 06:05:26 -08:00
import elm_general;
2017-05-21 20:48:12 -07:00
class Elm.Hoversel (Efl.Ui.Button, Efl.Ui.Selectable,
2016-06-10 01:29:40 -07:00
Efl.Ui.Clickable,
2018-01-23 22:50:58 -08:00
Efl.Access.Widget.Action,
Efl.Ui.Legacy)
2014-03-23 02:59:22 -07:00
{
2016-11-24 05:51:47 -08:00
[[Elementary hoversel class]]
2016-05-12 09:06:04 -07:00
legacy_prefix: elm_hoversel;
2014-03-23 02:59:22 -07:00
eo_prefix: elm_obj_hoversel;
2016-05-17 09:14:47 -07:00
event_prefix: elm_hoversel;
2015-05-07 09:32:53 -07:00
methods {
@property horizontal {
2015-08-06 06:47:09 -07:00
[[Control if the hoversel should expand horizontally.
2014-03-23 02:59:22 -07:00
2015-08-06 06:47:09 -07:00
Note: The initial button will display horizontally regradless of this setting.]]
set {
2014-03-23 02:59:22 -07:00
}
get {
}
values {
2015-08-06 06:47:09 -07:00
horizontal: bool; [[If $true, the hover will expand horizontally to the right.]]
2014-03-23 02:59:22 -07:00
}
}
2015-05-07 09:32:53 -07:00
@property hover_parent {
2015-08-06 06:47:09 -07:00
[[Control the hover parent.
2014-03-23 02:59:22 -07:00
2015-08-06 06:47:09 -07:00
Sets the hover parent object, the area that will be darkened when the
hoversel is clicked. Should probably be the window that the hoversel is
in.]]
set {
2014-03-23 02:59:22 -07:00
}
get {
}
values {
2016-06-20 21:26:15 -07:00
parent: Efl.Canvas.Object @nullable; [[The parent to use]]
2014-03-23 02:59:22 -07:00
}
}
2015-05-07 09:32:53 -07:00
@property expanded {
2014-03-23 02:59:22 -07:00
get {
2015-08-06 06:47:09 -07:00
[[Returns whether the hoversel is expanded.]]
return: bool; [[$true if the hoversel is expanded or $false otherwise]]
2014-03-23 02:59:22 -07:00
}
}
2015-05-07 09:32:53 -07:00
@property items {
2014-03-23 02:59:22 -07:00
get {
2015-08-06 06:47:09 -07:00
[[Get the list of items within the given hoversel.]]
2016-11-24 05:51:47 -08:00
return: const(list<Elm.Widget.Item>); [[List of items]]
2014-03-23 02:59:22 -07:00
}
}
2015-10-19 11:41:14 -07:00
@property auto_update {
2015-10-08 03:05:31 -07:00
[[Update icon and text of hoversel same to those of selected item automatically.]]
2015-10-04 06:09:22 -07:00
get{
}
set{
}
values {
2015-10-08 03:05:31 -07:00
auto_update: bool; [[$true if hoversel is updated automatically or $false otherwise]]
2015-10-04 06:09:22 -07:00
}
}
2014-03-23 02:59:22 -07:00
hover_begin {
2015-08-06 06:47:09 -07:00
[[This triggers the hoversel popup from code, the same as if the user had clicked the button.]]
2014-03-23 02:59:22 -07:00
}
clear {
2015-08-06 06:47:09 -07:00
[[This will remove all the children items from the hoversel.
2014-03-23 02:59:22 -07:00
2015-08-06 06:47:09 -07:00
Warning Should *not* be called while the hoversel is active; use
@Elm.Hoversel.expanded.get to check first.]]
2014-03-23 02:59:22 -07:00
}
hover_end {
2015-08-06 06:47:09 -07:00
[[This dismisses the hoversel popup as if the user had clicked outside the hover.]]
2014-03-23 02:59:22 -07:00
}
item_add {
2015-08-06 06:47:09 -07:00
[[Add an item to the hoversel button
2014-03-23 02:59:22 -07:00
2015-08-06 06:47:09 -07:00
This adds an item to the hoversel to show when it is clicked. Note: if you
2016-05-12 03:21:36 -07:00
need to use an icon from an edje file then use Elm.Hoversel.Item.icon.set
2015-08-06 06:47:09 -07:00
right after this function, and set icon_file to $null here.]]
2014-03-23 02:59:22 -07:00
2015-08-06 06:47:09 -07:00
/* FIXME: Make the hoversel_item reference in the doc a real ref. */
/* FIXME-doc
2015-08-06 07:12:27 -07:00
For more information on what $icon_file and $icon_type are, see the
2015-08-06 06:47:09 -07:00
@ref Icon "icon documentation". */
2016-05-23 07:41:28 -07:00
return: Elm.Widget.Item; [[A handle to the added item.]]
2014-03-23 02:59:22 -07:00
params {
2016-05-31 08:02:26 -07:00
@in label: string @optional; [[The text label to use for the item (NULL if not desired)]]
@in icon_file: string @optional; [[An image file path on disk to use for the icon or standard icon name (NULL if not desired)]]
2016-01-14 12:11:20 -08:00
@in icon_type: Elm.Icon.Type; [[The icon type if relevant]]
2015-08-06 06:47:09 -07:00
@in func: Evas_Smart_Cb @optional; [[Convenience function to call when this item is selected. The last parameter $event_info of $func is the selected item pointer.]]
2016-06-02 04:54:59 -07:00
@in data: const(void_ptr) @optional; [[Data to pass to item-related functions]]
2014-03-23 02:59:22 -07:00
}
}
}
implements {
2014-06-20 02:47:39 -07:00
class.constructor;
2016-08-10 07:23:04 -07:00
Efl.Object.constructor;
Efl.Object.destructor;
2016-12-27 10:15:41 -08:00
Efl.Gfx.visible { set; }
2018-01-07 20:55:35 -08:00
Efl.Ui.Widget.widget_parent { set; }
Efl.Ui.Widget.theme_apply;
2017-09-21 23:13:16 -07:00
Efl.Ui.Translatable.translation_update;
2018-01-07 20:55:35 -08:00
Efl.Ui.Widget.widget_event;
2017-05-16 18:28:49 -07:00
Efl.Ui.Autorepeat.autorepeat_supported { get; }
2017-11-15 18:31:26 -08:00
Efl.Access.Widget.Action.elm_actions { get; }
2018-02-14 18:14:52 -08:00
Efl.Access.access_children { get; }
2014-03-23 02:59:22 -07:00
}
events {
2016-11-24 05:51:47 -08:00
dismissed; [[Called when hoversel is dismissed]]
expanded; [[Called when hoversel is expanded]]
item,focused; [[Called when hoversel item got focus]]
item,unfocused; [[Called when hoversel item lost focus]]
2014-03-23 02:59:22 -07:00
}
}