merging dali-sharp class scope with nui
[platform/core/csapi/tizenfx.git] / src / Tizen.NUI / src / internal / Item.cs
1 //------------------------------------------------------------------------------
2 // <auto-generated />
3 //
4 // This file was automatically generated by SWIG (http://www.swig.org).
5 // Version 3.0.9
6 //
7 // Do not make changes to this file unless you know what you are doing--modify
8 // the SWIG interface file instead.
9 //------------------------------------------------------------------------------
10
11 namespace Tizen.NUI
12 {
13     using Tizen.NUI.BaseComponents;
14     internal class Item : global::System.IDisposable
15     {
16         private global::System.Runtime.InteropServices.HandleRef swigCPtr;
17         protected bool swigCMemOwn;
18
19         internal Item(global::System.IntPtr cPtr, bool cMemoryOwn)
20         {
21             swigCMemOwn = cMemoryOwn;
22             swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
23         }
24
25         internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Item obj)
26         {
27             return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
28         }
29
30         //A Flag to check who called Dispose(). (By User or DisposeQueue)
31         private bool isDisposeQueued = false;
32         //A Flat to check if it is already disposed.
33         protected bool disposed = false;
34
35
36         ~Item()
37         {
38             if (!isDisposeQueued)
39             {
40                 isDisposeQueued = true;
41                 DisposeQueue.Instance.Add(this);
42             }
43         }
44
45         public void Dispose()
46         {
47             //Throw excpetion if Dispose() is called in separate thread.
48             if (!Window.IsInstalled())
49             {
50                 throw new System.InvalidOperationException("This API called from separate thread. This API must be called from MainThread.");
51             }
52
53             if (isDisposeQueued)
54             {
55                 Dispose(DisposeTypes.Implicit);
56             }
57             else
58             {
59                 Dispose(DisposeTypes.Explicit);
60                 System.GC.SuppressFinalize(this);
61             }
62         }
63
64         protected virtual void Dispose(DisposeTypes type)
65         {
66             if (disposed)
67             {
68                 return;
69             }
70
71             if (type == DisposeTypes.Explicit)
72             {
73                 //Called by User
74                 //Release your own managed resources here.
75                 //You should release all of your own disposable objects here.
76
77             }
78
79             //Release your own unmanaged resources here.
80             //You should not access any managed member here except static instance.
81             //because the execution order of Finalizes is non-deterministic.
82
83             if (swigCPtr.Handle != global::System.IntPtr.Zero)
84             {
85                 if (swigCMemOwn)
86                 {
87                     swigCMemOwn = false;
88                     NDalicPINVOKE.delete_Item(swigCPtr);
89                 }
90                 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
91             }
92
93             disposed = true;
94         }
95
96         public Item() : this(NDalicPINVOKE.new_Item__SWIG_0(), true)
97         {
98             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
99         }
100
101         public Item(uint t, View u) : this(NDalicPINVOKE.new_Item__SWIG_1(t, View.getCPtr(u)), true)
102         {
103             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
104         }
105
106         public Item(Item p) : this(NDalicPINVOKE.new_Item__SWIG_2(Item.getCPtr(p)), true)
107         {
108             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
109         }
110
111         public uint first
112         {
113             set
114             {
115                 NDalicPINVOKE.Item_first_set(swigCPtr, value);
116                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
117             }
118             get
119             {
120                 uint ret = NDalicPINVOKE.Item_first_get(swigCPtr);
121                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
122                 return ret;
123             }
124         }
125
126         public View second
127         {
128             set
129             {
130                 NDalicPINVOKE.Item_second_set(swigCPtr, View.getCPtr(value));
131                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
132             }
133             get
134             {
135                 global::System.IntPtr cPtr = NDalicPINVOKE.Item_second_get(swigCPtr);
136                 View ret = (cPtr == global::System.IntPtr.Zero) ? null : new View(cPtr, false);
137                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
138                 return ret;
139             }
140         }
141
142     }
143
144 }