57e8a9d84f25451ef064bddfacd892046d9df988
[platform/core/csapi/tizenfx.git] / src / Tizen.NUI / src / public / Scrollable.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     using System;
15     using System.Runtime.InteropServices;
16     using Tizen.NUI.BaseComponents;
17
18     public class Scrollable : View
19     {
20         private global::System.Runtime.InteropServices.HandleRef swigCPtr;
21
22         internal Scrollable(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.Scrollable_SWIGUpcast(cPtr), cMemoryOwn)
23         {
24             swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
25             // By default, we do not want the position to use the anchor point
26             PositionUsesAnchorPoint = false;
27         }
28
29         internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Scrollable obj)
30         {
31             return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
32         }
33
34         protected override void Dispose(DisposeTypes type)
35         {
36             if (disposed)
37             {
38                 return;
39             }
40
41             if (type == DisposeTypes.Explicit)
42             {
43                 //Called by User
44                 //Release your own managed resources here.
45                 //You should release all of your own disposable objects here.
46
47             }
48
49             //Release your own unmanaged resources here.
50             //You should not access any managed member here except static instance.
51             //because the execution order of Finalizes is non-deterministic.
52
53             if (swigCPtr.Handle != global::System.IntPtr.Zero)
54             {
55                 if (swigCMemOwn)
56                 {
57                     swigCMemOwn = false;
58                     NDalicPINVOKE.delete_Scrollable(swigCPtr);
59                 }
60                 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
61             }
62
63             base.Dispose(type);
64         }
65
66         public class StartedEventArgs : EventArgs
67         {
68             private Vector2 _vector2;
69
70             public Vector2 Vector2
71             {
72                 get
73                 {
74                     return _vector2;
75                 }
76                 set
77                 {
78                     _vector2 = value;
79                 }
80             }
81         }
82
83         public class UpdatedEventArgs : EventArgs
84         {
85             private Vector2 _vector2;
86
87             public Vector2 Vector2
88             {
89                 get
90                 {
91                     return _vector2;
92                 }
93                 set
94                 {
95                     _vector2 = value;
96                 }
97             }
98         }
99
100         public class CompletedEventArgs : EventArgs
101         {
102             private Vector2 _vector2;
103
104             public Vector2 Vector2
105             {
106                 get
107                 {
108                     return _vector2;
109                 }
110                 set
111                 {
112                     _vector2 = value;
113                 }
114             }
115         }
116
117         [UnmanagedFunctionPointer(CallingConvention.StdCall)]
118         private delegate void StartedCallbackDelegate(IntPtr vector2);
119         private DaliEventHandler<object, StartedEventArgs> _scrollableStartedEventHandler;
120         private StartedCallbackDelegate _scrollableStartedCallbackDelegate;
121
122         [UnmanagedFunctionPointer(CallingConvention.StdCall)]
123         private delegate void UpdatedCallbackDelegate(IntPtr vector2);
124         private DaliEventHandler<object, UpdatedEventArgs> _scrollableUpdatedEventHandler;
125         private UpdatedCallbackDelegate _scrollableUpdatedCallbackDelegate;
126
127         [UnmanagedFunctionPointer(CallingConvention.StdCall)]
128         private delegate void CompletedCallbackDelegate(IntPtr vector2);
129         private DaliEventHandler<object, CompletedEventArgs> _scrollableCompletedEventHandler;
130         private CompletedCallbackDelegate _scrollableCompletedCallbackDelegate;
131
132         public event DaliEventHandler<object, StartedEventArgs> ScrollStarted
133         {
134             add
135             {
136                 lock (this)
137                 {
138                     // Restricted to only one listener
139                     if (_scrollableStartedEventHandler == null)
140                     {
141                         _scrollableStartedEventHandler += value;
142
143                         _scrollableStartedCallbackDelegate = new StartedCallbackDelegate(OnStarted);
144                         this.ScrollStartedSignal().Connect(_scrollableStartedCallbackDelegate);
145                     }
146                 }
147             }
148
149             remove
150             {
151                 lock (this)
152                 {
153                     if (_scrollableStartedEventHandler != null)
154                     {
155                         this.ScrollStartedSignal().Disconnect(_scrollableStartedCallbackDelegate);
156                     }
157
158                     _scrollableStartedEventHandler -= value;
159                 }
160             }
161         }
162
163         private void OnStarted(IntPtr vector2)
164         {
165             StartedEventArgs e = new StartedEventArgs();
166
167             // Populate all members of "e" (StartedEventArgs) with real data
168             e.Vector2 = Tizen.NUI.Vector2.GetVector2FromPtr(vector2);
169
170             if (_scrollableStartedEventHandler != null)
171             {
172                 //here we send all data to user event handlers
173                 _scrollableStartedEventHandler(this, e);
174             }
175
176         }
177
178         public event DaliEventHandler<object, UpdatedEventArgs> ScrollUpdated
179         {
180             add
181             {
182                 lock (this)
183                 {
184                     // Restricted to only one listener
185                     if (_scrollableUpdatedEventHandler == null)
186                     {
187                         _scrollableUpdatedEventHandler += value;
188
189                         _scrollableUpdatedCallbackDelegate = new UpdatedCallbackDelegate(OnUpdated);
190                         this.ScrollUpdatedSignal().Connect(_scrollableUpdatedCallbackDelegate);
191                     }
192                 }
193             }
194
195             remove
196             {
197                 lock (this)
198                 {
199                     if (_scrollableUpdatedEventHandler != null)
200                     {
201                         this.ScrollUpdatedSignal().Disconnect(_scrollableUpdatedCallbackDelegate);
202                     }
203
204                     _scrollableUpdatedEventHandler -= value;
205                 }
206             }
207         }
208
209         private void OnUpdated(IntPtr vector2)
210         {
211             UpdatedEventArgs e = new UpdatedEventArgs();
212
213             // Populate all members of "e" (UpdatedEventArgs) with real data
214             e.Vector2 = Tizen.NUI.Vector2.GetVector2FromPtr(vector2);
215
216             if (_scrollableUpdatedEventHandler != null)
217             {
218                 //here we send all data to user event handlers
219                 _scrollableUpdatedEventHandler(this, e);
220             }
221
222         }
223
224         public event DaliEventHandler<object, CompletedEventArgs> ScrollCompleted
225         {
226             add
227             {
228                 lock (this)
229                 {
230                     // Restricted to only one listener
231                     if (_scrollableCompletedEventHandler == null)
232                     {
233                         _scrollableCompletedEventHandler += value;
234
235                         _scrollableCompletedCallbackDelegate = new CompletedCallbackDelegate(OnCompleted);
236                         this.ScrollCompletedSignal().Connect(_scrollableCompletedCallbackDelegate);
237                     }
238                 }
239             }
240
241             remove
242             {
243                 lock (this)
244                 {
245                     if (_scrollableCompletedEventHandler != null)
246                     {
247                         this.ScrollCompletedSignal().Disconnect(_scrollableCompletedCallbackDelegate);
248                     }
249
250                     _scrollableCompletedEventHandler -= value;
251                 }
252             }
253         }
254
255         private void OnCompleted(IntPtr vector2)
256         {
257             CompletedEventArgs e = new CompletedEventArgs();
258
259             // Populate all members of "e" (CompletedEventArgs) with real data
260             e.Vector2 = Tizen.NUI.Vector2.GetVector2FromPtr(vector2);
261
262             if (_scrollableCompletedEventHandler != null)
263             {
264                 //here we send all data to user event handlers
265                 _scrollableCompletedEventHandler(this, e);
266             }
267
268         }
269
270
271         public class Property
272         {
273             public static readonly int OVERSHOOT_EFFECT_COLOR = NDalicPINVOKE.Scrollable_Property_OVERSHOOT_EFFECT_COLOR_get();
274             public static readonly int OVERSHOOT_ANIMATION_SPEED = NDalicPINVOKE.Scrollable_Property_OVERSHOOT_ANIMATION_SPEED_get();
275             public static readonly int OVERSHOOT_ENABLED = NDalicPINVOKE.Scrollable_Property_OVERSHOOT_ENABLED_get();
276             public static readonly int OVERSHOOT_SIZE = NDalicPINVOKE.Scrollable_Property_OVERSHOOT_SIZE_get();
277             public static readonly int SCROLL_TO_ALPHA_FUNCTION = NDalicPINVOKE.Scrollable_Property_SCROLL_TO_ALPHA_FUNCTION_get();
278             public static readonly int SCROLL_RELATIVE_POSITION = NDalicPINVOKE.Scrollable_Property_SCROLL_RELATIVE_POSITION_get();
279             public static readonly int SCROLL_POSITION_MIN = NDalicPINVOKE.Scrollable_Property_SCROLL_POSITION_MIN_get();
280             public static readonly int SCROLL_POSITION_MIN_X = NDalicPINVOKE.Scrollable_Property_SCROLL_POSITION_MIN_X_get();
281             public static readonly int SCROLL_POSITION_MIN_Y = NDalicPINVOKE.Scrollable_Property_SCROLL_POSITION_MIN_Y_get();
282             public static readonly int SCROLL_POSITION_MAX = NDalicPINVOKE.Scrollable_Property_SCROLL_POSITION_MAX_get();
283             public static readonly int SCROLL_POSITION_MAX_X = NDalicPINVOKE.Scrollable_Property_SCROLL_POSITION_MAX_X_get();
284             public static readonly int SCROLL_POSITION_MAX_Y = NDalicPINVOKE.Scrollable_Property_SCROLL_POSITION_MAX_Y_get();
285             public static readonly int CAN_SCROLL_VERTICAL = NDalicPINVOKE.Scrollable_Property_CAN_SCROLL_VERTICAL_get();
286             public static readonly int CAN_SCROLL_HORIZONTAL = NDalicPINVOKE.Scrollable_Property_CAN_SCROLL_HORIZONTAL_get();
287
288         }
289
290         public Scrollable() : this(NDalicPINVOKE.new_Scrollable__SWIG_0(), true)
291         {
292             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
293         }
294
295         private bool IsOvershootEnabled()
296         {
297             bool ret = NDalicPINVOKE.Scrollable_IsOvershootEnabled(swigCPtr);
298             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
299             return ret;
300         }
301
302         private void SetOvershootEnabled(bool enable)
303         {
304             NDalicPINVOKE.Scrollable_SetOvershootEnabled(swigCPtr, enable);
305             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
306         }
307
308         private void SetOvershootEffectColor(Vector4 color)
309         {
310             NDalicPINVOKE.Scrollable_SetOvershootEffectColor(swigCPtr, Vector4.getCPtr(color));
311             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
312         }
313
314         private Vector4 GetOvershootEffectColor()
315         {
316             Vector4 ret = new Vector4(NDalicPINVOKE.Scrollable_GetOvershootEffectColor(swigCPtr), true);
317             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
318             return ret;
319         }
320
321         private void SetOvershootAnimationSpeed(float pixelsPerSecond)
322         {
323             NDalicPINVOKE.Scrollable_SetOvershootAnimationSpeed(swigCPtr, pixelsPerSecond);
324             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
325         }
326
327         private float GetOvershootAnimationSpeed()
328         {
329             float ret = NDalicPINVOKE.Scrollable_GetOvershootAnimationSpeed(swigCPtr);
330             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
331             return ret;
332         }
333
334         internal ScrollableSignal ScrollStartedSignal()
335         {
336             ScrollableSignal ret = new ScrollableSignal(NDalicPINVOKE.Scrollable_ScrollStartedSignal(swigCPtr), false);
337             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
338             return ret;
339         }
340
341         internal ScrollableSignal ScrollUpdatedSignal()
342         {
343             ScrollableSignal ret = new ScrollableSignal(NDalicPINVOKE.Scrollable_ScrollUpdatedSignal(swigCPtr), false);
344             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
345             return ret;
346         }
347
348         internal ScrollableSignal ScrollCompletedSignal()
349         {
350             ScrollableSignal ret = new ScrollableSignal(NDalicPINVOKE.Scrollable_ScrollCompletedSignal(swigCPtr), false);
351             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
352             return ret;
353         }
354
355         public Vector4 OvershootEffectColor
356         {
357             get
358             {
359                 Vector4 temp = new Vector4(0.0f, 0.0f, 0.0f, 0.0f);
360                 GetProperty(Scrollable.Property.OVERSHOOT_EFFECT_COLOR).Get(temp);
361                 return temp;
362             }
363             set
364             {
365                 SetProperty(Scrollable.Property.OVERSHOOT_EFFECT_COLOR, new Tizen.NUI.PropertyValue(value));
366             }
367         }
368         public float OvershootAnimationSpeed
369         {
370             get
371             {
372                 float temp = 0.0f;
373                 GetProperty(Scrollable.Property.OVERSHOOT_ANIMATION_SPEED).Get(out temp);
374                 return temp;
375             }
376             set
377             {
378                 SetProperty(Scrollable.Property.OVERSHOOT_ANIMATION_SPEED, new Tizen.NUI.PropertyValue(value));
379             }
380         }
381         public bool OvershootEnabled
382         {
383             get
384             {
385                 bool temp = false;
386                 GetProperty(Scrollable.Property.OVERSHOOT_ENABLED).Get(out temp);
387                 return temp;
388             }
389             set
390             {
391                 SetProperty(Scrollable.Property.OVERSHOOT_ENABLED, new Tizen.NUI.PropertyValue(value));
392             }
393         }
394         public Vector2 OvershootSize
395         {
396             get
397             {
398                 Vector2 temp = new Vector2(0.0f, 0.0f);
399                 GetProperty(Scrollable.Property.OVERSHOOT_SIZE).Get(temp);
400                 return temp;
401             }
402             set
403             {
404                 SetProperty(Scrollable.Property.OVERSHOOT_SIZE, new Tizen.NUI.PropertyValue(value));
405             }
406         }
407         public int ScrollToAlphaFunction
408         {
409             get
410             {
411                 int temp = 0;
412                 GetProperty(Scrollable.Property.SCROLL_TO_ALPHA_FUNCTION).Get(out temp);
413                 return temp;
414             }
415             set
416             {
417                 SetProperty(Scrollable.Property.SCROLL_TO_ALPHA_FUNCTION, new Tizen.NUI.PropertyValue(value));
418             }
419         }
420         public Vector2 ScrollRelativePosition
421         {
422             get
423             {
424                 Vector2 temp = new Vector2(0.0f, 0.0f);
425                 GetProperty(Scrollable.Property.SCROLL_RELATIVE_POSITION).Get(temp);
426                 return temp;
427             }
428             set
429             {
430                 SetProperty(Scrollable.Property.SCROLL_RELATIVE_POSITION, new Tizen.NUI.PropertyValue(value));
431             }
432         }
433         public Vector2 ScrollPositionMin
434         {
435             get
436             {
437                 Vector2 temp = new Vector2(0.0f, 0.0f);
438                 GetProperty(Scrollable.Property.SCROLL_POSITION_MIN).Get(temp);
439                 return temp;
440             }
441             set
442             {
443                 SetProperty(Scrollable.Property.SCROLL_POSITION_MIN, new Tizen.NUI.PropertyValue(value));
444             }
445         }
446         public Vector2 ScrollPositionMax
447         {
448             get
449             {
450                 Vector2 temp = new Vector2(0.0f, 0.0f);
451                 GetProperty(Scrollable.Property.SCROLL_POSITION_MAX).Get(temp);
452                 return temp;
453             }
454             set
455             {
456                 SetProperty(Scrollable.Property.SCROLL_POSITION_MAX, new Tizen.NUI.PropertyValue(value));
457             }
458         }
459         public bool CanScrollVertical
460         {
461             get
462             {
463                 bool temp = false;
464                 GetProperty(Scrollable.Property.CAN_SCROLL_VERTICAL).Get(out temp);
465                 return temp;
466             }
467             set
468             {
469                 SetProperty(Scrollable.Property.CAN_SCROLL_VERTICAL, new Tizen.NUI.PropertyValue(value));
470             }
471         }
472         public bool CanScrollHorizontal
473         {
474             get
475             {
476                 bool temp = false;
477                 GetProperty(Scrollable.Property.CAN_SCROLL_HORIZONTAL).Get(out temp);
478                 return temp;
479             }
480             set
481             {
482                 SetProperty(Scrollable.Property.CAN_SCROLL_HORIZONTAL, new Tizen.NUI.PropertyValue(value));
483             }
484         }
485
486     }
487
488 }