Separate C# classes into Internal and Public
[platform/core/uifw/dali-toolkit.git] / plugins / dali-sharp / sharp / public / 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
190   {
191     public static readonly int SCROLL_DIRECTION = NDalicPINVOKE.ScrollBar_Property_SCROLL_DIRECTION_get();
192     public static readonly int INDICATOR_HEIGHT_POLICY = NDalicPINVOKE.ScrollBar_Property_INDICATOR_HEIGHT_POLICY_get();
193     public static readonly int INDICATOR_FIXED_HEIGHT = NDalicPINVOKE.ScrollBar_Property_INDICATOR_FIXED_HEIGHT_get();
194     public static readonly int INDICATOR_SHOW_DURATION = NDalicPINVOKE.ScrollBar_Property_INDICATOR_SHOW_DURATION_get();
195     public static readonly int INDICATOR_HIDE_DURATION = NDalicPINVOKE.ScrollBar_Property_INDICATOR_HIDE_DURATION_get();
196     public static readonly int SCROLL_POSITION_INTERVALS = NDalicPINVOKE.ScrollBar_Property_SCROLL_POSITION_INTERVALS_get();
197     public static readonly int INDICATOR_MINIMUM_HEIGHT = NDalicPINVOKE.ScrollBar_Property_INDICATOR_MINIMUM_HEIGHT_get();
198     public static readonly int INDICATOR_START_PADDING = NDalicPINVOKE.ScrollBar_Property_INDICATOR_START_PADDING_get();
199     public static readonly int INDICATOR_END_PADDING = NDalicPINVOKE.ScrollBar_Property_INDICATOR_END_PADDING_get();
200   }
201
202   public ScrollBar (ScrollBar.Direction direction) : this (NDalicPINVOKE.ScrollBar_New__SWIG_0((int)direction), true) {
203       if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
204
205   }
206   public ScrollBar () : this (NDalicPINVOKE.ScrollBar_New__SWIG_1(), true) {
207       if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
208
209   }
210   public ScrollBar(ScrollBar scrollBar) : this(NDalicPINVOKE.new_ScrollBar__SWIG_1(ScrollBar.getCPtr(scrollBar)), true) {
211     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
212   }
213
214   internal new static ScrollBar DownCast(BaseHandle handle) {
215     ScrollBar ret = new ScrollBar(NDalicPINVOKE.ScrollBar_DownCast(BaseHandle.getCPtr(handle)), true);
216     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
217     return ret;
218   }
219
220   public void SetScrollPropertySource(Animatable handle, int propertyScrollPosition, int propertyMinScrollPosition, int propertyMaxScrollPosition, int propertyScrollContentSize) {
221     NDalicPINVOKE.ScrollBar_SetScrollPropertySource(swigCPtr, Animatable.getCPtr(handle), propertyScrollPosition, propertyMinScrollPosition, propertyMaxScrollPosition, propertyScrollContentSize);
222     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
223   }
224
225   public void SetScrollIndicator(View indicator) {
226     NDalicPINVOKE.ScrollBar_SetScrollIndicator(swigCPtr, View.getCPtr(indicator));
227     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
228   }
229
230   public View GetScrollIndicator() {
231     View ret = new View(NDalicPINVOKE.ScrollBar_GetScrollIndicator(swigCPtr), true);
232     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
233     return ret;
234   }
235
236   public void SetScrollDirection(ScrollBar.Direction direction) {
237     NDalicPINVOKE.ScrollBar_SetScrollDirection(swigCPtr, (int)direction);
238     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
239   }
240
241   public ScrollBar.Direction GetScrollDirection() {
242     ScrollBar.Direction ret = (ScrollBar.Direction)NDalicPINVOKE.ScrollBar_GetScrollDirection(swigCPtr);
243     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
244     return ret;
245   }
246
247   private void SetIndicatorHeightPolicy(ScrollBar.IndicatorHeightPolicyType policy) {
248     NDalicPINVOKE.ScrollBar_SetIndicatorHeightPolicy(swigCPtr, (int)policy);
249     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
250   }
251
252   private ScrollBar.IndicatorHeightPolicyType GetIndicatorHeightPolicy() {
253     ScrollBar.IndicatorHeightPolicyType ret = (ScrollBar.IndicatorHeightPolicyType)NDalicPINVOKE.ScrollBar_GetIndicatorHeightPolicy(swigCPtr);
254     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
255     return ret;
256   }
257
258   private void SetIndicatorFixedHeight(float height) {
259     NDalicPINVOKE.ScrollBar_SetIndicatorFixedHeight(swigCPtr, height);
260     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
261   }
262
263   private float GetIndicatorFixedHeight() {
264     float ret = NDalicPINVOKE.ScrollBar_GetIndicatorFixedHeight(swigCPtr);
265     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
266     return ret;
267   }
268
269   private void SetIndicatorShowDuration(float durationSeconds) {
270     NDalicPINVOKE.ScrollBar_SetIndicatorShowDuration(swigCPtr, durationSeconds);
271     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
272   }
273
274   private float GetIndicatorShowDuration() {
275     float ret = NDalicPINVOKE.ScrollBar_GetIndicatorShowDuration(swigCPtr);
276     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
277     return ret;
278   }
279
280   private void SetIndicatorHideDuration(float durationSeconds) {
281     NDalicPINVOKE.ScrollBar_SetIndicatorHideDuration(swigCPtr, durationSeconds);
282     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
283   }
284
285   private float GetIndicatorHideDuration() {
286     float ret = NDalicPINVOKE.ScrollBar_GetIndicatorHideDuration(swigCPtr);
287     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
288     return ret;
289   }
290
291   public void ShowIndicator() {
292     NDalicPINVOKE.ScrollBar_ShowIndicator(swigCPtr);
293     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
294   }
295
296   public void HideIndicator() {
297     NDalicPINVOKE.ScrollBar_HideIndicator(swigCPtr);
298     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
299   }
300
301   internal VoidSignal PanFinishedSignal() {
302     VoidSignal ret = new VoidSignal(NDalicPINVOKE.ScrollBar_PanFinishedSignal(swigCPtr), false);
303     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
304     return ret;
305   }
306
307   internal FloatSignal ScrollPositionIntervalReachedSignal() {
308     FloatSignal ret = new FloatSignal(NDalicPINVOKE.ScrollBar_ScrollPositionIntervalReachedSignal(swigCPtr), false);
309     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
310     return ret;
311   }
312
313   public enum Direction {
314     Vertical = 0,
315     Horizontal
316   }
317
318   public enum IndicatorHeightPolicyType {
319     Variable = 0,
320     Fixed
321   }
322
323   public string ScrollDirection
324   {
325     get
326     {
327       string temp;
328       GetProperty( ScrollBar.Property.SCROLL_DIRECTION).Get( out temp );
329       return temp;
330     }
331     set
332     {
333       SetProperty( ScrollBar.Property.SCROLL_DIRECTION, new Dali.Property.Value( value ) );
334     }
335   }
336   public string IndicatorHeightPolicy
337   {
338     get
339     {
340       string temp;
341       GetProperty( ScrollBar.Property.INDICATOR_HEIGHT_POLICY).Get( out temp );
342       return temp;
343     }
344     set
345     {
346       SetProperty( ScrollBar.Property.INDICATOR_HEIGHT_POLICY, new Dali.Property.Value( value ) );
347     }
348   }
349   public float IndicatorFixedHeight
350   {
351     get
352     {
353       float temp = 0.0f;
354       GetProperty( ScrollBar.Property.INDICATOR_FIXED_HEIGHT).Get( out temp );
355       return temp;
356     }
357     set
358     {
359       SetProperty( ScrollBar.Property.INDICATOR_FIXED_HEIGHT, new Dali.Property.Value( value ) );
360     }
361   }
362   public float IndicatorShowDuration
363   {
364     get
365     {
366       float temp = 0.0f;
367       GetProperty( ScrollBar.Property.INDICATOR_SHOW_DURATION).Get( out temp );
368       return temp;
369     }
370     set
371     {
372       SetProperty( ScrollBar.Property.INDICATOR_SHOW_DURATION, new Dali.Property.Value( value ) );
373     }
374   }
375   public float IndicatorHideDuration
376   {
377     get
378     {
379       float temp = 0.0f;
380       GetProperty( ScrollBar.Property.INDICATOR_HIDE_DURATION).Get( out temp );
381       return temp;
382     }
383     set
384     {
385       SetProperty( ScrollBar.Property.INDICATOR_HIDE_DURATION, new Dali.Property.Value( value ) );
386     }
387   }
388   public Dali.Property.Array ScrollPositionIntervals
389   {
390     get
391     {
392       Dali.Property.Array temp = new Dali.Property.Array();
393       GetProperty( ScrollBar.Property.SCROLL_POSITION_INTERVALS).Get(  temp );
394       return temp;
395     }
396     set
397     {
398       SetProperty( ScrollBar.Property.SCROLL_POSITION_INTERVALS, new Dali.Property.Value( value ) );
399     }
400   }
401   public float IndicatorMinimumHeight
402   {
403     get
404     {
405       float temp = 0.0f;
406       GetProperty( ScrollBar.Property.INDICATOR_MINIMUM_HEIGHT).Get( out temp );
407       return temp;
408     }
409     set
410     {
411       SetProperty( ScrollBar.Property.INDICATOR_MINIMUM_HEIGHT, new Dali.Property.Value( value ) );
412     }
413   }
414   public float IndicatorStartPadding
415   {
416     get
417     {
418       float temp = 0.0f;
419       GetProperty( ScrollBar.Property.INDICATOR_START_PADDING).Get( out temp );
420       return temp;
421     }
422     set
423     {
424       SetProperty( ScrollBar.Property.INDICATOR_START_PADDING, new Dali.Property.Value( value ) );
425     }
426   }
427   public float IndicatorEndPadding
428   {
429     get
430     {
431       float temp = 0.0f;
432       GetProperty( ScrollBar.Property.INDICATOR_END_PADDING).Get( out temp );
433       return temp;
434     }
435     set
436     {
437       SetProperty( ScrollBar.Property.INDICATOR_END_PADDING, new Dali.Property.Value( value ) );
438     }
439   }
440
441 }
442
443 }