merging dali-sharp class scope with nui
[platform/core/csapi/tizenfx.git] / src / Tizen.NUI / src / internal / VoidSignal.cs
1 //------------------------------------------------------------------------------
2 // <auto-generated />
3 //
4 // This file was automatically generated by SWIG (http://www.swig.org).
5 // Version 3.0.9
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
11 namespace Tizen.NUI
12 {
13
14     internal class VoidSignal : global::System.IDisposable
15     {
16         private global::System.Runtime.InteropServices.HandleRef swigCPtr;
17         protected bool swigCMemOwn;
18
19         internal VoidSignal(global::System.IntPtr cPtr, bool cMemoryOwn)
20         {
21             swigCMemOwn = cMemoryOwn;
22             swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
23         }
24
25         internal static global::System.Runtime.InteropServices.HandleRef getCPtr(VoidSignal obj)
26         {
27             return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
28         }
29
30         //A Flag to check who called Dispose(). (By User or DisposeQueue)
31         private bool isDisposeQueued = false;
32         //A Flat to check if it is already disposed.
33         protected bool disposed = false;
34
35
36         ~VoidSignal()
37         {
38             if (!isDisposeQueued)
39             {
40                 isDisposeQueued = true;
41                 DisposeQueue.Instance.Add(this);
42             }
43         }
44
45         public void Dispose()
46         {
47             //Throw excpetion if Dispose() is called in separate thread.
48             if (!Window.IsInstalled())
49             {
50                 throw new System.InvalidOperationException("This API called from separate thread. This API must be called from MainThread.");
51             }
52
53             if (isDisposeQueued)
54             {
55                 Dispose(DisposeTypes.Implicit);
56             }
57             else
58             {
59                 Dispose(DisposeTypes.Explicit);
60                 System.GC.SuppressFinalize(this);
61             }
62         }
63
64         protected virtual void Dispose(DisposeTypes type)
65         {
66             if (disposed)
67             {
68                 return;
69             }
70
71             if (type == DisposeTypes.Explicit)
72             {
73                 //Called by User
74                 //Release your own managed resources here.
75                 //You should release all of your own disposable objects here.
76
77             }
78
79             //Release your own unmanaged resources here.
80             //You should not access any managed member here except static instance.
81             //because the execution order of Finalizes is non-deterministic.
82
83             if (swigCPtr.Handle != global::System.IntPtr.Zero)
84             {
85                 if (swigCMemOwn)
86                 {
87                     swigCMemOwn = false;
88                     NDalicPINVOKE.delete_VoidSignal(swigCPtr);
89                 }
90                 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
91             }
92
93             disposed = true;
94         }
95
96
97         public VoidSignal() : this(NDalicPINVOKE.new_VoidSignal(), true)
98         {
99             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
100         }
101
102         public bool Empty()
103         {
104             bool ret = NDalicPINVOKE.VoidSignal_Empty(swigCPtr);
105             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
106             return ret;
107         }
108
109         public uint GetConnectionCount()
110         {
111             uint ret = NDalicPINVOKE.VoidSignal_GetConnectionCount(swigCPtr);
112             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
113             return ret;
114         }
115
116         public void Connect(System.Delegate func)
117         {
118             System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func);
119             {
120                 NDalicPINVOKE.VoidSignal_Connect__SWIG_0(swigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip));
121                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
122             }
123         }
124
125         public void Disconnect(System.Delegate func)
126         {
127             System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func);
128             {
129                 NDalicPINVOKE.VoidSignal_Disconnect(swigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip));
130                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
131             }
132         }
133
134         public void Connect(ConnectionTrackerInterface connectionTracker, SWIGTYPE_p_Dali__FunctorDelegate arg1)
135         {
136             NDalicPINVOKE.VoidSignal_Connect__SWIG_4(swigCPtr, ConnectionTrackerInterface.getCPtr(connectionTracker), SWIGTYPE_p_Dali__FunctorDelegate.getCPtr(arg1));
137             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
138         }
139
140         public void Emit()
141         {
142             NDalicPINVOKE.VoidSignal_Emit(swigCPtr);
143             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
144         }
145
146     }
147
148 }