manual bind tts player for nui
[platform/core/csapi/tizenfx.git] / src / Tizen.NUI / src / public / BaseHandle.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     public class BaseHandle : global::System.IDisposable
15     {
16         private global::System.Runtime.InteropServices.HandleRef swigCPtr;
17         protected bool swigCMemOwn;
18
19         internal BaseHandle(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(BaseHandle 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         ~BaseHandle()
36         {
37             if (!isDisposeQueued)
38             {
39                 isDisposeQueued = true;
40                 DisposeQueue.Instance.Add(this);
41             }
42         }
43
44         public void Dispose()
45         {
46             //Throw excpetion if Dispose() is called in separate thread.
47             if (!Window.IsInstalled())
48             {
49                 throw new System.InvalidOperationException("This API called from separate thread. This API must be called from MainThread.");
50             }
51
52             if (isDisposeQueued)
53             {
54                 Dispose(DisposeTypes.Implicit);
55             }
56             else
57             {
58                 Dispose(DisposeTypes.Explicit);
59                 System.GC.SuppressFinalize(this);
60             }
61         }
62
63         protected virtual void Dispose(DisposeTypes type)
64         {
65             if (disposed)
66             {
67                 return;
68             }
69
70             if (type == DisposeTypes.Explicit)
71             {
72                 //Called by User
73                 //Release your own managed resources here.
74                 //You should release all of your own disposable objects here.
75
76             }
77
78             //Release your own unmanaged resources here.
79             //You should not access any managed member here except static instance.
80             //because the execution order of Finalizes is non-deterministic.
81
82             if (swigCPtr.Handle != global::System.IntPtr.Zero)
83             {
84                 if (swigCMemOwn)
85                 {
86                     swigCMemOwn = false;
87                     NDalicPINVOKE.delete_BaseHandle(swigCPtr);
88                 }
89                 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
90             }
91
92             disposed = true;
93         }
94
95
96
97         // Returns the bool value true to indicate that an operand is true and returns false otherwise.
98         public static bool operator true(BaseHandle handle)
99         {
100             // if the C# object is null, return false
101             if (BaseHandle.ReferenceEquals(handle, null))
102             {
103                 return false;
104             }
105             // returns true if the handle has a body, false otherwise
106             return handle.HasBody();
107         }
108
109         // Returns the bool false  to indicate that an operand is false and returns true otherwise.
110         public static bool operator false(BaseHandle handle)
111         {
112             // if the C# object is null, return true
113             if (BaseHandle.ReferenceEquals(handle, null))
114             {
115                 return true;
116             }
117             return !handle.HasBody();
118         }
119
120         // Explicit conversion from Handle to bool.
121         public static explicit operator bool(BaseHandle handle)
122         {
123             // if the C# object is null, return false
124             if (BaseHandle.ReferenceEquals(handle, null))
125             {
126                 return false;
127             }
128             // returns true if the handle has a body, false otherwise
129             return handle.HasBody();
130         }
131
132         // Equality operator
133         public static bool operator ==(BaseHandle x, BaseHandle y)
134         {
135             // if the C# objects are the same return true
136             if (BaseHandle.ReferenceEquals(x, y))
137             {
138                 return true;
139             }
140             if (!BaseHandle.ReferenceEquals(x, null) && !BaseHandle.ReferenceEquals(y, null))
141             {
142                 // drop into native code to see if both handles point to the same body
143                 return x.IsEqual(y);
144             }
145
146             if (BaseHandle.ReferenceEquals(x, null) && !BaseHandle.ReferenceEquals(y, null))
147             {
148                 if (y.HasBody()) return false;
149                 else return true;
150             }
151             if (!BaseHandle.ReferenceEquals(x, null) && BaseHandle.ReferenceEquals(y, null))
152             {
153                 if (x.HasBody()) return false;
154                 else return true;
155             }
156
157             return false;
158         }
159
160         // Inequality operator. Returns Null if either operand is Null
161         public static bool operator !=(BaseHandle x, BaseHandle y)
162         {
163             return !(x == y);
164         }
165
166         // Logical AND operator for &&
167         // It's possible when doing a && this function (opBitwiseAnd) is never called due
168         // to short circuiting. E.g.
169         // If you perform x && y What actually is called is
170         // BaseHandle.op_False( x ) ? BaseHandle.op_True( x ) : BaseHandle.opTrue( BaseHandle.opBitwiseAnd(x,y) )
171         //
172         public static BaseHandle operator &(BaseHandle x, BaseHandle y)
173         {
174             if (x == y)
175             {
176                 return x;
177             }
178             return null;
179         }
180
181         // Logical OR operator for ||
182         // It's possible when doing a || this function (opBitwiseOr) is never called due
183         // to short circuiting. E.g.
184         // If you perform x || y What actually is called is
185         // BaseHandle.op_True( x ) ? BaseHandle.op_True( x ) : BaseHandle.opTrue( BaseHandle.opBitwiseOr(x,y) )
186         public static BaseHandle operator |(BaseHandle x, BaseHandle y)
187         {
188             if (!BaseHandle.ReferenceEquals(x, null) || !BaseHandle.ReferenceEquals(y, null))
189             {
190                 if (x.HasBody())
191                 {
192                     return x;
193                 }
194                 if (y.HasBody())
195                 {
196                     return y;
197                 }
198                 return null;
199             }
200             return null;
201         }
202
203         // Logical ! operator
204         public static bool operator !(BaseHandle x)
205         {
206             // if the C# object is null, return true
207             if (BaseHandle.ReferenceEquals(x, null))
208             {
209                 return true;
210             }
211             if (x.HasBody())
212             {
213                 return false;
214             }
215             return true;
216         }
217
218
219         internal BaseHandle(BaseObject handle) : this(NDalicPINVOKE.new_BaseHandle__SWIG_0(BaseObject.getCPtr(handle)), true)
220         {
221             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
222         }
223
224         public BaseHandle() : this(NDalicPINVOKE.new_BaseHandle__SWIG_1(), true)
225         {
226             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
227         }
228
229         public BaseHandle(BaseHandle handle) : this(NDalicPINVOKE.new_BaseHandle__SWIG_2(BaseHandle.getCPtr(handle)), true)
230         {
231             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
232         }
233
234         public BaseHandle Assign(BaseHandle rhs)
235         {
236             BaseHandle ret = new BaseHandle(NDalicPINVOKE.BaseHandle_Assign(swigCPtr, BaseHandle.getCPtr(rhs)), false);
237             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
238             return ret;
239         }
240
241         public bool DoAction(string actionName, PropertyMap attributes)
242         {
243             bool ret = NDalicPINVOKE.BaseHandle_DoAction(swigCPtr, actionName, PropertyMap.getCPtr(attributes));
244             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
245             return ret;
246         }
247
248         public string GetTypeName()
249         {
250             string ret = NDalicPINVOKE.BaseHandle_GetTypeName(swigCPtr);
251             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
252             return ret;
253         }
254
255         public bool GetTypeInfo(TypeInfo info)
256         {
257             bool ret = NDalicPINVOKE.BaseHandle_GetTypeInfo(swigCPtr, TypeInfo.getCPtr(info));
258             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
259             return ret;
260         }
261
262         internal BaseObject GetBaseObject()
263         {
264             BaseObject ret = new BaseObject(NDalicPINVOKE.BaseHandle_GetBaseObject__SWIG_0(swigCPtr), false);
265             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
266             return ret;
267         }
268
269         public void Reset()
270         {
271             NDalicPINVOKE.BaseHandle_Reset(swigCPtr);
272             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
273         }
274
275         public bool EqualTo(BaseHandle rhs)
276         {
277             bool ret = NDalicPINVOKE.BaseHandle_EqualTo(swigCPtr, BaseHandle.getCPtr(rhs));
278             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
279             return ret;
280         }
281
282         public bool NotEqualTo(BaseHandle rhs)
283         {
284             bool ret = NDalicPINVOKE.BaseHandle_NotEqualTo(swigCPtr, BaseHandle.getCPtr(rhs));
285             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
286             return ret;
287         }
288
289         internal RefObject GetObjectPtr()
290         {
291             global::System.IntPtr cPtr = NDalicPINVOKE.BaseHandle_GetObjectPtr(swigCPtr);
292             RefObject ret = (cPtr == global::System.IntPtr.Zero) ? null : new RefObject(cPtr, false);
293             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
294             return ret;
295         }
296
297         public bool HasBody()
298         {
299             bool ret = NDalicPINVOKE.BaseHandle_HasBody(swigCPtr);
300             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
301             return ret;
302         }
303
304         public bool IsEqual(BaseHandle rhs)
305         {
306             bool ret = NDalicPINVOKE.BaseHandle_IsEqual(swigCPtr, BaseHandle.getCPtr(rhs));
307             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
308             return ret;
309         }
310
311     }
312
313 }
314