[NUI] Rollback split-nui (#887)
[platform/core/csapi/tizenfx.git] / src / Tizen.NUI / src / public / Property.cs
1 /*
2  * Copyright(c) 2017 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 System.ComponentModel;
20 using System.Collections.Generic;
21 using Tizen.NUI.Binding;
22
23 namespace Tizen.NUI
24 {
25     /// <summary>
26     /// An array of property values.
27     /// </summary>
28     /// <since_tizen> 3 </since_tizen>
29     public class PropertyArray : global::System.IDisposable
30     {
31         /// <summary>
32         /// swigCMemOwn
33         /// </summary>
34         /// <since_tizen> 3 </since_tizen>
35         protected bool swigCMemOwn;
36         /// <summary>
37         /// A Flat to check if it is already disposed.
38         /// </summary>
39         /// <since_tizen> 3 </since_tizen>
40         protected bool disposed = false;
41
42         private global::System.Runtime.InteropServices.HandleRef swigCPtr;
43
44         //A Flag to check who called Dispose(). (By User or DisposeQueue)
45         private bool isDisposeQueued = false;
46
47         /// <summary>
48         /// The constructor.
49         /// </summary>
50         /// <since_tizen> 3 </since_tizen>
51         public PropertyArray() : this(Interop.Property.new_Property_Array__SWIG_0(), true)
52         {
53             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
54         }
55
56         internal PropertyArray(PropertyArray other) : this(Interop.Property.new_Property_Array__SWIG_1(PropertyArray.getCPtr(other)), true)
57         {
58             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
59         }
60
61         internal PropertyArray(global::System.IntPtr cPtr, bool cMemoryOwn)
62         {
63             swigCMemOwn = cMemoryOwn;
64             swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
65         }
66
67         /// <summary>
68         /// Dispose.
69         /// </summary>
70         /// <since_tizen> 3 </since_tizen>
71         ~PropertyArray()
72         {
73             if(!isDisposeQueued)
74             {
75                 isDisposeQueued = true;
76                 DisposeQueue.Instance.Add(this);
77             }
78         }
79
80         /// <summary>
81         /// The operator to access an element.
82         /// </summary>
83         /// <param name="index">The element index to access. No bounds checking is performed.</param>
84         /// <returns>The reference to the element.</returns>
85         /// <since_tizen> 3 </since_tizen>
86         public PropertyValue this[uint index]
87         {
88             get
89             {
90                 return ValueOfIndex(index);
91             }
92         }
93
94         /// <summary>
95         /// Retrieves the number of elements in the array.
96         /// </summary>
97         /// <returns>The number of elements in the array.</returns>
98         /// <since_tizen> 3 </since_tizen>
99         public uint Size()
100         {
101             uint ret = Interop.Property.Property_Array_Size(swigCPtr);
102             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
103             return ret;
104         }
105
106         /// <summary>
107         /// Retrieves the number of elements in the array.
108         /// </summary>
109         /// <returns>The number of elements in the array.</returns>
110         /// <since_tizen> 3 </since_tizen>
111         public uint Count()
112         {
113             uint ret = Interop.Property.Property_Array_Count(swigCPtr);
114             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
115             return ret;
116         }
117
118         /// <summary>
119         /// Returns whether the array is empty.
120         /// </summary>
121         /// <returns>Returns true if empty, false otherwise.</returns>
122         /// <since_tizen> 3 </since_tizen>
123         public bool Empty()
124         {
125             bool ret = Interop.Property.Property_Array_Empty(swigCPtr);
126             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
127             return ret;
128         }
129
130         /// <summary>
131         /// Clears the array.
132         /// </summary>
133         /// <since_tizen> 3 </since_tizen>
134         public void Clear()
135         {
136             Interop.Property.Property_Array_Clear(swigCPtr);
137             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
138         }
139
140         /// <summary>
141         /// Increases the capacity of the array.
142         /// </summary>
143         /// <param name="size">The size to reserve.</param>
144         /// <since_tizen> 3 </since_tizen>
145         public void Reserve(uint size)
146         {
147             Interop.Property.Property_Array_Reserve(swigCPtr, size);
148             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
149         }
150
151         /// <summary>
152         /// Resizes to size.
153         /// </summary>
154         /// <param name="size">The size to resize</param>
155         /// <since_tizen> 3 </since_tizen>
156         public void Resize(uint size)
157         {
158             Interop.Property.Property_Array_Resize(swigCPtr, size);
159             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
160         }
161
162         /// <summary>
163         /// Retrieves the capacity of the array.
164         /// </summary>
165         /// <returns>The allocated capacity of the array.</returns>
166         /// <since_tizen> 3 </since_tizen>
167         public uint Capacity()
168         {
169             uint ret = Interop.Property.Property_Array_Capacity(swigCPtr);
170             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
171             return ret;
172         }
173
174         /// <summary>
175         /// Adds an element to the array.
176         /// </summary>
177         /// <param name="value">The value to add at the end of the array.</param>
178         /// <since_tizen> 3 </since_tizen>
179         public void PushBack(PropertyValue value)
180         {
181             Interop.Property.Property_Array_PushBack(swigCPtr, PropertyValue.getCPtr(value));
182             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
183         }
184
185         /// <summary>
186         /// Adds an keyvalue to the array.
187         /// This function should be first
188         /// </summary>
189         /// <param name="value">The value to add at the end of the array.</param>
190         public PropertyArray Add(KeyValue value)
191         {
192             PropertyArray ret = new PropertyArray(Interop.Property.Property_Array_Add(swigCPtr, PropertyValue.getCPtr(value.TrueValue)), false);
193             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
194             return ret;
195         }
196
197         /// <summary>
198         /// Adds an element to the array.
199         /// </summary>
200         /// <param name="value">The value to add at the end of the array.</param>
201         /// <since_tizen> 3 </since_tizen>
202         public PropertyArray Add(PropertyValue value)
203         {
204             PropertyArray ret = new PropertyArray(Interop.Property.Property_Array_Add(swigCPtr, PropertyValue.getCPtr(value)), false);
205             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
206             return ret;
207         }
208
209         /// <summary>
210         /// Accesses an element.
211         /// </summary>
212         /// <param name="index">The element index to access. No bounds checking is performed.</param>
213         /// <returns>The reference to the element.</returns>
214         /// <since_tizen> 3 </since_tizen>
215         public PropertyValue GetElementAt(uint index)
216         {
217             PropertyValue ret = new PropertyValue(Interop.Property.Property_Array_GetElementAt__SWIG_0(swigCPtr, index), false);
218             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
219             return ret;
220         }
221
222         /// <summary>
223         /// Dispose.
224         /// </summary>
225         /// <since_tizen> 3 </since_tizen>
226         public void Dispose()
227         {
228             //Throw excpetion if Dispose() is called in separate thread.
229             if (!Window.IsInstalled())
230             {
231                 throw new System.InvalidOperationException("This API called from separate thread. This API must be called from MainThread.");
232             }
233
234             if (isDisposeQueued)
235             {
236                 Dispose(DisposeTypes.Implicit);
237             }
238             else
239             {
240                 Dispose(DisposeTypes.Explicit);
241                 System.GC.SuppressFinalize(this);
242             }
243         }
244
245         internal static global::System.Runtime.InteropServices.HandleRef getCPtr(PropertyArray obj)
246         {
247             return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
248         }
249
250         /// <summary>
251         /// Dispose.
252         /// </summary>
253         /// <since_tizen> 3 </since_tizen>
254         protected virtual void Dispose(DisposeTypes type)
255         {
256             if (disposed)
257             {
258                 return;
259             }
260
261             if (type == DisposeTypes.Explicit)
262             {
263                 //Called by User
264                 //Release your own managed resources here.
265                 //You should release all of your own disposable objects here.
266             }
267
268             //Release your own unmanaged resources here.
269             //You should not access any managed member here except static instance.
270             //because the execution order of Finalizes is non-deterministic.
271
272             if (swigCPtr.Handle != global::System.IntPtr.Zero)
273             {
274                 if (swigCMemOwn)
275                 {
276                     swigCMemOwn = false;
277                     Interop.Property.delete_Property_Array(swigCPtr);
278                 }
279                 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
280             }
281             disposed = true;
282         }
283
284         /// <summary>
285         /// Retrieves the value of elements in the array.
286         /// </summary>
287         /// <param name="index">The element index to retrieve.</param>
288         /// <returns>The reference to the element.</returns>
289         private PropertyValue ValueOfIndex(uint index)
290         {
291             PropertyValue ret = new PropertyValue(Interop.Property.Property_Array_ValueOfIndex__SWIG_0(swigCPtr, index), false);
292             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
293             return ret;
294         }
295     }
296
297     /// <summary>
298     /// A key type which can be either a std::string or a Property::Index.
299     /// </summary>
300     /// <since_tizen> 3 </since_tizen>
301     public class PropertyKey : global::System.IDisposable
302     {
303         /// <summary>
304         /// swigCMemOwn
305         /// </summary>
306         /// <since_tizen> 3 </since_tizen>
307         protected bool swigCMemOwn;
308         /// <summary>
309         /// A Flat to check if it is already disposed.
310         /// </summary>
311         /// <since_tizen> 3 </since_tizen>
312         protected bool disposed = false;
313
314         private global::System.Runtime.InteropServices.HandleRef swigCPtr;
315
316         //A Flag to check who called Dispose(). (By User or DisposeQueue)
317         private bool isDisposeQueued = false;
318
319         /// <summary>
320         /// The constructor.
321         /// </summary>
322         /// <param name="key">The string key.</param>
323         /// <since_tizen> 3 </since_tizen>
324         public PropertyKey(string key) : this(Interop.Property.new_Property_Key__SWIG_0(key), true)
325         {
326             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
327         }
328
329         /// <summary>
330         /// The constructor.
331         /// </summary>
332         /// <param name="key">The index key.</param>
333         /// <since_tizen> 3 </since_tizen>
334         public PropertyKey(int key) : this(Interop.Property.new_Property_Key__SWIG_1(key), true)
335         {
336             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
337         }
338
339         internal PropertyKey(global::System.IntPtr cPtr, bool cMemoryOwn)
340         {
341             swigCMemOwn = cMemoryOwn;
342             swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
343         }
344
345         /// <summary>
346         /// Dispose.
347         /// </summary>
348         /// <since_tizen> 3 </since_tizen>
349         ~PropertyKey()
350         {
351             if(!isDisposeQueued)
352             {
353                 isDisposeQueued = true;
354                 DisposeQueue.Instance.Add(this);
355             }
356         }
357
358         /// <summary>
359         /// The type of key.
360         /// </summary>
361         /// <since_tizen> 3 </since_tizen>
362         public enum KeyType
363         {
364             /// <summary>
365             /// The type of key is index.
366             /// </summary>
367             /// <since_tizen> 3 </since_tizen>
368             Index,
369             /// <summary>
370             /// The type of key is string.
371             /// </summary>
372             /// <since_tizen> 3 </since_tizen>
373             String
374         }
375
376         /// <summary>
377         /// The type of the key.
378         /// </summary>
379         /// <since_tizen> 3 </since_tizen>
380         public PropertyKey.KeyType Type
381         {
382             set
383             {
384                 Interop.Property.Property_Key_type_set(swigCPtr, (int)value);
385                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
386             }
387             get
388             {
389                 PropertyKey.KeyType ret = (PropertyKey.KeyType)Interop.Property.Property_Key_type_get(swigCPtr);
390                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
391                 return ret;
392             }
393         }
394
395         /// <summary>
396         /// The index key.
397         /// </summary>
398         /// <since_tizen> 3 </since_tizen>
399         public int IndexKey
400         {
401             set
402             {
403                 Interop.Property.Property_Key_indexKey_set(swigCPtr, value);
404                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
405             }
406             get
407             {
408                 int ret = Interop.Property.Property_Key_indexKey_get(swigCPtr);
409                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
410                 return ret;
411             }
412         }
413
414         /// <summary>
415         /// The string key.
416         /// </summary>
417         /// <since_tizen> 3 </since_tizen>
418         public string StringKey
419         {
420             set
421             {
422                 Interop.Property.Property_Key_stringKey_set(swigCPtr, value);
423                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
424             }
425             get
426             {
427                 string ret = Interop.Property.Property_Key_stringKey_get(swigCPtr);
428                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
429                 return ret;
430             }
431         }
432
433         /// <summary>
434         /// Dispose.
435         /// </summary>
436         /// <since_tizen> 3 </since_tizen>
437         public void Dispose()
438         {
439             //Throw excpetion if Dispose() is called in separate thread.
440             if (!Window.IsInstalled())
441             {
442                 throw new System.InvalidOperationException("This API called from separate thread. This API must be called from MainThread.");
443             }
444
445             if (isDisposeQueued)
446             {
447                 Dispose(DisposeTypes.Implicit);
448             }
449             else
450             {
451                 Dispose(DisposeTypes.Explicit);
452                 System.GC.SuppressFinalize(this);
453             }
454         }
455
456         /// <summary>
457         /// Compares if rhs is equal to.
458         /// </summary>
459         /// <param name="rhs">A string key to compare against.</param>
460         /// <returns>Returns true if the key compares, or false if it isn't equal or of the wrong type.</returns>
461         /// <since_tizen> 3 </since_tizen>
462         public bool EqualTo(string rhs)
463         {
464             bool ret = Interop.Property.Property_Key_EqualTo__SWIG_0(swigCPtr, rhs);
465             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
466             return ret;
467         }
468
469         /// <summary>
470         /// Compares if rhs is equal to.
471         /// </summary>
472         /// <param name="rhs">The index key to compare against.</param>
473         /// <returns>Returns true if the key compares, or false if it isn't equal or of the wrong type.</returns>
474         /// <since_tizen> 3 </since_tizen>
475         public bool EqualTo(int rhs)
476         {
477             bool ret = Interop.Property.Property_Key_EqualTo__SWIG_1(swigCPtr, rhs);
478             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
479             return ret;
480         }
481
482         /// <summary>
483         /// Compares if rhs is equal to
484         /// </summary>
485         /// <param name="rhs">A key to compare against</param>
486         /// <returns>Returns true if the keys are of the same type and have the same value.</returns>
487         /// <since_tizen> 3 </since_tizen>
488         public bool EqualTo(PropertyKey rhs)
489         {
490             bool ret = Interop.Property.Property_Key_EqualTo__SWIG_2(swigCPtr, PropertyKey.getCPtr(rhs));
491             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
492             return ret;
493         }
494
495         /// <summary>
496         /// Compares if rhs is not equal to.
497         /// </summary>
498         /// <param name="rhs">The index key to compare against.</param>
499         /// <returns>Returns true if the key is not equal or not a string key.</returns>
500         /// <since_tizen> 3 </since_tizen>
501         public bool NotEqualTo(string rhs)
502         {
503             bool ret = Interop.Property.Property_Key_NotEqualTo__SWIG_0(swigCPtr, rhs);
504             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
505             return ret;
506         }
507
508         /// <summary>
509         /// Compares if rhs is not equal to.
510         /// </summary>
511         /// <param name="rhs">The index key to compare against.</param>
512         /// <returns>Returns true if the key is not equal, or not the index key.</returns>
513         /// <since_tizen> 3 </since_tizen>
514         public bool NotEqualTo(int rhs)
515         {
516             bool ret = Interop.Property.Property_Key_NotEqualTo__SWIG_1(swigCPtr, rhs);
517             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
518             return ret;
519         }
520
521         /// <summary>
522         /// Compares if rhs is not equal to.
523         /// </summary>
524         /// <param name="rhs">A key to compare against.</param>
525         /// <returns>Returns true if the keys are not of the same type or are not equal.</returns>
526         /// <since_tizen> 3 </since_tizen>
527         public bool NotEqualTo(PropertyKey rhs)
528         {
529             bool ret = Interop.Property.Property_Key_NotEqualTo__SWIG_2(swigCPtr, PropertyKey.getCPtr(rhs));
530             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
531             return ret;
532         }
533
534         internal static global::System.Runtime.InteropServices.HandleRef getCPtr(PropertyKey obj)
535         {
536             return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
537         }
538
539         /// <summary>
540         /// Dispose.
541         /// </summary>
542         /// <since_tizen> 3 </since_tizen>
543         protected virtual void Dispose(DisposeTypes type)
544         {
545             if (disposed)
546             {
547                 return;
548             }
549
550             if (type == DisposeTypes.Explicit)
551             {
552                 //Called by User
553                 //Release your own managed resources here.
554                 //You should release all of your own disposable objects here.
555             }
556
557             //Release your own unmanaged resources here.
558             //You should not access any managed member here except static instance.
559             //because the execution order of Finalizes is non-deterministic.
560
561             if (swigCPtr.Handle != global::System.IntPtr.Zero)
562             {
563                 if (swigCMemOwn)
564                 {
565                     swigCMemOwn = false;
566                     Interop.Property.delete_Property_Key(swigCPtr);
567                 }
568                 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
569             }
570             disposed = true;
571         }
572     }
573
574     /// <summary>
575     /// A map of property values, the key type could be string or Property::Index.
576     /// </summary>
577     /// <since_tizen> 3 </since_tizen>
578     public class PropertyMap : global::System.IDisposable
579     {
580         /// <summary>
581         /// swigCMemOwn
582         /// </summary>
583         /// <since_tizen> 3 </since_tizen>
584         protected bool swigCMemOwn;
585         /// <summary>
586         /// A Flat to check if it is already disposed.
587         /// </summary>
588         /// <since_tizen> 3 </since_tizen>
589         protected bool disposed = false;
590
591         private global::System.Runtime.InteropServices.HandleRef swigCPtr;
592
593         //A Flag to check who called Dispose(). (By User or DisposeQueue)
594         private bool isDisposeQueued = false;
595
596         /// <summary>
597         /// The constructor.
598         /// </summary>
599         /// <since_tizen> 3 </since_tizen>
600         public PropertyMap() : this(Interop.PropertyMap.new_Property_Map__SWIG_0(), true)
601         {
602             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
603         }
604
605         /// <summary>
606         /// The copy constructor.
607         /// </summary>
608         /// <param name="other">The map to copy from.</param>
609         /// <since_tizen> 3 </since_tizen>
610         public PropertyMap(PropertyMap other) : this(Interop.PropertyMap.new_Property_Map__SWIG_1(PropertyMap.getCPtr(other)), true)
611         {
612             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
613         }
614
615         internal PropertyMap(global::System.IntPtr cPtr, bool cMemoryOwn)
616         {
617             swigCMemOwn = cMemoryOwn;
618             swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
619         }
620
621         /// <summary>
622         /// Dispose.
623         /// </summary>
624         /// <since_tizen> 3 </since_tizen>
625         ~PropertyMap()
626         {
627             if(!isDisposeQueued)
628             {
629                 isDisposeQueued = true;
630                 DisposeQueue.Instance.Add(this);
631             }
632         }
633
634         /// <summary>
635         /// The operator to access the element with the specified string key.<br />
636         /// If an element with the key does not exist, then it is created.<br />
637         /// </summary>
638         /// <param name="key">The key whose value to access.</param>
639         /// <returns>A value for the element with the specified key.</returns>
640         /// <since_tizen> 3 </since_tizen>
641         public PropertyValue this[string key]
642         {
643             get
644             {
645                 return ValueOfIndex(key);
646             }
647         }
648
649         /// <summary>
650         /// The operator to access the element with the specified index key.<br />
651         /// If an element with the key does not exist, then it is created.<br />
652         /// </summary>
653         /// <param name="key">The key whose value to access.</param>
654         /// <returns>A value for the element with the specified key.</returns>
655         /// <since_tizen> 3 </since_tizen>
656         public PropertyValue this[int key]
657         {
658             get
659             {
660                 return ValueOfIndex(key);
661             }
662         }
663
664         /// <summary>
665         /// Dispose.
666         /// </summary>
667         /// <since_tizen> 3 </since_tizen>
668         public void Dispose()
669         {
670             //Throw excpetion if Dispose() is called in separate thread.
671             if (!Window.IsInstalled())
672             {
673                 throw new System.InvalidOperationException("This API called from separate thread. This API must be called from MainThread.");
674             }
675
676             if (isDisposeQueued)
677             {
678                 Dispose(DisposeTypes.Implicit);
679             }
680             else
681             {
682                 Dispose(DisposeTypes.Explicit);
683                 System.GC.SuppressFinalize(this);
684             }
685         }
686
687         /// <summary>
688         /// Retrieves the number of elements in the map.
689         /// </summary>
690         /// <returns>The number of elements in the map.</returns>
691         /// <since_tizen> 3 </since_tizen>
692         public uint Count()
693         {
694             uint ret = Interop.PropertyMap.Property_Map_Count(swigCPtr);
695             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
696             return ret;
697         }
698
699         /// <summary>
700         /// Returns whether the map is empty.
701         /// </summary>
702         /// <returns>Returns true if empty, false otherwise.</returns>
703         /// <since_tizen> 3 </since_tizen>
704         public bool Empty()
705         {
706             bool ret = Interop.PropertyMap.Property_Map_Empty(swigCPtr);
707             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
708             return ret;
709         }
710
711         /// <summary>
712         /// Inserts the key-value pair in the map, with the key type as string.<br />
713         /// Does not check for duplicates.<br />
714         /// </summary>
715         /// <param name="key">The key to insert.</param>
716         /// <param name="value">The value to insert.</param>
717         /// <since_tizen> 3 </since_tizen>
718         public void Insert(string key, PropertyValue value)
719         {
720             Interop.PropertyMap.Property_Map_Insert__SWIG_0(swigCPtr, key, PropertyValue.getCPtr(value));
721             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
722         }
723
724         /// <summary>
725         /// Inserts the key-value pair in the map, with the key type as index.<br />
726         /// Does not check for duplicates.<br />
727         /// </summary>
728         /// <param name="key">The key to insert.</param>
729         /// <param name="value">The value to insert.</param>
730         /// <since_tizen> 3 </since_tizen>
731         public void Insert(int key, PropertyValue value)
732         {
733             Interop.PropertyMap.Property_Map_Insert__SWIG_2(swigCPtr, key, PropertyValue.getCPtr(value));
734             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
735         }
736
737         /// <summary>
738         /// Inserts the key-value pair in the map, with the key type as string.<br />
739         /// Does not check for duplicates.<br />
740         /// </summary>
741         /// <param name="key">The key to insert.</param>
742         /// <param name="value">The value to insert.</param>
743         /// <returns>Returns a reference to this object.</returns>
744         /// <since_tizen> 3 </since_tizen>
745         public PropertyMap Add(string key, PropertyValue value)
746         {
747             PropertyMap ret = new PropertyMap(Interop.PropertyMap.Property_Map_Add__SWIG_0(swigCPtr, key, PropertyValue.getCPtr(value)), false);
748             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
749             return ret;
750         }
751
752         /// <summary>
753         /// Inserts the key-value pair in the map, with the key type as string.<br />
754         /// Does not check for duplicates.<br />
755         /// </summary>
756         /// <param name="key">The key to insert.</param>
757         /// <param name="value">The value to insert.</param>
758         /// <returns>Returns a reference to this object.</returns>
759         /// <since_tizen> 3 </since_tizen>
760         public PropertyMap Add(int key, PropertyValue value)
761         {
762             PropertyMap ret = new PropertyMap(Interop.PropertyMap.Property_Map_Add__SWIG_2(swigCPtr, key, PropertyValue.getCPtr(value)), false);
763             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
764             return ret;
765         }
766
767         /// <summary>
768         /// Inserts the keyvalue to the map.<br />
769         /// Does not check for duplicates.<br />
770         /// </summary>
771         /// <param name="keyValue">The keyvalue to insert.</param>
772         /// <returns>Returns a reference to this object.</returns>
773         public PropertyMap Add(KeyValue keyValue)
774         {
775             PropertyMap ret = new PropertyMap();
776             if ( keyValue.KeyInt != null )
777             {
778                 ret = new PropertyMap(Interop.PropertyMap.Property_Map_Add__SWIG_2(swigCPtr, (int)keyValue.KeyInt, PropertyValue.getCPtr(keyValue.TrueValue)), false);
779             }
780             else if ( keyValue.KeyString != null)
781             {
782                 ret = new PropertyMap(Interop.PropertyMap.Property_Map_Add__SWIG_0(swigCPtr, keyValue.KeyString, PropertyValue.getCPtr(keyValue.TrueValue)), false);
783             }
784             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
785
786             return ret;
787         }
788
789         /// <summary>
790         /// Retrieves the value at the specified position.
791         /// </summary>
792         /// <param name="position">The specified position.</param>
793         /// <returns>A reference to the value at the specified position.</returns>
794         /// <since_tizen> 3 </since_tizen>
795         public PropertyValue GetValue(uint position)
796         {
797             PropertyValue ret = new PropertyValue(Interop.PropertyMap.Property_Map_GetValue(swigCPtr, position), false);
798             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
799             return ret;
800         }
801
802         /// <summary>
803         /// Retrieves the key at the specified position.
804         /// </summary>
805         /// <param name="position">The specified position.</param>
806         /// <returns>A copy of the key at the specified position.</returns>
807         /// <since_tizen> 3 </since_tizen>
808         public PropertyKey GetKeyAt(uint position)
809         {
810             PropertyKey ret = new PropertyKey(Interop.PropertyMap.Property_Map_GetKeyAt(swigCPtr, position), true);
811             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
812             return ret;
813         }
814
815         /// <summary>
816         /// Finds the value for the specified key if it exists.
817         /// </summary>
818         /// <param name="key">The key to find.</param>
819         /// <returns>The value if it exists, an empty object otherwise.</returns>
820         /// <since_tizen> 3 </since_tizen>
821         public PropertyValue Find(int key)
822         {
823             global::System.IntPtr cPtr = Interop.PropertyMap.Property_Map_Find__SWIG_2(swigCPtr, key);
824             PropertyValue ret = (cPtr == global::System.IntPtr.Zero) ? null : new PropertyValue(cPtr, false);
825             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
826             return ret;
827         }
828
829         /// <summary>
830         /// Finds the value for the specified keys if either exist.
831         /// </summary>
832         /// <param name="indexKey">The index key to find.</param>
833         /// <param name="stringKey">The string key to find.</param>
834         /// <returns>The value if it exists, an empty object otherwise.</returns>
835         /// <since_tizen> 3 </since_tizen>
836         public PropertyValue Find(int indexKey, string stringKey)
837         {
838             global::System.IntPtr cPtr = Interop.PropertyMap.Property_Map_Find__SWIG_3(swigCPtr, indexKey, stringKey);
839             PropertyValue ret = (cPtr == global::System.IntPtr.Zero) ? null : new PropertyValue(cPtr, false);
840             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
841             return ret;
842         }
843
844         /// <summary>
845         /// Clears the map.
846         /// </summary>
847         /// <since_tizen> 3 </since_tizen>
848         public void Clear()
849         {
850             Interop.PropertyMap.Property_Map_Clear(swigCPtr);
851             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
852         }
853
854         /// <summary>
855         /// Merges values from the map 'from' to the current.<br />
856         /// Any values in 'from' will overwrite the values in the current map.<br />
857         /// </summary>
858         /// <param name="from">The map to merge from.</param>
859         /// <since_tizen> 3 </since_tizen>
860         public void Merge(PropertyMap from)
861         {
862             Interop.PropertyMap.Property_Map_Merge(swigCPtr, PropertyMap.getCPtr(from));
863             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
864         }
865
866         /// <summary>
867         /// Retrieves the element with the specified string key.
868         /// </summary>
869         /// <param name="key">The key whose value to retrieve.</param>
870         /// <returns>The value for the element with the specified key.</returns>
871         internal PropertyValue ValueOfIndex(string key)
872         {
873             PropertyValue ret = new PropertyValue(Interop.PropertyMap.Property_Map_ValueOfIndex__SWIG_0(swigCPtr, key), false);
874             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
875             return ret;
876         }
877
878         /// <summary>
879         /// Retrieves the element with the specified index key.
880         /// </summary>
881         /// <param name="key">The key whose value to retrieve.</param>
882         /// <returns>The value for the element with the specified key.</returns>
883         internal PropertyValue ValueOfIndex(int key)
884         {
885             PropertyValue ret = new PropertyValue(Interop.PropertyMap.Property_Map_ValueOfIndex__SWIG_2(swigCPtr, key), false);
886             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
887             return ret;
888         }
889
890         internal static global::System.Runtime.InteropServices.HandleRef getCPtr(PropertyMap obj)
891         {
892             return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
893         }
894
895         /// <summary>
896         /// Dispose.
897         /// </summary>
898         /// <since_tizen> 3 </since_tizen>
899         protected virtual void Dispose(DisposeTypes type)
900         {
901             if (disposed)
902             {
903                 return;
904             }
905
906             if (type == DisposeTypes.Explicit)
907             {
908                 //Called by User
909                 //Release your own managed resources here.
910                 //You should release all of your own disposable objects here.
911             }
912
913             //Release your own unmanaged resources here.
914             //You should not access any managed member here except static instance.
915             //because the execution order of Finalizes is non-deterministic.
916
917             if (swigCPtr.Handle != global::System.IntPtr.Zero)
918             {
919                 if (swigCMemOwn)
920                 {
921                     swigCMemOwn = false;
922                     Interop.PropertyMap.delete_Property_Map(swigCPtr);
923                 }
924                 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
925             }
926             disposed = true;
927         }
928     }
929
930     /// <summary>
931     /// A value-type representing a property value.
932     /// </summary>
933     /// <since_tizen> 3 </since_tizen>
934     public class PropertyValue : global::System.IDisposable
935     {
936         /// <summary>
937         /// swigCMemOwn
938         /// </summary>
939         /// <since_tizen> 3 </since_tizen>
940         protected bool swigCMemOwn;
941         /// <summary>
942         /// A Flat to check if it is already disposed.
943         /// </summary>
944         /// <since_tizen> 3 </since_tizen>
945         protected bool disposed = false;
946
947         private global::System.Runtime.InteropServices.HandleRef swigCPtr;
948
949         //A Flag to check who called Dispose(). (By User or DisposeQueue)
950         private bool isDisposeQueued = false;
951
952         /// <summary>
953         /// Creates a Size2D property value.
954         /// </summary>
955         /// <param name="vectorValue">Size2D values.</param>
956         /// <since_tizen> 3 </since_tizen>
957         public PropertyValue(Size2D vectorValue) : this(Interop.PropertyValue.new_Property_Value__SWIG_4(Size2D.getCPtr(vectorValue)), true)
958         {
959             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
960         }
961
962         /// <summary>
963         /// Creates a Position2D property value.
964         /// </summary>
965         /// <param name="vectorValue">Position2D values.</param>
966         /// <since_tizen> 3 </since_tizen>
967         public PropertyValue(Position2D vectorValue) : this(Interop.PropertyValue.new_Property_Value__SWIG_4(Position2D.getCPtr(vectorValue)), true)
968         {
969             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
970         }
971
972         /// <summary>
973         /// Creates a Position property value.
974         /// </summary>
975         /// <param name="vectorValue">Position values.</param>
976         /// <since_tizen> 3 </since_tizen>
977         public PropertyValue(Position vectorValue) : this(Interop.PropertyValue.new_Property_Value__SWIG_5(Position.getCPtr(vectorValue)), true)
978         {
979             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
980         }
981
982         /// <summary>
983         /// Creates a Color property value.
984         /// </summary>
985         /// <param name="vectorValue">Color values.</param>
986         /// <since_tizen> 3 </since_tizen>
987         public PropertyValue(Color vectorValue) : this(Interop.PropertyValue.new_Property_Value__SWIG_6(Color.getCPtr(vectorValue)), true)
988         {
989             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
990         }
991         /// <summary>
992         /// The default constructor.
993         /// </summary>
994         /// <since_tizen> 3 </since_tizen>
995         public PropertyValue() : this(Interop.PropertyValue.new_Property_Value__SWIG_0(), true)
996         {
997             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
998         }
999
1000         /// <summary>
1001         /// Creates a boolean property value.
1002         /// </summary>
1003         /// <param name="boolValue">A boolean value.</param>
1004         /// <since_tizen> 3 </since_tizen>
1005         public PropertyValue(bool boolValue) : this(Interop.PropertyValue.new_Property_Value__SWIG_1(boolValue), true)
1006         {
1007             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1008         }
1009
1010         /// <summary>
1011         /// Creates an integer property value.
1012         /// </summary>
1013         /// <param name="integerValue">An integer value.</param>
1014         /// <since_tizen> 3 </since_tizen>
1015         public PropertyValue(int integerValue) : this(Interop.PropertyValue.new_Property_Value__SWIG_2(integerValue), true)
1016         {
1017             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1018         }
1019
1020         /// <summary>
1021         /// Creates a float property value.
1022         /// </summary>
1023         /// <param name="floatValue">A floating-point value.</param>
1024         /// <since_tizen> 3 </since_tizen>
1025         public PropertyValue(float floatValue) : this(Interop.PropertyValue.new_Property_Value__SWIG_3(floatValue), true)
1026         {
1027             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1028         }
1029
1030         /// <summary>
1031         /// Creates a Vector2 property value.
1032         /// </summary>
1033         /// <param name="vectorValue">A vector of 2 floating-point values.</param>
1034         /// <since_tizen> 3 </since_tizen>
1035         public PropertyValue(Vector2 vectorValue) : this(Interop.PropertyValue.new_Property_Value__SWIG_4(Vector2.getCPtr(vectorValue)), true)
1036         {
1037             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1038         }
1039
1040         /// <summary>
1041         /// Creates a Vector3 property value.
1042         /// </summary>
1043         /// <param name="vectorValue">A vector of 3 floating-point values.</param>
1044         /// <since_tizen> 3 </since_tizen>
1045         public PropertyValue(Vector3 vectorValue) : this(Interop.PropertyValue.new_Property_Value__SWIG_5(Vector3.getCPtr(vectorValue)), true)
1046         {
1047             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1048         }
1049
1050         /// <summary>
1051         /// Creates a Vector4 property value.
1052         /// </summary>
1053         /// <param name="vectorValue">A vector of 4 floating-point values.</param>
1054         /// <since_tizen> 3 </since_tizen>
1055         public PropertyValue(Vector4 vectorValue) : this(Interop.PropertyValue.new_Property_Value__SWIG_6(Vector4.getCPtr(vectorValue)), true)
1056         {
1057             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1058         }
1059
1060         /// <summary>
1061         /// Creates a Rectangle property value.
1062         /// </summary>
1063         /// <param name="vectorValue">Rectangle values.</param>
1064         /// <since_tizen> 3 </since_tizen>
1065         public PropertyValue(Rectangle vectorValue) : this(Interop.PropertyValue.new_Property_Value__SWIG_9(Rectangle.getCPtr(vectorValue)), true)
1066         {
1067             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1068         }
1069
1070         /// <summary>
1071         /// Creates a Rotation property value.
1072         /// </summary>
1073         /// <param name="quaternion">Rotation values.</param>
1074         /// <since_tizen> 3 </since_tizen>
1075         public PropertyValue(Rotation quaternion) : this(Interop.PropertyValue.new_Property_Value__SWIG_11(Rotation.getCPtr(quaternion)), true)
1076         {
1077             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1078         }
1079
1080         /// <summary>
1081         /// Creates a string property value.
1082         /// </summary>
1083         /// <param name="stringValue">A string.</param>
1084         /// <since_tizen> 3 </since_tizen>
1085         public PropertyValue(string stringValue) : this(Interop.PropertyValue.new_Property_Value__SWIG_12(stringValue), true)
1086         {
1087             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1088         }
1089
1090         /// <summary>
1091         /// Creates an array property value.
1092         /// </summary>
1093         /// <param name="arrayValue">An array.</param>
1094         /// <since_tizen> 3 </since_tizen>
1095         public PropertyValue(PropertyArray arrayValue) : this(Interop.PropertyValue.new_Property_Value__SWIG_14(PropertyArray.getCPtr(arrayValue)), true)
1096         {
1097             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1098         }
1099
1100         /// <summary>
1101         /// Creates a map property value.
1102         /// </summary>
1103         /// <param name="mapValue">An array.</param>
1104         /// <since_tizen> 3 </since_tizen>
1105         public PropertyValue(PropertyMap mapValue) : this(Interop.PropertyValue.new_Property_Value__SWIG_15(PropertyMap.getCPtr(mapValue)), true)
1106         {
1107             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1108         }
1109
1110         /// <summary>
1111         /// Creates a Extents value.
1112         /// </summary>
1113         /// <param name="extentsValue">A Extents value.</param>
1114         /// <since_tizen> 4 </since_tizen>
1115         public PropertyValue(Extents extentsValue) : this(Interop.PropertyValue.new_Property_Value__SWIG_16(Extents.getCPtr(extentsValue)), true)
1116         {
1117             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1118         }
1119
1120         /// <summary>
1121         /// Creates a PropertyType value.
1122         /// </summary>
1123         /// <param name="type">A PropertyType value.</param>
1124         /// <since_tizen> 3 </since_tizen>
1125         public PropertyValue(PropertyType type) : this(Interop.PropertyValue.new_Property_Value__SWIG_17((int)type), true)
1126         {
1127             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1128         }
1129
1130         /// <summary>
1131         /// Creates a PropertyValue value.
1132         /// </summary>
1133         /// <param name="value">A PropertyValue value.</param>
1134         /// <since_tizen> 3 </since_tizen>
1135         public PropertyValue(PropertyValue value) : this(Interop.PropertyValue.new_Property_Value__SWIG_18(PropertyValue.getCPtr(value)), true)
1136         {
1137             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1138         }
1139
1140         /// <summary>
1141         /// Creates a Size property value.
1142         /// </summary>
1143         /// <param name="vectorValue">Size values.</param>
1144         internal PropertyValue(Size vectorValue) : this(Interop.PropertyValue.new_Property_Value__SWIG_5(Size.getCPtr(vectorValue)), true)
1145         {
1146             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1147         }
1148
1149         internal PropertyValue(global::System.IntPtr cPtr, bool cMemoryOwn)
1150         {
1151             swigCMemOwn = cMemoryOwn;
1152             swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
1153         }
1154
1155         internal PropertyValue(Matrix3 matrixValue) : this(Interop.PropertyValue.new_Property_Value__SWIG_7(Matrix3.getCPtr(matrixValue)), true)
1156         {
1157             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1158         }
1159
1160         internal PropertyValue(Matrix matrixValue) : this(Interop.PropertyValue.new_Property_Value__SWIG_8(Matrix.getCPtr(matrixValue)), true)
1161         {
1162             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1163         }
1164
1165         internal PropertyValue(AngleAxis angleAxis) : this(Interop.PropertyValue.new_Property_Value__SWIG_10(AngleAxis.getCPtr(angleAxis)), true)
1166         {
1167             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1168         }
1169
1170         /// <summary>
1171         /// Dispose.
1172         /// </summary>
1173         /// <since_tizen> 3 </since_tizen>
1174         ~PropertyValue()
1175         {
1176             if(!isDisposeQueued)
1177             {
1178                 isDisposeQueued = true;
1179                 DisposeQueue.Instance.Add(this);
1180             }
1181         }
1182
1183         /// <summary>
1184         /// An extension to the property value class that allows us to create a
1185         /// Property value from a C# object, for example, integer, float, or string.<br />
1186         /// </summary>
1187         /// <param name="obj">An object to create.</param>
1188         /// <returns>The created value.</returns>
1189         /// <since_tizen> 3 </since_tizen>
1190         static public PropertyValue CreateFromObject(System.Object obj)
1191         {
1192             System.Type type = obj.GetType();
1193
1194             PropertyValue value;
1195             if (type.IsEnum)
1196             {
1197                 value = new PropertyValue((int)obj);//Enum.Parse(type, str);
1198             }
1199             else if (type.Equals(typeof(int)))
1200             {
1201                 value = new PropertyValue((int)obj);
1202             }
1203             else if (type.Equals(typeof(System.Int32)))
1204             {
1205                 value = new PropertyValue((int)obj);
1206             }
1207             else if (type.Equals(typeof(bool)))
1208             {
1209                 value = new PropertyValue((bool)obj);
1210             }
1211             else if (type.Equals(typeof(float)))
1212             {
1213                 value = new PropertyValue((float)obj);
1214             }
1215             else if (type.Equals(typeof(string)))
1216             {
1217                 value = new PropertyValue((string)obj);
1218             }
1219             else if (type.Equals(typeof(Vector2)))
1220             {
1221                 value = new PropertyValue((Vector2)obj);
1222             }
1223             else if (type.Equals(typeof(Vector3)))
1224             {
1225                 value = new PropertyValue((Vector3)obj);
1226             }
1227             else if (type.Equals(typeof(Vector4)))
1228             {
1229                 value = new PropertyValue((Vector4)obj);
1230             }
1231             else if (type.Equals(typeof(Position)))
1232             {
1233                 value = new PropertyValue((Position)obj);
1234             }
1235             else if (type.Equals(typeof(Position2D)))
1236             {
1237                 value = new PropertyValue((Position2D)obj);
1238             }
1239             else if (type.Equals(typeof(Size)))
1240             {
1241                 value = new PropertyValue((Size)obj);
1242             }
1243             else if (type.Equals(typeof(Size2D)))
1244             {
1245                 value = new PropertyValue((Size2D)obj);
1246             }
1247             else if (type.Equals(typeof(Color)))
1248             {
1249                 value = new PropertyValue((Color)obj);
1250             }
1251             else if (type.Equals(typeof(Rotation)))
1252             {
1253                 value = new PropertyValue((Rotation)obj);
1254             }
1255             else if (type.Equals(typeof(RelativeVector2)))
1256             {
1257                 value = new PropertyValue((RelativeVector2)obj);
1258             }
1259             else if (type.Equals(typeof(RelativeVector3)))
1260             {
1261                 value = new PropertyValue((RelativeVector3)obj);
1262             }
1263             else if (type.Equals(typeof(RelativeVector4)))
1264             {
1265                 value = new PropertyValue((RelativeVector4)obj);
1266             }
1267             else if(type.Equals(typeof(Extents)))
1268             {
1269                 value = new PropertyValue((Extents)obj);
1270             }
1271             else
1272             {
1273                 throw new global::System.InvalidOperationException("Unimplemented type for Property Value :" + type.Name);
1274             }
1275             //NUILog.Debug(" got an property value of =" + type.Name);
1276             return value;
1277         }
1278
1279         /// <summary>
1280         /// Dispose.
1281         /// </summary>
1282         /// <since_tizen> 3 </since_tizen>
1283         public void Dispose()
1284         {
1285             //Throw excpetion if Dispose() is called in separate thread.
1286             if (!Window.IsInstalled())
1287             {
1288                 throw new System.InvalidOperationException("This API called from separate thread. This API must be called from MainThread.");
1289             }
1290
1291             if (isDisposeQueued)
1292             {
1293                 Dispose(DisposeTypes.Implicit);
1294             }
1295             else
1296             {
1297                 Dispose(DisposeTypes.Explicit);
1298                 System.GC.SuppressFinalize(this);
1299             }
1300         }
1301
1302         /// <summary>
1303         /// Retrieves a Size2D value.
1304         /// </summary>
1305         /// <param name="vectorValue"> On return, a Size2D value.</param>
1306         /// <since_tizen> 3 </since_tizen>
1307         public bool Get(Size2D vectorValue)
1308         {
1309             bool ret = Interop.PropertyValue.Property_Value_Get__SWIG_5(swigCPtr, Size2D.getCPtr(vectorValue));
1310             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1311             return ret;
1312         }
1313
1314         /// <summary>
1315         /// Retrieves a Position2D value.
1316         /// </summary>
1317         /// <param name="vectorValue"> On return, a Position2D value.</param>
1318         /// <since_tizen> 3 </since_tizen>
1319         public bool Get(Position2D vectorValue)
1320         {
1321             bool ret = Interop.PropertyValue.Property_Value_Get__SWIG_5(swigCPtr, Position2D.getCPtr(vectorValue));
1322             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1323             return ret;
1324         }
1325
1326         /// <summary>
1327         /// Retrieves a Size value.
1328         /// </summary>
1329         /// <param name="vectorValue"> On return, a size value.</param>
1330         /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
1331         [EditorBrowsable(EditorBrowsableState.Never)]
1332         public bool Get(Size vectorValue)
1333         {
1334             bool ret = Interop.PropertyValue.Property_Value_Get__SWIG_6(swigCPtr, Size.getCPtr(vectorValue));
1335             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1336             return ret;
1337         }
1338
1339         /// <summary>
1340         /// Retrieves a Position value.
1341         /// </summary>
1342         /// <param name="vectorValue"> On return, a position value.</param>
1343         /// <since_tizen> 3 </since_tizen>
1344         public bool Get(Position vectorValue)
1345         {
1346             bool ret = Interop.PropertyValue.Property_Value_Get__SWIG_6(swigCPtr, Position.getCPtr(vectorValue));
1347             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1348             return ret;
1349         }
1350
1351         /// <summary>
1352         /// Retrieves a Color value.
1353         /// </summary>
1354         /// <param name="vectorValue"> On return, a color value.</param>
1355         /// <since_tizen> 3 </since_tizen>
1356         public bool Get(Color vectorValue)
1357         {
1358             bool ret = Interop.PropertyValue.Property_Value_Get__SWIG_7(swigCPtr, Color.getCPtr(vectorValue));
1359             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1360             return ret;
1361         }
1362
1363         /// <summary>
1364         /// Queries the type of this property value.
1365         /// </summary>
1366         /// <returns>The type ID</returns>
1367         /// <since_tizen> 3 </since_tizen>
1368         public new PropertyType GetType()
1369         {
1370             PropertyType ret = (PropertyType)Interop.PropertyValue.Property_Value_GetType(swigCPtr);
1371             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1372             return ret;
1373         }
1374
1375         /// <summary>
1376         /// Retrieves a boolean value.
1377         /// </summary>
1378         /// <param name="boolValue">On return, a boolean value.</param>
1379         /// <returns>Returns true if the value is successfully retrieved, false if the type is not convertible.</returns>
1380         /// <since_tizen> 3 </since_tizen>
1381         public bool Get(out bool boolValue)
1382         {
1383             bool ret = Interop.PropertyValue.Property_Value_Get__SWIG_1(swigCPtr, out boolValue);
1384             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1385             return ret;
1386         }
1387
1388         /// <summary>
1389         /// Retrieves a floating-point value.
1390         /// </summary>
1391         /// <param name="floatValue">On return, a floating-point value.</param>
1392         /// <returns>Returns true if the value is successfully retrieved, false if the type is not convertible.</returns>
1393         /// <since_tizen> 3 </since_tizen>
1394         public bool Get(out float floatValue)
1395         {
1396             bool ret = Interop.PropertyValue.Property_Value_Get__SWIG_2(swigCPtr, out floatValue);
1397             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1398             return ret;
1399         }
1400
1401         /// <summary>
1402         /// Retrieves an integer value.
1403         /// </summary>
1404         /// <param name="integerValue">On return, an integer value.</param>
1405         /// <returns>Returns true if the value is successfully retrieved, false if the type is not convertible.</returns>
1406         /// <since_tizen> 3 </since_tizen>
1407         public bool Get(out int integerValue)
1408         {
1409             bool ret = Interop.PropertyValue.Property_Value_Get__SWIG_3(swigCPtr, out integerValue);
1410             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1411             return ret;
1412         }
1413
1414         /// <summary>
1415         /// Retrieves an integer rectangle.
1416         /// </summary>
1417         /// <param name="rect">On return, an integer rectangle.</param>
1418         /// <returns>Returns true if the value is successfully retrieved, false if the type is not convertible.</returns>
1419         /// <since_tizen> 3 </since_tizen>
1420         public bool Get(Rectangle rect)
1421         {
1422             bool ret = Interop.PropertyValue.Property_Value_Get__SWIG_4(swigCPtr, Rectangle.getCPtr(rect));
1423             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1424             return ret;
1425         }
1426
1427         /// <summary>
1428         /// Retrieves a vector value.
1429         /// </summary>
1430         /// <param name="vectorValue">On return, a vector value.</param>
1431         /// <returns>Returns true if the value is successfully retrieved, false if the type is not convertible.</returns>
1432         /// <since_tizen> 3 </since_tizen>
1433         public bool Get(Vector2 vectorValue)
1434         {
1435             bool ret = Interop.PropertyValue.Property_Value_Get__SWIG_5(swigCPtr, Vector2.getCPtr(vectorValue));
1436             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1437             return ret;
1438         }
1439
1440         /// <summary>
1441         /// Retrieves a vector value.
1442         /// </summary>
1443         /// <param name="vectorValue">On return, a vector value.</param>
1444         /// <returns>Returns true if the value is successfully retrieved, false if the type is not convertible.</returns>
1445         /// <since_tizen> 3 </since_tizen>
1446         public bool Get(Vector3 vectorValue)
1447         {
1448             bool ret = Interop.PropertyValue.Property_Value_Get__SWIG_6(swigCPtr, Vector3.getCPtr(vectorValue));
1449             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1450             return ret;
1451         }
1452
1453         /// <summary>
1454         /// Retrieves a vector value.
1455         /// </summary>
1456         /// <param name="vectorValue">On return, a vector value.</param>
1457         /// <returns>Returns true if the value is successfully retrieved, false if the type is not convertible.</returns>
1458         /// <since_tizen> 3 </since_tizen>
1459         public bool Get(Vector4 vectorValue)
1460         {
1461             bool ret = Interop.PropertyValue.Property_Value_Get__SWIG_7(swigCPtr, Vector4.getCPtr(vectorValue));
1462             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1463             return ret;
1464         }
1465
1466         /// <summary>
1467         /// Retrieves a vector value.
1468         /// </summary>
1469         /// <param name="vectorValue">On return, a vector value.</param>
1470         /// <returns>Returns true if the value is successfully retrieved, false if the type is not convertible.</returns>
1471         /// <since_tizen> 5 </since_tizen>
1472         /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
1473         [EditorBrowsable(EditorBrowsableState.Never)]
1474         public bool Get(RelativeVector2 vectorValue)
1475         {
1476             bool ret = Interop.PropertyValue.Property_Value_Get__SWIG_5(swigCPtr, RelativeVector2.getCPtr(vectorValue));
1477             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1478             return ret;
1479         }
1480
1481         /// <summary>
1482         /// Retrieves a vector value.
1483         /// </summary>
1484         /// <param name="vectorValue">On return, a vector value.</param>
1485         /// <returns>Returns true if the value is successfully retrieved, false if the type is not convertible.</returns>
1486         /// <since_tizen> 5 </since_tizen>
1487         /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
1488         [EditorBrowsable(EditorBrowsableState.Never)]
1489         public bool Get(RelativeVector3 vectorValue)
1490         {
1491             bool ret = Interop.PropertyValue.Property_Value_Get__SWIG_6(swigCPtr, RelativeVector3.getCPtr(vectorValue));
1492             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1493             return ret;
1494         }
1495
1496         /// <summary>
1497         /// Retrieves a vector value.
1498         /// </summary>
1499         /// <param name="vectorValue">On return, a vector value.</param>
1500         /// <returns>Returns true if the value is successfully retrieved, false if the type is not convertible.</returns>
1501         /// <since_tizen> 5 </since_tizen>
1502         /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
1503         [EditorBrowsable(EditorBrowsableState.Never)]
1504         public bool Get(RelativeVector4 vectorValue)
1505         {
1506             bool ret = Interop.PropertyValue.Property_Value_Get__SWIG_7(swigCPtr, RelativeVector4.getCPtr(vectorValue));
1507             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1508             return ret;
1509         }
1510
1511         /// <summary>
1512         /// Retrieves a rotation value.
1513         /// </summary>
1514         /// <param name="quaternionValue">On return, a rotation value.</param>
1515         /// <returns>Returns true if the value is successfully retrieved, false if the type is not convertible.</returns>
1516         /// <since_tizen> 3 </since_tizen>
1517         public bool Get(Rotation quaternionValue)
1518         {
1519             bool ret = Interop.PropertyValue.Property_Value_Get__SWIG_11(swigCPtr, Rotation.getCPtr(quaternionValue));
1520             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1521             return ret;
1522         }
1523
1524         /// <summary>
1525         /// Retrieves a string property value.
1526         /// </summary>
1527         /// <param name="stringValue">On return, a string.</param>
1528         /// <returns>Returns true if the value is successfully retrieved, false if the type is not convertible.</returns>
1529         /// <since_tizen> 3 </since_tizen>
1530         public bool Get(out string stringValue)
1531         {
1532             bool ret = Interop.PropertyValue.Property_Value_Get__SWIG_12(swigCPtr, out stringValue);
1533             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1534             return ret;
1535         }
1536
1537         /// <summary>
1538         /// Retrieves an array property value.
1539         /// </summary>
1540         /// <param name="arrayValue">On return, the array as a vector property values.</param>
1541         /// <returns>Returns true if the value is successfully retrieved, false if the type is not convertible.</returns>
1542         /// <since_tizen> 3 </since_tizen>
1543         public bool Get(PropertyArray arrayValue)
1544         {
1545             bool ret = Interop.PropertyValue.Property_Value_Get__SWIG_13(swigCPtr, PropertyArray.getCPtr(arrayValue));
1546             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1547             return ret;
1548         }
1549
1550         /// <summary>
1551         /// Retrieves a map property value.
1552         /// </summary>
1553         /// <param name="mapValue">On return, the map as vector of string and property value pairs.</param>
1554         /// <returns>Returns true if the value is successfully retrieved, false if the type is not convertible.</returns>
1555         /// <since_tizen> 3 </since_tizen>
1556         public bool Get(PropertyMap mapValue)
1557         {
1558             bool ret = Interop.PropertyValue.Property_Value_Get__SWIG_14(swigCPtr, PropertyMap.getCPtr(mapValue));
1559             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1560             return ret;
1561         }
1562
1563         /// <summary>
1564         /// Retrieves a Extents value.
1565         /// </summary>
1566         /// <param name="extentsValue">On return, a extents.</param>
1567         /// <returns>Returns true if the value is successfully retrieved, false if the type is not convertible.</returns>
1568         /// <since_tizen> 4 </since_tizen>
1569         public bool Get(Extents extentsValue)
1570         {
1571             bool ret = Interop.PropertyValue.Property_Value_Get__SWIG_15(swigCPtr, Extents.getCPtr(extentsValue));
1572             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1573             return ret;
1574         }
1575
1576         internal static global::System.Runtime.InteropServices.HandleRef getCPtr(PropertyValue obj)
1577         {
1578             return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
1579         }
1580
1581         internal bool Get(Matrix3 matrixValue)
1582         {
1583             bool ret = Interop.PropertyValue.Property_Value_Get__SWIG_8(swigCPtr, Matrix3.getCPtr(matrixValue));
1584             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1585             return ret;
1586         }
1587
1588         internal bool Get(Matrix matrixValue)
1589         {
1590             bool ret = Interop.PropertyValue.Property_Value_Get__SWIG_9(swigCPtr, Matrix.getCPtr(matrixValue));
1591             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1592             return ret;
1593         }
1594
1595         internal bool Get(AngleAxis angleAxisValue)
1596         {
1597             bool ret = Interop.PropertyValue.Property_Value_Get__SWIG_10(swigCPtr, AngleAxis.getCPtr(angleAxisValue));
1598             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1599             return ret;
1600         }
1601
1602         /// <summary>
1603         /// Dispose.
1604         /// </summary>
1605         /// <since_tizen> 3 </since_tizen>
1606         protected virtual void Dispose(DisposeTypes type)
1607         {
1608             if (disposed)
1609             {
1610                 return;
1611             }
1612
1613             if (type == DisposeTypes.Explicit)
1614             {
1615                 //Called by User
1616                 //Release your own managed resources here.
1617                 //You should release all of your own disposable objects here.
1618             }
1619
1620             //Release your own unmanaged resources here.
1621             //You should not access any managed member here except static instance.
1622             //because the execution order of Finalizes is non-deterministic.
1623
1624             if (swigCPtr.Handle != global::System.IntPtr.Zero)
1625             {
1626                 if (swigCMemOwn)
1627                 {
1628                     swigCMemOwn = false;
1629                     Interop.PropertyValue.delete_Property_Value(swigCPtr);
1630                 }
1631                 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
1632             }
1633             disposed = true;
1634         }
1635     }
1636
1637     /// <summary>
1638     /// KeyValue class.
1639     /// </summary>
1640     public class KeyValue
1641     {
1642         /// <summary>
1643         /// Int key.
1644         /// </summary>
1645         public int? KeyInt = null;
1646
1647         /// <summary>
1648         /// String key.
1649         /// </summary>
1650         public string KeyString = null;
1651
1652         /// <summary>
1653         /// True value.
1654         /// </summary>
1655         public PropertyValue TrueValue = null;
1656
1657         private string _key = null;
1658         private object _originalValue = null;
1659         private object _originalKey = null;
1660
1661         /// <summary>
1662         /// Default Constructor.
1663         /// </summary>
1664         public KeyValue()
1665         {}
1666
1667         /// <summary>
1668         /// Key property.
1669         /// </summary>
1670         public string Key
1671         {
1672             get
1673             {
1674                 return _key;
1675             }
1676             set
1677             {
1678                 _key = value;
1679                 ParseKey(value);
1680             }
1681         }
1682
1683         /// <summary>
1684         /// OriginalKey property.
1685         /// </summary>
1686         public object OriginalKey
1687         {
1688             get
1689             {
1690                 return _originalKey;
1691             }
1692             set
1693             {
1694                 _originalKey = value;
1695                 if (value is int || value is Int32)
1696                 {
1697                     KeyInt = (int)value;
1698                 }
1699                 else if (value is string)
1700                 {
1701                     KeyString = value.ToString();
1702                 }
1703                 else if (value.GetType().Equals(typeof(int)) || value.GetType().Equals(typeof(Int32)))
1704                 {
1705                     KeyInt = (int)value;
1706                 }
1707                 else if (value.GetType().Equals(typeof(string)))
1708                 {
1709                     KeyString = value.ToString();
1710                 }
1711             }
1712         }
1713
1714         /// <summary>
1715         /// Value property.
1716         /// </summary>
1717         public object Value
1718         {
1719             get
1720             {
1721                 return _originalValue;
1722             }
1723             set
1724             {
1725                 _originalValue = value;
1726                 TrueValue = PropertyValue.CreateFromObject(value);
1727             }
1728         }
1729
1730         /// <summary>
1731         /// IntergerValue property.
1732         /// </summary>
1733         public int IntergerValue
1734         {
1735             set
1736             {
1737                 TrueValue = new PropertyValue(value);
1738             }
1739         }
1740
1741         /// <summary>
1742         /// BooleanValue property.
1743         /// </summary>
1744         public bool BooleanValue
1745         {
1746             set
1747             {
1748                 TrueValue = new PropertyValue(value);
1749             }
1750         }
1751
1752         /// <summary>
1753         /// SingleValue property.
1754         /// </summary>
1755         public float SingleValue
1756         {
1757             set
1758             {
1759                 TrueValue = new PropertyValue(value);
1760             }
1761         }
1762
1763         /// <summary>
1764         /// StringValue property.
1765         /// </summary>
1766         public string StringValue
1767         {
1768             set
1769             {
1770                 TrueValue = new PropertyValue(value);
1771             }
1772         }
1773
1774         /// <summary>
1775         /// Vector2Value property.
1776         /// </summary>
1777         public Vector2 Vector2Value
1778         {
1779             set
1780             {
1781                 TrueValue = new PropertyValue(value);
1782             }
1783         }
1784
1785         /// <summary>
1786         /// Vector3Value property.
1787         /// </summary>
1788         public Vector3 Vector3Value
1789         {
1790             set
1791             {
1792                 TrueValue = new PropertyValue(value);
1793             }
1794         }
1795
1796         /// <summary>
1797         /// Vector4Value property.
1798         /// </summary>
1799         public Vector4 Vector4Value
1800         {
1801             set
1802             {
1803                 TrueValue = new PropertyValue(value);
1804             }
1805         }
1806
1807         /// <summary>
1808         /// PositionValue property.
1809         /// </summary>
1810         public Position PositionValue
1811         {
1812             set
1813             {
1814                 TrueValue = new PropertyValue(value);
1815             }
1816         }
1817
1818         /// <summary>
1819         /// Position2DValue property.
1820         /// </summary>
1821         public Position2D Position2DValue
1822         {
1823             set
1824             {
1825                 TrueValue = new PropertyValue(value);
1826             }
1827         }
1828
1829         /// <summary>
1830         /// SizeValue property.
1831         /// </summary>
1832         public Size SizeValue
1833         {
1834             set
1835             {
1836                 TrueValue = new PropertyValue(value);
1837             }
1838         }
1839
1840         /// <summary>
1841         /// Size2DValue property.
1842         /// </summary>
1843         public Size2D Size2DValue
1844         {
1845             set
1846             {
1847                 TrueValue = new PropertyValue(value);
1848             }
1849         }
1850
1851         /// <summary>
1852         /// ColorValue property.
1853         /// </summary>
1854         public Color ColorValue
1855         {
1856             set
1857             {
1858                 TrueValue = new PropertyValue(value);
1859             }
1860         }
1861
1862         /// <summary>
1863         /// RectangleValue property.
1864         /// </summary>
1865         public Rectangle RectangleValue
1866         {
1867             set
1868             {
1869                 TrueValue = new PropertyValue(value);
1870             }
1871         }
1872
1873         /// <summary>
1874         /// RotationValue property.
1875         /// </summary>
1876         public Rotation RotationValue
1877         {
1878             set
1879             {
1880                 TrueValue = new PropertyValue(value);
1881             }
1882         }
1883
1884         /// <summary>
1885         /// RelativeVector2Value property.
1886         /// </summary>
1887         public RelativeVector2 RelativeVector2Value
1888         {
1889             set
1890             {
1891                 TrueValue = new PropertyValue(value);
1892             }
1893         }
1894
1895         /// <summary>
1896         /// RelativeVector3Value property.
1897         /// </summary>
1898         public RelativeVector3 RelativeVector3Value
1899         {
1900             set
1901             {
1902                 TrueValue = new PropertyValue(value);
1903             }
1904         }
1905
1906         /// <summary>
1907         /// RelativeVector4Value property.
1908         /// </summary>
1909         public RelativeVector4 RelativeVector4Value
1910         {
1911             set
1912             {
1913                 TrueValue = new PropertyValue(value);
1914             }
1915         }
1916
1917         /// <summary>
1918         /// ExtentsValue property.
1919         /// </summary>
1920         public Extents ExtentsValue
1921         {
1922             set
1923             {
1924                 TrueValue = new PropertyValue(value);
1925             }
1926         }
1927
1928         /// <summary>
1929         /// PropertyArrayValue property.
1930         /// </summary>
1931         public PropertyArray PropertyArrayValue
1932         {
1933             set
1934             {
1935                 TrueValue = new PropertyValue(value);
1936             }
1937         }
1938
1939         /// <summary>
1940         /// PropertyMapValue property.
1941         /// </summary>
1942         public PropertyMap PropertyMapValue
1943         {
1944             set
1945             {
1946                 TrueValue = new PropertyValue(value);
1947             }
1948         }
1949
1950         private void ParseKey(string key)
1951         {
1952             int v = -1;
1953             if (VisualExtension.KeyDictionary.ContainsKey(key))
1954             {
1955                 VisualExtension.KeyDictionary.TryGetValue(key, out v);
1956                 KeyInt = v;
1957             }
1958             else
1959             {
1960                 KeyString = Key;
1961             }
1962         }
1963     }
1964
1965     internal class Property : global::System.IDisposable
1966     {
1967         /// <summary>
1968         /// swigCMemOwn
1969         /// </summary>
1970         /// <since_tizen> 3 </since_tizen>
1971         protected bool swigCMemOwn;
1972         /// <summary>
1973         /// <since_tizen> 3 </since_tizen>
1974         /// A Flat to check if it is already disposed.
1975         /// </summary>
1976         protected bool disposed = false;
1977
1978         private global::System.Runtime.InteropServices.HandleRef swigCPtr;
1979
1980         //A Flag to check who called Dispose(). (By User or DisposeQueue)
1981         private bool isDisposeQueued = false;
1982
1983         /// <summary>
1984         /// This constructor creates a property instance.
1985         /// </summary>
1986         /// <param name="arg0">A valid handle to the target object.</param>
1987         /// <param name="propertyIndex">The index of a property.</param>
1988         /// <since_tizen> 3 </since_tizen>
1989         public Property(Animatable arg0, int propertyIndex) : this(Interop.Property.new_Property__SWIG_0(Animatable.getCPtr(arg0), propertyIndex), true)
1990         {
1991             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1992         }
1993
1994         /// <summary>
1995         /// This constructor creates a property instance.
1996         /// </summary>
1997         /// <param name="arg0">A valid handle to the target object.</param>
1998         /// <param name="propertyIndex">The index of a property.</param>
1999         /// <param name="componentIndex">Index to a sub component of a property, for use with Vector2, Vector3 and Vector4. -1 for the main property (default is -1).</param>
2000         /// <since_tizen> 3 </since_tizen>
2001         public Property(Animatable arg0, int propertyIndex, int componentIndex) : this(Interop.Property.new_Property__SWIG_1(Animatable.getCPtr(arg0), propertyIndex, componentIndex), true)
2002         {
2003             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
2004         }
2005
2006         /// <summary>
2007         /// This constructor creates a property instance.<br />
2008         /// This performs a property index query and is therefore slower than constructing a property directly with the index.<br />
2009         /// </summary>
2010         /// <param name="arg0">A valid handle to the target object.</param>
2011         /// <param name="propertyName">The property name.</param>
2012         /// <since_tizen> 3 </since_tizen>
2013         public Property(Animatable arg0, string propertyName) : this(Interop.Property.new_Property__SWIG_2(Animatable.getCPtr(arg0), propertyName), true)
2014         {
2015             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
2016         }
2017
2018         /// <summary>
2019         /// This constructor creates a property instance.<br />
2020         /// This performs a property index query and is therefore slower than constructing a property directly with the index.<br />
2021         /// </summary>
2022         /// <param name="arg0">A valid handle to the target object.</param>
2023         /// <param name="propertyName">The property name.</param>
2024         /// <param name="componentIndex">Index to a sub component of a property, for use with Vector2, Vector3 and Vector4. -1 for main property (default is -1).</param>
2025         /// <since_tizen> 3 </since_tizen>
2026         public Property(Animatable arg0, string propertyName, int componentIndex) : this(Interop.Property.new_Property__SWIG_3(Animatable.getCPtr(arg0), propertyName, componentIndex), true)
2027         {
2028             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
2029         }
2030
2031         internal Property(global::System.IntPtr cPtr, bool cMemoryOwn)
2032         {
2033             swigCMemOwn = cMemoryOwn;
2034             swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
2035         }
2036
2037         ~Property()
2038         {
2039             if(!isDisposeQueued)
2040             {
2041                 isDisposeQueued = true;
2042                 DisposeQueue.Instance.Add(this);
2043             }
2044         }
2045
2046         /// <summary>
2047         /// Gets or sets the index of the property.
2048         /// </summary>
2049         /// <since_tizen> 3 </since_tizen>
2050         public int propertyIndex
2051         {
2052             set
2053             {
2054                 Interop.Property.Property_propertyIndex_set(swigCPtr, value);
2055                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
2056             }
2057             get
2058             {
2059                 int ret = Interop.Property.Property_propertyIndex_get(swigCPtr);
2060                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
2061                 return ret;
2062             }
2063         }
2064
2065         /// <summary>
2066         /// Gets or sets the component index of the property.
2067         /// </summary>
2068         /// <since_tizen> 3 </since_tizen>
2069         public int componentIndex
2070         {
2071             set
2072             {
2073                 Interop.Property.Property_componentIndex_set(swigCPtr, value);
2074                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
2075             }
2076             get
2077             {
2078                 int ret = Interop.Property.Property_componentIndex_get(swigCPtr);
2079                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
2080                 return ret;
2081             }
2082         }
2083
2084         internal static int INVALID_INDEX
2085         {
2086             get
2087             {
2088                 int ret = Interop.Property.Property_INVALID_INDEX_get();
2089                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
2090                 return ret;
2091             }
2092         }
2093
2094         internal static int INVALID_KEY
2095         {
2096             get
2097             {
2098                 int ret = Interop.Property.Property_INVALID_KEY_get();
2099                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
2100                 return ret;
2101             }
2102         }
2103
2104         internal static int INVALID_COMPONENT_INDEX
2105         {
2106             get
2107             {
2108                 int ret = Interop.Property.Property_INVALID_COMPONENT_INDEX_get();
2109                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
2110                 return ret;
2111             }
2112         }
2113
2114         internal Animatable _object
2115         {
2116             set
2117             {
2118                 Interop.Property.Property__object_set(swigCPtr, Animatable.getCPtr(value));
2119                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
2120             }
2121             get
2122             {
2123                 Animatable ret = new Animatable(Interop.Property.Property__object_get(swigCPtr), false);
2124                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
2125                 return ret;
2126             }
2127         }
2128
2129         public void Dispose()
2130         {
2131             //Throw excpetion if Dispose() is called in separate thread.
2132             if (!Window.IsInstalled())
2133             {
2134                 throw new System.InvalidOperationException("This API called from separate thread. This API must be called from MainThread.");
2135             }
2136
2137             if (isDisposeQueued)
2138             {
2139                 Dispose(DisposeTypes.Implicit);
2140             }
2141             else
2142             {
2143                 Dispose(DisposeTypes.Explicit);
2144                 System.GC.SuppressFinalize(this);
2145             }
2146         }
2147
2148         internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Property obj)
2149         {
2150             return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
2151         }
2152
2153         protected virtual void Dispose(DisposeTypes type)
2154         {
2155             if (disposed)
2156             {
2157                 return;
2158             }
2159
2160             if(type == DisposeTypes.Explicit)
2161             {
2162                 //Called by User
2163                 //Release your own managed resources here.
2164                 //You should release all of your own disposable objects here.
2165             }
2166
2167             //Release your own unmanaged resources here.
2168             //You should not access any managed member here except static instance.
2169             //because the execution order of Finalizes is non-deterministic.
2170
2171             if (swigCPtr.Handle != global::System.IntPtr.Zero)
2172             {
2173                 if (swigCMemOwn)
2174                 {
2175                     swigCMemOwn = false;
2176                     Interop.Property.delete_Property(swigCPtr);
2177                 }
2178                 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
2179             }
2180             disposed = true;
2181         }
2182     }
2183 }