merging dali-sharp class scope with nui
[platform/core/csapi/tizenfx.git] / src / Tizen.NUI / src / internal / Camera.cs
1 /** Copyright (c) 2017 Samsung Electronics Co., Ltd.
2 *
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at
6 *
7 * http://www.apache.org/licenses/LICENSE-2.0
8 *
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
14 *
15 */
16 // This File has been auto-generated by SWIG and then modified using DALi Ruby Scripts
17 //------------------------------------------------------------------------------
18 // <auto-generated />
19 //
20 // This file was automatically generated by SWIG (http://www.swig.org).
21 // Version 3.0.10
22 //
23 // Do not make changes to this file unless you know what you are doing--modify
24 // the SWIG interface file instead.
25 //------------------------------------------------------------------------------
26
27 namespace Tizen.NUI
28 {
29
30     internal class Camera : Animatable
31     {
32         private global::System.Runtime.InteropServices.HandleRef swigCPtr;
33
34         internal Camera(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.CameraActor_SWIGUpcast(cPtr), cMemoryOwn)
35         {
36             swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
37         }
38
39         internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Camera obj)
40         {
41             return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
42         }
43
44         protected override void Dispose(DisposeTypes type)
45         {
46             if (disposed)
47             {
48                 return;
49             }
50
51             if (type == DisposeTypes.Explicit)
52             {
53                 //Called by User
54                 //Release your own managed resources here.
55                 //You should release all of your own disposable objects here.
56
57             }
58
59             //Release your own unmanaged resources here.
60             //You should not access any managed member here except static instance.
61             //because the execution order of Finalizes is non-deterministic.
62
63             if (swigCPtr.Handle != global::System.IntPtr.Zero)
64             {
65                 if (swigCMemOwn)
66                 {
67                     swigCMemOwn = false;
68                     NDalicPINVOKE.delete_CameraActor(swigCPtr);
69                 }
70                 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
71             }
72
73             base.Dispose(type);
74         }
75
76
77
78         public class Property : global::System.IDisposable
79         {
80             private global::System.Runtime.InteropServices.HandleRef swigCPtr;
81             protected bool swigCMemOwn;
82
83             internal Property(global::System.IntPtr cPtr, bool cMemoryOwn)
84             {
85                 swigCMemOwn = cMemoryOwn;
86                 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
87             }
88
89             internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Property obj)
90             {
91                 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
92             }
93
94             //A Flag to check who called Dispose(). (By User or DisposeQueue)
95             private bool isDisposeQueued = false;
96             //A Flat to check if it is already disposed.
97             protected bool disposed = false;
98
99             ~Property()
100             {
101                 if (!isDisposeQueued)
102                 {
103                     isDisposeQueued = true;
104                     DisposeQueue.Instance.Add(this);
105                 }
106             }
107
108             public void Dispose()
109             {
110                 //Throw excpetion if Dispose() is called in separate thread.
111                 if (!Window.IsInstalled())
112                 {
113                     throw new System.InvalidOperationException("This API called from separate thread. This API must be called from MainThread.");
114                 }
115
116                 if (isDisposeQueued)
117                 {
118                     Dispose(DisposeTypes.Implicit);
119                 }
120                 else
121                 {
122                     Dispose(DisposeTypes.Explicit);
123                     System.GC.SuppressFinalize(this);
124                 }
125             }
126
127             protected virtual void Dispose(DisposeTypes type)
128             {
129                 if (disposed)
130                 {
131                     return;
132                 }
133
134                 if (type == DisposeTypes.Explicit)
135                 {
136                     //Called by User
137                     //Release your own managed resources here.
138                     //You should release all of your own disposable objects here.
139
140                 }
141
142                 //Release your own unmanaged resources here.
143                 //You should not access any managed member here except static instance.
144                 //because the execution order of Finalizes is non-deterministic.
145
146                 if (swigCPtr.Handle != global::System.IntPtr.Zero)
147                 {
148                     if (swigCMemOwn)
149                     {
150                         swigCMemOwn = false;
151                         NDalicPINVOKE.delete_CameraActor_Property(swigCPtr);
152                     }
153                     swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
154                 }
155
156                 disposed = true;
157             }
158
159
160             public Property() : this(NDalicPINVOKE.new_CameraActor_Property(), true)
161             {
162                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
163             }
164
165             public static readonly int TYPE = NDalicPINVOKE.CameraActor_Property_TYPE_get();
166             public static readonly int PROJECTION_MODE = NDalicPINVOKE.CameraActor_Property_PROJECTION_MODE_get();
167             public static readonly int FIELD_OF_VIEW = NDalicPINVOKE.CameraActor_Property_FIELD_OF_VIEW_get();
168             public static readonly int ASPECT_RATIO = NDalicPINVOKE.CameraActor_Property_ASPECT_RATIO_get();
169             public static readonly int NEAR_PLANE_DISTANCE = NDalicPINVOKE.CameraActor_Property_NEAR_PLANE_DISTANCE_get();
170             public static readonly int FAR_PLANE_DISTANCE = NDalicPINVOKE.CameraActor_Property_FAR_PLANE_DISTANCE_get();
171             public static readonly int LEFT_PLANE_DISTANCE = NDalicPINVOKE.CameraActor_Property_LEFT_PLANE_DISTANCE_get();
172             public static readonly int RIGHT_PLANE_DISTANCE = NDalicPINVOKE.CameraActor_Property_RIGHT_PLANE_DISTANCE_get();
173             public static readonly int TOP_PLANE_DISTANCE = NDalicPINVOKE.CameraActor_Property_TOP_PLANE_DISTANCE_get();
174             public static readonly int BOTTOM_PLANE_DISTANCE = NDalicPINVOKE.CameraActor_Property_BOTTOM_PLANE_DISTANCE_get();
175             public static readonly int TARGET_POSITION = NDalicPINVOKE.CameraActor_Property_TARGET_POSITION_get();
176             public static readonly int PROJECTION_MATRIX = NDalicPINVOKE.CameraActor_Property_PROJECTION_MATRIX_get();
177             public static readonly int VIEW_MATRIX = NDalicPINVOKE.CameraActor_Property_VIEW_MATRIX_get();
178             public static readonly int INVERT_Y_AXIS = NDalicPINVOKE.CameraActor_Property_INVERT_Y_AXIS_get();
179
180         }
181
182         public Camera() : this(NDalicPINVOKE.CameraActor_New__SWIG_0(), true)
183         {
184             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
185
186         }
187         public Camera(Vector2 size) : this(NDalicPINVOKE.CameraActor_New__SWIG_1(Vector2.getCPtr(size)), true)
188         {
189             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
190
191         }
192         public new static Camera DownCast(BaseHandle handle)
193         {
194             Camera ret = new Camera(NDalicPINVOKE.CameraActor_DownCast(BaseHandle.getCPtr(handle)), true);
195             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
196             return ret;
197         }
198
199         public Camera(Camera copy) : this(NDalicPINVOKE.new_CameraActor__SWIG_1(Camera.getCPtr(copy)), true)
200         {
201             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
202         }
203
204         public Camera Assign(Camera rhs)
205         {
206             Camera ret = new Camera(NDalicPINVOKE.CameraActor_Assign(swigCPtr, Camera.getCPtr(rhs)), false);
207             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
208             return ret;
209         }
210
211         public void SetType(CameraType type)
212         {
213             NDalicPINVOKE.CameraActor_SetType(swigCPtr, (int)type);
214             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
215         }
216
217         public CameraType GetType()
218         {
219             CameraType ret = (CameraType)NDalicPINVOKE.CameraActor_GetType(swigCPtr);
220             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
221             return ret;
222         }
223
224         public void SetProjectionMode(ProjectionMode mode)
225         {
226             NDalicPINVOKE.CameraActor_SetProjectionMode(swigCPtr, (int)mode);
227             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
228         }
229
230         public ProjectionMode GetProjectionMode()
231         {
232             ProjectionMode ret = (ProjectionMode)NDalicPINVOKE.CameraActor_GetProjectionMode(swigCPtr);
233             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
234             return ret;
235         }
236
237         public void SetFieldOfView(float fieldOfView)
238         {
239             NDalicPINVOKE.CameraActor_SetFieldOfView(swigCPtr, fieldOfView);
240             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
241         }
242
243         public float GetFieldOfView()
244         {
245             float ret = NDalicPINVOKE.CameraActor_GetFieldOfView(swigCPtr);
246             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
247             return ret;
248         }
249
250         public void SetAspectRatio(float aspectRatio)
251         {
252             NDalicPINVOKE.CameraActor_SetAspectRatio(swigCPtr, aspectRatio);
253             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
254         }
255
256         public float GetAspectRatio()
257         {
258             float ret = NDalicPINVOKE.CameraActor_GetAspectRatio(swigCPtr);
259             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
260             return ret;
261         }
262
263         public void SetNearClippingPlane(float nearClippingPlane)
264         {
265             NDalicPINVOKE.CameraActor_SetNearClippingPlane(swigCPtr, nearClippingPlane);
266             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
267         }
268
269         public float GetNearClippingPlane()
270         {
271             float ret = NDalicPINVOKE.CameraActor_GetNearClippingPlane(swigCPtr);
272             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
273             return ret;
274         }
275
276         public void SetFarClippingPlane(float farClippingPlane)
277         {
278             NDalicPINVOKE.CameraActor_SetFarClippingPlane(swigCPtr, farClippingPlane);
279             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
280         }
281
282         public float GetFarClippingPlane()
283         {
284             float ret = NDalicPINVOKE.CameraActor_GetFarClippingPlane(swigCPtr);
285             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
286             return ret;
287         }
288
289         public void SetTargetPosition(Vector3 targetPosition)
290         {
291             NDalicPINVOKE.CameraActor_SetTargetPosition(swigCPtr, Vector3.getCPtr(targetPosition));
292             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
293         }
294
295         public Vector3 GetTargetPosition()
296         {
297             Vector3 ret = new Vector3(NDalicPINVOKE.CameraActor_GetTargetPosition(swigCPtr), true);
298             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
299             return ret;
300         }
301
302         public void SetInvertYAxis(bool invertYAxis)
303         {
304             NDalicPINVOKE.CameraActor_SetInvertYAxis(swigCPtr, invertYAxis);
305             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
306         }
307
308         public bool GetInvertYAxis()
309         {
310             bool ret = NDalicPINVOKE.CameraActor_GetInvertYAxis(swigCPtr);
311             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
312             return ret;
313         }
314
315         public void SetPerspectiveProjection(Vector2 size)
316         {
317             NDalicPINVOKE.CameraActor_SetPerspectiveProjection(swigCPtr, Vector2.getCPtr(size));
318             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
319         }
320
321         public void SetOrthographicProjection(Vector2 size)
322         {
323             NDalicPINVOKE.CameraActor_SetOrthographicProjection__SWIG_0(swigCPtr, Vector2.getCPtr(size));
324             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
325         }
326
327         public void SetOrthographicProjection(float left, float right, float top, float bottom, float near, float far)
328         {
329             NDalicPINVOKE.CameraActor_SetOrthographicProjection__SWIG_1(swigCPtr, left, right, top, bottom, near, far);
330             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
331         }
332
333         public string Type
334         {
335             get
336             {
337                 string temp;
338                 GetProperty(Camera.Property.TYPE).Get(out temp);
339                 return temp;
340             }
341             set
342             {
343                 SetProperty(Camera.Property.TYPE, new Tizen.NUI.PropertyValue(value));
344             }
345         }
346         public string ProjectionMode
347         {
348             get
349             {
350                 string temp;
351                 GetProperty(Camera.Property.PROJECTION_MODE).Get(out temp);
352                 return temp;
353             }
354             set
355             {
356                 SetProperty(Camera.Property.PROJECTION_MODE, new Tizen.NUI.PropertyValue(value));
357             }
358         }
359         public float FieldOfView
360         {
361             get
362             {
363                 float temp = 0.0f;
364                 GetProperty(Camera.Property.FIELD_OF_VIEW).Get(ref temp);
365                 return temp;
366             }
367             set
368             {
369                 SetProperty(Camera.Property.FIELD_OF_VIEW, new Tizen.NUI.PropertyValue(value));
370             }
371         }
372         public float AspectRatio
373         {
374             get
375             {
376                 float temp = 0.0f;
377                 GetProperty(Camera.Property.ASPECT_RATIO).Get(ref temp);
378                 return temp;
379             }
380             set
381             {
382                 SetProperty(Camera.Property.ASPECT_RATIO, new Tizen.NUI.PropertyValue(value));
383             }
384         }
385         public float NearPlaneDistance
386         {
387             get
388             {
389                 float temp = 0.0f;
390                 GetProperty(Camera.Property.NEAR_PLANE_DISTANCE).Get(ref temp);
391                 return temp;
392             }
393             set
394             {
395                 SetProperty(Camera.Property.NEAR_PLANE_DISTANCE, new Tizen.NUI.PropertyValue(value));
396             }
397         }
398         public float FarPlaneDistance
399         {
400             get
401             {
402                 float temp = 0.0f;
403                 GetProperty(Camera.Property.FAR_PLANE_DISTANCE).Get(ref temp);
404                 return temp;
405             }
406             set
407             {
408                 SetProperty(Camera.Property.FAR_PLANE_DISTANCE, new Tizen.NUI.PropertyValue(value));
409             }
410         }
411         public float LeftPlaneDistance
412         {
413             get
414             {
415                 float temp = 0.0f;
416                 GetProperty(Camera.Property.LEFT_PLANE_DISTANCE).Get(ref temp);
417                 return temp;
418             }
419             set
420             {
421                 SetProperty(Camera.Property.LEFT_PLANE_DISTANCE, new Tizen.NUI.PropertyValue(value));
422             }
423         }
424         public float RightPlaneDistance
425         {
426             get
427             {
428                 float temp = 0.0f;
429                 GetProperty(Camera.Property.RIGHT_PLANE_DISTANCE).Get(ref temp);
430                 return temp;
431             }
432             set
433             {
434                 SetProperty(Camera.Property.RIGHT_PLANE_DISTANCE, new Tizen.NUI.PropertyValue(value));
435             }
436         }
437         public float TopPlaneDistance
438         {
439             get
440             {
441                 float temp = 0.0f;
442                 GetProperty(Camera.Property.TOP_PLANE_DISTANCE).Get(ref temp);
443                 return temp;
444             }
445             set
446             {
447                 SetProperty(Camera.Property.TOP_PLANE_DISTANCE, new Tizen.NUI.PropertyValue(value));
448             }
449         }
450         public float BottomPlaneDistance
451         {
452             get
453             {
454                 float temp = 0.0f;
455                 GetProperty(Camera.Property.BOTTOM_PLANE_DISTANCE).Get(ref temp);
456                 return temp;
457             }
458             set
459             {
460                 SetProperty(Camera.Property.BOTTOM_PLANE_DISTANCE, new Tizen.NUI.PropertyValue(value));
461             }
462         }
463         public Vector3 TargetPosition
464         {
465             get
466             {
467                 Vector3 temp = new Vector3(0.0f, 0.0f, 0.0f);
468                 GetProperty(Camera.Property.TARGET_POSITION).Get(temp);
469                 return temp;
470             }
471             set
472             {
473                 SetProperty(Camera.Property.TARGET_POSITION, new Tizen.NUI.PropertyValue(value));
474             }
475         }
476         internal Matrix ProjectionMatrix
477         {
478             get
479             {
480                 Matrix temp = new Matrix();
481                 GetProperty(Camera.Property.PROJECTION_MATRIX).Get(temp);
482                 return temp;
483             }
484         }
485         internal Matrix ViewMatrix
486         {
487             get
488             {
489                 Matrix temp = new Matrix();
490                 GetProperty(Camera.Property.VIEW_MATRIX).Get(temp);
491                 return temp;
492             }
493         }
494         public bool InvertYAxis
495         {
496             get
497             {
498                 bool temp = false;
499                 GetProperty(Camera.Property.INVERT_Y_AXIS).Get(ref temp);
500                 return temp;
501             }
502             set
503             {
504                 SetProperty(Camera.Property.INVERT_Y_AXIS, new Tizen.NUI.PropertyValue(value));
505             }
506         }
507
508     }
509
510 }