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);
44 // By default, we do not want the position to use the anchor point
45 PositionUsesAnchorPoint = false;
48 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(ProgressBar obj)
50 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
54 /// To make ProgressBar instance be disposed.
56 protected override void Dispose(DisposeTypes type)
63 if (type == DisposeTypes.Explicit)
66 //Release your own managed resources here.
67 //You should release all of your own disposable objects here.
71 //Release your own unmanaged resources here.
72 //You should not access any managed member here except static instance.
73 //because the execution order of Finalizes is non-deterministic.
75 //Unreference this from if a static instance refer to this.
76 ViewRegistry.UnregisterView(this);
78 if (swigCPtr.Handle != global::System.IntPtr.Zero)
83 NDalicPINVOKE.delete_ProgressBar(swigCPtr);
85 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
93 /// Event arguments that passed via ValueChangedEventArgs
95 public class ValueChangedEventArgs : EventArgs
97 private ProgressBar _progressBar;
98 private float _progressValue;
99 private float _secondaryProgressValue;
101 public ProgressBar ProgressBar
109 _progressBar = value;
113 public float ProgressValue
117 return _progressValue;
121 _progressValue = value;
125 public float SecondaryProgressValue
129 return _secondaryProgressValue;
133 _secondaryProgressValue = value;
139 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
140 private delegate void ValueChangedCallbackDelegate(IntPtr progressBar, float progressValue, float secondaryProgressValue);
141 private EventHandler<ValueChangedEventArgs> _progressBarValueChangedEventHandler;
142 private ValueChangedCallbackDelegate _progressBarValueChangedCallbackDelegate;
145 /// Event is sent when the ProgressBar value changes.
147 public event EventHandler<ValueChangedEventArgs> ValueChanged
151 if (_progressBarValueChangedEventHandler == null)
153 _progressBarValueChangedCallbackDelegate = (OnValueChanged);
154 ValueChangedSignal().Connect(_progressBarValueChangedCallbackDelegate);
156 _progressBarValueChangedEventHandler += value;
160 _progressBarValueChangedEventHandler -= value;
161 if (_progressBarValueChangedEventHandler == null && ValueChangedSignal().Empty() == false)
163 ValueChangedSignal().Disconnect(_progressBarValueChangedCallbackDelegate);
168 // Callback for ProgressBar ValueChanged signal
169 private void OnValueChanged(IntPtr progressBar, float progressValue, float secondaryProgressValue)
171 ValueChangedEventArgs e = new ValueChangedEventArgs();
173 // Populate all members of "e" (ValueChangedEventArgs) with real page
174 e.ProgressBar = ProgressBar.GetProgressBarFromPtr(progressBar);
175 e.ProgressValue = progressValue;
176 e.SecondaryProgressValue = secondaryProgressValue;
178 if (_progressBarValueChangedEventHandler != null)
180 _progressBarValueChangedEventHandler(this, e);
186 internal static ProgressBar GetProgressBarFromPtr(global::System.IntPtr cPtr)
188 ProgressBar ret = new ProgressBar(cPtr, false);
189 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
194 internal class Property : global::System.IDisposable
196 private global::System.Runtime.InteropServices.HandleRef swigCPtr;
197 protected bool swigCMemOwn;
199 internal Property(global::System.IntPtr cPtr, bool cMemoryOwn)
201 swigCMemOwn = cMemoryOwn;
202 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
205 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Property obj)
207 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
210 //A Flag to check who called Dispose(). (By User or DisposeQueue)
211 private bool isDisposeQueued = false;
212 //A Flat to check if it is already disposed.
213 protected bool disposed = false;
218 if (!isDisposeQueued)
220 isDisposeQueued = true;
221 DisposeQueue.Instance.Add(this);
225 public void Dispose()
227 //Throw excpetion if Dispose() is called in separate thread.
228 if (!Window.IsInstalled())
230 throw new System.InvalidOperationException("This API called from separate thread. This API must be called from MainThread.");
235 Dispose(DisposeTypes.Implicit);
239 Dispose(DisposeTypes.Explicit);
240 System.GC.SuppressFinalize(this);
244 protected virtual void Dispose(DisposeTypes type)
251 if (type == DisposeTypes.Explicit)
254 //Release your own managed resources here.
255 //You should release all of your own disposable objects here.
259 //Release your own unmanaged resources here.
260 //You should not access any managed member here except static instance.
261 //because the execution order of Finalizes is non-deterministic.
263 if (swigCPtr.Handle != global::System.IntPtr.Zero)
268 NDalicPINVOKE.delete_ProgressBar_Property(swigCPtr);
270 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
276 internal Property() : this(NDalicPINVOKE.new_ProgressBar_Property(), true)
278 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
281 internal static readonly int PROGRESS_VALUE = NDalicPINVOKE.ProgressBar_Property_PROGRESS_VALUE_get();
282 internal static readonly int SECONDARY_PROGRESS_VALUE = NDalicPINVOKE.ProgressBar_Property_SECONDARY_PROGRESS_VALUE_get();
283 internal static readonly int INDETERMINATE = NDalicPINVOKE.ProgressBar_Property_INDETERMINATE_get();
284 internal static readonly int TRACK_VISUAL = NDalicPINVOKE.ProgressBar_Property_TRACK_VISUAL_get();
285 internal static readonly int PROGRESS_VISUAL = NDalicPINVOKE.ProgressBar_Property_PROGRESS_VISUAL_get();
286 internal static readonly int SECONDARY_PROGRESS_VISUAL = NDalicPINVOKE.ProgressBar_Property_SECONDARY_PROGRESS_VISUAL_get();
287 internal static readonly int INDETERMINATE_VISUAL = NDalicPINVOKE.ProgressBar_Property_INDETERMINATE_VISUAL_get();
288 internal static readonly int INDETERMINATE_VISUAL_ANIMATION = NDalicPINVOKE.ProgressBar_Property_INDETERMINATE_VISUAL_ANIMATION_get();
289 internal static readonly int LABEL_VISUAL = NDalicPINVOKE.ProgressBar_Property_LABEL_VISUAL_get();
294 /// Creates the ProgressBar.
296 public ProgressBar() : this(NDalicPINVOKE.ProgressBar_New(), true)
298 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
301 internal ProgressBar(ProgressBar handle) : this(NDalicPINVOKE.new_ProgressBar__SWIG_1(ProgressBar.getCPtr(handle)), true)
303 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
306 internal ProgressBar Assign(ProgressBar handle)
308 ProgressBar ret = new ProgressBar(NDalicPINVOKE.ProgressBar_Assign(swigCPtr, ProgressBar.getCPtr(handle)), false);
309 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
314 /// Downcasts a handle to ProgressBar handle.<br>
315 /// If handle points to a ProgressBar, the downcast produces valid handle.<br>
316 /// If not the returned handle is left uninitialized.<br>
318 /// <param name="handle">Handle to an object</param>
319 /// <returns>handle to a ProgressBar or an uninitialized handle</returns>
320 public new static ProgressBar DownCast(BaseHandle handle)
322 ProgressBar ret = new ProgressBar(NDalicPINVOKE.ProgressBar_DownCast(BaseHandle.getCPtr(handle)), true);
323 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
327 internal ProgressBarValueChangedSignal ValueChangedSignal()
329 ProgressBarValueChangedSignal ret = new ProgressBarValueChangedSignal(NDalicPINVOKE.ProgressBar_ValueChangedSignal(swigCPtr), false);
330 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
334 internal enum PropertyRange
336 PROPERTY_START_INDEX = PropertyRanges.PROPERTY_REGISTRATION_START_INDEX,
337 PROPERTY_END_INDEX = View.PropertyRange.PROPERTY_START_INDEX + 1000
341 /// The progress value of progress bar, progress runs form 0 to 1.<br>
342 /// If Value is set to 0, progress bar will be set to beginning.<br>
343 /// If Value is set to 1, progress bar will be set to end.<br>
344 /// Any Value outside of the range is ignored.<br>
346 public float ProgressValue
351 GetProperty(ProgressBar.Property.PROGRESS_VALUE).Get(ref temp);
356 SetProperty(ProgressBar.Property.PROGRESS_VALUE, new Tizen.NUI.PropertyValue(value));
360 /// The secondary progress value of progress bar, secondary progress runs form 0 to 1.<br>
361 /// Optional. If not supplied, the default is 0.<br>
362 /// If Value is set to 0, progress bar will be set secondary progress to beginning.<br>
363 /// If Value is set to 1, progress bar will be set secondary progress to end.<br>
364 /// Any Value outside of the range is ignored.<br>
366 public float SecondaryProgressValue
371 GetProperty(ProgressBar.Property.SECONDARY_PROGRESS_VALUE).Get(ref temp);
376 SetProperty(ProgressBar.Property.SECONDARY_PROGRESS_VALUE, new Tizen.NUI.PropertyValue(value));
380 /// Sets the progress-bar as \e indeterminate state.
382 public bool Indeterminate
387 GetProperty(ProgressBar.Property.INDETERMINATE).Get(ref temp);
392 SetProperty(ProgressBar.Property.INDETERMINATE, new Tizen.NUI.PropertyValue(value));
396 /// The track Visual value of progress bar, it's a full progress area and it's shown behind PROGRESS_VISUAL.<br>
397 /// Optional. If not supplied, the default track visual will be shown.<br>
399 public Tizen.NUI.PropertyMap TrackVisual
403 Tizen.NUI.PropertyMap temp = new Tizen.NUI.PropertyMap();
404 GetProperty(ProgressBar.Property.TRACK_VISUAL).Get(temp);
409 SetProperty(ProgressBar.Property.TRACK_VISUAL, new Tizen.NUI.PropertyValue(value));
413 /// The progress Visual value of progress bar, size of the progress visual is changed based on PROGRESS_VALUE.<br>
414 /// Optional. If not supplied, the default progress visual will be shown.<br>
416 public Tizen.NUI.PropertyMap ProgressVisual
420 Tizen.NUI.PropertyMap temp = new Tizen.NUI.PropertyMap();
421 GetProperty(ProgressBar.Property.PROGRESS_VISUAL).Get(temp);
426 SetProperty(ProgressBar.Property.PROGRESS_VISUAL, new Tizen.NUI.PropertyValue(value));
430 /// The secondary progress visual of progress bar, size of the secondary progress visual is changed based on SECONDARY_PROGRESS_VALUE.<br>
431 /// Optional. If not supplied, the secondary progress visual will not be shown.<br>
433 public Tizen.NUI.PropertyMap SecondaryProgressVisual
437 Tizen.NUI.PropertyMap temp = new Tizen.NUI.PropertyMap();
438 GetProperty(ProgressBar.Property.SECONDARY_PROGRESS_VISUAL).Get(temp);
443 SetProperty(ProgressBar.Property.SECONDARY_PROGRESS_VISUAL, new Tizen.NUI.PropertyValue(value));
447 /// The indeterminate visual of progress bar.<br>
448 /// Optional. If not supplied, the default inditerminate visual will be shown.<br>
450 public Tizen.NUI.PropertyMap IndeterminateVisual
454 Tizen.NUI.PropertyMap temp = new Tizen.NUI.PropertyMap();
455 GetProperty(ProgressBar.Property.INDETERMINATE_VISUAL).Get(temp);
460 SetProperty(ProgressBar.Property.INDETERMINATE_VISUAL, new Tizen.NUI.PropertyValue(value));
464 /// The transition data for indeterminate visual animation.<br>
465 /// Optional. If not supplied, default animation will be played.<br>
467 public Tizen.NUI.PropertyArray IndeterminateVisualAnimation
471 Tizen.NUI.PropertyArray temp = new Tizen.NUI.PropertyArray();
472 GetProperty(ProgressBar.Property.INDETERMINATE_VISUAL_ANIMATION).Get(temp);
477 SetProperty(ProgressBar.Property.INDETERMINATE_VISUAL_ANIMATION, new Tizen.NUI.PropertyValue(value));
481 /// The Label visual of progress bar.
483 public Tizen.NUI.PropertyMap LabelVisual
487 Tizen.NUI.PropertyMap temp = new Tizen.NUI.PropertyMap();
488 GetProperty(ProgressBar.Property.LABEL_VISUAL).Get(temp);
493 SetProperty(ProgressBar.Property.LABEL_VISUAL, new Tizen.NUI.PropertyValue(value));