From d88ff8e0855641a108f0cab86a5a621571aaf451 Mon Sep 17 00:00:00 2001 From: SungHyun Min Date: Thu, 11 May 2017 15:26:56 +0900 Subject: [PATCH] Add IsExpanded property in GenListItem TASK=TCAPI-2326 Change-Id: Ie95ea510b890343af1bd57f0b839bf27ffb4715a Signed-off-by: SungHyun Min --- src/ElmSharp/ElmSharp/GenListItem.cs | 24 +++++++++++++++++++++- .../Interop/Interop.Elementary.GenListView.cs | 15 +++++++++++++- 2 files changed, 37 insertions(+), 2 deletions(-) mode change 100755 => 100644 src/ElmSharp/ElmSharp/GenListItem.cs diff --git a/src/ElmSharp/ElmSharp/GenListItem.cs b/src/ElmSharp/ElmSharp/GenListItem.cs old mode 100755 new mode 100644 index 0b1d677..33ee199 --- a/src/ElmSharp/ElmSharp/GenListItem.cs +++ b/src/ElmSharp/ElmSharp/GenListItem.cs @@ -27,14 +27,17 @@ namespace ElmSharp /// Default select mode. /// Default, + /// /// Always select mode. /// Always, + /// /// No select mode. /// None, + /// /// No select mode with no finger size rule. /// @@ -51,18 +54,22 @@ namespace ElmSharp /// All item's parts. /// All = 0, + /// /// The text part type. /// Text = (1 << 0), + /// /// The Content part type. /// Content = (1 << 1), + /// /// The state of part. /// State = (1 << 2), + /// /// No part type. /// @@ -97,6 +104,21 @@ namespace ElmSharp } /// + /// Gets or sets whether a given genlist item is expanded. + /// + public bool IsExpanded + { + get + { + return Interop.Elementary.elm_genlist_item_expanded_get(Handle); + } + set + { + Interop.Elementary.elm_genlist_item_expanded_set(Handle, value); + } + } + + /// /// Updates the content of an item. /// This updates an item by calling all the again to get the content, text, and states. /// Use this when the original item data has changed and the changes are desired to reflect. @@ -182,4 +204,4 @@ namespace ElmSharp Interop.Elementary.elm_genlist_item_item_class_update((IntPtr)Handle, itemClass.UnmanagedPtr); } } -} +} \ No newline at end of file diff --git a/src/ElmSharp/Interop/Interop.Elementary.GenListView.cs b/src/ElmSharp/Interop/Interop.Elementary.GenListView.cs index 1df2030..380d059 100644 --- a/src/ElmSharp/Interop/Interop.Elementary.GenListView.cs +++ b/src/ElmSharp/Interop/Interop.Elementary.GenListView.cs @@ -24,14 +24,19 @@ internal static partial class Interop internal enum Elm_Genlist_Item_Scrollto_Type { ELM_GENLIST_ITEM_SCROLLTO_NONE = 0, + // Scrolls to nowhere ELM_GENLIST_ITEM_SCROLLTO_IN = (1 << 0), + // Scrolls to the nearest viewport ELM_GENLIST_ITEM_SCROLLTO_TOP = (1 << 1), + // Scrolls to the top of the viewport ELM_GENLIST_ITEM_SCROLLTO_MIDDLE = (1 << 2), + // Scrolls to the middle of the viewport ELM_GENLIST_ITEM_SCROLLTO_BOTTOM = (1 << 3) + // Scrolls to the bottom of the viewport } @@ -148,5 +153,13 @@ internal static partial class Interop [DllImport(Libraries.Elementary)] [return: MarshalAs(UnmanagedType.U1)] internal static extern bool elm_genlist_reorder_mode_get(IntPtr obj); + + [DllImport(Libraries.Elementary)] + [return: MarshalAs(UnmanagedType.U1)] + internal static extern void elm_genlist_item_expanded_set(IntPtr obj, bool isExpanded); + + [DllImport(Libraries.Elementary)] + [return: MarshalAs(UnmanagedType.U1)] + internal static extern bool elm_genlist_item_expanded_get(IntPtr obj); } -} +} \ No newline at end of file -- 2.7.4