Release 4.0.0-preview1-00051
[platform/core/csapi/tizenfx.git] / src / Tizen.NUI / src / internal / Ruler.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
17 namespace Tizen.NUI
18 {
19
20     internal class Ruler : RefObject
21     {
22         private global::System.Runtime.InteropServices.HandleRef swigCPtr;
23
24         internal Ruler(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.Ruler_SWIGUpcast(cPtr), cMemoryOwn)
25         {
26             swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
27         }
28
29         internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Ruler obj)
30         {
31             return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
32         }
33
34         protected override void Dispose(DisposeTypes type)
35         {
36             if (disposed)
37             {
38                 return;
39             }
40
41             if (type == DisposeTypes.Explicit)
42             {
43                 //Called by User
44                 //Release your own managed resources here.
45                 //You should release all of your own disposable objects here.
46
47             }
48
49             //Release your own unmanaged resources here.
50             //You should not access any managed member here except static instance.
51             //because the execution order of Finalizes is non-deterministic.
52
53             if (swigCPtr.Handle != global::System.IntPtr.Zero)
54             {
55                 if (swigCMemOwn)
56                 {
57                     swigCMemOwn = false;
58                     throw new global::System.MethodAccessException("C++ destructor does not have public access");
59                 }
60                 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
61             }
62
63             base.Dispose(type);
64         }
65
66         public virtual float Snap(float x, float bias)
67         {
68             float ret = NDalicPINVOKE.Ruler_Snap__SWIG_0(swigCPtr, x, bias);
69             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
70             return ret;
71         }
72
73         public virtual float Snap(float x)
74         {
75             float ret = NDalicPINVOKE.Ruler_Snap__SWIG_1(swigCPtr, x);
76             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
77             return ret;
78         }
79
80         public virtual float GetPositionFromPage(uint page, out uint volume, bool wrap)
81         {
82             float ret = NDalicPINVOKE.Ruler_GetPositionFromPage(swigCPtr, page, out volume, wrap);
83             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
84             return ret;
85         }
86
87         public virtual uint GetPageFromPosition(float position, bool wrap)
88         {
89             uint ret = NDalicPINVOKE.Ruler_GetPageFromPosition(swigCPtr, position, wrap);
90             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
91             return ret;
92         }
93
94         public virtual uint GetTotalPages()
95         {
96             uint ret = NDalicPINVOKE.Ruler_GetTotalPages(swigCPtr);
97             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
98             return ret;
99         }
100
101         public Ruler.RulerType GetType()
102         {
103             Ruler.RulerType ret = (Ruler.RulerType)NDalicPINVOKE.Ruler_GetType(swigCPtr);
104             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
105             return ret;
106         }
107
108         public bool IsEnabled()
109         {
110             bool ret = NDalicPINVOKE.Ruler_IsEnabled(swigCPtr);
111             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
112             return ret;
113         }
114
115         public void Enable()
116         {
117             NDalicPINVOKE.Ruler_Enable(swigCPtr);
118             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
119         }
120
121         public void Disable()
122         {
123             NDalicPINVOKE.Ruler_Disable(swigCPtr);
124             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
125         }
126
127         public void SetDomain(RulerDomain domain)
128         {
129             NDalicPINVOKE.Ruler_SetDomain(swigCPtr, RulerDomain.getCPtr(domain));
130             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
131         }
132
133         public RulerDomain GetDomain()
134         {
135             RulerDomain ret = new RulerDomain(NDalicPINVOKE.Ruler_GetDomain(swigCPtr), false);
136             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
137             return ret;
138         }
139
140         public void DisableDomain()
141         {
142             NDalicPINVOKE.Ruler_DisableDomain(swigCPtr);
143             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
144         }
145
146         public float Clamp(float x, float length, float scale)
147         {
148             float ret = NDalicPINVOKE.Ruler_Clamp__SWIG_0(swigCPtr, x, length, scale);
149             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
150             return ret;
151         }
152
153         public float Clamp(float x, float length)
154         {
155             float ret = NDalicPINVOKE.Ruler_Clamp__SWIG_1(swigCPtr, x, length);
156             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
157             return ret;
158         }
159
160         public float Clamp(float x)
161         {
162             float ret = NDalicPINVOKE.Ruler_Clamp__SWIG_2(swigCPtr, x);
163             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
164             return ret;
165         }
166
167         internal float Clamp(float x, float length, float scale, SWIGTYPE_p_Dali__Toolkit__ClampState clamped)
168         {
169             float ret = NDalicPINVOKE.Ruler_Clamp__SWIG_3(swigCPtr, x, length, scale, SWIGTYPE_p_Dali__Toolkit__ClampState.getCPtr(clamped));
170             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
171             return ret;
172         }
173
174         public float SnapAndClamp(float x, float bias, float length, float scale)
175         {
176             float ret = NDalicPINVOKE.Ruler_SnapAndClamp__SWIG_0(swigCPtr, x, bias, length, scale);
177             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
178             return ret;
179         }
180
181         public float SnapAndClamp(float x, float bias, float length)
182         {
183             float ret = NDalicPINVOKE.Ruler_SnapAndClamp__SWIG_1(swigCPtr, x, bias, length);
184             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
185             return ret;
186         }
187
188         public float SnapAndClamp(float x, float bias)
189         {
190             float ret = NDalicPINVOKE.Ruler_SnapAndClamp__SWIG_2(swigCPtr, x, bias);
191             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
192             return ret;
193         }
194
195         public float SnapAndClamp(float x)
196         {
197             float ret = NDalicPINVOKE.Ruler_SnapAndClamp__SWIG_3(swigCPtr, x);
198             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
199             return ret;
200         }
201
202         internal float SnapAndClamp(float x, float bias, float length, float scale, SWIGTYPE_p_Dali__Toolkit__ClampState clamped)
203         {
204             float ret = NDalicPINVOKE.Ruler_SnapAndClamp__SWIG_4(swigCPtr, x, bias, length, scale, SWIGTYPE_p_Dali__Toolkit__ClampState.getCPtr(clamped));
205             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
206             return ret;
207         }
208
209         public enum RulerType
210         {
211             Fixed,
212             Free
213         }
214
215     }
216
217 }