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