[NUI] Add Obsolete attributes for EditorBrowsable apis
[platform/core/csapi/tizenfx.git] / src / Tizen.NUI / src / internal / ImfVoidSignalType.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;
18 using System.Runtime.InteropServices;
19 using System.ComponentModel;
20
21 namespace Tizen.NUI
22 {
23     /// <summary>
24     /// Please do not use! this will be deprecated
25     /// </summary>
26     /// <since_tizen> 3 </since_tizen>
27     [Obsolete("Please do not use! This will be deprecated!")]
28     [EditorBrowsable(EditorBrowsableState.Never)]
29     public class ImfVoidSignalType : global::System.IDisposable
30     {
31         private global::System.Runtime.InteropServices.HandleRef swigCPtr;
32         /// <summary>
33         /// swigCMemOwn
34         /// </summary>
35         /// <since_tizen> 3 </since_tizen>
36         protected bool swigCMemOwn;
37
38         internal ImfVoidSignalType(global::System.IntPtr cPtr, bool cMemoryOwn)
39         {
40             swigCMemOwn = cMemoryOwn;
41             swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
42         }
43
44         internal static global::System.Runtime.InteropServices.HandleRef getCPtr(ImfVoidSignalType obj)
45         {
46             return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
47         }
48
49         //A Flag to check who called Dispose(). (By User or DisposeQueue)
50         private bool isDisposeQueued = false;
51         /// <summary>
52         /// A Flat to check if it is already disposed.
53         /// </summary>
54         /// <since_tizen> 3 </since_tizen>
55         protected bool disposed = false;
56
57         /// <summary>
58         /// Dispose
59         /// </summary>
60         /// <since_tizen> 3 </since_tizen>
61         ~ImfVoidSignalType()
62         {
63             if (!isDisposeQueued)
64             {
65                 isDisposeQueued = true;
66                 DisposeQueue.Instance.Add(this);
67             }
68         }
69
70         /// <summary>
71         /// Dispose
72         /// </summary>
73         /// <since_tizen> 3 </since_tizen>
74         public void Dispose()
75         {
76             //Throw excpetion if Dispose() is called in separate thread.
77             if (!Window.IsInstalled())
78             {
79                 throw new System.InvalidOperationException("This API called from separate thread. This API must be called from MainThread.");
80             }
81
82             if (isDisposeQueued)
83             {
84                 Dispose(DisposeTypes.Implicit);
85             }
86             else
87             {
88                 Dispose(DisposeTypes.Explicit);
89                 System.GC.SuppressFinalize(this);
90             }
91         }
92
93         /// <summary>
94         /// Dispose
95         /// </summary>
96         /// <since_tizen> 3 </since_tizen>
97         protected virtual void Dispose(DisposeTypes type)
98         {
99             if (disposed)
100             {
101                 return;
102             }
103
104             if (type == DisposeTypes.Explicit)
105             {
106                 //Called by User
107                 //Release your own managed resources here.
108                 //You should release all of your own disposable objects here.
109
110             }
111
112             //Release your own unmanaged resources here.
113             //You should not access any managed member here except static instance.
114             //because the execution order of Finalizes is non-deterministic.
115
116             if (swigCPtr.Handle != global::System.IntPtr.Zero)
117             {
118                 if (swigCMemOwn)
119                 {
120                     swigCMemOwn = false;
121                     NDalicManualPINVOKE.delete_ImfVoidSignalType(swigCPtr);
122                 }
123                 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
124             }
125
126             disposed = true;
127         }
128
129         /// <summary>
130         /// The contructor.
131         /// </summary>
132         /// <since_tizen> 3 </since_tizen>
133         public ImfVoidSignalType() : this(NDalicManualPINVOKE.new_ImfVoidSignalType(), true)
134         {
135             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
136         }
137
138         /// <summary>
139         /// Queries whether there are any connected slots.
140         /// </summary>
141         /// <returns>True if there are any slots connected to the signal</returns>
142         /// <since_tizen> 3 </since_tizen>
143         public bool Empty()
144         {
145             bool ret = NDalicManualPINVOKE.ImfVoidSignalType_Empty(swigCPtr);
146             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
147             return ret;
148         }
149
150         /// <summary>
151         /// Queries the number of slots.
152         /// </summary>
153         /// <returns>The number of slots connected to this signal</returns>
154         /// <since_tizen> 3 </since_tizen>
155         public uint GetConnectionCount()
156         {
157             uint ret = NDalicManualPINVOKE.ImfVoidSignalType_GetConnectionCount(swigCPtr);
158             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
159             return ret;
160         }
161
162         /// <summary>
163         /// Connects a function.
164         /// </summary>
165         /// <param name="func">The function to connect</param>
166         /// <since_tizen> 3 </since_tizen>
167         public void Connect(System.Delegate func)
168         {
169             System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate<System.Delegate>(func);
170             {
171                 NDalicManualPINVOKE.ImfVoidSignalType_Connect__SWIG_0(swigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip));
172                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
173             }
174         }
175
176         /// <summary>
177         /// Disconnects a function.
178         /// </summary>
179         /// <param name="func">The function to disconnect</param>
180         /// <since_tizen> 3 </since_tizen>
181         public void Disconnect(System.Delegate func)
182         {
183             System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate<System.Delegate>(func);
184             {
185                 NDalicManualPINVOKE.ImfVoidSignalType_Disconnect(swigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip));
186                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
187             }
188         }
189         /// <summary>
190         /// Connects a member function.
191         /// </summary>
192         /// <param name="connectionTracker">An object which must implement the ConnectionTrackerInterface</param>
193         /// <param name="arg1">The member function to connect</param>
194         /// <since_tizen> 4 </since_tizen>
195         public void Connect(ConnectionTrackerInterface connectionTracker, SWIGTYPE_p_Dali__FunctorDelegate arg1)
196         {
197             NDalicManualPINVOKE.ImfVoidSignalType_Connect__SWIG_4(swigCPtr, ConnectionTrackerInterface.getCPtr(connectionTracker), SWIGTYPE_p_Dali__FunctorDelegate.getCPtr(arg1));
198             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
199         }
200
201         /// <summary>
202         /// Emits the signal.
203         /// </summary>
204         /// <since_tizen> 3 </since_tizen>
205         public void Emit()
206         {
207             NDalicManualPINVOKE.ImfVoidSignalType_Emit(swigCPtr);
208             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
209         }
210
211     }
212
213 }