From: Piotr Szydelko
Date: Thu, 2 Mar 2017 06:38:05 +0000 (+0100)
Subject: Add GenListItem.Next and Previous properties
X-Git-Tag: accepted/tizen/common/20170310.122346~6
X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F01%2F117301%2F2;p=platform%2Fcore%2Fcsapi%2Felm-sharp.git
Add GenListItem.Next and Previous properties
These readnly properties allows the developer to access
the item following the current one and the one before it.
Change-Id: If3b9cf51a88a4313776057fd433fcf9fd697c40a
Signed-off-by: Piotr Szydelko
---
diff --git a/ElmSharp/ElmSharp/GenListItem.cs b/ElmSharp/ElmSharp/GenListItem.cs
index af616e5..d1b9b47 100644
--- a/ElmSharp/ElmSharp/GenListItem.cs
+++ b/ElmSharp/ElmSharp/GenListItem.cs
@@ -77,6 +77,30 @@ namespace ElmSharp
}
}
+ public GenListItem Next
+ {
+ get
+ {
+ IntPtr next = Interop.Elementary.elm_genlist_item_next_get(Handle);
+ if (next == IntPtr.Zero)
+ return null;
+ else
+ return GetItemByHandle(next) as GenListItem;
+ }
+ }
+
+ public GenListItem Previous
+ {
+ get
+ {
+ IntPtr prev = Interop.Elementary.elm_genlist_item_prev_get(Handle);
+ if (prev == IntPtr.Zero)
+ return null;
+ else
+ return GetItemByHandle(prev) as GenListItem;
+ }
+ }
+
public void UpdateItemClass(GenItemClass itemClass, object data)
{
Data = data;
diff --git a/ElmSharp/Interop/Interop.Elementary.GenListView.cs b/ElmSharp/Interop/Interop.Elementary.GenListView.cs
index 732db0d..1df2030 100644
--- a/ElmSharp/Interop/Interop.Elementary.GenListView.cs
+++ b/ElmSharp/Interop/Interop.Elementary.GenListView.cs
@@ -116,6 +116,12 @@ internal static partial class Interop
internal static extern IntPtr elm_genlist_last_item_get(IntPtr obj);
[DllImport(Libraries.Elementary)]
+ internal static extern IntPtr elm_genlist_item_next_get(IntPtr item);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern IntPtr elm_genlist_item_prev_get(IntPtr item);
+
+ [DllImport(Libraries.Elementary)]
internal static extern bool elm_genlist_item_selected_get(IntPtr obj);
[DllImport(Libraries.Elementary)]