diff options
author | Kangho Hur <kangho.hur@samsung.com> | 2017-02-10 01:35:05 -0800 |
---|---|---|
committer | Gerrit Code Review <gerrit@review.vlan103.tizen.org> | 2017-02-10 01:35:05 -0800 |
commit | 6c15da8918dd1dad3f816144b22f86d8e6ca7233 (patch) | |
tree | 5dfb2427c42a2276b785b09c8d597a03d2120d73 | |
parent | d9778bcb94fe87c5c197e1051ca9891c6256f1a7 (diff) | |
parent | 9eeecad0e6d172e25c5e8bc8d25a6137b7bba74a (diff) | |
download | elm-sharp-6c15da8918dd1dad3f816144b22f86d8e6ca7233.tar.gz elm-sharp-6c15da8918dd1dad3f816144b22f86d8e6ca7233.tar.bz2 elm-sharp-6c15da8918dd1dad3f816144b22f86d8e6ca7233.zip |
Merge "Implement ItemStyle of Naviframe" into tizen
-rw-r--r-- | ElmSharp/ElmSharp/NaviItem.cs | 12 | ||||
-rw-r--r-- | ElmSharp/ElmSharp/Naviframe.cs | 24 | ||||
-rw-r--r-- | ElmSharp/Interop/Interop.Elementary.Naviframe.cs | 11 |
3 files changed, 44 insertions, 3 deletions
diff --git a/ElmSharp/ElmSharp/NaviItem.cs b/ElmSharp/ElmSharp/NaviItem.cs index d3f3bde..eabd003 100644 --- a/ElmSharp/ElmSharp/NaviItem.cs +++ b/ElmSharp/ElmSharp/NaviItem.cs @@ -77,6 +77,18 @@ namespace ElmSharp } } + public string Style + { + get + { + return Interop.Elementary.elm_naviframe_item_style_get(Handle); + } + set + { + Interop.Elementary.elm_naviframe_item_style_set(Handle, value); + } + } + protected override void OnInvalidate() { if (!_isPopped) diff --git a/ElmSharp/ElmSharp/Naviframe.cs b/ElmSharp/ElmSharp/Naviframe.cs index c657ff0..0ff43b7 100644 --- a/ElmSharp/ElmSharp/Naviframe.cs +++ b/ElmSharp/ElmSharp/Naviframe.cs @@ -77,9 +77,15 @@ namespace ElmSharp { return Push(content, null); } + public NaviItem Push(EvasObject content, string title) { - IntPtr item = Interop.Elementary.elm_naviframe_item_push(Handle, title, IntPtr.Zero, IntPtr.Zero, content.Handle, null); + return Push(content, title, null); + } + + public NaviItem Push(EvasObject content, string title, string style) + { + IntPtr item = Interop.Elementary.elm_naviframe_item_push(Handle, title, IntPtr.Zero, IntPtr.Zero, content.Handle, style); NaviItem naviItem = NaviItem.FromNativeHandle(item, content); _itemStack.Add(naviItem); naviItem.Popped += ItemPoppedHandler; @@ -90,9 +96,15 @@ namespace ElmSharp { return InsertBefore(before, content, ""); } + public NaviItem InsertBefore(NaviItem before, EvasObject content, string title) { - IntPtr item = Interop.Elementary.elm_naviframe_item_insert_before(Handle, before, title, IntPtr.Zero, IntPtr.Zero, content, null); + return InsertBefore(before, content, title, null); + } + + public NaviItem InsertBefore(NaviItem before, EvasObject content, string title, string style) + { + IntPtr item = Interop.Elementary.elm_naviframe_item_insert_before(Handle, before, title, IntPtr.Zero, IntPtr.Zero, content, style); NaviItem naviItem = NaviItem.FromNativeHandle(item, content); int idx = _itemStack.IndexOf(before); _itemStack.Insert(idx, naviItem); @@ -104,9 +116,15 @@ namespace ElmSharp { return InsertAfter(after, content, ""); } + public NaviItem InsertAfter(NaviItem after, EvasObject content, string title) { - IntPtr item = Interop.Elementary.elm_naviframe_item_insert_after(Handle, after, title, IntPtr.Zero, IntPtr.Zero, content, null); + return InsertAfter(after, content, title, null); + } + + public NaviItem InsertAfter(NaviItem after, EvasObject content, string title, string style) + { + IntPtr item = Interop.Elementary.elm_naviframe_item_insert_after(Handle, after, title, IntPtr.Zero, IntPtr.Zero, content, style); NaviItem naviItem = NaviItem.FromNativeHandle(item, content); int idx = _itemStack.IndexOf(after); _itemStack.Insert(idx + 1, naviItem); diff --git a/ElmSharp/Interop/Interop.Elementary.Naviframe.cs b/ElmSharp/Interop/Interop.Elementary.Naviframe.cs index 5a481b4..2804eb1 100644 --- a/ElmSharp/Interop/Interop.Elementary.Naviframe.cs +++ b/ElmSharp/Interop/Interop.Elementary.Naviframe.cs @@ -68,5 +68,16 @@ internal static partial class Interop [DllImport(Libraries.Elementary)] internal static extern void elm_naviframe_item_pop_to(IntPtr item); + + [DllImport(Libraries.Elementary)] + internal static extern void elm_naviframe_item_style_set(IntPtr item, string style); + + [DllImport(Libraries.Elementary, EntryPoint = "elm_naviframe_item_style_get", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true, CharSet = CharSet.Ansi)] + internal static extern IntPtr _elm_naviframe_item_style_get(IntPtr item); + internal static string elm_naviframe_item_style_get(IntPtr item) + { + var text = _elm_naviframe_item_style_get(item); + return Marshal.PtrToStringAnsi(text); + } } } |