Merge branch 'devel/master' into tizen
[platform/core/csapi/tizenfx.git] / src / Tizen.NUI / src / public / Rectangle.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     /// <summary>
15     /// Rectangle class
16     /// </summary>
17     public class Rectangle : global::System.IDisposable
18     {
19         private global::System.Runtime.InteropServices.HandleRef swigCPtr;
20         protected bool swigCMemOwn;
21
22         internal Rectangle(global::System.IntPtr cPtr, bool cMemoryOwn)
23         {
24             swigCMemOwn = cMemoryOwn;
25             swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
26         }
27
28         internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Rectangle obj)
29         {
30             return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
31         }
32
33         //NUI Dispose Pattern written by Jinwoo Nam(jjw.nam) 
34
35         //A Flag to check who called Dispose(). (By User or DisposeQueue)
36         private bool isDisposeQueued = false;
37         //A Flat to check if it is already disposed.
38         protected bool disposed = false;
39
40         ~Rectangle()
41         {
42             if(!isDisposeQueued)
43             {
44                 isDisposeQueued = true;
45                 DisposeQueue.Instance.Add(this);
46             }
47         }
48
49         public void Dispose()
50         {
51             //Throw excpetion if Dispose() is called in separate thread.
52             if (!Window.IsInstalled())
53             {
54                 throw new System.InvalidOperationException("This API called from separate thread. This API must be called from MainThread.");
55             }
56
57             if (isDisposeQueued)
58             {
59                 Dispose(DisposeTypes.Implicit);
60             }
61             else
62             {
63                 Dispose(DisposeTypes.Explicit);
64                 System.GC.SuppressFinalize(this);
65             }
66         }
67
68         protected virtual void Dispose(DisposeTypes type)
69         {
70             if (disposed)
71             {
72                 return;
73             }
74
75             if(type == DisposeTypes.Explicit)
76             {
77                 //Called by User
78                 //Release your own managed resources here.
79                 //You should release all of your own disposable objects here.
80             }
81
82             //Release your own unmanaged resources here.
83             //You should not access any managed member here except static instance.
84             //because the execution order of Finalizes is non-deterministic.
85
86             if (swigCPtr.Handle != global::System.IntPtr.Zero)
87             {
88                 if (swigCMemOwn)
89                 {
90                     swigCMemOwn = false;
91                     NDalicPINVOKE.delete_Rectangle(swigCPtr);
92                 }
93                 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
94             }
95             disposed = true;
96         }
97
98         /// <summary>
99         /// Equality operator.
100         /// </summary>
101         /// <param name="a">First operand</param>
102         /// <param name="b">Second operand</param>
103         /// <returns>True if boxes are exactly same</returns>
104         public static bool operator ==(Rectangle a, Rectangle b)
105         {
106             // If both are null, or both are same instance, return true.
107             if (System.Object.ReferenceEquals(a, b))
108             {
109                 return true;
110             }
111
112             // If one is null, but not both, return false.
113             if (((object)a == null) || ((object)b == null))
114             {
115                 return false;
116             }
117
118             // Return true if the fields match:
119             return a.X == b.X && a.Y == b.Y && a.Width == b.Width && a.Height == b.Height;
120         }
121
122         /// <summary>
123         /// Inequality operator.
124         /// </summary>
125         /// <param name="a">The first rectangle</param>
126         /// <param name="b">The second rectangle</param>
127         /// <returns>True if rectangles are not identical</returns>
128         public static bool operator !=(Rectangle a, Rectangle b)
129         {
130             return !(a == b);
131         }
132
133         /// <summary>
134         /// X position of the rectangle
135         /// </summary>
136         public int X
137         {
138             set
139             {
140                 x = ( value );
141             }
142             get
143             {
144                 return x;
145             }
146             }
147
148         /// <summary>
149         /// Y position of the rectangle
150         /// </summary>
151         public int Y
152         {
153             set
154             {
155                 y = ( value );
156             }
157             get
158             {
159                 return y;
160             }
161         }
162
163         /// <summary>
164         /// Width of the rectangle
165         /// </summary>
166         public int Width
167         {
168             set
169             {
170                 width = ( value );
171             }
172             get
173             {
174                 return width;
175             }
176         }
177
178         /// <summary>
179         /// Height of the rectangle
180         /// </summary>
181         public int Height
182         {
183             set
184             {
185                 height = ( value );
186             }
187             get
188             {
189                 return height;
190             }
191         }
192
193         /// <summary>
194         /// Constructor.
195         /// </summary>
196         public Rectangle() : this(NDalicPINVOKE.new_Rectangle__SWIG_0(), true)
197         {
198             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
199         }
200
201         /// <summary>
202         /// Constructor.
203         /// </summary>
204         /// <param name="x">X coordinate (or left)</param>
205         /// <param name="y">Y coordinate (or right)</param>
206         /// <param name="width">Width (or bottom)</param>
207         /// <param name="height">Height (or top)</param>
208         public Rectangle(int x, int y, int width, int height) : this(NDalicPINVOKE.new_Rectangle__SWIG_1(x, y, width, height), true)
209         {
210             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
211         }
212
213         /// <summary>
214         /// Assignment from individual values.
215         /// </summary>
216         /// <param name="newX">X coordinate</param>
217         /// <param name="newY">Y coordinate</param>
218         /// <param name="newWidth">Width</param>
219         /// <param name="newHeight">Height</param>
220         public void Set(int newX, int newY, int newWidth, int newHeight)
221         {
222             NDalicPINVOKE.Rectangle_Set(swigCPtr, newX, newY, newWidth, newHeight);
223             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
224         }
225
226         /// <summary>
227         /// Determines whether or not this Rectangle is empty.
228         /// </summary>
229         /// <returns>True if width or height are zero</returns>
230         public bool IsEmpty()
231         {
232             bool ret = NDalicPINVOKE.Rectangle_IsEmpty(swigCPtr);
233             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
234             return ret;
235         }
236
237         /// <summary>
238         /// Gets the left of the rectangle.
239         /// </summary>
240         /// <returns>The left edge of the rectangle</returns>
241         public int Left()
242         {
243             int ret = NDalicPINVOKE.Rectangle_Left(swigCPtr);
244             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
245             return ret;
246         }
247
248         /// <summary>
249         /// Gets the right of the rectangle.
250         /// </summary>
251         /// <returns>The right edge of the rectangle</returns>
252         public int Right()
253         {
254             int ret = NDalicPINVOKE.Rectangle_Right(swigCPtr);
255             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
256             return ret;
257         }
258
259         /// <summary>
260         /// Gets the top of the rectangle.
261         /// </summary>
262         /// <returns>The top of the rectangle</returns>
263         public int Top()
264         {
265             int ret = NDalicPINVOKE.Rectangle_Top(swigCPtr);
266             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
267             return ret;
268         }
269
270         /// <summary>
271         /// Gets the bottom of the rectangle.
272         /// </summary>
273         /// <returns>The bottom of the rectangle</returns>
274         public int Bottom()
275         {
276             int ret = NDalicPINVOKE.Rectangle_Bottom(swigCPtr);
277             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
278             return ret;
279         }
280
281         /// <summary>
282         /// Gets the area of the rectangle.
283         /// </summary>
284         /// <returns>The area of the rectangle</returns>
285         public int Area()
286         {
287             int ret = NDalicPINVOKE.Rectangle_Area(swigCPtr);
288             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
289             return ret;
290         }
291
292         /// <summary>
293         /// Determines whether or not this rectangle and the specified rectangle intersect.
294         /// </summary>
295         /// <param name="other">The other rectangle to test against this rectangle</param>
296         /// <returns>True if the rectangles intersect</returns>
297         public bool Intersects(Rectangle other)
298         {
299             bool ret = NDalicPINVOKE.Rectangle_Intersects(swigCPtr, Rectangle.getCPtr(other));
300             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
301             return ret;
302         }
303
304         /// <summary>
305         /// Determines whether or not this Rectangle contains the specified rectangle.
306         /// </summary>
307         /// <param name="other">The other rectangle to test against this rectangle</param>
308         /// <returns>True if the specified rectangle is contained</returns>
309         public bool Contains(Rectangle other)
310         {
311             bool ret = NDalicPINVOKE.Rectangle_Contains(swigCPtr, Rectangle.getCPtr(other));
312             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
313             return ret;
314         }
315
316         private int x
317         {
318             set
319             {
320                 NDalicPINVOKE.Rectangle_x_set(swigCPtr, value);
321                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
322             }
323             get
324             {
325                 int ret = NDalicPINVOKE.Rectangle_x_get(swigCPtr);
326                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
327                 return ret;
328             }
329         }
330
331         private int left
332         {
333             set
334             {
335                 NDalicPINVOKE.Rectangle_left_set(swigCPtr, value);
336                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
337             }
338             get
339             {
340                 int ret = NDalicPINVOKE.Rectangle_left_get(swigCPtr);
341                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
342                 return ret;
343             }
344         }
345
346         private int y
347         {
348             set
349             {
350                 NDalicPINVOKE.Rectangle_y_set(swigCPtr, value);
351                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
352             }
353             get
354             {
355                 int ret = NDalicPINVOKE.Rectangle_y_get(swigCPtr);
356                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
357                 return ret;
358             }
359         }
360
361         private int right
362         {
363             set
364             {
365                 NDalicPINVOKE.Rectangle_right_set(swigCPtr, value);
366                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
367             }
368             get
369             {
370                 int ret = NDalicPINVOKE.Rectangle_right_get(swigCPtr);
371                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
372                 return ret;
373             }
374         }
375
376         private int width
377         {
378             set
379             {
380                 NDalicPINVOKE.Rectangle_width_set(swigCPtr, value);
381                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
382             }
383             get
384             {
385                 int ret = NDalicPINVOKE.Rectangle_width_get(swigCPtr);
386                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
387                 return ret;
388             }
389         }
390
391         private int bottom
392         {
393             set
394             {
395                 NDalicPINVOKE.Rectangle_bottom_set(swigCPtr, value);
396                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
397             }
398             get
399             {
400                 int ret = NDalicPINVOKE.Rectangle_bottom_get(swigCPtr);
401                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
402                 return ret;
403             }
404         }
405
406         private int height
407         {
408             set
409             {
410                 NDalicPINVOKE.Rectangle_height_set(swigCPtr, value);
411                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
412             }
413             get
414             {
415                 int ret = NDalicPINVOKE.Rectangle_height_get(swigCPtr);
416                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
417                 return ret;
418             }
419         }
420
421         private int top
422         {
423             set
424             {
425                 NDalicPINVOKE.Rectangle_top_set(swigCPtr, value);
426                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
427             }
428             get
429             {
430                 int ret = NDalicPINVOKE.Rectangle_top_get(swigCPtr);
431                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
432                 return ret;
433             }
434         }
435
436     }
437
438 }