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