9d6718797eedd7e07d508474cbc1dc6da2c4b5de
[platform/core/csapi/tizenfx.git] / src / Tizen.NUI / src / internal / DefaultRuler.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 using System.ComponentModel;
19
20 namespace Tizen.NUI
21 {
22     /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API.
23     [EditorBrowsable(EditorBrowsableState.Never)]
24     public class DefaultRuler : Ruler
25     {
26         private global::System.Runtime.InteropServices.HandleRef swigCPtr;
27
28         internal DefaultRuler(global::System.IntPtr cPtr, bool cMemoryOwn) : base(Interop.Ruler.DefaultRuler_SWIGUpcast(cPtr), cMemoryOwn)
29         {
30             swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
31         }
32
33         internal static global::System.Runtime.InteropServices.HandleRef getCPtr(DefaultRuler obj)
34         {
35             return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
36         }
37
38         /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API.
39         [EditorBrowsable(EditorBrowsableState.Never)]
40         protected override void Dispose(DisposeTypes type)
41         {
42             if (disposed)
43             {
44                 return;
45             }
46
47             if (type == DisposeTypes.Explicit)
48             {
49                 //Called by User
50                 //Release your own managed resources here.
51                 //You should release all of your own disposable objects here.
52
53             }
54
55             //Release your own unmanaged resources here.
56             //You should not access any managed member here except static instance.
57             //because the execution order of Finalizes is non-deterministic.
58
59             if (swigCPtr.Handle != global::System.IntPtr.Zero)
60             {
61                 if (swigCMemOwn)
62                 {
63                     swigCMemOwn = false;
64                     Interop.Ruler.delete_DefaultRuler(swigCPtr);
65                 }
66                 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
67             }
68
69             base.Dispose(type);
70         }
71
72         /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API.
73         [EditorBrowsable(EditorBrowsableState.Never)]
74         public DefaultRuler() : this(Interop.Ruler.new_DefaultRuler(), true)
75         {
76             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
77         }
78
79         /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API.
80         [EditorBrowsable(EditorBrowsableState.Never)]
81         public override float Snap(float x, float bias)
82         {
83             float ret = Interop.Ruler.DefaultRuler_Snap(swigCPtr, x, bias);
84             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
85             return ret;
86         }
87
88         /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API.
89         [EditorBrowsable(EditorBrowsableState.Never)]
90         public override float GetPositionFromPage(uint page, out uint volume, bool wrap)
91         {
92             float ret = Interop.Ruler.DefaultRuler_GetPositionFromPage(swigCPtr, page, out volume, wrap);
93             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
94             return ret;
95         }
96
97         /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API.
98         [EditorBrowsable(EditorBrowsableState.Never)]
99         public override uint GetPageFromPosition(float position, bool wrap)
100         {
101             uint ret = Interop.Ruler.DefaultRuler_GetPageFromPosition(swigCPtr, position, wrap);
102             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
103             return ret;
104         }
105
106         /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API.
107         [EditorBrowsable(EditorBrowsableState.Never)]
108         public override uint GetTotalPages()
109         {
110             uint ret = Interop.Ruler.DefaultRuler_GetTotalPages(swigCPtr);
111             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
112             return ret;
113         }
114
115     }
116
117 }