From 8562facff222956d4f22d7c4ddff555a1fdcdea5 Mon Sep 17 00:00:00 2001 From: tscholb Date: Tue, 1 Sep 2020 16:24:22 +0900 Subject: [PATCH] [NUI]Add WatchView (#1960) Co-authored-by: dongsug-song <35130733+dongsug-song@users.noreply.github.com> Co-authored-by: hyunjushin --- src/Tizen.NUI.Wearable/src/public/WatchView.cs | 115 +++++++++++++++++++++ .../src/internal/Interop/Interop.WatchView.cs | 40 +++++++ 2 files changed, 155 insertions(+) create mode 100644 src/Tizen.NUI.Wearable/src/public/WatchView.cs create mode 100644 src/Tizen.NUI/src/internal/Interop/Interop.WatchView.cs diff --git a/src/Tizen.NUI.Wearable/src/public/WatchView.cs b/src/Tizen.NUI.Wearable/src/public/WatchView.cs new file mode 100644 index 0000000..9f7ae9c --- /dev/null +++ b/src/Tizen.NUI.Wearable/src/public/WatchView.cs @@ -0,0 +1,115 @@ +/* + * Copyright(c) 2020 Samsung Electronics Co., Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ +using System; +using System.ComponentModel; +using System.Runtime.InteropServices; +using Tizen.NUI.BaseComponents; + +namespace Tizen.NUI.Wearable +{ + + + /// + /// The WatchView is a class for displaying the watch.
+ ///
+ /// 6 + [EditorBrowsable(EditorBrowsableState.Never)] + public class WatchView : View + { + /// + /// Creates a new WatchView. + /// + /// 6 + [EditorBrowsable(EditorBrowsableState.Never)] + public WatchView(Window window, string watchId, string contentInfo, int width, int height) : this(Interop.WatchView.WatchView_New(Window.getCPtr(window), watchId, contentInfo, width, height), true) + { + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + + } + + internal WatchView(global::System.IntPtr cPtr, bool cMemoryOwn) : base(Interop.WatchView.WatchView_SWIGUpcast(cPtr), cMemoryOwn) + { + } + internal WatchView(WatchView handle) : this(Interop.WatchView.new_WatchView__SWIG_1(WatchView.getCPtr(handle)), true) + { + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + /// + /// Pauses a given Watch. + /// + /// True on success, false otherwise. + /// 6 + [EditorBrowsable(EditorBrowsableState.Never)] + public bool PauseWatch() + { + bool ret = Interop.WatchView.WatchView_PauseWatch(swigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + /// + /// Resumes a given Watch. + /// + /// True on success, false otherwise. + /// 6 + [EditorBrowsable(EditorBrowsableState.Never)] + public bool ResumeWatch() + { + bool ret = Interop.WatchView.WatchView_ResumeWatch(swigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + internal static WatchView DownCast(BaseHandle handle) + { + WatchView ret = new WatchView(Interop.WatchView.WatchView_DownCast(BaseHandle.getCPtr(handle)), true); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + internal static WatchView GetWatchViewFromPtr(global::System.IntPtr cPtr) + { + WatchView ret = new WatchView(cPtr, false); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + internal static global::System.Runtime.InteropServices.HandleRef getCPtr(WatchView obj) + { + return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; + } + + internal WatchView Assign(WatchView handle) + { + WatchView ret = new WatchView(Interop.WatchView.WatchView_Assign(swigCPtr, WatchView.getCPtr(handle)), false); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + /// + /// To make the Button instance be disposed. + /// + /// 6 + [EditorBrowsable(EditorBrowsableState.Never)] + protected override void Dispose(DisposeTypes type) + { + base.Dispose(type); + } + } + +} diff --git a/src/Tizen.NUI/src/internal/Interop/Interop.WatchView.cs b/src/Tizen.NUI/src/internal/Interop/Interop.WatchView.cs new file mode 100644 index 0000000..f3ec4df --- /dev/null +++ b/src/Tizen.NUI/src/internal/Interop/Interop.WatchView.cs @@ -0,0 +1,40 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace Tizen.NUI +{ + internal static partial class Interop + { + internal static partial class WatchView + { + //for widget view + [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_WatchView_New")] + public static extern global::System.IntPtr WatchView_New(global::System.Runtime.InteropServices.HandleRef window, string nuiWatchId, string contentinfo, int width, int height); + + [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_WatchView_DownCast")] + public static extern global::System.IntPtr WatchView_DownCast(global::System.Runtime.InteropServices.HandleRef jarg1); + + [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_new_WatchView__SWIG_0")] + public static extern global::System.IntPtr new_WatchView__SWIG_0(); + + [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_new_WatchView__SWIG_1")] + public static extern global::System.IntPtr new_WatchView__SWIG_1(global::System.Runtime.InteropServices.HandleRef jarg1); + + [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_WatchView_Assign")] + public static extern global::System.IntPtr WatchView_Assign(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2); + + [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_delete_WatchView")] + public static extern void delete_WatchView(global::System.Runtime.InteropServices.HandleRef jarg1); + + [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_WatchView_PauseWatch")] + public static extern bool WatchView_PauseWatch(global::System.Runtime.InteropServices.HandleRef jarg1); + + [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_WatchView_ResumeWatch")] + public static extern bool WatchView_ResumeWatch(global::System.Runtime.InteropServices.HandleRef jarg1); + + [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_WatchView_SWIGUpcast")] + public static extern global::System.IntPtr WatchView_SWIGUpcast(global::System.IntPtr jarg1); + } + } +} \ No newline at end of file -- 2.7.4