to resolve TCT issues
[platform/core/csapi/nui.git] / Tizen.NUI / src / public / 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.9
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 Tizen.NUI
28 {
29
30     using System;
31     using System.Runtime.InteropServices;
32
33
34     /// <summary>
35     /// ProgressBar is a control to give the user an indication of the progress of an operation.
36     /// </summary>
37     public class ProgressBar : View
38     {
39         private global::System.Runtime.InteropServices.HandleRef swigCPtr;
40
41         internal ProgressBar(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.ProgressBar_SWIGUpcast(cPtr), cMemoryOwn)
42         {
43             swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
44         }
45
46         internal static global::System.Runtime.InteropServices.HandleRef getCPtr(ProgressBar obj)
47         {
48             return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
49         }
50
51         ~ProgressBar()
52         {
53             DisposeQueue.Instance.Add(this);
54         }
55
56         public override void Dispose()
57         {
58             if (!Stage.IsInstalled())
59             {
60                 DisposeQueue.Instance.Add(this);
61                 return;
62             }
63
64             lock (this)
65             {
66                 if (swigCPtr.Handle != global::System.IntPtr.Zero)
67                 {
68                     if (swigCMemOwn)
69                     {
70                         swigCMemOwn = false;
71                         NDalicPINVOKE.delete_ProgressBar(swigCPtr);
72                     }
73                     swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
74                 }
75                 global::System.GC.SuppressFinalize(this);
76                 base.Dispose();
77             }
78         }
79
80
81
82         /// <summary>
83         /// Event arguments that passed via ValueChangedEventArgs
84         /// </summary>
85         public class ValueChangedEventArgs : EventArgs
86         {
87             private ProgressBar _progressBar;
88             private float _progressValue;
89             private float _secondaryProgressValue;
90
91             public ProgressBar ProgressBar
92             {
93                 get
94                 {
95                     return _progressBar;
96                 }
97                 set
98                 {
99                     _progressBar = value;
100                 }
101             }
102
103             public float ProgressValue
104             {
105                 get
106                 {
107                     return _progressValue;
108                 }
109                 set
110                 {
111                     _progressValue = value;
112                 }
113             }
114
115             public float SecondaryProgressValue
116             {
117                 get
118                 {
119                     return _secondaryProgressValue;
120                 }
121                 set
122                 {
123                     _secondaryProgressValue = value;
124                 }
125             }
126
127         }
128
129         [UnmanagedFunctionPointer(CallingConvention.StdCall)]
130         private delegate void ValueChangedCallbackDelegate(IntPtr progressBar, float progressValue, float secondaryProgressValue);
131         private EventHandler<ValueChangedEventArgs> _progressBarValueChangedEventHandler;
132         private ValueChangedCallbackDelegate _progressBarValueChangedCallbackDelegate;
133
134         /// <summary>
135         /// Event is sent when the ProgressBar value changes.
136         /// </summary>
137         public event EventHandler<ValueChangedEventArgs> ValueChanged
138         {
139             add
140             {
141                 if (_progressBarValueChangedEventHandler == null)
142                 {
143                     _progressBarValueChangedCallbackDelegate = (OnValueChanged);
144                     ValueChangedSignal().Connect(_progressBarValueChangedCallbackDelegate);
145                 }
146                 _progressBarValueChangedEventHandler += value;
147             }
148             remove
149             {
150                 _progressBarValueChangedEventHandler -= value;
151                 if (_progressBarValueChangedEventHandler == null && _progressBarValueChangedCallbackDelegate != null)
152                 {
153                     ValueChangedSignal().Disconnect(_progressBarValueChangedCallbackDelegate);
154                 }
155             }
156         }
157
158         // Callback for ProgressBar ValueChanged signal
159         private void OnValueChanged(IntPtr progressBar, float progressValue, float secondaryProgressValue)
160         {
161             ValueChangedEventArgs e = new ValueChangedEventArgs();
162
163             // Populate all members of "e" (ValueChangedEventArgs) with real page
164             e.ProgressBar = ProgressBar.GetProgressBarFromPtr(progressBar);
165             e.ProgressValue = progressValue;
166             e.SecondaryProgressValue = secondaryProgressValue;
167
168             if (_progressBarValueChangedEventHandler != null)
169             {
170                 _progressBarValueChangedEventHandler(this, e);
171             }
172         }
173
174         /// <summary>
175         /// </summary>
176         internal static ProgressBar GetProgressBarFromPtr(global::System.IntPtr cPtr)
177         {
178             ProgressBar ret = new ProgressBar(cPtr, false);
179             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
180             return ret;
181         }
182
183
184         internal class Property : global::System.IDisposable
185         {
186             private global::System.Runtime.InteropServices.HandleRef swigCPtr;
187             protected bool swigCMemOwn;
188
189             internal Property(global::System.IntPtr cPtr, bool cMemoryOwn)
190             {
191                 swigCMemOwn = cMemoryOwn;
192                 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
193             }
194
195             internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Property obj)
196             {
197                 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
198             }
199
200             ~Property()
201             {
202                 Dispose();
203             }
204
205             public virtual void Dispose()
206             {
207                 lock (this)
208                 {
209                     if (swigCPtr.Handle != global::System.IntPtr.Zero)
210                     {
211                         if (swigCMemOwn)
212                         {
213                             swigCMemOwn = false;
214                             NDalicPINVOKE.delete_ProgressBar_Property(swigCPtr);
215                         }
216                         swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
217                     }
218                     global::System.GC.SuppressFinalize(this);
219                 }
220             }
221
222             internal Property() : this(NDalicPINVOKE.new_ProgressBar_Property(), true)
223             {
224                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
225             }
226
227             internal static readonly int PROGRESS_VALUE = NDalicPINVOKE.ProgressBar_Property_PROGRESS_VALUE_get();
228             internal static readonly int SECONDARY_PROGRESS_VALUE = NDalicPINVOKE.ProgressBar_Property_SECONDARY_PROGRESS_VALUE_get();
229             internal static readonly int INDETERMINATE = NDalicPINVOKE.ProgressBar_Property_INDETERMINATE_get();
230             internal static readonly int TRACK_VISUAL = NDalicPINVOKE.ProgressBar_Property_TRACK_VISUAL_get();
231             internal static readonly int PROGRESS_VISUAL = NDalicPINVOKE.ProgressBar_Property_PROGRESS_VISUAL_get();
232             internal static readonly int SECONDARY_PROGRESS_VISUAL = NDalicPINVOKE.ProgressBar_Property_SECONDARY_PROGRESS_VISUAL_get();
233             internal static readonly int INDETERMINATE_VISUAL = NDalicPINVOKE.ProgressBar_Property_INDETERMINATE_VISUAL_get();
234             internal static readonly int INDETERMINATE_VISUAL_ANIMATION = NDalicPINVOKE.ProgressBar_Property_INDETERMINATE_VISUAL_ANIMATION_get();
235             internal static readonly int LABEL_VISUAL = NDalicPINVOKE.ProgressBar_Property_LABEL_VISUAL_get();
236
237         }
238
239         /// <summary>
240         /// Creates the ProgressBar.
241         /// </summary>
242         public ProgressBar() : this(NDalicPINVOKE.ProgressBar_New(), true)
243         {
244             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
245
246         }
247         internal ProgressBar(ProgressBar handle) : this(NDalicPINVOKE.new_ProgressBar__SWIG_1(ProgressBar.getCPtr(handle)), true)
248         {
249             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
250         }
251
252         internal ProgressBar Assign(ProgressBar handle)
253         {
254             ProgressBar ret = new ProgressBar(NDalicPINVOKE.ProgressBar_Assign(swigCPtr, ProgressBar.getCPtr(handle)), false);
255             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
256             return ret;
257         }
258
259         /// <summary>
260         /// Downcasts a handle to ProgressBar handle.
261         /// If handle points to a ProgressBar, the downcast produces valid handle.
262         /// If not the returned handle is left uninitialized.
263         /// </summary>
264         /// <param name="handle">Handle to an object</param>
265         /// <returns>handle to a ProgressBar or an uninitialized handle</returns>
266         public new static ProgressBar DownCast(BaseHandle handle)
267         {
268             ProgressBar ret = new ProgressBar(NDalicPINVOKE.ProgressBar_DownCast(BaseHandle.getCPtr(handle)), true);
269             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
270             return ret;
271         }
272
273         internal ProgressBarValueChangedSignal ValueChangedSignal()
274         {
275             ProgressBarValueChangedSignal ret = new ProgressBarValueChangedSignal(NDalicPINVOKE.ProgressBar_ValueChangedSignal(swigCPtr), false);
276             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
277             return ret;
278         }
279
280         internal enum PropertyRange
281         {
282             PROPERTY_START_INDEX = PropertyRanges.PROPERTY_REGISTRATION_START_INDEX,
283             PROPERTY_END_INDEX = View.PropertyRange.PROPERTY_START_INDEX + 1000
284         }
285
286         /// <summary>
287         /// The progress value of progress bar, progress runs form 0 to 1.
288         /// If Value is set to 0, progress bar will be set to beginning.
289         /// If Value is set to 1, progress bar will be set to end.
290         /// Any Value outside of the range is ignored.
291         /// </summary>
292         public float ProgressValue
293         {
294             get
295             {
296                 float temp = 0.0f;
297                 GetProperty(ProgressBar.Property.PROGRESS_VALUE).Get(ref temp);
298                 return temp;
299             }
300             set
301             {
302                 SetProperty(ProgressBar.Property.PROGRESS_VALUE, new Tizen.NUI.PropertyValue(value));
303             }
304         }
305         /// <summary>
306         /// The secondary progress value of progress bar, secondary progress runs form 0 to 1.
307         /// Optional. If not supplied, the default is 0.
308         /// If Value is set to 0, progress bar will be set secondary progress to beginning.
309         /// If Value is set to 1, progress bar will be set secondary progress to end.
310         /// Any Value outside of the range is ignored.
311         /// </summary>
312         public float SecondaryProgressValue
313         {
314             get
315             {
316                 float temp = 0.0f;
317                 GetProperty(ProgressBar.Property.SECONDARY_PROGRESS_VALUE).Get(ref temp);
318                 return temp;
319             }
320             set
321             {
322                 SetProperty(ProgressBar.Property.SECONDARY_PROGRESS_VALUE, new Tizen.NUI.PropertyValue(value));
323             }
324         }
325         /// <summary>
326         /// Sets the progress-bar as \e indeterminate state.
327         /// </summary>
328         public bool Indeterminate
329         {
330             get
331             {
332                 bool temp = false;
333                 GetProperty(ProgressBar.Property.INDETERMINATE).Get(ref temp);
334                 return temp;
335             }
336             set
337             {
338                 SetProperty(ProgressBar.Property.INDETERMINATE, new Tizen.NUI.PropertyValue(value));
339             }
340         }
341         /// <summary>
342         /// The track Visual value of progress bar, it's a full progress area and it's shown behind PROGRESS_VISUAL.
343         /// Optional. If not supplied, the default track visual will be shown.
344         /// </summary>
345         public Tizen.NUI.PropertyMap TrackVisual
346         {
347             get
348             {
349                 Tizen.NUI.PropertyMap temp = new Tizen.NUI.PropertyMap();
350                 GetProperty(ProgressBar.Property.TRACK_VISUAL).Get(temp);
351                 return temp;
352             }
353             set
354             {
355                 SetProperty(ProgressBar.Property.TRACK_VISUAL, new Tizen.NUI.PropertyValue(value));
356             }
357         }
358         /// <summary>
359         /// The progress Visual value of progress bar, size of the progress visual is changed based on PROGRESS_VALUE.
360         /// Optional. If not supplied, the default progress visual will be shown.
361         /// </summary>
362         public Tizen.NUI.PropertyMap ProgressVisual
363         {
364             get
365             {
366                 Tizen.NUI.PropertyMap temp = new Tizen.NUI.PropertyMap();
367                 GetProperty(ProgressBar.Property.PROGRESS_VISUAL).Get(temp);
368                 return temp;
369             }
370             set
371             {
372                 SetProperty(ProgressBar.Property.PROGRESS_VISUAL, new Tizen.NUI.PropertyValue(value));
373             }
374         }
375         /// <summary>
376         /// The secondary progress visual of progress bar, size of the secondary progress visual is changed based on SECONDARY_PROGRESS_VALUE.
377         /// Optional. If not supplied, the secondary progress visual will not be shown.
378         /// </summary>
379         public Tizen.NUI.PropertyMap SecondaryProgressVisual
380         {
381             get
382             {
383                 Tizen.NUI.PropertyMap temp = new Tizen.NUI.PropertyMap();
384                 GetProperty(ProgressBar.Property.SECONDARY_PROGRESS_VISUAL).Get(temp);
385                 return temp;
386             }
387             set
388             {
389                 SetProperty(ProgressBar.Property.SECONDARY_PROGRESS_VISUAL, new Tizen.NUI.PropertyValue(value));
390             }
391         }
392         /// <summary>
393         /// The indeterminate visual of progress bar.
394         /// Optional. If not supplied, the default inditerminate visual will be shown.
395         /// </summary>
396         public Tizen.NUI.PropertyMap IndeterminateVisual
397         {
398             get
399             {
400                 Tizen.NUI.PropertyMap temp = new Tizen.NUI.PropertyMap();
401                 GetProperty(ProgressBar.Property.INDETERMINATE_VISUAL).Get(temp);
402                 return temp;
403             }
404             set
405             {
406                 SetProperty(ProgressBar.Property.INDETERMINATE_VISUAL, new Tizen.NUI.PropertyValue(value));
407             }
408         }
409         /// <summary>
410         /// The transition data for indeterminate visual animation.
411         /// Optional. If not supplied, default animation will be played.
412         /// </summary>
413         public Tizen.NUI.PropertyArray IndeterminateVisualAnimation
414         {
415             get
416             {
417                 Tizen.NUI.PropertyArray temp = new Tizen.NUI.PropertyArray();
418                 GetProperty(ProgressBar.Property.INDETERMINATE_VISUAL_ANIMATION).Get(temp);
419                 return temp;
420             }
421             set
422             {
423                 SetProperty(ProgressBar.Property.INDETERMINATE_VISUAL_ANIMATION, new Tizen.NUI.PropertyValue(value));
424             }
425         }
426         /// <summary>
427         /// The Label visual of progress bar.
428         /// </summary>
429         public Tizen.NUI.PropertyMap LabelVisual
430         {
431             get
432             {
433                 Tizen.NUI.PropertyMap temp = new Tizen.NUI.PropertyMap();
434                 GetProperty(ProgressBar.Property.LABEL_VISUAL).Get(temp);
435                 return temp;
436             }
437             set
438             {
439                 SetProperty(ProgressBar.Property.LABEL_VISUAL, new Tizen.NUI.PropertyValue(value));
440             }
441         }
442
443     }
444
445 }