2 using System.Collections.Generic;
11 public class MoreOptionItemEventArgs : EventArgs
13 public MoreOptionItem item { get; set; }
17 /// The MoreOption is a widget composed of the toggle (cue button) and more option view that can change a visibility through the toggle.
19 /// <since_tizen> 6 </since_tizen>
20 public class MoreOption : Efl.Ui.Layout
22 const string IconPartName = "selector,icon";
23 const string ContentPartName = "selector,content";
24 const string BgPartName = "selector,bg_image";
26 const string ItemSelectedEventName = "item,selected";
27 const string ItemClickedEventName = "item,clicked";
30 /// Clicked will be triggered when the user selects the already selected item again or selects a selector.
32 /// <since_tizen> 6 </since_tizen>
33 public event EventHandler<MoreOptionItemEventArgs> Clicked;
36 /// Selected will be triggered when the user selects an item.
38 /// <since_tizen> 6 </since_tizen>
39 public event EventHandler<MoreOptionItemEventArgs> Selected;
41 private Interop.Evas.SmartCallback smartClicked;
42 private Interop.Evas.SmartCallback smartSelected;
45 /// Creates and initializes a new instance of the MoreOption class.
47 /// <param name="parent">The Efl.Ui.Widget to which the new MoreOption will be attached as a child.</param>
48 /// <since_tizen> 6 </since_tizen>
49 public MoreOption(Efl.Ui.Widget parent) : base(Interop.Eext.eext_more_option_add(parent.NativeHandle))
51 smartClicked = new Interop.Evas.SmartCallback((d, o, e) =>
53 MoreOptionItem clickedItem = new MoreOptionItem();
54 clickedItem._handle = e;
55 Clicked?.Invoke(this, new MoreOptionItemEventArgs { item = clickedItem });
58 smartSelected = new Interop.Evas.SmartCallback((d, o, e) =>
60 MoreOptionItem selectedItem = new MoreOptionItem();
61 selectedItem._handle = e;
62 Selected?.Invoke(this, new MoreOptionItemEventArgs { item = selectedItem });
65 Interop.Evas.evas_object_smart_callback_add(this.NativeHandle, ItemClickedEventName, smartClicked, IntPtr.Zero);
66 Interop.Evas.evas_object_smart_callback_add(this.NativeHandle, ItemSelectedEventName, smartSelected, IntPtr.Zero);
70 /// Appends a more option item.
72 /// <since_tizen> 6 </since_tizen>
73 public void Append(MoreOptionItem item)
75 if (item.NativeHandle != null)
76 item.NativeHandle = Interop.Eext.eext_more_option_item_append(this.NativeHandle);
80 /// Prepends a more option item.
82 /// <since_tizen> 6 </since_tizen>
83 public void PrependItem(MoreOptionItem item)
85 if (item.NativeHandle != null)
86 item.NativeHandle = Interop.Eext.eext_more_option_item_prepend(this.NativeHandle);
90 /// Inserts a more option item after the target item.
92 /// <since_tizen> 6 </since_tizen>
93 public void InsertAfter(MoreOptionItem targetItem, MoreOptionItem item)
95 if (item.NativeHandle != null)
96 item.NativeHandle = Interop.Eext.eext_more_option_item_insert_after(this.NativeHandle, targetItem.NativeHandle);
100 /// Inserts a more option item before the target item.
102 /// <since_tizen> 6 </since_tizen>
103 public void InsertBefore(MoreOptionItem targetItem, MoreOptionItem item)
105 if (item.NativeHandle != null)
106 item.NativeHandle = Interop.Eext.eext_more_option_item_insert_before(this.NativeHandle, targetItem.NativeHandle);
110 /// Delete a more option item.
112 /// <since_tizen> 6 </since_tizen>
113 public void DeleteItem(MoreOptionItem item)
115 if (item.NativeHandle != null)
116 Interop.Eext.eext_more_option_item_del(item.NativeHandle);
120 /// Clears all items of more option.
122 /// <since_tizen> 6 </since_tizen>
123 public void ClearItems()
125 if (this.NativeHandle != null)
126 Interop.Eext.eext_more_option_items_clear(this.NativeHandle);
130 /// Sets or gets the direction of more option.
132 /// <since_tizen> 6 </since_tizen>
133 public MoreOptionDirection Direction
137 int dir = Interop.Eext.eext_more_option_direction_get(this.NativeHandle);
138 return (MoreOptionDirection)dir;
143 Interop.Eext.eext_more_option_direction_set(this.NativeHandle, (int)value);
148 /// Sets or gets the visibility of the more option view.
150 /// <since_tizen> 6 </since_tizen>
155 return Interop.Eext.eext_more_option_opened_get(this.NativeHandle);
160 Interop.Eext.eext_more_option_opened_set(this.NativeHandle, value);
165 /// Enumeration for the more option direction types.
167 /// <since_tizen> 6 </since_tizen>
168 public enum MoreOptionDirection