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 protected override void Dispose(DisposeTypes type)
61 if (type == DisposeTypes.Explicit)
64 //Release your own managed resources here.
65 //You should release all of your own disposable objects here.
69 //Release your own unmanaged resources here.
70 //You should not access any managed member here except static instance.
71 //because the execution order of Finalizes is non-deterministic.
73 if (swigCPtr.Handle != global::System.IntPtr.Zero)
78 NDalicPINVOKE.delete_ProgressBar(swigCPtr);
80 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
88 /// Event arguments that passed via ValueChangedEventArgs
90 public class ValueChangedEventArgs : EventArgs
92 private ProgressBar _progressBar;
93 private float _progressValue;
94 private float _secondaryProgressValue;
96 public ProgressBar ProgressBar
104 _progressBar = value;
108 public float ProgressValue
112 return _progressValue;
116 _progressValue = value;
120 public float SecondaryProgressValue
124 return _secondaryProgressValue;
128 _secondaryProgressValue = value;
134 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
135 private delegate void ValueChangedCallbackDelegate(IntPtr progressBar, float progressValue, float secondaryProgressValue);
136 private EventHandler<ValueChangedEventArgs> _progressBarValueChangedEventHandler;
137 private ValueChangedCallbackDelegate _progressBarValueChangedCallbackDelegate;
140 /// Event is sent when the ProgressBar value changes.
142 public event EventHandler<ValueChangedEventArgs> ValueChanged
146 if (_progressBarValueChangedEventHandler == null)
148 _progressBarValueChangedCallbackDelegate = (OnValueChanged);
149 ValueChangedSignal().Connect(_progressBarValueChangedCallbackDelegate);
151 _progressBarValueChangedEventHandler += value;
155 _progressBarValueChangedEventHandler -= value;
156 if (_progressBarValueChangedEventHandler == null && ValueChangedSignal().Empty() == false)
158 ValueChangedSignal().Disconnect(_progressBarValueChangedCallbackDelegate);
163 // Callback for ProgressBar ValueChanged signal
164 private void OnValueChanged(IntPtr progressBar, float progressValue, float secondaryProgressValue)
166 ValueChangedEventArgs e = new ValueChangedEventArgs();
168 // Populate all members of "e" (ValueChangedEventArgs) with real page
169 e.ProgressBar = Registry.GetManagedBaseHandleFromNativePtr(progressBar) as ProgressBar;
170 e.ProgressValue = progressValue;
171 e.SecondaryProgressValue = secondaryProgressValue;
173 if (_progressBarValueChangedEventHandler != null)
175 _progressBarValueChangedEventHandler(this, e);
179 internal class Property
181 internal static readonly int PROGRESS_VALUE = NDalicPINVOKE.ProgressBar_Property_PROGRESS_VALUE_get();
182 internal static readonly int SECONDARY_PROGRESS_VALUE = NDalicPINVOKE.ProgressBar_Property_SECONDARY_PROGRESS_VALUE_get();
183 internal static readonly int INDETERMINATE = NDalicPINVOKE.ProgressBar_Property_INDETERMINATE_get();
184 internal static readonly int TRACK_VISUAL = NDalicPINVOKE.ProgressBar_Property_TRACK_VISUAL_get();
185 internal static readonly int PROGRESS_VISUAL = NDalicPINVOKE.ProgressBar_Property_PROGRESS_VISUAL_get();
186 internal static readonly int SECONDARY_PROGRESS_VISUAL = NDalicPINVOKE.ProgressBar_Property_SECONDARY_PROGRESS_VISUAL_get();
187 internal static readonly int INDETERMINATE_VISUAL = NDalicPINVOKE.ProgressBar_Property_INDETERMINATE_VISUAL_get();
188 internal static readonly int INDETERMINATE_VISUAL_ANIMATION = NDalicPINVOKE.ProgressBar_Property_INDETERMINATE_VISUAL_ANIMATION_get();
189 internal static readonly int LABEL_VISUAL = NDalicPINVOKE.ProgressBar_Property_LABEL_VISUAL_get();
193 /// Creates the ProgressBar.
195 public ProgressBar() : this(NDalicPINVOKE.ProgressBar_New(), true)
197 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
201 internal ProgressBarValueChangedSignal ValueChangedSignal()
203 ProgressBarValueChangedSignal ret = new ProgressBarValueChangedSignal(NDalicPINVOKE.ProgressBar_ValueChangedSignal(swigCPtr), false);
204 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
209 /// The progress value of progress bar, progress runs form 0 to 1.<br>
210 /// If Value is set to 0, progress bar will be set to beginning.<br>
211 /// If Value is set to 1, progress bar will be set to end.<br>
212 /// Any Value outside of the range is ignored.<br>
214 public float ProgressValue
219 GetProperty(ProgressBar.Property.PROGRESS_VALUE).Get(out temp);
224 SetProperty(ProgressBar.Property.PROGRESS_VALUE, new Tizen.NUI.PropertyValue(value));
228 /// The secondary progress value of progress bar, secondary progress runs form 0 to 1.<br>
229 /// Optional. If not supplied, the default is 0.<br>
230 /// If Value is set to 0, progress bar will be set secondary progress to beginning.<br>
231 /// If Value is set to 1, progress bar will be set secondary progress to end.<br>
232 /// Any Value outside of the range is ignored.<br>
234 public float SecondaryProgressValue
239 GetProperty(ProgressBar.Property.SECONDARY_PROGRESS_VALUE).Get(out temp);
244 SetProperty(ProgressBar.Property.SECONDARY_PROGRESS_VALUE, new Tizen.NUI.PropertyValue(value));
248 /// Sets the progress-bar as \e indeterminate state.
250 public bool Indeterminate
255 GetProperty(ProgressBar.Property.INDETERMINATE).Get(out temp);
260 SetProperty(ProgressBar.Property.INDETERMINATE, new Tizen.NUI.PropertyValue(value));
264 /// The track Visual value of progress bar, it's a full progress area and it's shown behind PROGRESS_VISUAL.<br>
265 /// Optional. If not supplied, the default track visual will be shown.<br>
267 public Tizen.NUI.PropertyMap TrackVisual
271 Tizen.NUI.PropertyMap temp = new Tizen.NUI.PropertyMap();
272 GetProperty(ProgressBar.Property.TRACK_VISUAL).Get(temp);
277 SetProperty(ProgressBar.Property.TRACK_VISUAL, new Tizen.NUI.PropertyValue(value));
281 /// The progress Visual value of progress bar, size of the progress visual is changed based on PROGRESS_VALUE.<br>
282 /// Optional. If not supplied, the default progress visual will be shown.<br>
284 public Tizen.NUI.PropertyMap ProgressVisual
288 Tizen.NUI.PropertyMap temp = new Tizen.NUI.PropertyMap();
289 GetProperty(ProgressBar.Property.PROGRESS_VISUAL).Get(temp);
294 SetProperty(ProgressBar.Property.PROGRESS_VISUAL, new Tizen.NUI.PropertyValue(value));
298 /// The secondary progress visual of progress bar, size of the secondary progress visual is changed based on SECONDARY_PROGRESS_VALUE.<br>
299 /// Optional. If not supplied, the secondary progress visual will not be shown.<br>
301 public Tizen.NUI.PropertyMap SecondaryProgressVisual
305 Tizen.NUI.PropertyMap temp = new Tizen.NUI.PropertyMap();
306 GetProperty(ProgressBar.Property.SECONDARY_PROGRESS_VISUAL).Get(temp);
311 SetProperty(ProgressBar.Property.SECONDARY_PROGRESS_VISUAL, new Tizen.NUI.PropertyValue(value));
315 /// The indeterminate visual of progress bar.<br>
316 /// Optional. If not supplied, the default inditerminate visual will be shown.<br>
318 public Tizen.NUI.PropertyMap IndeterminateVisual
322 Tizen.NUI.PropertyMap temp = new Tizen.NUI.PropertyMap();
323 GetProperty(ProgressBar.Property.INDETERMINATE_VISUAL).Get(temp);
328 SetProperty(ProgressBar.Property.INDETERMINATE_VISUAL, new Tizen.NUI.PropertyValue(value));
332 /// The transition data for indeterminate visual animation.<br>
333 /// Optional. If not supplied, default animation will be played.<br>
335 public Tizen.NUI.PropertyArray IndeterminateVisualAnimation
339 Tizen.NUI.PropertyArray temp = new Tizen.NUI.PropertyArray();
340 GetProperty(ProgressBar.Property.INDETERMINATE_VISUAL_ANIMATION).Get(temp);
345 SetProperty(ProgressBar.Property.INDETERMINATE_VISUAL_ANIMATION, new Tizen.NUI.PropertyValue(value));
349 /// The Label visual of progress bar.
351 public Tizen.NUI.PropertyMap LabelVisual
355 Tizen.NUI.PropertyMap temp = new Tizen.NUI.PropertyMap();
356 GetProperty(ProgressBar.Property.LABEL_VISUAL).Get(temp);
361 SetProperty(ProgressBar.Property.LABEL_VISUAL, new Tizen.NUI.PropertyValue(value));