Merge "Add C# binding for VideoView.Underlay property."
[platform/core/csapi/tizenfx.git] / src / Tizen.NUI / src / public / LongPressGesture.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 namespace Tizen.NUI
19 {
20
21     /// <summary>
22     /// A long press gesture is emitted when the user holds the screen with the stated number of fingers.<br />
23     /// A long press gesture finishes when all touches have been released.<br />
24     /// </summary>
25     public class LongPressGesture : Gesture
26     {
27         private global::System.Runtime.InteropServices.HandleRef swigCPtr;
28
29         internal LongPressGesture(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.LongPressGesture_SWIGUpcast(cPtr), cMemoryOwn)
30         {
31             swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
32         }
33
34         internal static global::System.Runtime.InteropServices.HandleRef getCPtr(LongPressGesture obj)
35         {
36             return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
37         }
38
39         /// <summary>
40         /// Dispose.
41         /// </summary>
42         /// <since_tizen> 3 </since_tizen>
43         protected override void Dispose(DisposeTypes type)
44         {
45             if(disposed)
46             {
47                 return;
48             }
49
50             if(type == DisposeTypes.Explicit)
51             {
52                 //Called by User
53                 //Release your own managed resources here.
54                 //You should release all of your own disposable objects here.
55             }
56
57             //Release your own unmanaged resources here.
58             //You should not access any managed member here except static instance.
59             //because the execution order of Finalizes is non-deterministic.
60
61             if (swigCPtr.Handle != global::System.IntPtr.Zero)
62             {
63                 if (swigCMemOwn)
64                 {
65                     swigCMemOwn = false;
66                     NDalicPINVOKE.delete_LongPressGesture(swigCPtr);
67                 }
68                 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
69             }
70
71             base.Dispose(type);
72         }
73
74
75         internal static LongPressGesture GetLongPressGestureFromPtr(global::System.IntPtr cPtr)
76         {
77             LongPressGesture ret = new LongPressGesture(cPtr, false);
78             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
79             return ret;
80         }
81
82         /// <summary>
83         /// The number of touch points in this long press gesture, i.e., the number of fingers the user had
84         /// on the screen to generate the long press gesture.<br />
85         /// </summary>
86         /// <since_tizen> 3 </since_tizen>
87         public uint NumberOfTouches
88         {
89             get
90             {
91                 return numberOfTouches;
92             }
93         }
94
95         /// <summary>
96         /// This is the point, in screen coordinates, where the long press occurred.<br />
97         /// If a multi-touch long press, then this is the centroid of all the touch points.<br />
98         /// </summary>
99         /// <since_tizen> 3 </since_tizen>
100         public Vector2 ScreenPoint
101         {
102             get
103             {
104                 return screenPoint;
105             }
106         }
107
108         /// <summary>
109         /// This is the point, in local actor coordinates, where the long press occurred.<br />
110         /// If a multi-touch long press, then this is the centroid of all the touch points.<br />
111         /// </summary>
112         /// <since_tizen> 3 </since_tizen>
113         public Vector2 LocalPoint
114         {
115             get
116             {
117                 return localPoint;
118             }
119         }
120
121         /// <summary>
122         /// The constructor.
123         /// </summary>
124         /// <param name="state">The state of the gesture</param>
125         /// <since_tizen> 3 </since_tizen>
126         public LongPressGesture(Gesture.StateType state) : this(NDalicPINVOKE.new_LongPressGesture__SWIG_0((int)state), true)
127         {
128             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
129         }
130
131
132         private uint numberOfTouches
133         {
134             set
135             {
136                 NDalicPINVOKE.LongPressGesture_numberOfTouches_set(swigCPtr, value);
137                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
138             }
139             get
140             {
141                 uint ret = NDalicPINVOKE.LongPressGesture_numberOfTouches_get(swigCPtr);
142                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
143                 return ret;
144             }
145         }
146
147         private Vector2 screenPoint
148         {
149             set
150             {
151                 NDalicPINVOKE.LongPressGesture_screenPoint_set(swigCPtr, Vector2.getCPtr(value));
152                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
153             }
154             get
155             {
156                 global::System.IntPtr cPtr = NDalicPINVOKE.LongPressGesture_screenPoint_get(swigCPtr);
157                 Vector2 ret = (cPtr == global::System.IntPtr.Zero) ? null : new Vector2(cPtr, false);
158                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
159                 return ret;
160             }
161         }
162
163         private Vector2 localPoint
164         {
165             set
166             {
167                 NDalicPINVOKE.LongPressGesture_localPoint_set(swigCPtr, Vector2.getCPtr(value));
168                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
169             }
170             get
171             {
172                 global::System.IntPtr cPtr = NDalicPINVOKE.LongPressGesture_localPoint_get(swigCPtr);
173                 Vector2 ret = (cPtr == global::System.IntPtr.Zero) ? null : new Vector2(cPtr, false);
174                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
175                 return ret;
176             }
177         }
178
179     }
180
181 }