2 * Copyright(c) 2017 Samsung Electronics Co., Ltd.
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
18 using global::System.Runtime.InteropServices;
23 /// Static Helper class for Property
26 /// <since_tizen> 3 </since_tizen>
27 internal static class Object
29 public static PropertyValue GetProperty(global::System.Runtime.InteropServices.HandleRef handle, int index)
31 if (handle.Handle == System.IntPtr.Zero)
33 throw new System.InvalidOperationException("Error! NUI's native dali object is already disposed. OR the native dali object handle of NUI becomes null!");
36 PropertyValue ret = new PropertyValue(Interop.Handle.GetProperty(handle, index), true);
37 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
40 public static PropertyValue GetCurrentProperty(global::System.Runtime.InteropServices.HandleRef handle, int index)
42 if (handle.Handle == System.IntPtr.Zero)
44 throw new System.InvalidOperationException("Error! NUI's native dali object is already disposed. OR the native dali object handle of NUI becomes null!");
47 PropertyValue ret = new PropertyValue(Interop.Handle.GetCurrentProperty(handle, index), true);
48 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
52 public static void SetProperty(global::System.Runtime.InteropServices.HandleRef handle, int index, PropertyValue propertyValue)
54 if (handle.Handle == System.IntPtr.Zero)
56 throw new System.InvalidOperationException("Error! NUI's native dali object is already disposed. OR the native dali object handle of NUI becomes null!");
59 Interop.Handle.SetProperty(handle, index, PropertyValue.getCPtr(propertyValue));
60 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
63 internal static int InternalSetPropertyString(HandleRef actor, int propertyType, string valString)
65 if (actor.Handle == System.IntPtr.Zero)
67 throw new System.InvalidOperationException("Error! NUI's native dali object is already disposed. OR the native dali object handle of NUI becomes null!");
69 var ret = Interop.Actor.InternalSetPropertyString(actor, propertyType, valString);
71 if (NDalicPINVOKE.SWIGPendingException.Pending)
73 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
78 internal static string InternalGetPropertyString(HandleRef actor, int propertyType)
80 if (actor.Handle == System.IntPtr.Zero)
82 throw new System.InvalidOperationException("Error! NUI's native dali object is already disposed. OR the native dali object handle of NUI becomes null!");
84 var ret = Interop.Actor.InternalGetPropertyString(actor, propertyType);
86 if (NDalicPINVOKE.SWIGPendingException.Pending)
88 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
93 internal static int InternalSetPropertyBool(HandleRef actor, int propertyType, bool valBool)
95 if (actor.Handle == System.IntPtr.Zero)
97 throw new System.InvalidOperationException("Error! NUI's native dali object is already disposed. OR the native dali object handle of NUI becomes null!");
99 var ret = Interop.Actor.InternalSetPropertyBool(actor, propertyType, valBool);
101 if (NDalicPINVOKE.SWIGPendingException.Pending)
103 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
108 internal static bool InternalGetPropertyBool(HandleRef actor, int propertyType)
110 if (actor.Handle == System.IntPtr.Zero)
112 throw new System.InvalidOperationException("Error! NUI's native dali object is already disposed. OR the native dali object handle of NUI becomes null!");
114 var ret = Interop.Actor.InternalGetPropertyBool(actor, propertyType);
116 if (NDalicPINVOKE.SWIGPendingException.Pending)
118 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
123 internal static int InternalSetPropertyVector4(HandleRef actor, int propertyType, HandleRef vector4)
125 if (actor.Handle == System.IntPtr.Zero)
127 throw new System.InvalidOperationException("Error! NUI's native dali object is already disposed. OR the native dali object handle of NUI becomes null!");
129 var ret = Interop.Actor.InternalSetPropertyVector4(actor, propertyType, vector4);
131 if (NDalicPINVOKE.SWIGPendingException.Pending)
133 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
138 internal static int InternalRetrievingPropertyVector4(HandleRef actor, int propertyType, HandleRef retrievingVector4)
140 if (actor.Handle == System.IntPtr.Zero)
142 throw new System.InvalidOperationException("Error! NUI's native dali object is already disposed. OR the native dali object handle of NUI becomes null!");
144 var ret = Interop.Actor.InternalRetrievingPropertyVector4(actor, propertyType, retrievingVector4);
146 if (NDalicPINVOKE.SWIGPendingException.Pending)
148 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
153 internal static int InternalGetPropertyInt(HandleRef actor, int propertyType)
155 if (actor.Handle == System.IntPtr.Zero)
157 throw new System.InvalidOperationException("Error! NUI's native dali object is already disposed. OR the native dali object handle of NUI becomes null!");
159 var ret = Interop.Actor.InternalGetPropertyInt(actor, propertyType);
161 if (NDalicPINVOKE.SWIGPendingException.Pending)
163 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
168 internal static int InternalSetPropertyInt(HandleRef actor, int propertyType, int valInt)
170 if (actor.Handle == System.IntPtr.Zero)
172 throw new System.InvalidOperationException("Error! NUI's native dali object is already disposed. OR the native dali object handle of NUI becomes null!");
174 var ret = Interop.Actor.InternalSetPropertyInt(actor, propertyType, valInt);
176 if (NDalicPINVOKE.SWIGPendingException.Pending)
178 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
183 internal static int InternalRetrievingPropertyVector3(HandleRef actor, int propertyType, HandleRef retrievingVector3)
185 if (actor.Handle == System.IntPtr.Zero)
187 throw new System.InvalidOperationException("Error! NUI's native dali object is already disposed. OR the native dali object handle of NUI becomes null!");
189 var ret = Interop.Actor.InternalRetrievingPropertyVector3(actor, propertyType, retrievingVector3);
191 if (NDalicPINVOKE.SWIGPendingException.Pending)
193 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
198 internal static int InternalSetPropertyVector3(HandleRef actor, int propertyType, HandleRef vector3)
200 if (actor.Handle == System.IntPtr.Zero)
202 throw new System.InvalidOperationException("Error! NUI's native dali object is already disposed. OR the native dali object handle of NUI becomes null!");
204 var ret = Interop.Actor.InternalSetPropertyVector3(actor, propertyType, vector3);
206 if (NDalicPINVOKE.SWIGPendingException.Pending)
208 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
213 internal static float InternalGetPropertyFloat(HandleRef actor, int propertyType)
215 if (actor.Handle == System.IntPtr.Zero)
217 throw new System.InvalidOperationException("Error! NUI's native dali object is already disposed. OR the native dali object handle of NUI becomes null!");
219 var ret = Interop.Actor.InternalGetPropertyFloat(actor, propertyType);
221 if (NDalicPINVOKE.SWIGPendingException.Pending)
223 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
228 internal static int InternalSetPropertyFloat(HandleRef actor, int propertyType, float valFloat)
230 if (actor.Handle == System.IntPtr.Zero)
232 throw new System.InvalidOperationException("Error! NUI's native dali object is already disposed. OR the native dali object handle of NUI becomes null!");
234 var ret = Interop.Actor.InternalSetPropertyFloat(actor, propertyType, valFloat);
236 if (NDalicPINVOKE.SWIGPendingException.Pending)
238 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
243 internal static int InternalRetrievingPropertyVector2(HandleRef actor, int propertyType, HandleRef retrievingVector2)
245 if (actor.Handle == System.IntPtr.Zero)
247 throw new System.InvalidOperationException("Error! NUI's native dali object is already disposed. OR the native dali object handle of NUI becomes null!");
249 var ret = Interop.Actor.InternalRetrievingPropertyVector2(actor, propertyType, retrievingVector2);
251 if (NDalicPINVOKE.SWIGPendingException.Pending)
253 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
258 internal static int InternalSetPropertyVector2(HandleRef actor, int propertyType, HandleRef vector2)
260 if (actor.Handle == System.IntPtr.Zero)
262 throw new System.InvalidOperationException("Error! NUI's native dali object is already disposed. OR the native dali object handle of NUI becomes null!");
264 var ret = Interop.Actor.InternalSetPropertyVector2(actor, propertyType, vector2);
266 if (NDalicPINVOKE.SWIGPendingException.Pending)
268 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
273 internal static int InternalRetrievingPropertyVector2ActualVector3(HandleRef actor, int propertyType, HandleRef retrievingVector2)
275 if (actor.Handle == System.IntPtr.Zero)
277 throw new System.InvalidOperationException("Error! NUI's native dali object is already disposed. OR the native dali object handle of NUI becomes null!");
279 var ret = Interop.Actor.InternalRetrievingPropertyVector2ActualVector3(actor, propertyType, retrievingVector2);
281 if (NDalicPINVOKE.SWIGPendingException.Pending)
283 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
288 internal static int InternalSetPropertyVector2ActualVector3(HandleRef actor, int propertyType, HandleRef vector2)
290 if (actor.Handle == System.IntPtr.Zero)
292 throw new System.InvalidOperationException("Error! NUI's native dali object is already disposed. OR the native dali object handle of NUI becomes null!");
294 var ret = Interop.Actor.InternalSetPropertyVector2ActualVector3(actor, propertyType, vector2);
296 if (NDalicPINVOKE.SWIGPendingException.Pending)
298 throw NDalicPINVOKE.SWIGPendingException.Retrieve();