[NUI] Fixing the emtpy finalizers(CA1821)
[platform/core/csapi/tizenfx.git] / src / Tizen.NUI / src / public / WidgetViewManager.cs
1 /*
2  * Copyright(c) 2017 Samsung Electronics Co., Ltd.
3  *
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
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
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.
15  *
16  */
17 using System.ComponentModel;
18
19 namespace Tizen.NUI
20 {
21     /// <summary>
22     /// WidgetViewManager manages addition of WidgetView controls.
23     /// This class provides the functionality of adding the widget views and controlling the widgets.
24     /// </summary>
25     /// <since_tizen> 3 </since_tizen>
26     public class WidgetViewManager : BaseHandle
27     {
28
29         /// <summary>
30         /// Creates a new widgetView manager object.
31         /// </summary>
32         /// <since_tizen> 3 </since_tizen>
33         public WidgetViewManager(NUIApplication nuiApplication, string appId) : this(Interop.WidgetViewManager.New(Application.getCPtr(nuiApplication?.ApplicationHandle), appId), true)
34         {
35             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
36         }
37         internal WidgetViewManager(global::System.IntPtr cPtr, bool cMemoryOwn) : base(Interop.WidgetViewManager.Upcast(cPtr), cMemoryOwn)
38         {
39         }
40
41         /// <summary>
42         /// Creates a new widget view object.
43         /// </summary>
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)
52         {
53             WidgetView ret = new WidgetView(Interop.WidgetViewManager.AddWidget(SwigCPtr, widgetId, contentInfo, width, height, updatePeriod), true);
54             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
55             return ret;
56         }
57
58         internal static global::System.Runtime.InteropServices.HandleRef getCPtr(WidgetViewManager obj)
59         {
60             return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.SwigCPtr;
61         }
62
63         internal static WidgetViewManager DownCast(BaseHandle handle)
64         {
65             WidgetViewManager ret = new WidgetViewManager(Interop.WidgetViewManager.DownCast(BaseHandle.getCPtr(handle)), true);
66             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
67             return ret;
68         }
69
70         internal WidgetViewManager(WidgetViewManager handle) : this(Interop.WidgetViewManager.NewWidgetViewManager(WidgetViewManager.getCPtr(handle)), true)
71         {
72             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
73         }
74
75         internal WidgetViewManager Assign(WidgetViewManager handle)
76         {
77             WidgetViewManager ret = new WidgetViewManager(Interop.WidgetViewManager.Assign(SwigCPtr, WidgetViewManager.getCPtr(handle)), false);
78             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
79             return ret;
80         }
81
82         /// This will not be public opened.
83         [EditorBrowsable(EditorBrowsableState.Never)]
84         protected override void ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef swigCPtr)
85         {
86             Interop.WidgetViewManager.DeleteWidgetViewManager(swigCPtr);
87         }
88     }
89 }