GenListItem Selection Mode method
authorLukasz Foniok <l.foniok@samsung.com>
Thu, 6 Oct 2016 15:45:06 +0000 (17:45 +0200)
committerLukasz Foniok <l.foniok@samsung.com>
Tue, 11 Oct 2016 15:55:52 +0000 (17:55 +0200)
Change-Id: I59d2d1944b1bcb459085102371a8e6889d09b48d
Signed-off-by: Lukasz Foniok <l.foniok@samsung.com>
src/ElmSharp/ElmSharp/GenListItem.cs
src/ElmSharp/Interop/Interop.Elementary.GenListView.cs

index 74326e1..db701b6 100644 (file)
@@ -2,9 +2,18 @@ using System;
 
 namespace ElmSharp
 {
+    public enum GenListSelectionMode
+    {
+        Default,
+        Always,
+        None,
+        DisplayOnly
+    }
+
     public class GenListItem : GenItem
     {
-        internal GenListItem(object data, GenItemClass itemClass) : base(data, itemClass)
+        internal GenListItem(object data, GenItemClass itemClass)
+            : base(data, itemClass)
         {
         }
 
@@ -24,5 +33,17 @@ namespace ElmSharp
         {
             Interop.Elementary.elm_genlist_item_update(Handle);
         }
+
+        public GenListSelectionMode SelectionMode
+        {
+            get
+            {
+                return (GenListSelectionMode)Interop.Elementary.elm_genlist_item_select_mode_get(Handle);
+            }
+            set
+            {
+                Interop.Elementary.elm_genlist_item_select_mode_set(Handle, (Interop.Elementary.Elm_Object_Select_Mode)value);
+            }
+        }
     }
 }
index 943f291..79deff4 100644 (file)
@@ -15,11 +15,24 @@ 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
+            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
+        }
+
+        internal enum Elm_Object_Select_Mode
+        {
+            ELM_OBJECT_SELECT_MODE_DEFAULT,
+            ELM_OBJECT_SELECT_MODE_ALWAYS,
+            ELM_OBJECT_SELECT_MODE_NONE,
+            ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY
         }
 
         [DllImport(Libraries.Elementary)]
@@ -96,5 +109,11 @@ internal static partial class Interop
 
         [DllImport(Libraries.Elementary)]
         internal static extern void elm_genlist_item_selected_set(IntPtr obj, bool selected);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_genlist_item_select_mode_set(IntPtr obj, Elm_Object_Select_Mode mode);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern Elm_Object_Select_Mode elm_genlist_item_select_mode_get(IntPtr obj);
     }
 }