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 //------------------------------------------------------------------------------
27 namespace Tizen.NUI.UIComponents
31 using System.Runtime.InteropServices;
32 using Tizen.NUI.BaseComponents;
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;
52 /// To make ProgressBar instance be disposed.
54 public override void Dispose()
56 if (!Window.IsInstalled())
58 DisposeQueue.Instance.Add(this);
64 if (swigCPtr.Handle != global::System.IntPtr.Zero)
69 NDalicPINVOKE.delete_ProgressBar(swigCPtr);
71 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
73 global::System.GC.SuppressFinalize(this);
81 /// Event arguments that passed via ValueChangedEventArgs
83 public class ValueChangedEventArgs : EventArgs
85 private ProgressBar _progressBar;
86 private float _progressValue;
87 private float _secondaryProgressValue;
89 public ProgressBar ProgressBar
101 public float ProgressValue
105 return _progressValue;
109 _progressValue = value;
113 public float SecondaryProgressValue
117 return _secondaryProgressValue;
121 _secondaryProgressValue = value;
127 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
128 private delegate void ValueChangedCallbackDelegate(IntPtr progressBar, float progressValue, float secondaryProgressValue);
129 private EventHandler<ValueChangedEventArgs> _progressBarValueChangedEventHandler;
130 private ValueChangedCallbackDelegate _progressBarValueChangedCallbackDelegate;
133 /// Event is sent when the ProgressBar value changes.
135 public event EventHandler<ValueChangedEventArgs> ValueChanged
139 if (_progressBarValueChangedEventHandler == null)
141 _progressBarValueChangedCallbackDelegate = (OnValueChanged);
142 ValueChangedSignal().Connect(_progressBarValueChangedCallbackDelegate);
144 _progressBarValueChangedEventHandler += value;
148 _progressBarValueChangedEventHandler -= value;
149 if (_progressBarValueChangedEventHandler == null && ValueChangedSignal().Empty() == false)
151 ValueChangedSignal().Disconnect(_progressBarValueChangedCallbackDelegate);
156 // Callback for ProgressBar ValueChanged signal
157 private void OnValueChanged(IntPtr progressBar, float progressValue, float secondaryProgressValue)
159 ValueChangedEventArgs e = new ValueChangedEventArgs();
161 // Populate all members of "e" (ValueChangedEventArgs) with real page
162 e.ProgressBar = ProgressBar.GetProgressBarFromPtr(progressBar);
163 e.ProgressValue = progressValue;
164 e.SecondaryProgressValue = secondaryProgressValue;
166 if (_progressBarValueChangedEventHandler != null)
168 _progressBarValueChangedEventHandler(this, e);
174 internal static ProgressBar GetProgressBarFromPtr(global::System.IntPtr cPtr)
176 ProgressBar ret = new ProgressBar(cPtr, false);
177 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
182 internal class Property : global::System.IDisposable
184 private global::System.Runtime.InteropServices.HandleRef swigCPtr;
185 protected bool swigCMemOwn;
187 internal Property(global::System.IntPtr cPtr, bool cMemoryOwn)
189 swigCMemOwn = cMemoryOwn;
190 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
193 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Property obj)
195 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
203 public virtual void Dispose()
207 if (swigCPtr.Handle != global::System.IntPtr.Zero)
212 NDalicPINVOKE.delete_ProgressBar_Property(swigCPtr);
214 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
216 global::System.GC.SuppressFinalize(this);
220 internal Property() : this(NDalicPINVOKE.new_ProgressBar_Property(), true)
222 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
225 internal static readonly int PROGRESS_VALUE = NDalicPINVOKE.ProgressBar_Property_PROGRESS_VALUE_get();
226 internal static readonly int SECONDARY_PROGRESS_VALUE = NDalicPINVOKE.ProgressBar_Property_SECONDARY_PROGRESS_VALUE_get();
227 internal static readonly int INDETERMINATE = NDalicPINVOKE.ProgressBar_Property_INDETERMINATE_get();
228 internal static readonly int TRACK_VISUAL = NDalicPINVOKE.ProgressBar_Property_TRACK_VISUAL_get();
229 internal static readonly int PROGRESS_VISUAL = NDalicPINVOKE.ProgressBar_Property_PROGRESS_VISUAL_get();
230 internal static readonly int SECONDARY_PROGRESS_VISUAL = NDalicPINVOKE.ProgressBar_Property_SECONDARY_PROGRESS_VISUAL_get();
231 internal static readonly int INDETERMINATE_VISUAL = NDalicPINVOKE.ProgressBar_Property_INDETERMINATE_VISUAL_get();
232 internal static readonly int INDETERMINATE_VISUAL_ANIMATION = NDalicPINVOKE.ProgressBar_Property_INDETERMINATE_VISUAL_ANIMATION_get();
233 internal static readonly int LABEL_VISUAL = NDalicPINVOKE.ProgressBar_Property_LABEL_VISUAL_get();
238 /// Creates the ProgressBar.
240 public ProgressBar() : this(NDalicPINVOKE.ProgressBar_New(), true)
242 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
245 internal ProgressBar(ProgressBar handle) : this(NDalicPINVOKE.new_ProgressBar__SWIG_1(ProgressBar.getCPtr(handle)), true)
247 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
250 internal ProgressBar Assign(ProgressBar handle)
252 ProgressBar ret = new ProgressBar(NDalicPINVOKE.ProgressBar_Assign(swigCPtr, ProgressBar.getCPtr(handle)), false);
253 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
258 /// Downcasts a handle to ProgressBar handle.<br>
259 /// If handle points to a ProgressBar, the downcast produces valid handle.<br>
260 /// If not the returned handle is left uninitialized.<br>
262 /// <param name="handle">Handle to an object</param>
263 /// <returns>handle to a ProgressBar or an uninitialized handle</returns>
264 public new static ProgressBar DownCast(BaseHandle handle)
266 ProgressBar ret = new ProgressBar(NDalicPINVOKE.ProgressBar_DownCast(BaseHandle.getCPtr(handle)), true);
267 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
271 internal ProgressBarValueChangedSignal ValueChangedSignal()
273 ProgressBarValueChangedSignal ret = new ProgressBarValueChangedSignal(NDalicPINVOKE.ProgressBar_ValueChangedSignal(swigCPtr), false);
274 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
278 internal enum PropertyRange
280 PROPERTY_START_INDEX = PropertyRanges.PROPERTY_REGISTRATION_START_INDEX,
281 PROPERTY_END_INDEX = View.PropertyRange.PROPERTY_START_INDEX + 1000
285 /// The progress value of progress bar, progress runs form 0 to 1.<br>
286 /// If Value is set to 0, progress bar will be set to beginning.<br>
287 /// If Value is set to 1, progress bar will be set to end.<br>
288 /// Any Value outside of the range is ignored.<br>
290 public float ProgressValue
295 GetProperty(ProgressBar.Property.PROGRESS_VALUE).Get(ref temp);
300 SetProperty(ProgressBar.Property.PROGRESS_VALUE, new Tizen.NUI.PropertyValue(value));
304 /// The secondary progress value of progress bar, secondary progress runs form 0 to 1.<br>
305 /// Optional. If not supplied, the default is 0.<br>
306 /// If Value is set to 0, progress bar will be set secondary progress to beginning.<br>
307 /// If Value is set to 1, progress bar will be set secondary progress to end.<br>
308 /// Any Value outside of the range is ignored.<br>
310 public float SecondaryProgressValue
315 GetProperty(ProgressBar.Property.SECONDARY_PROGRESS_VALUE).Get(ref temp);
320 SetProperty(ProgressBar.Property.SECONDARY_PROGRESS_VALUE, new Tizen.NUI.PropertyValue(value));
324 /// Sets the progress-bar as \e indeterminate state.
326 public bool Indeterminate
331 GetProperty(ProgressBar.Property.INDETERMINATE).Get(ref temp);
336 SetProperty(ProgressBar.Property.INDETERMINATE, new Tizen.NUI.PropertyValue(value));
340 /// The track Visual value of progress bar, it's a full progress area and it's shown behind PROGRESS_VISUAL.<br>
341 /// Optional. If not supplied, the default track visual will be shown.<br>
343 public Tizen.NUI.PropertyMap TrackVisual
347 Tizen.NUI.PropertyMap temp = new Tizen.NUI.PropertyMap();
348 GetProperty(ProgressBar.Property.TRACK_VISUAL).Get(temp);
353 SetProperty(ProgressBar.Property.TRACK_VISUAL, new Tizen.NUI.PropertyValue(value));
357 /// The progress Visual value of progress bar, size of the progress visual is changed based on PROGRESS_VALUE.<br>
358 /// Optional. If not supplied, the default progress visual will be shown.<br>
360 public Tizen.NUI.PropertyMap ProgressVisual
364 Tizen.NUI.PropertyMap temp = new Tizen.NUI.PropertyMap();
365 GetProperty(ProgressBar.Property.PROGRESS_VISUAL).Get(temp);
370 SetProperty(ProgressBar.Property.PROGRESS_VISUAL, new Tizen.NUI.PropertyValue(value));
374 /// The secondary progress visual of progress bar, size of the secondary progress visual is changed based on SECONDARY_PROGRESS_VALUE.<br>
375 /// Optional. If not supplied, the secondary progress visual will not be shown.<br>
377 public Tizen.NUI.PropertyMap SecondaryProgressVisual
381 Tizen.NUI.PropertyMap temp = new Tizen.NUI.PropertyMap();
382 GetProperty(ProgressBar.Property.SECONDARY_PROGRESS_VISUAL).Get(temp);
387 SetProperty(ProgressBar.Property.SECONDARY_PROGRESS_VISUAL, new Tizen.NUI.PropertyValue(value));
391 /// The indeterminate visual of progress bar.<br>
392 /// Optional. If not supplied, the default inditerminate visual will be shown.<br>
394 public Tizen.NUI.PropertyMap IndeterminateVisual
398 Tizen.NUI.PropertyMap temp = new Tizen.NUI.PropertyMap();
399 GetProperty(ProgressBar.Property.INDETERMINATE_VISUAL).Get(temp);
404 SetProperty(ProgressBar.Property.INDETERMINATE_VISUAL, new Tizen.NUI.PropertyValue(value));
408 /// The transition data for indeterminate visual animation.<br>
409 /// Optional. If not supplied, default animation will be played.<br>
411 public Tizen.NUI.PropertyArray IndeterminateVisualAnimation
415 Tizen.NUI.PropertyArray temp = new Tizen.NUI.PropertyArray();
416 GetProperty(ProgressBar.Property.INDETERMINATE_VISUAL_ANIMATION).Get(temp);
421 SetProperty(ProgressBar.Property.INDETERMINATE_VISUAL_ANIMATION, new Tizen.NUI.PropertyValue(value));
425 /// The Label visual of progress bar.
427 public Tizen.NUI.PropertyMap LabelVisual
431 Tizen.NUI.PropertyMap temp = new Tizen.NUI.PropertyMap();
432 GetProperty(ProgressBar.Property.LABEL_VISUAL).Get(temp);
437 SetProperty(ProgressBar.Property.LABEL_VISUAL, new Tizen.NUI.PropertyValue(value));