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