Combined Stage and Window class, and removed Stage class
[platform/core/uifw/dali-toolkit.git] / plugins / dali-sharp / sharp / internal / ScrollBar.cs
1 /** Copyright (c) 2017 Samsung Electronics Co., Ltd.
2 *
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at
6 *
7 * http://www.apache.org/licenses/LICENSE-2.0
8 *
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
14 *
15 */
16 // This File has been auto-generated by SWIG and then modified using DALi Ruby Scripts
17 //------------------------------------------------------------------------------
18 // <auto-generated />
19 //
20 // This file was automatically generated by SWIG (http://www.swig.org).
21 // Version 3.0.10
22 //
23 // Do not make changes to this file unless you know what you are doing--modify
24 // the SWIG interface file instead.
25 //------------------------------------------------------------------------------
26
27 namespace Dali {
28
29 using System;
30 using System.Runtime.InteropServices;
31
32
33 public class ScrollBar : View {
34   private global::System.Runtime.InteropServices.HandleRef swigCPtr;
35
36   internal ScrollBar(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.ScrollBar_SWIGUpcast(cPtr), cMemoryOwn) {
37     swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
38   }
39
40   internal static global::System.Runtime.InteropServices.HandleRef getCPtr(ScrollBar obj) {
41     return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
42   }
43
44   ~ScrollBar() {
45     DisposeQueue.Instance.Add(this);
46   }
47
48   public override void Dispose() {
49     if (!Window.IsInstalled()) {
50       DisposeQueue.Instance.Add(this);
51       return;
52     }
53
54     lock(this) {
55       if (swigCPtr.Handle != global::System.IntPtr.Zero) {
56         if (swigCMemOwn) {
57           swigCMemOwn = false;
58           NDalicPINVOKE.delete_ScrollBar(swigCPtr);
59         }
60         swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
61       }
62       global::System.GC.SuppressFinalize(this);
63       base.Dispose();
64     }
65   }
66
67
68
69
70 public class PanFinishedEventArgs : EventArgs
71 {
72 }
73
74 public class ScrollPositionIntervalReachedEventArgs : EventArgs
75 {
76    private float _currentScrollPosition;
77
78    public float CurrentScrollPosition
79    {
80       get
81       {
82          return _currentScrollPosition;
83       }
84       set
85       {
86          _currentScrollPosition = value;
87       }
88    }
89 }
90
91   [UnmanagedFunctionPointer(CallingConvention.StdCall)]
92   private delegate void PanFinishedEventCallbackDelegate();
93   private DaliEventHandler<object,PanFinishedEventArgs> _scrollBarPanFinishedEventHandler;
94   private PanFinishedEventCallbackDelegate _scrollBarPanFinishedEventCallbackDelegate;
95   
96   [UnmanagedFunctionPointer(CallingConvention.StdCall)]
97   private delegate void ScrollPositionIntervalReachedEventCallbackDelegate();
98   private DaliEventHandler<object,ScrollPositionIntervalReachedEventArgs> _scrollBarScrollPositionIntervalReachedEventHandler;
99   private ScrollPositionIntervalReachedEventCallbackDelegate _scrollBarScrollPositionIntervalReachedEventCallbackDelegate;
100
101   public event DaliEventHandler<object,PanFinishedEventArgs> PanFinished
102   {
103      add
104      {
105         lock(this)
106         {
107            // Restricted to only one listener
108            if (_scrollBarPanFinishedEventHandler == null)
109            {
110               _scrollBarPanFinishedEventHandler += value;
111
112               _scrollBarPanFinishedEventCallbackDelegate = new PanFinishedEventCallbackDelegate(OnScrollBarPanFinished);
113               this.PanFinishedSignal().Connect(_scrollBarPanFinishedEventCallbackDelegate);
114            }
115         }
116      }
117
118      remove
119      {
120         lock(this)
121         {
122            if (_scrollBarPanFinishedEventHandler != null)
123            {
124               this.PanFinishedSignal().Disconnect(_scrollBarPanFinishedEventCallbackDelegate);
125            }
126
127            _scrollBarPanFinishedEventHandler -= value;
128         }
129      }
130   }
131
132   // Callback for ScrollBar PanFinishedSignal
133   private void OnScrollBarPanFinished()
134   {
135      PanFinishedEventArgs e = new PanFinishedEventArgs();
136
137      if (_scrollBarPanFinishedEventHandler != null)
138      {
139         //here we send all data to user event handlers
140         _scrollBarPanFinishedEventHandler(this, e);
141      }
142   }
143
144
145   public event DaliEventHandler<object,ScrollPositionIntervalReachedEventArgs> ScrollPositionIntervalReached
146   {
147      add
148      {
149         lock(this)
150         {
151            // Restricted to only one listener
152            if (_scrollBarScrollPositionIntervalReachedEventHandler == null)
153            {
154               _scrollBarScrollPositionIntervalReachedEventHandler += value;
155
156               _scrollBarScrollPositionIntervalReachedEventCallbackDelegate = new ScrollPositionIntervalReachedEventCallbackDelegate(OnScrollBarScrollPositionIntervalReached);
157               this.ScrollPositionIntervalReachedSignal().Connect(_scrollBarScrollPositionIntervalReachedEventCallbackDelegate);
158            }
159         }
160      }
161
162      remove
163      {
164         lock(this)
165         {
166            if (_scrollBarScrollPositionIntervalReachedEventHandler != null)
167            {
168               this.ScrollPositionIntervalReachedSignal().Disconnect(_scrollBarScrollPositionIntervalReachedEventCallbackDelegate);
169            }
170
171            _scrollBarScrollPositionIntervalReachedEventHandler -= value;
172         }
173      }
174   }
175
176   // Callback for ScrollBar ScrollPositionIntervalReachedSignal
177   private void OnScrollBarScrollPositionIntervalReached()
178   {
179      ScrollPositionIntervalReachedEventArgs e = new ScrollPositionIntervalReachedEventArgs();
180
181      if (_scrollBarScrollPositionIntervalReachedEventHandler != null)
182      {
183         //here we send all data to user event handlers
184         _scrollBarScrollPositionIntervalReachedEventHandler(this, e);
185      }
186   }
187
188
189   public class Property : global::System.IDisposable {
190     private global::System.Runtime.InteropServices.HandleRef swigCPtr;
191     protected bool swigCMemOwn;
192   
193     internal Property(global::System.IntPtr cPtr, bool cMemoryOwn) {
194       swigCMemOwn = cMemoryOwn;
195       swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
196     }
197   
198     internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Property obj) {
199       return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
200     }
201   
202     ~Property() {
203       Dispose();
204     }
205   
206     public virtual void Dispose() {
207       lock(this) {
208         if (swigCPtr.Handle != global::System.IntPtr.Zero) {
209           if (swigCMemOwn) {
210             swigCMemOwn = false;
211             NDalicPINVOKE.delete_ScrollBar_Property(swigCPtr);
212           }
213           swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
214         }
215         global::System.GC.SuppressFinalize(this);
216       }
217     }
218   
219     public Property() : this(NDalicPINVOKE.new_ScrollBar_Property(), true) {
220       if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
221     }
222   
223     public static readonly int SCROLL_DIRECTION = NDalicPINVOKE.ScrollBar_Property_SCROLL_DIRECTION_get();
224     public static readonly int INDICATOR_HEIGHT_POLICY = NDalicPINVOKE.ScrollBar_Property_INDICATOR_HEIGHT_POLICY_get();
225     public static readonly int INDICATOR_FIXED_HEIGHT = NDalicPINVOKE.ScrollBar_Property_INDICATOR_FIXED_HEIGHT_get();
226     public static readonly int INDICATOR_SHOW_DURATION = NDalicPINVOKE.ScrollBar_Property_INDICATOR_SHOW_DURATION_get();
227     public static readonly int INDICATOR_HIDE_DURATION = NDalicPINVOKE.ScrollBar_Property_INDICATOR_HIDE_DURATION_get();
228     public static readonly int SCROLL_POSITION_INTERVALS = NDalicPINVOKE.ScrollBar_Property_SCROLL_POSITION_INTERVALS_get();
229     public static readonly int INDICATOR_MINIMUM_HEIGHT = NDalicPINVOKE.ScrollBar_Property_INDICATOR_MINIMUM_HEIGHT_get();
230     public static readonly int INDICATOR_START_PADDING = NDalicPINVOKE.ScrollBar_Property_INDICATOR_START_PADDING_get();
231     public static readonly int INDICATOR_END_PADDING = NDalicPINVOKE.ScrollBar_Property_INDICATOR_END_PADDING_get();
232   
233   }
234
235   public ScrollBar (ScrollBar.Direction direction) : this (NDalicPINVOKE.ScrollBar_New__SWIG_0((int)direction), true) {
236       if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
237
238   }
239   public ScrollBar () : this (NDalicPINVOKE.ScrollBar_New__SWIG_1(), true) {
240       if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
241
242   }
243   public ScrollBar(ScrollBar scrollBar) : this(NDalicPINVOKE.new_ScrollBar__SWIG_1(ScrollBar.getCPtr(scrollBar)), true) {
244     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
245   }
246
247   public ScrollBar Assign(ScrollBar scrollBar) {
248     ScrollBar ret = new ScrollBar(NDalicPINVOKE.ScrollBar_Assign(swigCPtr, ScrollBar.getCPtr(scrollBar)), false);
249     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
250     return ret;
251   }
252
253   public new static ScrollBar DownCast(BaseHandle handle) {
254     ScrollBar ret = new ScrollBar(NDalicPINVOKE.ScrollBar_DownCast(BaseHandle.getCPtr(handle)), true);
255     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
256     return ret;
257   }
258
259   public void SetScrollPropertySource(Animatable handle, int propertyScrollPosition, int propertyMinScrollPosition, int propertyMaxScrollPosition, int propertyScrollContentSize) {
260     NDalicPINVOKE.ScrollBar_SetScrollPropertySource(swigCPtr, Animatable.getCPtr(handle), propertyScrollPosition, propertyMinScrollPosition, propertyMaxScrollPosition, propertyScrollContentSize);
261     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
262   }
263
264   public void SetScrollIndicator(View indicator) {
265     NDalicPINVOKE.ScrollBar_SetScrollIndicator(swigCPtr, View.getCPtr(indicator));
266     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
267   }
268
269   public View GetScrollIndicator() {
270     View ret = new View(NDalicPINVOKE.ScrollBar_GetScrollIndicator(swigCPtr), true);
271     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
272     return ret;
273   }
274
275   public void SetScrollPositionIntervals(VectorFloat positions) {
276     NDalicPINVOKE.ScrollBar_SetScrollPositionIntervals(swigCPtr, VectorFloat.getCPtr(positions));
277     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
278   }
279
280   public VectorFloat GetScrollPositionIntervals() {
281     VectorFloat ret = new VectorFloat(NDalicPINVOKE.ScrollBar_GetScrollPositionIntervals(swigCPtr), true);
282     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
283     return ret;
284   }
285
286   public void SetScrollDirection(ScrollBar.Direction direction) {
287     NDalicPINVOKE.ScrollBar_SetScrollDirection(swigCPtr, (int)direction);
288     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
289   }
290
291   public ScrollBar.Direction GetScrollDirection() {
292     ScrollBar.Direction ret = (ScrollBar.Direction)NDalicPINVOKE.ScrollBar_GetScrollDirection(swigCPtr);
293     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
294     return ret;
295   }
296
297   public void SetIndicatorHeightPolicy(ScrollBar.IndicatorHeightPolicyType policy) {
298     NDalicPINVOKE.ScrollBar_SetIndicatorHeightPolicy(swigCPtr, (int)policy);
299     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
300   }
301
302   public ScrollBar.IndicatorHeightPolicyType GetIndicatorHeightPolicy() {
303     ScrollBar.IndicatorHeightPolicyType ret = (ScrollBar.IndicatorHeightPolicyType)NDalicPINVOKE.ScrollBar_GetIndicatorHeightPolicy(swigCPtr);
304     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
305     return ret;
306   }
307
308   public void SetIndicatorFixedHeight(float height) {
309     NDalicPINVOKE.ScrollBar_SetIndicatorFixedHeight(swigCPtr, height);
310     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
311   }
312
313   public float GetIndicatorFixedHeight() {
314     float ret = NDalicPINVOKE.ScrollBar_GetIndicatorFixedHeight(swigCPtr);
315     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
316     return ret;
317   }
318
319   public void SetIndicatorShowDuration(float durationSeconds) {
320     NDalicPINVOKE.ScrollBar_SetIndicatorShowDuration(swigCPtr, durationSeconds);
321     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
322   }
323
324   public float GetIndicatorShowDuration() {
325     float ret = NDalicPINVOKE.ScrollBar_GetIndicatorShowDuration(swigCPtr);
326     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
327     return ret;
328   }
329
330   public void SetIndicatorHideDuration(float durationSeconds) {
331     NDalicPINVOKE.ScrollBar_SetIndicatorHideDuration(swigCPtr, durationSeconds);
332     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
333   }
334
335   public float GetIndicatorHideDuration() {
336     float ret = NDalicPINVOKE.ScrollBar_GetIndicatorHideDuration(swigCPtr);
337     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
338     return ret;
339   }
340
341   public void ShowIndicator() {
342     NDalicPINVOKE.ScrollBar_ShowIndicator(swigCPtr);
343     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
344   }
345
346   public void HideIndicator() {
347     NDalicPINVOKE.ScrollBar_HideIndicator(swigCPtr);
348     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
349   }
350
351   public VoidSignal PanFinishedSignal() {
352     VoidSignal ret = new VoidSignal(NDalicPINVOKE.ScrollBar_PanFinishedSignal(swigCPtr), false);
353     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
354     return ret;
355   }
356
357   public FloatSignal ScrollPositionIntervalReachedSignal() {
358     FloatSignal ret = new FloatSignal(NDalicPINVOKE.ScrollBar_ScrollPositionIntervalReachedSignal(swigCPtr), false);
359     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
360     return ret;
361   }
362
363   public enum PropertyRange {
364     PROPERTY_START_INDEX = PropertyRanges.PROPERTY_REGISTRATION_START_INDEX,
365     PROPERTY_END_INDEX = View.PropertyRange.PROPERTY_START_INDEX+1000
366   }
367
368   public enum Direction {
369     Vertical = 0,
370     Horizontal
371   }
372
373   public enum IndicatorHeightPolicyType {
374     Variable = 0,
375     Fixed
376   }
377
378   public string ScrollDirection
379   {
380     get
381     {
382       string temp;
383       GetProperty( ScrollBar.Property.SCROLL_DIRECTION).Get( out temp );
384       return temp;
385     }
386     set
387     {
388       SetProperty( ScrollBar.Property.SCROLL_DIRECTION, new Dali.Property.Value( value ) );
389     }
390   }
391   public string IndicatorHeightPolicy
392   {
393     get
394     {
395       string temp;
396       GetProperty( ScrollBar.Property.INDICATOR_HEIGHT_POLICY).Get( out temp );
397       return temp;
398     }
399     set
400     {
401       SetProperty( ScrollBar.Property.INDICATOR_HEIGHT_POLICY, new Dali.Property.Value( value ) );
402     }
403   }
404   public float IndicatorFixedHeight
405   {
406     get
407     {
408       float temp = 0.0f;
409       GetProperty( ScrollBar.Property.INDICATOR_FIXED_HEIGHT).Get( ref temp );
410       return temp;
411     }
412     set
413     {
414       SetProperty( ScrollBar.Property.INDICATOR_FIXED_HEIGHT, new Dali.Property.Value( value ) );
415     }
416   }
417   public float IndicatorShowDuration
418   {
419     get
420     {
421       float temp = 0.0f;
422       GetProperty( ScrollBar.Property.INDICATOR_SHOW_DURATION).Get( ref temp );
423       return temp;
424     }
425     set
426     {
427       SetProperty( ScrollBar.Property.INDICATOR_SHOW_DURATION, new Dali.Property.Value( value ) );
428     }
429   }
430   public float IndicatorHideDuration
431   {
432     get
433     {
434       float temp = 0.0f;
435       GetProperty( ScrollBar.Property.INDICATOR_HIDE_DURATION).Get( ref temp );
436       return temp;
437     }
438     set
439     {
440       SetProperty( ScrollBar.Property.INDICATOR_HIDE_DURATION, new Dali.Property.Value( value ) );
441     }
442   }
443   public Dali.Property.Array ScrollPositionIntervals
444   {
445     get
446     {
447       Dali.Property.Array temp = new Dali.Property.Array();
448       GetProperty( ScrollBar.Property.SCROLL_POSITION_INTERVALS).Get(  temp );
449       return temp;
450     }
451     set
452     {
453       SetProperty( ScrollBar.Property.SCROLL_POSITION_INTERVALS, new Dali.Property.Value( value ) );
454     }
455   }
456   public float IndicatorMinimumHeight
457   {
458     get
459     {
460       float temp = 0.0f;
461       GetProperty( ScrollBar.Property.INDICATOR_MINIMUM_HEIGHT).Get( ref temp );
462       return temp;
463     }
464     set
465     {
466       SetProperty( ScrollBar.Property.INDICATOR_MINIMUM_HEIGHT, new Dali.Property.Value( value ) );
467     }
468   }
469   public float IndicatorStartPadding
470   {
471     get
472     {
473       float temp = 0.0f;
474       GetProperty( ScrollBar.Property.INDICATOR_START_PADDING).Get( ref temp );
475       return temp;
476     }
477     set
478     {
479       SetProperty( ScrollBar.Property.INDICATOR_START_PADDING, new Dali.Property.Value( value ) );
480     }
481   }
482   public float IndicatorEndPadding
483   {
484     get
485     {
486       float temp = 0.0f;
487       GetProperty( ScrollBar.Property.INDICATOR_END_PADDING).Get( ref temp );
488       return temp;
489     }
490     set
491     {
492       SetProperty( ScrollBar.Property.INDICATOR_END_PADDING, new Dali.Property.Value( value ) );
493     }
494   }
495
496 }
497
498 }