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 if (swigCPtr.Handle != global::System.IntPtr.Zero)
80 NDalicPINVOKE.delete_ProgressBar(swigCPtr);
82 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
90 /// Event arguments that passed via ValueChangedEventArgs
92 public class ValueChangedEventArgs : EventArgs
94 private ProgressBar _progressBar;
95 private float _progressValue;
96 private float _secondaryProgressValue;
98 public ProgressBar ProgressBar
106 _progressBar = value;
110 public float ProgressValue
114 return _progressValue;
118 _progressValue = value;
122 public float SecondaryProgressValue
126 return _secondaryProgressValue;
130 _secondaryProgressValue = value;
136 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
137 private delegate void ValueChangedCallbackDelegate(IntPtr progressBar, float progressValue, float secondaryProgressValue);
138 private EventHandler<ValueChangedEventArgs> _progressBarValueChangedEventHandler;
139 private ValueChangedCallbackDelegate _progressBarValueChangedCallbackDelegate;
142 /// Event is sent when the ProgressBar value changes.
144 public event EventHandler<ValueChangedEventArgs> ValueChanged
148 if (_progressBarValueChangedEventHandler == null)
150 _progressBarValueChangedCallbackDelegate = (OnValueChanged);
151 ValueChangedSignal().Connect(_progressBarValueChangedCallbackDelegate);
153 _progressBarValueChangedEventHandler += value;
157 _progressBarValueChangedEventHandler -= value;
158 if (_progressBarValueChangedEventHandler == null && ValueChangedSignal().Empty() == false)
160 ValueChangedSignal().Disconnect(_progressBarValueChangedCallbackDelegate);
165 // Callback for ProgressBar ValueChanged signal
166 private void OnValueChanged(IntPtr progressBar, float progressValue, float secondaryProgressValue)
168 ValueChangedEventArgs e = new ValueChangedEventArgs();
170 // Populate all members of "e" (ValueChangedEventArgs) with real page
171 e.ProgressBar = Registry.GetManagedBaseHandleFromNativePtr(progressBar) as ProgressBar;
172 e.ProgressValue = progressValue;
173 e.SecondaryProgressValue = secondaryProgressValue;
175 if (_progressBarValueChangedEventHandler != null)
177 _progressBarValueChangedEventHandler(this, e);
181 internal class Property
183 internal static readonly int PROGRESS_VALUE = NDalicPINVOKE.ProgressBar_Property_PROGRESS_VALUE_get();
184 internal static readonly int SECONDARY_PROGRESS_VALUE = NDalicPINVOKE.ProgressBar_Property_SECONDARY_PROGRESS_VALUE_get();
185 internal static readonly int INDETERMINATE = NDalicPINVOKE.ProgressBar_Property_INDETERMINATE_get();
186 internal static readonly int TRACK_VISUAL = NDalicPINVOKE.ProgressBar_Property_TRACK_VISUAL_get();
187 internal static readonly int PROGRESS_VISUAL = NDalicPINVOKE.ProgressBar_Property_PROGRESS_VISUAL_get();
188 internal static readonly int SECONDARY_PROGRESS_VISUAL = NDalicPINVOKE.ProgressBar_Property_SECONDARY_PROGRESS_VISUAL_get();
189 internal static readonly int INDETERMINATE_VISUAL = NDalicPINVOKE.ProgressBar_Property_INDETERMINATE_VISUAL_get();
190 internal static readonly int INDETERMINATE_VISUAL_ANIMATION = NDalicPINVOKE.ProgressBar_Property_INDETERMINATE_VISUAL_ANIMATION_get();
191 internal static readonly int LABEL_VISUAL = NDalicPINVOKE.ProgressBar_Property_LABEL_VISUAL_get();
195 /// Creates the ProgressBar.
197 public ProgressBar() : this(NDalicPINVOKE.ProgressBar_New(), true)
199 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
203 internal ProgressBarValueChangedSignal ValueChangedSignal()
205 ProgressBarValueChangedSignal ret = new ProgressBarValueChangedSignal(NDalicPINVOKE.ProgressBar_ValueChangedSignal(swigCPtr), false);
206 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
211 /// The progress value of progress bar, progress runs form 0 to 1.<br>
212 /// If Value is set to 0, progress bar will be set to beginning.<br>
213 /// If Value is set to 1, progress bar will be set to end.<br>
214 /// Any Value outside of the range is ignored.<br>
216 public float ProgressValue
221 GetProperty(ProgressBar.Property.PROGRESS_VALUE).Get(out temp);
226 SetProperty(ProgressBar.Property.PROGRESS_VALUE, new Tizen.NUI.PropertyValue(value));
230 /// The secondary progress value of progress bar, secondary progress runs form 0 to 1.<br>
231 /// Optional. If not supplied, the default is 0.<br>
232 /// If Value is set to 0, progress bar will be set secondary progress to beginning.<br>
233 /// If Value is set to 1, progress bar will be set secondary progress to end.<br>
234 /// Any Value outside of the range is ignored.<br>
236 public float SecondaryProgressValue
241 GetProperty(ProgressBar.Property.SECONDARY_PROGRESS_VALUE).Get(out temp);
246 SetProperty(ProgressBar.Property.SECONDARY_PROGRESS_VALUE, new Tizen.NUI.PropertyValue(value));
250 /// Sets the progress-bar as \e indeterminate state.
252 public bool Indeterminate
257 GetProperty(ProgressBar.Property.INDETERMINATE).Get(out temp);
262 SetProperty(ProgressBar.Property.INDETERMINATE, new Tizen.NUI.PropertyValue(value));
266 /// The track Visual value of progress bar, it's a full progress area and it's shown behind PROGRESS_VISUAL.<br>
267 /// Optional. If not supplied, the default track visual will be shown.<br>
269 public Tizen.NUI.PropertyMap TrackVisual
273 Tizen.NUI.PropertyMap temp = new Tizen.NUI.PropertyMap();
274 GetProperty(ProgressBar.Property.TRACK_VISUAL).Get(temp);
279 SetProperty(ProgressBar.Property.TRACK_VISUAL, new Tizen.NUI.PropertyValue(value));
283 /// The progress Visual value of progress bar, size of the progress visual is changed based on PROGRESS_VALUE.<br>
284 /// Optional. If not supplied, the default progress visual will be shown.<br>
286 public Tizen.NUI.PropertyMap ProgressVisual
290 Tizen.NUI.PropertyMap temp = new Tizen.NUI.PropertyMap();
291 GetProperty(ProgressBar.Property.PROGRESS_VISUAL).Get(temp);
296 SetProperty(ProgressBar.Property.PROGRESS_VISUAL, new Tizen.NUI.PropertyValue(value));
300 /// The secondary progress visual of progress bar, size of the secondary progress visual is changed based on SECONDARY_PROGRESS_VALUE.<br>
301 /// Optional. If not supplied, the secondary progress visual will not be shown.<br>
303 public Tizen.NUI.PropertyMap SecondaryProgressVisual
307 Tizen.NUI.PropertyMap temp = new Tizen.NUI.PropertyMap();
308 GetProperty(ProgressBar.Property.SECONDARY_PROGRESS_VISUAL).Get(temp);
313 SetProperty(ProgressBar.Property.SECONDARY_PROGRESS_VISUAL, new Tizen.NUI.PropertyValue(value));
317 /// The indeterminate visual of progress bar.<br>
318 /// Optional. If not supplied, the default inditerminate visual will be shown.<br>
320 public Tizen.NUI.PropertyMap IndeterminateVisual
324 Tizen.NUI.PropertyMap temp = new Tizen.NUI.PropertyMap();
325 GetProperty(ProgressBar.Property.INDETERMINATE_VISUAL).Get(temp);
330 SetProperty(ProgressBar.Property.INDETERMINATE_VISUAL, new Tizen.NUI.PropertyValue(value));
334 /// The transition data for indeterminate visual animation.<br>
335 /// Optional. If not supplied, default animation will be played.<br>
337 public Tizen.NUI.PropertyArray IndeterminateVisualAnimation
341 Tizen.NUI.PropertyArray temp = new Tizen.NUI.PropertyArray();
342 GetProperty(ProgressBar.Property.INDETERMINATE_VISUAL_ANIMATION).Get(temp);
347 SetProperty(ProgressBar.Property.INDETERMINATE_VISUAL_ANIMATION, new Tizen.NUI.PropertyValue(value));
351 /// The Label visual of progress bar.
353 public Tizen.NUI.PropertyMap LabelVisual
357 Tizen.NUI.PropertyMap temp = new Tizen.NUI.PropertyMap();
358 GetProperty(ProgressBar.Property.LABEL_VISUAL).Get(temp);
363 SetProperty(ProgressBar.Property.LABEL_VISUAL, new Tizen.NUI.PropertyValue(value));