[ElmSharp] Add Missed Features 81/157381/1
authorpius.lee <pius.lee@samsung.com>
Tue, 24 Oct 2017 09:33:46 +0000 (18:33 +0900)
committerpius.lee <pius.lee@samsung.com>
Tue, 24 Oct 2017 09:33:46 +0000 (18:33 +0900)
Add Count property to GenList
Add Style property to ItemObject
Add SignalEmit method to Widget

Change-Id: I13f4e9ac4c259c194bc88d219aabade7a722917e

src/ElmSharp/ElmSharp/GenList.cs
src/ElmSharp/ElmSharp/ItemObject.cs
src/ElmSharp/ElmSharp/Widget.cs
src/ElmSharp/Interop/Interop.Elementary.Item.cs

index 82730d1..600c57b 100755 (executable)
@@ -356,6 +356,17 @@ namespace ElmSharp
         }
 
         /// <summary>
+        /// Gets count of items in a this genlist widget
+        /// </summary>
+        public int Count
+        {
+            get
+            {
+                return Interop.Elementary.elm_genlist_items_count(RealHandle);
+            }
+        }
+
+        /// <summary>
         /// ItemSelected is raised when a new genlist item is selected.
         /// </summary>
         public event EventHandler<GenListItemEventArgs> ItemSelected;
index b4616a4..0980c5b 100755 (executable)
@@ -82,6 +82,21 @@ namespace ElmSharp
             }
         }
 
+        /// <summary>
+        /// Sets or gets the style of the Item.
+        /// </summary>
+        public string Style
+        {
+            get
+            {
+                return Interop.Elementary.elm_object_item_style_get(Handle);
+            }
+            set
+            {
+                Interop.Elementary.elm_object_item_style_set(Handle, value);
+            }
+        }
+
         internal IntPtr Handle
         {
             get
index 6407888..a6b19fe 100755 (executable)
@@ -432,6 +432,16 @@ namespace ElmSharp
             return a;
         }
 
+       /// <summary>
+        /// Send a signal to the edje object of the widget.
+        /// </summary>
+        /// <param name="emission">The signal's name.</param>
+        /// <param name="source">The signal's source.</param>
+        public void SignalEmit(string emission, string source)
+        {
+            Interop.Elementary.elm_object_signal_emit(Handle, emission, source);
+        }
+
         /// <summary>
         /// The callback of Realized Event
         /// </summary>
index 0d516ec..c0e4f3f 100644 (file)
@@ -99,6 +99,18 @@ internal static partial class Interop
         [DllImport(Libraries.Elementary)]
         internal static extern IntPtr elm_object_item_signal_callback_del(IntPtr obj, string emission, string source, Elm_Object_Item_Signal_Cb func);
 
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_object_item_style_set(IntPtr obj, string style);
+
+        [DllImport(Libraries.Elementary, EntryPoint = "elm_object_item_style_get", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true, CharSet = CharSet.Ansi)]
+        internal static extern IntPtr _elm_object_item_style_get(IntPtr obj);
+
+        internal static string elm_object_item_style_get(IntPtr obj)
+        {
+            var text = _elm_object_item_style_get(obj);
+            return Marshal.PtrToStringAnsi(text);
+        }
+
         [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
         internal delegate bool Elm_Object_Item_Signal_Cb(IntPtr data, IntPtr item, string emission, string source);