sync with devel/master branch
[platform/core/csapi/tizenfx.git] / src / Tizen.NUI / src / public / Gesture.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     /// Base structure for different gestures that an application can receive.<br>
16     /// A gesture is an event that is produced from a combination of several touch events
17     /// in a particular order or within a certain time frame (e.g pinch).<br>
18     /// </summary>
19     public class Gesture : global::System.IDisposable
20     {
21         private global::System.Runtime.InteropServices.HandleRef swigCPtr;
22         protected bool swigCMemOwn;
23
24         internal Gesture(global::System.IntPtr cPtr, bool cMemoryOwn)
25         {
26             swigCMemOwn = cMemoryOwn;
27             swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
28         }
29
30         internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Gesture obj)
31         {
32             return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
33         }
34
35         //NUI Dispose Pattern written by Jinwoo Nam(jjw.nam) 
36
37         //A Flag to check who called Dispose(). (By User or DisposeQueue)
38         private bool isDisposeQueued = false;
39         //A Flat to check if it is already disposed.
40         protected bool disposed = false;
41
42         ~Gesture()
43         {
44             if(!isDisposeQueued)
45             {
46                 isDisposeQueued = true;
47                 DisposeQueue.Instance.Add(this);
48             }
49         }
50
51         public void Dispose()
52         {
53             //Throw excpetion if Dispose() is called in separate thread.
54             if (!Window.IsInstalled())
55             {
56                 throw new System.InvalidOperationException("This API called from separate thread. This API must be called from MainThread.");
57             }
58
59             if (isDisposeQueued)
60             {
61                 Dispose(DisposeTypes.Implicit);
62             }
63             else
64             {
65                 Dispose(DisposeTypes.Explicit);
66                 System.GC.SuppressFinalize(this);
67             }
68         }
69
70         protected virtual void Dispose(DisposeTypes type)
71         {
72             if (disposed)
73             {
74                 return;
75             }
76
77             if(type == DisposeTypes.Explicit)
78             {
79                 //Called by User
80                 //Release your own managed resources here.
81                 //You should release all of your own disposable objects here.
82             }
83
84             //Release your own unmanaged resources here.
85             //You should not access any managed member here except static instance.
86             //because the execution order of Finalizes is non-deterministic.
87
88             if (swigCPtr.Handle != global::System.IntPtr.Zero)
89             {
90                 if (swigCMemOwn)
91                 {
92                     swigCMemOwn = false;
93                     NDalicPINVOKE.delete_Gesture(swigCPtr);
94                 }
95                 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
96             }
97             disposed = true;
98         }
99
100
101         /// <summary>
102         /// The gesture type.
103         /// </summary>
104         public Gesture.GestureType Type
105         {
106             get
107             {
108                 return type;
109             }
110         }
111
112         /// <summary>
113         /// The gesture state.
114         /// </summary>
115         public Gesture.StateType State
116         {
117             get
118             {
119                 return state;
120             }
121         }
122
123         /// <summary>
124         /// The time the gesture took place.
125         /// </summary>
126         public uint Time
127         {
128             get
129             {
130                 return time;
131             }
132         }
133
134         /// <summary>
135         /// Copy constructor.
136         /// </summary>
137         /// <param name="rhs">A reference to the copied handle</param>
138         public Gesture(Gesture rhs) : this(NDalicPINVOKE.new_Gesture(Gesture.getCPtr(rhs)), true)
139         {
140             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
141         }
142
143         /// <summary>
144         /// Assignment operator.
145         /// </summary>
146         /// <param name="rhs">A reference to the copied handle</param>
147         /// <returns>A reference to this</returns>
148         public Gesture Assign(Gesture rhs)
149         {
150             Gesture ret = new Gesture(NDalicPINVOKE.Gesture_Assign(swigCPtr, Gesture.getCPtr(rhs)), false);
151             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
152             return ret;
153         }
154
155         private Gesture.GestureType type
156         {
157             set
158             {
159                 NDalicPINVOKE.Gesture_type_set(swigCPtr, (int)value);
160                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
161             }
162             get
163             {
164                 Gesture.GestureType ret = (Gesture.GestureType)NDalicPINVOKE.Gesture_type_get(swigCPtr);
165                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
166                 return ret;
167             }
168         }
169
170         private Gesture.StateType state
171         {
172             set
173             {
174                 NDalicPINVOKE.Gesture_state_set(swigCPtr, (int)value);
175                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
176             }
177             get
178             {
179                 Gesture.StateType ret = (Gesture.StateType)NDalicPINVOKE.Gesture_state_get(swigCPtr);
180                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
181                 return ret;
182             }
183         }
184
185         private uint time
186         {
187             set
188             {
189                 NDalicPINVOKE.Gesture_time_set(swigCPtr, value);
190                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
191             }
192             get
193             {
194                 uint ret = NDalicPINVOKE.Gesture_time_get(swigCPtr);
195                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
196                 return ret;
197             }
198         }
199
200         /// <summary>
201         /// Enumeration for type of gesture
202         /// </summary>
203         public enum GestureType
204         {
205             Pinch = 1 << 0,
206             Pan = 1 << 1,
207             Tap = 1 << 2,
208             LongPress = 1 << 3
209         }
210
211         /// <summary>
212         /// Enumeration for state of the gesture.
213         /// </summary>
214         public enum StateType
215         {
216             Clear,
217             Started,
218             Continuing,
219             Finished,
220             Cancelled,
221             Possible
222         }
223
224     }
225
226 }