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