2 * Copyright(c) 2017 Samsung Electronics Co., Ltd.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
17 using System.ComponentModel;
22 /// WidgetViewManager manages addition of WidgetView controls.
23 /// This class provides the functionality of adding the widget views and controlling the widgets.
25 /// <since_tizen> 3 </since_tizen>
26 public class WidgetViewManager : BaseHandle
30 /// Creates a new widgetView manager object.
32 /// <since_tizen> 3 </since_tizen>
33 public WidgetViewManager(NUIApplication nuiApplication, string appId) : this(Interop.WidgetViewManager.New(Application.getCPtr(nuiApplication?.ApplicationHandle), appId), true)
35 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
37 internal WidgetViewManager(global::System.IntPtr cPtr, bool cMemoryOwn) : base(Interop.WidgetViewManager.Upcast(cPtr), cMemoryOwn)
42 /// Creates a new widget view object.
44 /// <param name="widgetId">The widget ID.</param>
45 /// <param name="contentInfo">Contents that will be given to the widget instance.</param>
46 /// <param name="width">The widget width.</param>
47 /// <param name="height">The widget height.</param>
48 /// <param name="updatePeriod">The period of updating contents of the widget.</param>
49 /// <returns>A handle to WidgetView.</returns>
50 /// <since_tizen> 3 </since_tizen>
51 public WidgetView AddWidget(string widgetId, string contentInfo, int width, int height, float updatePeriod)
53 WidgetView ret = new WidgetView(Interop.WidgetViewManager.AddWidget(swigCPtr, widgetId, contentInfo, width, height, updatePeriod), true);
54 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
58 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(WidgetViewManager obj)
60 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
63 internal static WidgetViewManager DownCast(BaseHandle handle)
65 WidgetViewManager ret = new WidgetViewManager(Interop.WidgetViewManager.DownCast(BaseHandle.getCPtr(handle)), true);
66 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
70 internal WidgetViewManager(WidgetViewManager handle) : this(Interop.WidgetViewManager.NewWidgetViewManager(WidgetViewManager.getCPtr(handle)), true)
72 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
75 internal WidgetViewManager Assign(WidgetViewManager handle)
77 WidgetViewManager ret = new WidgetViewManager(Interop.WidgetViewManager.Assign(swigCPtr, WidgetViewManager.getCPtr(handle)), false);
78 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
82 /// This will not be public opened.
83 [EditorBrowsable(EditorBrowsableState.Never)]
84 protected override void ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef swigCPtr)
86 Interop.WidgetViewManager.DeleteWidgetViewManager(swigCPtr);