[3.0] Dali C# GBS build enabled
[platform/core/uifw/dali-toolkit.git] / plugins / dali-swig / automatic / csharp / 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 Dali {
12
13 public class BaseHandle : global::System.IDisposable {
14   private global::System.Runtime.InteropServices.HandleRef swigCPtr;
15   protected bool swigCMemOwn;
16
17   internal BaseHandle(global::System.IntPtr cPtr, bool cMemoryOwn) {
18     swigCMemOwn = cMemoryOwn;
19     swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
20   }
21
22   internal static global::System.Runtime.InteropServices.HandleRef getCPtr(BaseHandle obj) {
23     return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
24   }
25
26   ~BaseHandle() {
27     Dispose();
28   }
29
30   public virtual void Dispose() {
31     lock(this) {
32       if (swigCPtr.Handle != global::System.IntPtr.Zero) {
33         if (swigCMemOwn) {
34           swigCMemOwn = false;
35           NDalicPINVOKE.delete_BaseHandle(swigCPtr);
36         }
37         swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
38       }
39       global::System.GC.SuppressFinalize(this);
40     }
41   }
42
43
44   // Returns the bool value true to indicate that an operand is true and returns false otherwise.
45   public static bool operator true(BaseHandle handle)
46   {
47     // if the C# object is null, return false
48     if( BaseHandle.ReferenceEquals( handle, null ) )
49     {
50       return false;
51     }
52     // returns true if the handle has a body, false otherwise
53     return handle.HasBody();
54   }
55
56   // Returns the bool false  to indicate that an operand is false and returns true otherwise.
57   public static bool operator false(BaseHandle  handle)
58   {
59     // if the C# object is null, return true
60     if( BaseHandle.ReferenceEquals( handle, null ) )
61     {
62       return true;
63     }
64     return !handle.HasBody();
65   }
66
67   // Explicit conversion from Handle to bool.
68   public static explicit operator bool(BaseHandle handle)
69   {
70      // if the C# object is null, return false
71     if( BaseHandle.ReferenceEquals( handle, null ) )
72     {
73       return false;
74     }
75     // returns true if the handle has a body, false otherwise
76     return handle.HasBody();
77   }
78
79   // Equality operator
80   public static bool operator == (BaseHandle x, BaseHandle y)
81   {
82     // if the C# objects are the same return true
83     if(  BaseHandle.ReferenceEquals( x, y ) )
84     {
85       return true;
86     }
87     if ( !BaseHandle.ReferenceEquals( x, null ) && !BaseHandle.ReferenceEquals( y, null ) )
88     {
89       // drop into native code to see if both handles point to the same body
90       return x.IsEqual( y) ;
91     }
92     return false;
93
94   }
95
96   // Inequality operator. Returns Null if either operand is Null
97   public static bool operator !=(BaseHandle x, BaseHandle y)
98   {
99     return !(x==y);
100   }
101
102   // Logical AND operator for &&
103   // It's possible when doing a && this function (opBitwiseAnd) is never called due
104   // to short circuiting. E.g.
105   // If you perform x && y What actually is called is
106   // BaseHandle.op_False( x ) ? BaseHandle.op_True( x ) : BaseHandle.opTrue( BaseHandle.opBitwiseAnd(x,y) )
107   //
108   public static BaseHandle operator &(BaseHandle x, BaseHandle y)
109   {
110     if( x == y )
111     {
112       return x;
113     }
114     return null;
115   }
116
117   // Logical OR operator for ||
118   // It's possible when doing a || this function (opBitwiseOr) is never called due
119   // to short circuiting. E.g.
120   // If you perform x || y What actually is called is
121   // BaseHandle.op_True( x ) ? BaseHandle.op_True( x ) : BaseHandle.opTrue( BaseHandle.opBitwiseOr(x,y) )
122   public static BaseHandle operator |(BaseHandle x, BaseHandle y)
123   {
124     if ( !BaseHandle.ReferenceEquals( x, null ) || !BaseHandle.ReferenceEquals( y, null ) )
125     {
126        if( x.HasBody() )
127        {
128          return x;
129        }
130        if( y.HasBody() )
131        {
132          return y;
133        }
134        return null;
135     }
136     return null;
137   }
138
139   // Logical ! operator
140   public static bool operator !(BaseHandle x)
141   {
142     // if the C# object is null, return true
143     if( BaseHandle.ReferenceEquals( x, null ) )
144     {
145       return true;
146     }
147     if( x.HasBody() )
148     {
149       return false;
150     }
151     return true;
152   }
153
154
155   public BaseHandle(BaseObject handle) : this(NDalicPINVOKE.new_BaseHandle__SWIG_0(BaseObject.getCPtr(handle)), true) {
156     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
157   }
158
159   public BaseHandle() : this(NDalicPINVOKE.new_BaseHandle__SWIG_1(), true) {
160     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
161   }
162
163   public BaseHandle(BaseHandle handle) : this(NDalicPINVOKE.new_BaseHandle__SWIG_2(BaseHandle.getCPtr(handle)), true) {
164     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
165   }
166
167   public BaseHandle Assign(BaseHandle rhs) {
168     BaseHandle ret = new BaseHandle(NDalicPINVOKE.BaseHandle_Assign(swigCPtr, BaseHandle.getCPtr(rhs)), false);
169     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
170     return ret;
171   }
172
173   public bool DoAction(string actionName, Property.Map attributes) {
174     bool ret = NDalicPINVOKE.BaseHandle_DoAction(swigCPtr, actionName, Property.Map.getCPtr(attributes));
175     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
176     return ret;
177   }
178
179   public string GetTypeName() {
180     string ret = NDalicPINVOKE.BaseHandle_GetTypeName(swigCPtr);
181     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
182     return ret;
183   }
184
185   public bool GetTypeInfo(TypeInfo info) {
186     bool ret = NDalicPINVOKE.BaseHandle_GetTypeInfo(swigCPtr, TypeInfo.getCPtr(info));
187     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
188     return ret;
189   }
190
191   public BaseObject GetBaseObject() {
192     BaseObject ret = new BaseObject(NDalicPINVOKE.BaseHandle_GetBaseObject__SWIG_0(swigCPtr), false);
193     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
194     return ret;
195   }
196
197   public void Reset() {
198     NDalicPINVOKE.BaseHandle_Reset(swigCPtr);
199     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
200   }
201
202   public bool EqualTo(BaseHandle rhs) {
203     bool ret = NDalicPINVOKE.BaseHandle_EqualTo(swigCPtr, BaseHandle.getCPtr(rhs));
204     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
205     return ret;
206   }
207
208   public bool NotEqualTo(BaseHandle rhs) {
209     bool ret = NDalicPINVOKE.BaseHandle_NotEqualTo(swigCPtr, BaseHandle.getCPtr(rhs));
210     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
211     return ret;
212   }
213
214   public RefObject GetObjectPtr() {
215     global::System.IntPtr cPtr = NDalicPINVOKE.BaseHandle_GetObjectPtr(swigCPtr);
216     RefObject ret = (cPtr == global::System.IntPtr.Zero) ? null : new RefObject(cPtr, false);
217     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
218     return ret;
219   }
220
221   public bool HasBody() {
222     bool ret = NDalicPINVOKE.BaseHandle_HasBody(swigCPtr);
223     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
224     return ret;
225   }
226
227   public bool IsEqual(BaseHandle rhs) {
228     bool ret = NDalicPINVOKE.BaseHandle_IsEqual(swigCPtr, BaseHandle.getCPtr(rhs));
229     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
230     return ret;
231   }
232
233 }
234
235 }