diff options
author | sung-su.kim <sung-su.kim@samsung.com> | 2017-05-25 18:47:52 +0900 |
---|---|---|
committer | sung-su.kim <sung-su.kim@samsung.com> | 2017-06-09 09:54:44 +0900 |
commit | 74d9f3940562524cb04b323d2bb458eaa5bd36e6 (patch) | |
tree | 2faf6ca42ce09594ad79726e80375553c6a50883 /ElmSharp | |
parent | 602c52c8279bfce8a1e835ae269a63ac1e3b802b (diff) | |
download | elm-sharp-74d9f3940562524cb04b323d2bb458eaa5bd36e6.tar.gz elm-sharp-74d9f3940562524cb04b323d2bb458eaa5bd36e6.tar.bz2 elm-sharp-74d9f3940562524cb04b323d2bb458eaa5bd36e6.zip |
Enhance Index widget
Change-Id: If719a2a20ed231dc7517eb5d3dbf2072c9cc5255
Diffstat (limited to 'ElmSharp')
-rwxr-xr-x | ElmSharp/ElmSharp/Index.cs | 70 | ||||
-rwxr-xr-x[-rw-r--r--] | ElmSharp/Interop/Interop.Elementary.Index.cs | 37 |
2 files changed, 105 insertions, 2 deletions
diff --git a/ElmSharp/ElmSharp/Index.cs b/ElmSharp/ElmSharp/Index.cs index e177968..f73ec7a 100755 --- a/ElmSharp/ElmSharp/Index.cs +++ b/ElmSharp/ElmSharp/Index.cs @@ -104,6 +104,53 @@ namespace ElmSharp } /// <summary> + /// Set a delay change time for index object. + /// delay time is 0.2 sec by default. + /// </summary> + public double Delay + { + get + { + return Interop.Elementary.elm_index_delay_change_time_get(RealHandle); + } + set + { + Interop.Elementary.elm_index_delay_change_time_set(RealHandle, value); + } + } + + /// <summary> + /// Gets or sets the items level for a given index widget. + /// </summary> + public int Level + { + get + { + return Interop.Elementary.elm_index_item_level_get(RealHandle); + } + set + { + Interop.Elementary.elm_index_item_level_set(RealHandle, value); + } + } + + /// <summary> + /// Control standard_priority group of index. + /// Priority group will be shown as many items as it can, and other group will be shown one character only. + /// </summary> + public int Priority + { + get + { + return Interop.Elementary.elm_index_standard_priority_get(RealHandle); + } + set + { + Interop.Elementary.elm_index_standard_priority_set(RealHandle, value); + } + } + + /// <summary> /// Gets the last selected item, for a given index widget. /// </summary> public IndexItem SelectedItem @@ -153,6 +200,19 @@ namespace ElmSharp } /// <summary> + /// Insert a new item into the index object after item after. + /// </summary> + /// <param name="label">the label which the item should be indexed</param> + /// <param name="after">The index item to insert after.</param> + /// <returns>A object to the IndexItem added or null, on errors</returns> + public IndexItem InsertAfter(string label, IndexItem after) + { + IndexItem item = new IndexItem(label); + item.Handle = Interop.Elementary.elm_index_item_insert_after(RealHandle, after, label, null, (IntPtr)item.Id); + return item; + } + + /// <summary> /// Flush the changes made to the index items so they work correctly. /// </summary> /// <param name="level">The index level (one of 0 or 1) where changes were made</param> @@ -161,6 +221,14 @@ namespace ElmSharp Interop.Elementary.elm_index_level_go(RealHandle, level); } + /// <summary> + /// Removes all items from a given index widget. + /// </summary> + public void Clear() + { + Interop.Elementary.elm_index_item_clear(RealHandle); + } + protected override IntPtr CreateHandle(EvasObject parent) { IntPtr handle = Interop.Elementary.elm_layout_add(parent.Handle); @@ -189,4 +257,4 @@ namespace ElmSharp _children.Remove((IndexItem)sender); } } -} +}
\ No newline at end of file diff --git a/ElmSharp/Interop/Interop.Elementary.Index.cs b/ElmSharp/Interop/Interop.Elementary.Index.cs index 47a424f..b1470b2 100644..100755 --- a/ElmSharp/Interop/Interop.Elementary.Index.cs +++ b/ElmSharp/Interop/Interop.Elementary.Index.cs @@ -23,6 +23,8 @@ internal static partial class Interop { internal delegate void EventCallback(IntPtr data, IntPtr obj, IntPtr info); + internal delegate void SmartCallback(IntPtr data, IntPtr obj, IntPtr info); + [DllImport(Libraries.Elementary)] internal static extern IntPtr elm_index_add(IntPtr parent); @@ -67,5 +69,38 @@ internal static partial class Interop [DllImport(Libraries.Elementary)] internal static extern IntPtr elm_index_item_insert_before(IntPtr obj, IntPtr before, string letter, EventCallback func, IntPtr data); + + [DllImport(Libraries.Elementary)] + internal static extern IntPtr elm_index_item_sorted_insert(IntPtr obj, string letter, Evas_Smart_Cb func, IntPtr data, Eina_Compare_Cb cmpFunc, Eina_Compare_Cb cmpDataFunc); + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + internal delegate int Eina_Compare_Cb(IntPtr data1, IntPtr data2); + + [DllImport(Libraries.Elementary)] + internal static extern void elm_index_delay_change_time_set(IntPtr obj, double time); + + [DllImport(Libraries.Elementary)] + internal static extern double elm_index_delay_change_time_get(IntPtr obj); + + [DllImport(Libraries.Elementary)] + internal static extern void elm_index_item_clear(IntPtr obj); + + [DllImport(Libraries.Elementary)] + internal static extern IntPtr elm_index_item_find(IntPtr obj, IntPtr data); + + [DllImport(Libraries.Elementary)] + internal static extern IntPtr elm_index_item_insert_after(IntPtr obj, IntPtr after, string letter, SmartCallback func, IntPtr data); + + [DllImport(Libraries.Elementary)] + internal static extern int elm_index_item_level_get(IntPtr obj); + + [DllImport(Libraries.Elementary)] + internal static extern void elm_index_item_level_set(IntPtr obj, int level); + + [DllImport(Libraries.Elementary)] + internal static extern void elm_index_standard_priority_set(IntPtr obj, int priority); + + [DllImport(Libraries.Elementary)] + internal static extern int elm_index_standard_priority_get(IntPtr obj); } -} +}
\ No newline at end of file |