From: WonYoung Choi Date: Mon, 6 Feb 2017 07:28:43 +0000 (+0900) Subject: Implement ItemStyle of Naviframe X-Git-Tag: submit/trunk/20170823.075128~110^2~166^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c9816271fda4a7c2f67a27b601ec1c9f15c0fa3f;p=platform%2Fcore%2Fcsapi%2Ftizenfx.git Implement ItemStyle of Naviframe Change-Id: Ie735334a39dc43da17cf5ab396544006be79d138 --- diff --git a/packaging/elm-sharp.spec b/packaging/elm-sharp.spec index 9def293..b690ec0 100644 --- a/packaging/elm-sharp.spec +++ b/packaging/elm-sharp.spec @@ -1,4 +1,4 @@ -%define DEV_VERSION beta-009 +%define DEV_VERSION beta-010 Name: elm-sharp Summary: C# Binding for Elementary diff --git a/src/ElmSharp/ElmSharp/NaviItem.cs b/src/ElmSharp/ElmSharp/NaviItem.cs index d3f3bde..eabd003 100644 --- a/src/ElmSharp/ElmSharp/NaviItem.cs +++ b/src/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/src/ElmSharp/ElmSharp/Naviframe.cs b/src/ElmSharp/ElmSharp/Naviframe.cs index c657ff0..0ff43b7 100644 --- a/src/ElmSharp/ElmSharp/Naviframe.cs +++ b/src/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/src/ElmSharp/Interop/Interop.Elementary.Naviframe.cs b/src/ElmSharp/Interop/Interop.Elementary.Naviframe.cs index 5a481b4..2804eb1 100644 --- a/src/ElmSharp/Interop/Interop.Elementary.Naviframe.cs +++ b/src/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); + } } }