Revert "[Tizen] Remove multiple ..."
[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         private Gesture.GestureType type
144         {
145             set
146             {
147                 NDalicPINVOKE.Gesture_type_set(swigCPtr, (int)value);
148                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
149             }
150             get
151             {
152                 Gesture.GestureType ret = (Gesture.GestureType)NDalicPINVOKE.Gesture_type_get(swigCPtr);
153                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
154                 return ret;
155             }
156         }
157
158         private Gesture.StateType state
159         {
160             set
161             {
162                 NDalicPINVOKE.Gesture_state_set(swigCPtr, (int)value);
163                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
164             }
165             get
166             {
167                 Gesture.StateType ret = (Gesture.StateType)NDalicPINVOKE.Gesture_state_get(swigCPtr);
168                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
169                 return ret;
170             }
171         }
172
173         private uint time
174         {
175             set
176             {
177                 NDalicPINVOKE.Gesture_time_set(swigCPtr, value);
178                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
179             }
180             get
181             {
182                 uint ret = NDalicPINVOKE.Gesture_time_get(swigCPtr);
183                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
184                 return ret;
185             }
186         }
187
188         /// <summary>
189         /// Enumeration for type of gesture
190         /// </summary>
191         public enum GestureType
192         {
193             Pinch = 1 << 0,
194             Pan = 1 << 1,
195             Tap = 1 << 2,
196             LongPress = 1 << 3
197         }
198
199         /// <summary>
200         /// Enumeration for state of the gesture.
201         /// </summary>
202         public enum StateType
203         {
204             Clear,
205             Started,
206             Continuing,
207             Finished,
208             Cancelled,
209             Possible
210         }
211
212     }
213
214 }