1 /** Copyright (c) 2017 Samsung Electronics Co., Ltd.
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
7 * http://www.apache.org/licenses/LICENSE-2.0
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.
16 // This File has been auto-generated by SWIG and then modified using DALi Ruby Scripts
17 //------------------------------------------------------------------------------
20 // This file was automatically generated by SWIG (http://www.swig.org).
23 // Do not make changes to this file unless you know what you are doing--modify
24 // the SWIG interface file instead.
25 //------------------------------------------------------------------------------
31 using System.Runtime.InteropServices;
35 /// ProgressBar is a control to give the user an indication of the progress of an operation.
37 public class ProgressBar : View
39 private global::System.Runtime.InteropServices.HandleRef swigCPtr;
41 internal ProgressBar(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.ProgressBar_SWIGUpcast(cPtr), cMemoryOwn)
43 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
46 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(ProgressBar obj)
48 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
53 DisposeQueue.Instance.Add(this);
56 public override void Dispose()
58 if (!Stage.IsInstalled())
60 DisposeQueue.Instance.Add(this);
66 if (swigCPtr.Handle != global::System.IntPtr.Zero)
71 NDalicPINVOKE.delete_ProgressBar(swigCPtr);
73 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
75 global::System.GC.SuppressFinalize(this);
83 /// Event arguments that passed via ValueChangedEventArgs
85 public class ValueChangedEventArgs : EventArgs
87 private ProgressBar _progressBar;
88 private float _progressValue;
89 private float _secondaryProgressValue;
91 public ProgressBar ProgressBar
103 public float ProgressValue
107 return _progressValue;
111 _progressValue = value;
115 public float SecondaryProgressValue
119 return _secondaryProgressValue;
123 _secondaryProgressValue = value;
129 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
130 private delegate void ValueChangedCallbackDelegate(IntPtr progressBar, float progressValue, float secondaryProgressValue);
131 private EventHandler<ValueChangedEventArgs> _progressBarValueChangedEventHandler;
132 private ValueChangedCallbackDelegate _progressBarValueChangedCallbackDelegate;
135 /// Event is sent when the ProgressBar value changes.
137 public event EventHandler<ValueChangedEventArgs> ValueChanged
141 if (_progressBarValueChangedEventHandler == null)
143 _progressBarValueChangedCallbackDelegate = (OnValueChanged);
144 ValueChangedSignal().Connect(_progressBarValueChangedCallbackDelegate);
146 _progressBarValueChangedEventHandler += value;
150 _progressBarValueChangedEventHandler -= value;
151 if (_progressBarValueChangedEventHandler == null && _progressBarValueChangedCallbackDelegate != null)
153 ValueChangedSignal().Disconnect(_progressBarValueChangedCallbackDelegate);
158 // Callback for ProgressBar ValueChanged signal
159 private void OnValueChanged(IntPtr progressBar, float progressValue, float secondaryProgressValue)
161 ValueChangedEventArgs e = new ValueChangedEventArgs();
163 // Populate all members of "e" (ValueChangedEventArgs) with real page
164 e.ProgressBar = ProgressBar.GetProgressBarFromPtr(progressBar);
165 e.ProgressValue = progressValue;
166 e.SecondaryProgressValue = secondaryProgressValue;
168 if (_progressBarValueChangedEventHandler != null)
170 _progressBarValueChangedEventHandler(this, e);
176 internal static ProgressBar GetProgressBarFromPtr(global::System.IntPtr cPtr)
178 ProgressBar ret = new ProgressBar(cPtr, false);
179 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
184 internal class Property : global::System.IDisposable
186 private global::System.Runtime.InteropServices.HandleRef swigCPtr;
187 protected bool swigCMemOwn;
189 internal Property(global::System.IntPtr cPtr, bool cMemoryOwn)
191 swigCMemOwn = cMemoryOwn;
192 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
195 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Property obj)
197 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
205 public virtual void Dispose()
209 if (swigCPtr.Handle != global::System.IntPtr.Zero)
214 NDalicPINVOKE.delete_ProgressBar_Property(swigCPtr);
216 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
218 global::System.GC.SuppressFinalize(this);
222 internal Property() : this(NDalicPINVOKE.new_ProgressBar_Property(), true)
224 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
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();
240 /// Creates the ProgressBar.
242 public ProgressBar() : this(NDalicPINVOKE.ProgressBar_New(), true)
244 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
247 internal ProgressBar(ProgressBar handle) : this(NDalicPINVOKE.new_ProgressBar__SWIG_1(ProgressBar.getCPtr(handle)), true)
249 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
252 internal ProgressBar Assign(ProgressBar handle)
254 ProgressBar ret = new ProgressBar(NDalicPINVOKE.ProgressBar_Assign(swigCPtr, ProgressBar.getCPtr(handle)), false);
255 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
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.
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)
268 ProgressBar ret = new ProgressBar(NDalicPINVOKE.ProgressBar_DownCast(BaseHandle.getCPtr(handle)), true);
269 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
273 internal ProgressBarValueChangedSignal ValueChangedSignal()
275 ProgressBarValueChangedSignal ret = new ProgressBarValueChangedSignal(NDalicPINVOKE.ProgressBar_ValueChangedSignal(swigCPtr), false);
276 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
280 internal enum PropertyRange
282 PROPERTY_START_INDEX = PropertyRanges.PROPERTY_REGISTRATION_START_INDEX,
283 PROPERTY_END_INDEX = View.PropertyRange.PROPERTY_START_INDEX + 1000
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.
292 public float ProgressValue
297 GetProperty(ProgressBar.Property.PROGRESS_VALUE).Get(ref temp);
302 SetProperty(ProgressBar.Property.PROGRESS_VALUE, new Tizen.NUI.PropertyValue(value));
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.
312 public float SecondaryProgressValue
317 GetProperty(ProgressBar.Property.SECONDARY_PROGRESS_VALUE).Get(ref temp);
322 SetProperty(ProgressBar.Property.SECONDARY_PROGRESS_VALUE, new Tizen.NUI.PropertyValue(value));
326 /// Sets the progress-bar as \e indeterminate state.
328 public bool Indeterminate
333 GetProperty(ProgressBar.Property.INDETERMINATE).Get(ref temp);
338 SetProperty(ProgressBar.Property.INDETERMINATE, new Tizen.NUI.PropertyValue(value));
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.
345 public Tizen.NUI.PropertyMap TrackVisual
349 Tizen.NUI.PropertyMap temp = new Tizen.NUI.PropertyMap();
350 GetProperty(ProgressBar.Property.TRACK_VISUAL).Get(temp);
355 SetProperty(ProgressBar.Property.TRACK_VISUAL, new Tizen.NUI.PropertyValue(value));
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.
362 public Tizen.NUI.PropertyMap ProgressVisual
366 Tizen.NUI.PropertyMap temp = new Tizen.NUI.PropertyMap();
367 GetProperty(ProgressBar.Property.PROGRESS_VISUAL).Get(temp);
372 SetProperty(ProgressBar.Property.PROGRESS_VISUAL, new Tizen.NUI.PropertyValue(value));
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.
379 public Tizen.NUI.PropertyMap SecondaryProgressVisual
383 Tizen.NUI.PropertyMap temp = new Tizen.NUI.PropertyMap();
384 GetProperty(ProgressBar.Property.SECONDARY_PROGRESS_VISUAL).Get(temp);
389 SetProperty(ProgressBar.Property.SECONDARY_PROGRESS_VISUAL, new Tizen.NUI.PropertyValue(value));
393 /// The indeterminate visual of progress bar.
394 /// Optional. If not supplied, the default inditerminate visual will be shown.
396 public Tizen.NUI.PropertyMap IndeterminateVisual
400 Tizen.NUI.PropertyMap temp = new Tizen.NUI.PropertyMap();
401 GetProperty(ProgressBar.Property.INDETERMINATE_VISUAL).Get(temp);
406 SetProperty(ProgressBar.Property.INDETERMINATE_VISUAL, new Tizen.NUI.PropertyValue(value));
410 /// The transition data for indeterminate visual animation.
411 /// Optional. If not supplied, default animation will be played.
413 public Tizen.NUI.PropertyArray IndeterminateVisualAnimation
417 Tizen.NUI.PropertyArray temp = new Tizen.NUI.PropertyArray();
418 GetProperty(ProgressBar.Property.INDETERMINATE_VISUAL_ANIMATION).Get(temp);
423 SetProperty(ProgressBar.Property.INDETERMINATE_VISUAL_ANIMATION, new Tizen.NUI.PropertyValue(value));
427 /// The Label visual of progress bar.
429 public Tizen.NUI.PropertyMap LabelVisual
433 Tizen.NUI.PropertyMap temp = new Tizen.NUI.PropertyMap();
434 GetProperty(ProgressBar.Property.LABEL_VISUAL).Get(temp);
439 SetProperty(ProgressBar.Property.LABEL_VISUAL, new Tizen.NUI.PropertyValue(value));