[NUI] Remove duplicate getCPtr from BaseHandle subclasses (#3545)
[platform/core/csapi/tizenfx.git] / src / Tizen.NUI / src / public / Events / RotationGesture.cs
1 /*
2  * Copyright(c) 2021 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 using System.ComponentModel;
18
19 namespace Tizen.NUI
20 {
21     /// <summary>
22     /// A RotationGesture is emitted when the user moves two fingers in a circular motion.<br />
23     /// A rotation gesture will continue to be sent to the actor under the center point of the rotation until the rotation ends.<br />
24     /// </summary>
25     /// This will be made public in the next tizen release after an ACR is done. Till then, it needs to be hidden as an inhouse API.
26     [EditorBrowsable(EditorBrowsableState.Never)]
27     public class RotationGesture : Gesture
28     {
29
30         internal RotationGesture(global::System.IntPtr cPtr, bool cMemoryOwn) : base(cPtr, cMemoryOwn)
31         {
32         }
33
34
35         /// <summary>
36         /// The overall rotation (in radians) from the start of the rotation gesture till the latest rotation gesture.
37         /// </summary>
38         /// This will be made public in the next tizen release after an ACR is done. Till then, it needs to be hidden as an inhouse API.
39         [EditorBrowsable(EditorBrowsableState.Never)]
40         public float Rotation
41         {
42             get
43             {
44                 return rotation;
45             }
46         }
47
48         /// <summary>
49         /// The center point of the two points that caused the rotation gesture in screen coordinates.
50         /// </summary>
51         /// This will be made public in the next tizen release after an ACR is done. Till then, it needs to be hidden as an inhouse API.
52         [EditorBrowsable(EditorBrowsableState.Never)]
53         public Vector2 ScreenCenterPoint
54         {
55             get
56             {
57                 return screenCenterPoint;
58             }
59         }
60
61         /// <summary>
62         /// The center point of the two points that caused the rotation gesture in local view coordinates.
63         /// </summary>
64         /// This will be made public in the next tizen release after an ACR is done. Till then, it needs to be hidden as an inhouse API.
65         [EditorBrowsable(EditorBrowsableState.Never)]
66         public Vector2 LocalCenterPoint
67         {
68             get
69             {
70                 return localCenterPoint;
71             }
72         }
73
74         /// <summary>
75         /// The default constructor.
76         /// </summary>
77         /// <param name="state">The state of the gesture.</param>
78         /// This will be made public in the next tizen release after an ACR is done. Till then, it needs to be hidden as an inhouse API.
79         [EditorBrowsable(EditorBrowsableState.Never)]
80         public RotationGesture(Gesture.StateType state) : this(Interop.RotationGesture.New((int)state), true)
81         {
82             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
83         }
84
85         private float rotation
86         {
87             set
88             {
89                 Interop.RotationGesture.RotationSet(SwigCPtr, value);
90                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
91             }
92             get
93             {
94                 float ret = Interop.RotationGesture.RotationGet(SwigCPtr);
95                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
96                 return ret;
97             }
98         }
99
100         private Vector2 screenCenterPoint
101         {
102             set
103             {
104                 Interop.RotationGesture.ScreenCenterPointSet(SwigCPtr, Vector2.getCPtr(value));
105                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
106             }
107             get
108             {
109                 global::System.IntPtr cPtr = Interop.RotationGesture.ScreenCenterPointGet(SwigCPtr);
110                 Vector2 ret = (cPtr == global::System.IntPtr.Zero) ? null : new Vector2(cPtr, false);
111                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
112                 return ret;
113             }
114         }
115
116         private Vector2 localCenterPoint
117         {
118             set
119             {
120                 Interop.RotationGesture.LocalCenterPointSet(SwigCPtr, Vector2.getCPtr(value));
121                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
122             }
123             get
124             {
125                 global::System.IntPtr cPtr = Interop.RotationGesture.LocalCenterPointGet(SwigCPtr);
126                 Vector2 ret = (cPtr == global::System.IntPtr.Zero) ? null : new Vector2(cPtr, false);
127                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
128                 return ret;
129             }
130         }
131
132         internal static RotationGesture GetRotationGestureFromPtr(global::System.IntPtr cPtr)
133         {
134             RotationGesture ret = new RotationGesture(cPtr, false);
135             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
136             return ret;
137         }
138
139         /// This will not be public opened.
140         [EditorBrowsable(EditorBrowsableState.Never)]
141         protected override void ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef swigCPtr)
142         {
143             Interop.RotationGesture.DeleteRotationGesture(swigCPtr);
144         }
145     }
146 }