[NUI] TCSACR-226 code change (#1032)
[platform/core/csapi/tizenfx.git] / src / Tizen.NUI / src / internal / Any.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 namespace Tizen.NUI
19 {
20     internal class Any : Disposable
21     {
22         private global::System.Runtime.InteropServices.HandleRef swigCPtr;
23         protected bool swigCMemOwn;
24
25         internal Any(global::System.IntPtr cPtr, bool cMemoryOwn)
26         {
27             swigCMemOwn = cMemoryOwn;
28             swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
29         }
30
31         internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Any obj)
32         {
33             return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
34         }
35
36         protected override void Dispose(DisposeTypes type)
37         {
38             if (disposed)
39             {
40                 return;
41             }
42
43             //Release your own unmanaged resources here.
44             //You should not access any managed member here except static instance.
45             //because the execution order of Finalizes is non-deterministic.
46
47             if (swigCPtr.Handle != global::System.IntPtr.Zero)
48             {
49                 if (swigCMemOwn)
50                 {
51                     swigCMemOwn = false;
52                     Interop.Any.delete_Any(swigCPtr);
53                 }
54                 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
55             }
56
57             base.Dispose(type);
58         }
59
60
61         public Any() : this(Interop.Any.new_Any__SWIG_0(), true)
62         {
63             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
64         }
65
66         public static void AssertAlways(string assertMessage)
67         {
68             Interop.Any.Any_AssertAlways(assertMessage);
69             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
70         }
71
72         public Any(Any any) : this(Interop.Any.new_Any__SWIG_2(Any.getCPtr(any)), true)
73         {
74             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
75         }
76
77         public Any Assign(Any any)
78         {
79             Any ret = new Any(Interop.Any.Any_Assign(swigCPtr, Any.getCPtr(any)), false);
80             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
81             return ret;
82         }
83
84         public new SWIGTYPE_p_std__type_info GetType()
85         {
86             SWIGTYPE_p_std__type_info ret = new SWIGTYPE_p_std__type_info(Interop.Any.Any_GetType(swigCPtr), false);
87             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
88             return ret;
89         }
90
91         public bool Empty()
92         {
93             bool ret = Interop.Any.Any_Empty(swigCPtr);
94             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
95             return ret;
96         }
97
98         /// <since_tizen> 3 </since_tizen>
99         public class AnyContainerBase : Disposable
100         {
101             private global::System.Runtime.InteropServices.HandleRef swigCPtr;
102             /// <since_tizen> 3 </since_tizen>
103             protected bool swigCMemOwn;
104
105             internal AnyContainerBase(global::System.IntPtr cPtr, bool cMemoryOwn)
106             {
107                 swigCMemOwn = cMemoryOwn;
108                 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
109             }
110
111             internal static global::System.Runtime.InteropServices.HandleRef getCPtr(AnyContainerBase obj)
112             {
113                 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
114             }
115
116             /// <since_tizen> 3 </since_tizen>
117             protected override void Dispose(DisposeTypes type)
118             {
119                 if (disposed)
120                 {
121                     return;
122                 }
123
124                 //Release your own unmanaged resources here.
125                 //You should not access any managed member here except static instance.
126                 //because the execution order of Finalizes is non-deterministic.
127
128                 if (swigCPtr.Handle != global::System.IntPtr.Zero)
129                 {
130                     if (swigCMemOwn)
131                     {
132                         swigCMemOwn = false;
133                         Interop.Any.delete_Any_AnyContainerBase(swigCPtr);
134                     }
135                     swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
136                 }
137
138                 base.Dispose(type);
139             }
140
141             /// <since_tizen> 3 </since_tizen>
142             public AnyContainerBase(SWIGTYPE_p_std__type_info type, SWIGTYPE_p_f_r_q_const__Dali__Any__AnyContainerBase__p_Dali__Any__AnyContainerBase cloneFunc, SWIGTYPE_p_f_p_q_const__Dali__Any__AnyContainerBase__void deleteFunc) : this(Interop.Any.new_Any_AnyContainerBase(SWIGTYPE_p_std__type_info.getCPtr(type), SWIGTYPE_p_f_r_q_const__Dali__Any__AnyContainerBase__p_Dali__Any__AnyContainerBase.getCPtr(cloneFunc), SWIGTYPE_p_f_p_q_const__Dali__Any__AnyContainerBase__void.getCPtr(deleteFunc)), true)
143             {
144                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
145             }
146
147             /// <since_tizen> 3 </since_tizen>
148             public new SWIGTYPE_p_std__type_info GetType()
149             {
150                 SWIGTYPE_p_std__type_info ret = new SWIGTYPE_p_std__type_info(Interop.Any.Any_AnyContainerBase_GetType(swigCPtr), false);
151                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
152                 return ret;
153             }
154
155             /// <since_tizen> 3 </since_tizen>
156             public SWIGTYPE_p_std__type_info mType
157             {
158                 get
159                 {
160                     SWIGTYPE_p_std__type_info ret = new SWIGTYPE_p_std__type_info(Interop.Any.Any_AnyContainerBase_mType_get(swigCPtr), false);
161                     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
162                     return ret;
163                 }
164             }
165
166             /// <since_tizen> 3 </since_tizen>
167             public SWIGTYPE_p_f_r_q_const__Dali__Any__AnyContainerBase__p_Dali__Any__AnyContainerBase mCloneFunc
168             {
169                 set
170                 {
171                     Interop.Any.Any_AnyContainerBase_mCloneFunc_set(swigCPtr, SWIGTYPE_p_f_r_q_const__Dali__Any__AnyContainerBase__p_Dali__Any__AnyContainerBase.getCPtr(value));
172                     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
173                 }
174                 get
175                 {
176                     global::System.IntPtr cPtr = Interop.Any.Any_AnyContainerBase_mCloneFunc_get(swigCPtr);
177                     SWIGTYPE_p_f_r_q_const__Dali__Any__AnyContainerBase__p_Dali__Any__AnyContainerBase ret = (cPtr == global::System.IntPtr.Zero) ? null : new SWIGTYPE_p_f_r_q_const__Dali__Any__AnyContainerBase__p_Dali__Any__AnyContainerBase(cPtr, false);
178                     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
179                     return ret;
180                 }
181             }
182
183             /// <since_tizen> 3 </since_tizen>
184             public SWIGTYPE_p_f_p_q_const__Dali__Any__AnyContainerBase__void mDeleteFunc
185             {
186                 set
187                 {
188                     Interop.Any.Any_AnyContainerBase_mDeleteFunc_set(swigCPtr, SWIGTYPE_p_f_p_q_const__Dali__Any__AnyContainerBase__void.getCPtr(value));
189                     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
190                 }
191                 get
192                 {
193                     global::System.IntPtr cPtr = Interop.Any.Any_AnyContainerBase_mDeleteFunc_get(swigCPtr);
194                     SWIGTYPE_p_f_p_q_const__Dali__Any__AnyContainerBase__void ret = (cPtr == global::System.IntPtr.Zero) ? null : new SWIGTYPE_p_f_p_q_const__Dali__Any__AnyContainerBase__void(cPtr, false);
195                     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
196                     return ret;
197                 }
198             }
199         }
200
201         public Any.AnyContainerBase mContainer
202         {
203             set
204             {
205                 Interop.Any.Any_mContainer_set(swigCPtr, Any.AnyContainerBase.getCPtr(value));
206                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
207             }
208             get
209             {
210                 global::System.IntPtr cPtr = Interop.Any.Any_mContainer_get(swigCPtr);
211                 Any.AnyContainerBase ret = (cPtr == global::System.IntPtr.Zero) ? null : new Any.AnyContainerBase(cPtr, false);
212                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
213                 return ret;
214             }
215         }
216     }
217 }