[NUI] Reduce code duplication - refactor dispose codes (#1010)
[platform/core/csapi/tizenfx.git] / src / Tizen.NUI / src / internal / WidgetViewSignal.cs
1 //------------------------------------------------------------------------------
2 // <auto-generated />
3 //
4 // This file was automatically generated by SWIG (http://www.swig.org).
5 // Version 3.0.12
6 //
7 // Do not make changes to this file unless you know what you are doing--modify
8 // the SWIG interface file instead.
9 //------------------------------------------------------------------------------
10 using System.ComponentModel;
11
12 namespace Tizen.NUI
13 {
14     /// <summary>
15     /// WidgetViewSignal
16     /// </summary>
17     /// <since_tizen> 3 </since_tizen>
18     public class WidgetViewSignal : Disposable
19     {
20         private global::System.Runtime.InteropServices.HandleRef swigCPtr;
21         /// <summary>
22         /// swigCMemOwn
23         /// </summary>
24         /// <since_tizen> 3 </since_tizen>
25         protected bool swigCMemOwn;
26
27         internal WidgetViewSignal(global::System.IntPtr cPtr, bool cMemoryOwn)
28         {
29             swigCMemOwn = cMemoryOwn;
30             swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
31         }
32
33         internal static global::System.Runtime.InteropServices.HandleRef getCPtr(WidgetViewSignal obj)
34         {
35             return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
36         }
37
38         /// <summary>
39         /// Dispose
40         /// </summary>
41         /// <since_tizen> 3 </since_tizen>
42         protected override void Dispose(DisposeTypes type)
43         {
44             if (disposed)
45             {
46                 return;
47             }
48
49             if (swigCPtr.Handle != global::System.IntPtr.Zero)
50             {
51                 if (swigCMemOwn)
52                 {
53                     swigCMemOwn = false;
54                     Interop.WidgetView.delete_WidgetViewSignal(swigCPtr);
55                 }
56                 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
57             }
58
59             base.Dispose(type);
60         }
61
62         /// <summary>
63         /// Queries whether there are any connected slots.
64         /// </summary>
65         /// <returns>True if there are any slots connected to the signal</returns>
66         /// <since_tizen> 3 </since_tizen>
67         public bool Empty()
68         {
69             bool ret = Interop.WidgetView.WidgetViewSignal_Empty(swigCPtr);
70             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
71             return ret;
72         }
73
74         /// <summary>
75         /// Queries the number of slots.
76         /// </summary>
77         /// <returns>The number of slots connected to this signal</returns>
78         /// <since_tizen> 3 </since_tizen>
79         public uint GetConnectionCount()
80         {
81             uint ret = Interop.WidgetView.WidgetViewSignal_GetConnectionCount(swigCPtr);
82             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
83             return ret;
84         }
85
86         /// <summary>
87         /// Connects a function.
88         /// </summary>
89         /// <param name="func">The function to connect</param>
90         /// <since_tizen> 3 </since_tizen>
91         public void Connect(System.Delegate func)
92         {
93             System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate<System.Delegate>(func);
94             {
95                 Interop.WidgetView.WidgetViewSignal_Connect(swigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip));
96                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
97             }
98         }
99
100         /// <summary>
101         /// Disconnects a function.
102         /// </summary>
103         /// <param name="func">The function to disconnect</param>
104         /// <since_tizen> 3 </since_tizen>
105         public void Disconnect(System.Delegate func)
106         {
107             System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate<System.Delegate>(func);
108             {
109                 Interop.WidgetView.WidgetViewSignal_Disconnect(swigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip));
110                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
111             }
112         }
113
114         /// <summary>
115         /// Connects a member function.
116         /// </summary>
117         /// <param name="arg">The member function to connect</param>
118         /// <since_tizen> 3 </since_tizen>
119         public void Emit(WidgetView arg)
120         {
121             Interop.WidgetView.WidgetViewSignal_Emit(swigCPtr, WidgetView.getCPtr(arg));
122             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
123         }
124
125         /// <summary>
126         /// The contructor.
127         /// </summary>
128         /// <since_tizen> 3 </since_tizen>
129         public WidgetViewSignal() : this(Interop.WidgetView.new_WidgetViewSignal(), true)
130         {
131             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
132         }
133     }
134 }