Merge branch 'devel/master' into tizen
[platform/core/csapi/tizenfx.git] / src / Tizen.NUI / src / public / Radian.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
14     /// <summary>
15     /// An angle in radians.
16     /// </summary>
17     public class Radian : global::System.IDisposable
18     {
19         private global::System.Runtime.InteropServices.HandleRef swigCPtr;
20         protected bool swigCMemOwn;
21
22         internal Radian(global::System.IntPtr cPtr, bool cMemoryOwn)
23         {
24             swigCMemOwn = cMemoryOwn;
25             swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
26         }
27
28         internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Radian obj)
29         {
30             return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
31         }
32
33         //NUI Dispose Pattern written by Jinwoo Nam(jjw.nam) 
34
35         //A Flag to check who called Dispose(). (By User or DisposeQueue)
36         private bool isDisposeQueued = false;
37         //A Flat to check if it is already disposed.
38         protected bool disposed = false;
39
40         ~Radian()
41         {
42             if(!isDisposeQueued)
43             {
44                 isDisposeQueued = true;
45                 DisposeQueue.Instance.Add(this);
46             }
47         }
48
49         public void Dispose()
50         {
51             //Throw excpetion if Dispose() is called in separate thread.
52             if (!Window.IsInstalled())
53             {
54                 throw new System.InvalidOperationException("This API called from separate thread. This API must be called from MainThread.");
55             }
56
57             if (isDisposeQueued)
58             {
59                 Dispose(DisposeTypes.Implicit);
60             }
61             else
62             {
63                 Dispose(DisposeTypes.Explicit);
64                 System.GC.SuppressFinalize(this);
65             }
66         }
67
68         protected virtual void Dispose(DisposeTypes type)
69         {
70             if (disposed)
71             {
72                 return;
73             }
74
75             if(type == DisposeTypes.Explicit)
76             {
77                 //Called by User
78                 //Release your own managed resources here.
79                 //You should release all of your own disposable objects here.
80             }
81
82             //Release your own unmanaged resources here.
83             //You should not access any managed member here except static instance.
84             //because the execution order of Finalizes is non-deterministic.
85
86             if (swigCPtr.Handle != global::System.IntPtr.Zero)
87             {
88                 if (swigCMemOwn)
89                 {
90                     swigCMemOwn = false;
91                     NDalicPINVOKE.delete_Radian(swigCPtr);
92                 }
93                 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
94             }
95             disposed = true;
96         }
97
98
99         /// <summary>
100         /// Default constructor, initializes to 0.
101         /// </summary>
102         public Radian() : this(NDalicPINVOKE.new_Radian__SWIG_0(), true)
103         {
104             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
105         }
106
107         /// <summary>
108         /// Creates an angle in radians.
109         /// </summary>
110         /// <param name="value">The initial value in radians</param>
111         public Radian(float value) : this(NDalicPINVOKE.new_Radian__SWIG_1(value), true)
112         {
113             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
114         }
115
116         /// <summary>
117         /// Creates an angle in radians from an angle in degrees.
118         /// </summary>
119         /// <param name="degree">The initial value in degrees</param>
120         public Radian(Degree degree) : this(NDalicPINVOKE.new_Radian__SWIG_2(Degree.getCPtr(degree)), true)
121         {
122             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
123         }
124
125         /// <summary>
126         /// Conversion to float.
127         /// </summary>
128         /// <returns>The float value of this Radian</returns>
129         public float ConvertToFloat()
130         {
131             float ret = NDalicPINVOKE.Radian_ConvertToFloat(swigCPtr);
132             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
133             return ret;
134         }
135
136         /// <summary>
137         /// The value in radians
138         /// </summary>
139         public float Value
140         {
141             set
142             {
143                 NDalicPINVOKE.Radian_radian_set(swigCPtr, value);
144                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
145             }
146             get
147             {
148                 float ret = NDalicPINVOKE.Radian_radian_get(swigCPtr);
149                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
150                 return ret;
151             }
152         }
153
154     }
155
156 }