[NUI] Change Color, Position2D, and etc properties to own only one instance
[platform/core/csapi/tizenfx.git] / src / Tizen.NUI / src / public / Common / Position.cs
1 /*
2  * Copyright (c) 2021 Samsung Electronics Co., Ltd.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  *
16  */
17
18 using System;
19 using Tizen.NUI.Binding;
20 using System.ComponentModel;
21
22 namespace Tizen.NUI
23 {
24
25     /// <summary>
26     /// Position is a three-dimensional vector.
27     /// </summary>
28     /// <since_tizen> 3 </since_tizen>
29     [Tizen.NUI.Binding.TypeConverter(typeof(PositionTypeConverter))]
30     public class Position : Disposable, ICloneable
31     {
32
33         /// <summary>
34         /// The constructor.
35         /// </summary>
36         /// <remarks>
37         /// Position2D and Position are implicitly converted to each other, so these are compatible and can be replaced without any type casting. <br />
38         /// For example, the followings are possible. <br />
39         /// view.Position2D = new Position(10.0f, 10.0f, 10.0f); // be aware that here the z value(10.0f) will be lost. <br />
40         /// view.Position = new Position2D(10, 10); // be aware that here the z value is 0.0f by default. <br />
41         /// </remarks>
42         /// <since_tizen> 3 </since_tizen>
43         public Position() : this(Interop.Vector3.NewVector3(), true)
44         {
45             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
46         }
47
48         /// <summary>
49         /// The constructor.
50         /// </summary>
51         /// <param name="x">The x component.</param>
52         /// <param name="y">The y component.</param>
53         /// <param name="z">The z component(optional).</param>
54         /// <remarks>
55         /// Position2D and Position are implicitly converted to each other, so these are compatible and can be replaced without any type casting. <br />
56         /// For example, the followings are possible. <br />
57         /// view.Position2D = new Position(10.0f, 10.0f, 10.0f); // be aware that here the z value(10.0f) will be lost. <br />
58         /// view.Position = new Position2D(10, 10); // be aware that here the z value is 0.0f by default. <br />
59         /// </remarks>
60         /// <since_tizen> 3 </since_tizen>
61         public Position(float x, float y, float z = 0.0f) : this(Interop.Vector3.NewVector3(x, y, z), true)
62         {
63             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
64         }
65
66         /// <summary>
67         /// The constructor.
68         /// </summary>
69         /// <param name="position2d">Position2D to create this vector from.</param>
70         /// <since_tizen> 3 </since_tizen>
71         public Position(Position2D position2d) : this(Interop.Vector3.NewVector3WithVector2(Position2D.getCPtr(position2d)), true)
72         {
73             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
74         }
75
76         internal Position(global::System.IntPtr cPtr, bool cMemoryOwn) : base(cPtr, cMemoryOwn)
77         {
78         }
79
80         /// <summary>
81         /// ParentOrigin constants. It's 0.0.
82         /// </summary>
83         /// <since_tizen> 3 </since_tizen>
84         public static float ParentOriginTop
85         {
86             get
87             {
88                 float ret = Interop.NDalicParentOrigin.ParentOriginTopGet();
89                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
90                 return ret;
91             }
92         }
93
94         /// <summary>
95         /// ParentOrigin constants. It's 1.0.
96         /// </summary>
97         /// <since_tizen> 3 </since_tizen>
98         public static float ParentOriginBottom
99         {
100             get
101             {
102                 float ret = Interop.NDalicParentOrigin.ParentOriginBottomGet();
103                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
104                 return ret;
105             }
106         }
107
108         /// <summary>
109         /// ParentOrigin constants. It's 0.0.
110         /// </summary>
111         /// <since_tizen> 3 </since_tizen>
112         public static float ParentOriginLeft
113         {
114             get
115             {
116                 float ret = Interop.NDalicParentOrigin.ParentOriginLeftGet();
117                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
118                 return ret;
119             }
120         }
121
122         /// <summary>
123         /// ParentOrigin constants. It's 1.0.
124         /// </summary>
125         /// <since_tizen> 3 </since_tizen>
126         public static float ParentOriginRight
127         {
128             get
129             {
130                 float ret = Interop.NDalicParentOrigin.ParentOriginRightGet();
131                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
132                 return ret;
133             }
134         }
135
136         /// <summary>
137         /// ParentOrigin constants. It's 0.5.
138         /// </summary>
139         /// <since_tizen> 3 </since_tizen>
140         public static float ParentOriginMiddle
141         {
142             get
143             {
144                 float ret = Interop.NDalicParentOrigin.ParentOriginMiddleGet();
145                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
146                 return ret;
147             }
148         }
149
150         /// <summary>
151         /// ParentOrigin constants: 0.0, 0.0, 0.5.
152         /// </summary>
153         /// <since_tizen> 3 </since_tizen>
154         public static Position ParentOriginTopLeft
155         {
156             get
157             {
158                 global::System.IntPtr cPtr = Interop.NDalicParentOrigin.ParentOriginTopLeftGet();
159                 Position ret = (cPtr == global::System.IntPtr.Zero) ? null : new Position(cPtr, false);
160                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
161                 return ret;
162             }
163         }
164
165         /// <summary>
166         /// ParentOrigin constants: 0.5, 0.0, 0.5.
167         /// </summary>
168         /// <since_tizen> 3 </since_tizen>
169         public static Position ParentOriginTopCenter
170         {
171             get
172             {
173                 global::System.IntPtr cPtr = Interop.NDalicParentOrigin.ParentOriginTopCenterGet();
174                 Position ret = (cPtr == global::System.IntPtr.Zero) ? null : new Position(cPtr, false);
175                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
176                 return ret;
177             }
178         }
179
180         /// <summary>
181         /// ParentOrigin constants: 1.0, 0.0, 0.5.
182         /// </summary>
183         /// <since_tizen> 3 </since_tizen>
184         public static Position ParentOriginTopRight
185         {
186             get
187             {
188                 global::System.IntPtr cPtr = Interop.NDalicParentOrigin.ParentOriginTopRightGet();
189                 Position ret = (cPtr == global::System.IntPtr.Zero) ? null : new Position(cPtr, false);
190                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
191                 return ret;
192             }
193         }
194
195         /// <summary>
196         /// ParentOrigin constants: 0.0, 0.5, 0.5.
197         /// </summary>
198         /// <since_tizen> 3 </since_tizen>
199         public static Position ParentOriginCenterLeft
200         {
201             get
202             {
203                 global::System.IntPtr cPtr = Interop.NDalicParentOrigin.ParentOriginCenterLeftGet();
204                 Position ret = (cPtr == global::System.IntPtr.Zero) ? null : new Position(cPtr, false);
205                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
206                 return ret;
207             }
208         }
209
210         /// <summary>
211         /// ParentOrigin constants: 0.0, 0.5, 0.5
212         /// </summary>
213         /// <since_tizen> 3 </since_tizen>
214         public static Position ParentOriginCenter
215         {
216             get
217             {
218                 global::System.IntPtr cPtr = Interop.NDalicParentOrigin.ParentOriginCenterGet();
219                 Position ret = (cPtr == global::System.IntPtr.Zero) ? null : new Position(cPtr, false);
220                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
221                 return ret;
222             }
223         }
224
225         /// <summary>
226         /// ParentOrigin constants: 1.0, 0.5, 0.5.
227         /// </summary>
228         /// <since_tizen> 3 </since_tizen>
229         public static Position ParentOriginCenterRight
230         {
231             get
232             {
233                 global::System.IntPtr cPtr = Interop.NDalicParentOrigin.ParentOriginCenterRightGet();
234                 Position ret = (cPtr == global::System.IntPtr.Zero) ? null : new Position(cPtr, false);
235                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
236                 return ret;
237             }
238         }
239
240         /// <summary>
241         /// ParentOrigin constants: 0.0f, 1.0f, 0.5f.
242         /// </summary>
243         /// <since_tizen> 3 </since_tizen>
244         public static Position ParentOriginBottomLeft
245         {
246             get
247             {
248                 global::System.IntPtr cPtr = Interop.NDalicParentOrigin.ParentOriginBottomLeftGet();
249                 Position ret = (cPtr == global::System.IntPtr.Zero) ? null : new Position(cPtr, false);
250                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
251                 return ret;
252             }
253         }
254
255         /// <summary>
256         /// ParentOrigin constants: 0.5, 1.0, 0.5.
257         /// </summary>
258         /// <since_tizen> 3 </since_tizen>
259         public static Position ParentOriginBottomCenter
260         {
261             get
262             {
263                 global::System.IntPtr cPtr = Interop.NDalicParentOrigin.ParentOriginBottomCenterGet();
264                 Position ret = (cPtr == global::System.IntPtr.Zero) ? null : new Position(cPtr, false);
265                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
266                 return ret;
267             }
268         }
269
270         /// <summary>
271         /// ParentOrigin constants: 1.0, 1.0, 0.5.
272         /// </summary>
273         /// <since_tizen> 3 </since_tizen>
274         public static Position ParentOriginBottomRight
275         {
276             get
277             {
278                 global::System.IntPtr cPtr = Interop.NDalicParentOrigin.ParentOriginBottomRightGet();
279                 Position ret = (cPtr == global::System.IntPtr.Zero) ? null : new Position(cPtr, false);
280                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
281                 return ret;
282             }
283         }
284
285         /// <summary>
286         /// PivotPoint constants: 0.0.
287         /// </summary>
288         /// <since_tizen> 3 </since_tizen>
289         public static float PivotPointTop
290         {
291             get
292             {
293                 float ret = Interop.NDalicAnchorPoint.AnchorPointTopGet();
294                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
295                 return ret;
296             }
297         }
298
299         /// <summary>
300         /// PivotPoint constants: 1.0.
301         /// </summary>
302         /// <since_tizen> 3 </since_tizen>
303         public static float PivotPointBottom
304         {
305             get
306             {
307                 float ret = Interop.NDalicAnchorPoint.AnchorPointBottomGet();
308                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
309                 return ret;
310             }
311         }
312
313         /// <summary>
314         /// PivotPoint constants: 0.0.
315         /// </summary>
316         /// <since_tizen> 3 </since_tizen>
317         public static float PivotPointLeft
318         {
319             get
320             {
321                 float ret = Interop.NDalicAnchorPoint.AnchorPointLeftGet();
322                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
323                 return ret;
324             }
325         }
326
327         /// <summary>
328         /// PivotPoint constants: 1.0.
329         /// </summary>
330         /// <since_tizen> 3 </since_tizen>
331         public static float PivotPointRight
332         {
333             get
334             {
335                 float ret = Interop.NDalicAnchorPoint.AnchorPointRightGet();
336                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
337                 return ret;
338             }
339         }
340
341         /// <summary>
342         /// PivotPoint constants: 0.5.
343         /// </summary>
344         /// <since_tizen> 3 </since_tizen>
345         public static float PivotPointMiddle
346         {
347             get
348             {
349                 float ret = Interop.NDalicAnchorPoint.AnchorPointMiddleGet();
350                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
351                 return ret;
352             }
353         }
354
355         /// <summary>
356         /// PivotPoint constants: 0.0, 0.0, 0.5.
357         /// </summary>
358         /// <since_tizen> 3 </since_tizen>
359         public static Position PivotPointTopLeft
360         {
361             get
362             {
363                 global::System.IntPtr cPtr = Interop.NDalicAnchorPoint.AnchorPointTopLeftGet();
364                 Position ret = (cPtr == global::System.IntPtr.Zero) ? null : new Position(cPtr, false);
365                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
366                 return ret;
367             }
368         }
369
370         /// <summary>
371         /// PivotPoint constants: 0.5, 0.0, 0.5.
372         /// </summary>
373         /// <since_tizen> 3 </since_tizen>
374         public static Position PivotPointTopCenter
375         {
376             get
377             {
378                 global::System.IntPtr cPtr = Interop.NDalicAnchorPoint.AnchorPointTopCenterGet();
379                 Position ret = (cPtr == global::System.IntPtr.Zero) ? null : new Position(cPtr, false);
380                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
381                 return ret;
382             }
383         }
384
385         /// <summary>
386         /// PivotPoint constants: 1.0, 0.0, 0.5.
387         /// </summary>
388         /// <since_tizen> 3 </since_tizen>
389         public static Position PivotPointTopRight
390         {
391             get
392             {
393                 global::System.IntPtr cPtr = Interop.NDalicAnchorPoint.AnchorPointTopRightGet();
394                 Position ret = (cPtr == global::System.IntPtr.Zero) ? null : new Position(cPtr, false);
395                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
396                 return ret;
397             }
398         }
399
400         /// <summary>
401         /// PivotPoint constants: 0.0, 0.5, 0.5.
402         /// </summary>
403         /// <since_tizen> 3 </since_tizen>
404         public static Position PivotPointCenterLeft
405         {
406             get
407             {
408                 global::System.IntPtr cPtr = Interop.NDalicAnchorPoint.AnchorPointCenterLeftGet();
409                 Position ret = (cPtr == global::System.IntPtr.Zero) ? null : new Position(cPtr, false);
410                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
411                 return ret;
412             }
413         }
414
415         /// <summary>
416         /// PivotPoint constants: 0.5, 0.5, 0.5.
417         /// </summary>
418         /// <since_tizen> 3 </since_tizen>
419         public static Position PivotPointCenter
420         {
421             get
422             {
423                 global::System.IntPtr cPtr = Interop.NDalicAnchorPoint.AnchorPointCenterGet();
424                 Position ret = (cPtr == global::System.IntPtr.Zero) ? null : new Position(cPtr, false);
425                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
426                 return ret;
427             }
428         }
429
430         /// <summary>
431         /// PivotPoint constants: 1.0, 0.5, 0.5.
432         /// </summary>
433         /// <since_tizen> 3 </since_tizen>
434         public static Position PivotPointCenterRight
435         {
436             get
437             {
438                 global::System.IntPtr cPtr = Interop.NDalicAnchorPoint.AnchorPointCenterRightGet();
439                 Position ret = (cPtr == global::System.IntPtr.Zero) ? null : new Position(cPtr, false);
440                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
441                 return ret;
442             }
443         }
444
445         /// <summary>
446         /// PivotPoint constants: 0.0, 1.0, 0.5.
447         /// </summary>
448         /// <since_tizen> 3 </since_tizen>
449         public static Position PivotPointBottomLeft
450         {
451             get
452             {
453                 global::System.IntPtr cPtr = Interop.NDalicAnchorPoint.AnchorPointBottomLeftGet();
454                 Position ret = (cPtr == global::System.IntPtr.Zero) ? null : new Position(cPtr, false);
455                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
456                 return ret;
457             }
458         }
459
460         /// <summary>
461         /// PivotPoint constants: 0.5, 1.0, 0.5
462         /// </summary>
463         /// <since_tizen> 3 </since_tizen>
464         public static Position PivotPointBottomCenter
465         {
466             get
467             {
468                 global::System.IntPtr cPtr = Interop.NDalicAnchorPoint.AnchorPointBottomCenterGet();
469                 Position ret = (cPtr == global::System.IntPtr.Zero) ? null : new Position(cPtr, false);
470                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
471                 return ret;
472             }
473         }
474
475         /// <summary>
476         /// PivotPoint constants: 1.0, 1.0, 0.5.
477         /// </summary>
478         /// <since_tizen> 3 </since_tizen>
479         public static Position PivotPointBottomRight
480         {
481             get
482             {
483                 global::System.IntPtr cPtr = Interop.NDalicAnchorPoint.AnchorPointBottomRightGet();
484                 Position ret = (cPtr == global::System.IntPtr.Zero) ? null : new Position(cPtr, false);
485                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
486                 return ret;
487             }
488         }
489
490         /// <summary>
491         /// Constant ( 1.0f, 1.0f, 1.0f ).
492         /// </summary>
493         /// <since_tizen> 3 </since_tizen>
494         public static Position One
495         {
496             get
497             {
498                 global::System.IntPtr cPtr = Interop.Vector3.OneGet();
499                 Position ret = (cPtr == global::System.IntPtr.Zero) ? null : new Position(cPtr, false);
500                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
501                 return ret;
502             }
503         }
504
505         /// <summary>
506         /// Constant ( 0.0f, 0.0f, 0.0f ).
507         /// </summary>
508         /// <since_tizen> 3 </since_tizen>
509         public static Position Zero
510         {
511             get
512             {
513                 global::System.IntPtr cPtr = Interop.Vector3.ZeroGet();
514                 Position ret = (cPtr == global::System.IntPtr.Zero) ? null : new Position(cPtr, false);
515                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
516                 return ret;
517             }
518         }
519
520         /// <summary>
521         /// The x component.
522         /// </summary>
523         /// <remarks>
524         /// The setter is deprecated in API8 and will be removed in API10. Please use new Position(...) constructor.
525         /// </remarks>
526         /// <code>
527         /// // DO NOT use like the followings!
528         /// Position position = new Position();
529         /// position.X = 1.0f; 
530         /// // Please USE like this
531         /// float x = 1.0f, y = 2.0f, z = 3.0f;
532         /// Position position = new Position(x, y, z);
533         /// </code>
534         /// <since_tizen> 3 </since_tizen>
535         public float X
536         {
537             [Obsolete("Please do not use this setter, Deprecated in API8, will be removed in API10. please use new Position(...) constructor")]
538             set
539             {
540                 Interop.Vector3.XSet(SwigCPtr, value);
541                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
542
543                 callback?.Invoke(value, Y, Z);
544             }
545             get
546             {
547                 float ret = Interop.Vector3.XGet(SwigCPtr);
548                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
549                 return ret;
550             }
551         }
552
553         /// <summary>
554         /// The y component.
555         /// </summary>
556         /// <remarks>
557         /// The setter is deprecated in API8 and will be removed in API10. Please use new Position(...) constructor.
558         /// </remarks>
559         /// <code>
560         /// // DO NOT use like the followings!
561         /// Position position = new Position();
562         /// position.Y = 2.0f; 
563         /// // Please USE like this
564         /// float x = 1.0f, y = 2.0f, z = 3.0f;
565         /// Position position = new Position(x, y, z);
566         /// </code>
567         /// <since_tizen> 3 </since_tizen>
568         public float Y
569         {
570             [Obsolete("Please do not use this setter, Deprecated in API8, will be removed in API10. please use new Position(...) constructor")]
571             set
572             {
573                 Interop.Vector3.YSet(SwigCPtr, value);
574                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
575
576                 callback?.Invoke(X, value, Z);
577             }
578             get
579             {
580                 float ret = Interop.Vector3.YGet(SwigCPtr);
581                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
582                 return ret;
583             }
584         }
585
586         /// <summary>
587         /// The z component.
588         /// </summary>
589         /// <remarks>
590         /// The setter is deprecated in API8 and will be removed in API10. Please use new Position(...) constructor.
591         /// </remarks>
592         /// <code>
593         /// // DO NOT use like the followings!
594         /// Position position = new Position();
595         /// position.Z = 3.0f; 
596         /// // Please USE like this
597         /// float x = 1.0f, y = 2.0f, z = 3.0f;
598         /// Position position = new Position(x, y, z);
599         /// </code>
600         /// <since_tizen> 3 </since_tizen>
601         public float Z
602         {
603             [Obsolete("Please do not use this setter, Deprecated in API8, will be removed in API10. please use new Position(...) constructor")]
604             set
605             {
606                 Interop.Vector3.ZSet(SwigCPtr, value);
607                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
608
609                 callback?.Invoke(X, Y, value);
610             }
611             get
612             {
613                 float ret = Interop.Vector3.ZGet(SwigCPtr);
614                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
615                 return ret;
616             }
617         }
618
619         internal static Position XAxis
620         {
621             get
622             {
623                 global::System.IntPtr cPtr = Interop.Vector3.XaxisGet();
624                 Position ret = (cPtr == global::System.IntPtr.Zero) ? null : new Position(cPtr, false);
625                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
626                 return ret;
627             }
628         }
629
630         internal static Position YAxis
631         {
632             get
633             {
634                 global::System.IntPtr cPtr = Interop.Vector3.YaxisGet();
635                 Position ret = (cPtr == global::System.IntPtr.Zero) ? null : new Position(cPtr, false);
636                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
637                 return ret;
638             }
639         }
640
641         internal static Position ZAxis
642         {
643             get
644             {
645                 global::System.IntPtr cPtr = Interop.Vector3.ZaxisGet();
646                 Position ret = (cPtr == global::System.IntPtr.Zero) ? null : new Position(cPtr, false);
647                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
648                 return ret;
649             }
650         }
651
652         internal static Position NegativeXAxis
653         {
654             get
655             {
656                 global::System.IntPtr cPtr = Interop.Vector3.NegativeXaxisGet();
657                 Position ret = (cPtr == global::System.IntPtr.Zero) ? null : new Position(cPtr, false);
658                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
659                 return ret;
660             }
661         }
662
663         internal static Position NegativeYAxis
664         {
665             get
666             {
667                 global::System.IntPtr cPtr = Interop.Vector3.NegativeYaxisGet();
668                 Position ret = (cPtr == global::System.IntPtr.Zero) ? null : new Position(cPtr, false);
669                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
670                 return ret;
671             }
672         }
673
674         internal static Position NegativeZAxis
675         {
676             get
677             {
678                 global::System.IntPtr cPtr = Interop.Vector3.NegativeZaxisGet();
679                 Position ret = (cPtr == global::System.IntPtr.Zero) ? null : new Position(cPtr, false);
680                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
681                 return ret;
682             }
683         }
684
685         /// <summary>
686         /// The const array subscript operator overload. Should be 0, 1, or 2.
687         /// </summary>
688         /// <param name="index">The subscript index.</param>
689         /// <returns>The float at the given index.</returns>
690         /// <since_tizen> 3 </since_tizen>
691         public float this[uint index]
692         {
693             get
694             {
695                 return ValueOfIndex(index);
696             }
697         }
698
699
700         /// <summary>
701         /// An addition operator.
702         /// </summary>
703         /// <param name="arg1">The vector to add.</param>
704         /// <param name="arg2">The vector to add.</param>
705         /// <returns>The vector containing the result of the addition.</returns>
706         /// <since_tizen> 3 </since_tizen>
707         public static Position operator +(Position arg1, Position arg2)
708         {
709             return arg1?.Add(arg2);
710         }
711
712         /// <summary>
713         /// The subtraction operator.
714         /// </summary>
715         /// <param name="arg1">The vector to subtract.</param>
716         /// <param name="arg2">The vector to subtract.</param>
717         /// <returns>The vector containing the result of the subtraction.</returns>
718         /// <since_tizen> 3 </since_tizen>
719         public static Position operator -(Position arg1, Position arg2)
720         {
721             return arg1?.Subtract(arg2);
722         }
723
724         /// <summary>
725         /// The unary negation operator.
726         /// </summary>
727         /// <param name="arg1">The vector to negate.</param>
728         /// <returns>The vector containg the negation.</returns>
729         /// <since_tizen> 3 </since_tizen>
730         public static Position operator -(Position arg1)
731         {
732             return arg1?.Subtract();
733         }
734
735         /// <summary>
736         /// The multiplication operator.
737         /// </summary>
738         /// <param name="arg1">The vector to multiply.</param>
739         /// <param name="arg2">The vector to multiply.</param>
740         /// <returns>The vector containing the result of the multiplication.</returns>
741         /// <since_tizen> 3 </since_tizen>
742         public static Position operator *(Position arg1, Position arg2)
743         {
744             return arg1?.Multiply(arg2);
745         }
746
747         /// <summary>
748         /// The multiplication operator.
749         /// </summary>
750         /// <param name="arg1">The vector to multiply</param>
751         /// <param name="arg2">The float value to scale the vector.</param>
752         /// <returns>The vector containing the result of scaling.</returns>
753         /// <since_tizen> 3 </since_tizen>
754         public static Position operator *(Position arg1, float arg2)
755         {
756             return arg1?.Multiply(arg2);
757         }
758
759         /// <summary>
760         /// The division operator.
761         /// </summary>
762         /// <param name="arg1">The vector to divide.</param>
763         /// <param name="arg2">The vector to divide.</param>
764         /// <returns>The vector containing the result of the division.</returns>
765         /// <since_tizen> 3 </since_tizen>
766         public static Position operator /(Position arg1, Position arg2)
767         {
768             return arg1?.Divide(arg2);
769         }
770
771         /// <summary>
772         /// The division operator.
773         /// </summary>
774         /// <param name="arg1">The vector to divide.</param>
775         /// <param name="arg2">The float value to scale the vector by.</param>
776         /// <returns>The vector containing the result of scaling.</returns>
777         /// <since_tizen> 3 </since_tizen>
778         public static Position operator /(Position arg1, float arg2)
779         {
780             return arg1?.Divide(arg2);
781         }
782
783         /// <summary>
784         /// Converts a position instance to a Vector3 instance.
785         /// </summary>
786         /// <since_tizen> 3 </since_tizen>
787         public static implicit operator Vector3(Position position)
788         {
789             if (position == null)
790             {
791                 return null;
792             }
793             return new Vector3(position.X, position.Y, position.Z);
794         }
795
796         /// <summary>
797         /// Converts a Vector3 instance to a position instance.
798         /// </summary>
799         /// <since_tizen> 3 </since_tizen>
800         public static implicit operator Position(Vector3 vec)
801         {
802             if (vec == null)
803             {
804                 return null;
805             }
806             return new Position(vec.X, vec.Y, vec.Z);
807         }
808
809         /// <summary>
810         /// Implicit type cast operator, Position2D to Position
811         /// </summary>
812         /// <param name="position2d">The object of Position2D type.</param>
813         /// <since_tizen> none </since_tizen>
814         /// This will be public opened in tizen_next by ACR.
815         [EditorBrowsable(EditorBrowsableState.Never)]
816         public static implicit operator Position(Position2D position2d)
817         {
818             if (position2d == null)
819             {
820                 return null;
821             }
822             return new Position(position2d.X, position2d.Y, 0);
823         }
824
825         /// <summary>
826         /// Determines whether the specified object is equal to the current object.
827         /// </summary>
828         /// <param name="obj">The object to compare with the current object.</param>
829         /// <returns>true if the specified object is equal to the current object; otherwise, false.</returns>
830         public override bool Equals(System.Object obj)
831         {
832             Position position = obj as Position;
833             bool equal = false;
834             if (X == position?.X && Y == position?.Y && Z == position?.Z)
835             {
836                 equal = true;
837             }
838             return equal;
839         }
840
841         /// <summary>
842         /// Gets the hash code of this Position.
843         /// </summary>
844         /// <returns>The Hash Code.</returns>
845         /// <since_tizen> 6 </since_tizen>
846         public override int GetHashCode()
847         {
848             return SwigCPtr.Handle.GetHashCode();
849         }
850
851         /// <summary>
852         /// Compares if rhs is equal to.
853         /// </summary>
854         /// <param name="rhs">The vector to compare.</param>
855         /// <returns>Returns true if the two vectors are equal, otherwise false.</returns>
856         /// <since_tizen> 3 </since_tizen>
857         public bool EqualTo(Position rhs)
858         {
859             bool ret = Interop.Vector3.EqualTo(SwigCPtr, Position.getCPtr(rhs));
860             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
861             return ret;
862         }
863
864         /// <summary>
865         /// Compares if rhs is not equal to.
866         /// </summary>
867         /// <param name="rhs">The vector to compare.</param>
868         /// <returns>Returns true if the two vectors are not equal, otherwise false.</returns>
869         /// <since_tizen> 3 </since_tizen>
870         public bool NotEqualTo(Position rhs)
871         {
872             bool ret = Interop.Vector3.NotEqualTo(SwigCPtr, Position.getCPtr(rhs));
873             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
874             return ret;
875         }
876
877         /// <inheritdoc/>
878         [EditorBrowsable(EditorBrowsableState.Never)]
879         public object Clone() => new Position(X, Y, Z);
880
881         internal static Position GetPositionFromPtr(global::System.IntPtr cPtr)
882         {
883             Position ret = new Position(cPtr, false);
884             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
885             return ret;
886         }
887
888         /// This will not be public opened.
889         [EditorBrowsable(EditorBrowsableState.Never)]
890         protected override void ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef swigCPtr)
891         {
892             Interop.Vector3.DeleteVector3(swigCPtr);
893         }
894
895
896         private Position Add(Position rhs)
897         {
898             Position ret = new Position(Interop.Vector3.Add(SwigCPtr, Position.getCPtr(rhs)), true);
899             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
900             return ret;
901         }
902
903         private Position Subtract(Position rhs)
904         {
905             Position ret = new Position(Interop.Vector3.Subtract(SwigCPtr, Position.getCPtr(rhs)), true);
906             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
907             return ret;
908         }
909
910         private Position Multiply(Position rhs)
911         {
912             Position ret = new Position(Interop.Vector3.Multiply(SwigCPtr, Position.getCPtr(rhs)), true);
913             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
914             return ret;
915         }
916
917         private Position Multiply(float rhs)
918         {
919             Position ret = new Position(Interop.Vector3.Multiply(SwigCPtr, rhs), true);
920             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
921             return ret;
922         }
923
924         private Position Divide(Position rhs)
925         {
926             Position ret = new Position(Interop.Vector3.Divide(SwigCPtr, Position.getCPtr(rhs)), true);
927             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
928             return ret;
929         }
930
931         private Position Divide(float rhs)
932         {
933             Position ret = new Position(Interop.Vector3.Divide(SwigCPtr, rhs), true);
934             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
935             return ret;
936         }
937
938         private Position Subtract()
939         {
940             Position ret = new Position(Interop.Vector3.Subtract(SwigCPtr), true);
941             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
942             return ret;
943         }
944
945         private float ValueOfIndex(uint index)
946         {
947             float ret = Interop.Vector3.ValueOfIndex(SwigCPtr, index);
948             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
949             return ret;
950         }
951
952         internal delegate void PositionChangedCallback(float x, float y, float z);
953
954         internal Position(PositionChangedCallback cb, float x, float y, float z) : this(Interop.Vector3.NewVector3(x, y, z), true)
955         {
956             callback = cb;
957             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
958         }
959
960         private PositionChangedCallback callback = null;
961     }
962 }