New directory structure for C#
[platform/core/uifw/dali-toolkit.git] / plugins / dali-sharp / sharp / internal / ProgressBar.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 ProgressBar : View {
34   private global::System.Runtime.InteropServices.HandleRef swigCPtr;
35
36   internal ProgressBar(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.ProgressBar_SWIGUpcast(cPtr), cMemoryOwn) {
37     swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
38   }
39
40   internal static global::System.Runtime.InteropServices.HandleRef getCPtr(ProgressBar obj) {
41     return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
42   }
43
44   ~ProgressBar() {
45     DisposeQueue.Instance.Add(this);
46   }
47
48   public override void Dispose() {
49     if (!Stage.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_ProgressBar(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 public class ValueChangedEventArgs : EventArgs
70 {
71    private ProgressBar _progressBar;
72    private float _progressValue;
73    private float _secondaryProgressValue;
74
75    public ProgressBar ProgressBar
76    {
77       get
78       {
79          return _progressBar;
80       }
81       set
82       {
83          _progressBar = value;
84       }
85    }
86
87    public float ProgressValue
88    {
89       get
90       {
91          return _progressValue;
92       }
93       set
94       {
95          _progressValue = value;
96       }
97    }
98
99    public float SecondaryProgressValue
100    {
101       get
102       {
103          return _secondaryProgressValue;
104       }
105       set
106       {
107          _secondaryProgressValue = value;
108       }
109    }
110
111 }
112
113   [UnmanagedFunctionPointer(CallingConvention.StdCall)]
114   private delegate void ValueChangedCallbackDelegate(IntPtr progressBar, float progressValue, float secondaryProgressValue);
115   private DaliEventHandler<object,ValueChangedEventArgs> _progressBarValueChangedEventHandler;
116   private ValueChangedCallbackDelegate _progressBarValueChangedCallbackDelegate;
117
118   public event DaliEventHandler<object,ValueChangedEventArgs> ValueChanged
119   {
120      add
121      {
122         lock(this)
123         {
124            // Restricted to only one listener
125            if (_progressBarValueChangedEventHandler == null)
126            {
127               _progressBarValueChangedEventHandler += value;
128
129               _progressBarValueChangedCallbackDelegate = new ValueChangedCallbackDelegate(OnValueChanged);
130               this.ValueChangedSignal().Connect(_progressBarValueChangedCallbackDelegate);
131            }
132         }
133      }
134
135      remove
136      {
137         lock(this)
138         {
139            if (_progressBarValueChangedEventHandler != null)
140            {
141               this.ValueChangedSignal().Disconnect(_progressBarValueChangedCallbackDelegate);
142            }
143
144            _progressBarValueChangedEventHandler -= value;
145         }
146      }
147   }
148
149   // Callback for ProgressBar ValueChanged signal
150   private void OnValueChanged(IntPtr progressBar, float progressValue, float secondaryProgressValue)
151   {
152      ValueChangedEventArgs e = new ValueChangedEventArgs();
153
154      // Populate all members of "e" (ValueChangedEventArgs) with real page
155      e.ProgressBar = ProgressBar.GetProgressBarFromPtr( progressBar );
156      e.ProgressValue = progressValue;
157      e.SecondaryProgressValue = secondaryProgressValue;
158
159      if (_progressBarValueChangedEventHandler != null)
160      {
161        _progressBarValueChangedEventHandler(this, e);
162      }
163   }
164
165   public static ProgressBar GetProgressBarFromPtr(global::System.IntPtr cPtr) {
166     ProgressBar ret = new ProgressBar(cPtr, false);
167    if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
168     return ret;
169   }
170
171
172   public class Property : global::System.IDisposable {
173     private global::System.Runtime.InteropServices.HandleRef swigCPtr;
174     protected bool swigCMemOwn;
175   
176     internal Property(global::System.IntPtr cPtr, bool cMemoryOwn) {
177       swigCMemOwn = cMemoryOwn;
178       swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
179     }
180   
181     internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Property obj) {
182       return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
183     }
184   
185     ~Property() {
186       Dispose();
187     }
188   
189     public virtual void Dispose() {
190       lock(this) {
191         if (swigCPtr.Handle != global::System.IntPtr.Zero) {
192           if (swigCMemOwn) {
193             swigCMemOwn = false;
194             NDalicPINVOKE.delete_ProgressBar_Property(swigCPtr);
195           }
196           swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
197         }
198         global::System.GC.SuppressFinalize(this);
199       }
200     }
201   
202     public Property() : this(NDalicPINVOKE.new_ProgressBar_Property(), true) {
203       if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
204     }
205   
206     public static readonly int PROGRESS_VALUE = NDalicPINVOKE.ProgressBar_Property_PROGRESS_VALUE_get();
207     public static readonly int SECONDARY_PROGRESS_VALUE = NDalicPINVOKE.ProgressBar_Property_SECONDARY_PROGRESS_VALUE_get();
208     public static readonly int INDETERMINATE = NDalicPINVOKE.ProgressBar_Property_INDETERMINATE_get();
209     public static readonly int TRACK_VISUAL = NDalicPINVOKE.ProgressBar_Property_TRACK_VISUAL_get();
210     public static readonly int PROGRESS_VISUAL = NDalicPINVOKE.ProgressBar_Property_PROGRESS_VISUAL_get();
211     public static readonly int SECONDARY_PROGRESS_VISUAL = NDalicPINVOKE.ProgressBar_Property_SECONDARY_PROGRESS_VISUAL_get();
212     public static readonly int INDETERMINATE_VISUAL = NDalicPINVOKE.ProgressBar_Property_INDETERMINATE_VISUAL_get();
213     public static readonly int INDETERMINATE_VISUAL_ANIMATION = NDalicPINVOKE.ProgressBar_Property_INDETERMINATE_VISUAL_ANIMATION_get();
214     public static readonly int LABEL_VISUAL = NDalicPINVOKE.ProgressBar_Property_LABEL_VISUAL_get();
215   
216   }
217
218   public ProgressBar () : this (NDalicPINVOKE.ProgressBar_New(), true) {
219       if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
220
221   }
222   public ProgressBar(ProgressBar handle) : this(NDalicPINVOKE.new_ProgressBar__SWIG_1(ProgressBar.getCPtr(handle)), true) {
223     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
224   }
225
226   public ProgressBar Assign(ProgressBar handle) {
227     ProgressBar ret = new ProgressBar(NDalicPINVOKE.ProgressBar_Assign(swigCPtr, ProgressBar.getCPtr(handle)), false);
228     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
229     return ret;
230   }
231
232   public new static ProgressBar DownCast(BaseHandle handle) {
233     ProgressBar ret = new ProgressBar(NDalicPINVOKE.ProgressBar_DownCast(BaseHandle.getCPtr(handle)), true);
234     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
235     return ret;
236   }
237
238   public ProgressBarValueChangedSignal ValueChangedSignal() {
239     ProgressBarValueChangedSignal ret = new ProgressBarValueChangedSignal(NDalicPINVOKE.ProgressBar_ValueChangedSignal(swigCPtr), false);
240     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
241     return ret;
242   }
243
244   public enum PropertyRange {
245     PROPERTY_START_INDEX = PropertyRanges.PROPERTY_REGISTRATION_START_INDEX,
246     PROPERTY_END_INDEX = View.PropertyRange.PROPERTY_START_INDEX+1000
247   }
248
249   public float ProgressValue
250   {
251     get
252     {
253       float temp = 0.0f;
254       GetProperty( ProgressBar.Property.PROGRESS_VALUE).Get( ref temp );
255       return temp;
256     }
257     set
258     {
259       SetProperty( ProgressBar.Property.PROGRESS_VALUE, new Dali.Property.Value( value ) );
260     }
261   }
262   public float SecondaryProgressValue
263   {
264     get
265     {
266       float temp = 0.0f;
267       GetProperty( ProgressBar.Property.SECONDARY_PROGRESS_VALUE).Get( ref temp );
268       return temp;
269     }
270     set
271     {
272       SetProperty( ProgressBar.Property.SECONDARY_PROGRESS_VALUE, new Dali.Property.Value( value ) );
273     }
274   }
275   public bool Indeterminate
276   {
277     get
278     {
279       bool temp = false;
280       GetProperty( ProgressBar.Property.INDETERMINATE).Get( ref temp );
281       return temp;
282     }
283     set
284     {
285       SetProperty( ProgressBar.Property.INDETERMINATE, new Dali.Property.Value( value ) );
286     }
287   }
288   public Dali.Property.Map TrackVisual
289   {
290     get
291     {
292       Dali.Property.Map temp = new Dali.Property.Map();
293       GetProperty( ProgressBar.Property.TRACK_VISUAL).Get(  temp );
294       return temp;
295     }
296     set
297     {
298       SetProperty( ProgressBar.Property.TRACK_VISUAL, new Dali.Property.Value( value ) );
299     }
300   }
301   public Dali.Property.Map ProgressVisual
302   {
303     get
304     {
305       Dali.Property.Map temp = new Dali.Property.Map();
306       GetProperty( ProgressBar.Property.PROGRESS_VISUAL).Get(  temp );
307       return temp;
308     }
309     set
310     {
311       SetProperty( ProgressBar.Property.PROGRESS_VISUAL, new Dali.Property.Value( value ) );
312     }
313   }
314   public Dali.Property.Map SecondaryProgressVisual
315   {
316     get
317     {
318       Dali.Property.Map temp = new Dali.Property.Map();
319       GetProperty( ProgressBar.Property.SECONDARY_PROGRESS_VISUAL).Get(  temp );
320       return temp;
321     }
322     set
323     {
324       SetProperty( ProgressBar.Property.SECONDARY_PROGRESS_VISUAL, new Dali.Property.Value( value ) );
325     }
326   }
327   public Dali.Property.Map IndeterminateVisual
328   {
329     get
330     {
331       Dali.Property.Map temp = new Dali.Property.Map();
332       GetProperty( ProgressBar.Property.INDETERMINATE_VISUAL).Get(  temp );
333       return temp;
334     }
335     set
336     {
337       SetProperty( ProgressBar.Property.INDETERMINATE_VISUAL, new Dali.Property.Value( value ) );
338     }
339   }
340   public Dali.Property.Array IndeterminateVisualAnimation
341   {
342     get
343     {
344       Dali.Property.Array temp = new Dali.Property.Array();
345       GetProperty( ProgressBar.Property.INDETERMINATE_VISUAL_ANIMATION).Get(  temp );
346       return temp;
347     }
348     set
349     {
350       SetProperty( ProgressBar.Property.INDETERMINATE_VISUAL_ANIMATION, new Dali.Property.Value( value ) );
351     }
352   }
353   public Dali.Property.Map LabelVisual
354   {
355     get
356     {
357       Dali.Property.Map temp = new Dali.Property.Map();
358       GetProperty( ProgressBar.Property.LABEL_VISUAL).Get(  temp );
359       return temp;
360     }
361     set
362     {
363       SetProperty( ProgressBar.Property.LABEL_VISUAL, new Dali.Property.Value( value ) );
364     }
365   }
366
367 }
368
369 }