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();
193 internal class Property
195 internal static readonly int PROGRESS_VALUE = NDalicPINVOKE.ProgressBar_Property_PROGRESS_VALUE_get();
196 internal static readonly int SECONDARY_PROGRESS_VALUE = NDalicPINVOKE.ProgressBar_Property_SECONDARY_PROGRESS_VALUE_get();
197 internal static readonly int INDETERMINATE = NDalicPINVOKE.ProgressBar_Property_INDETERMINATE_get();
198 internal static readonly int TRACK_VISUAL = NDalicPINVOKE.ProgressBar_Property_TRACK_VISUAL_get();
199 internal static readonly int PROGRESS_VISUAL = NDalicPINVOKE.ProgressBar_Property_PROGRESS_VISUAL_get();
200 internal static readonly int SECONDARY_PROGRESS_VISUAL = NDalicPINVOKE.ProgressBar_Property_SECONDARY_PROGRESS_VISUAL_get();
201 internal static readonly int INDETERMINATE_VISUAL = NDalicPINVOKE.ProgressBar_Property_INDETERMINATE_VISUAL_get();
202 internal static readonly int INDETERMINATE_VISUAL_ANIMATION = NDalicPINVOKE.ProgressBar_Property_INDETERMINATE_VISUAL_ANIMATION_get();
203 internal static readonly int LABEL_VISUAL = NDalicPINVOKE.ProgressBar_Property_LABEL_VISUAL_get();
207 /// Creates the ProgressBar.
209 public ProgressBar() : this(NDalicPINVOKE.ProgressBar_New(), true)
211 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
215 internal ProgressBarValueChangedSignal ValueChangedSignal()
217 ProgressBarValueChangedSignal ret = new ProgressBarValueChangedSignal(NDalicPINVOKE.ProgressBar_ValueChangedSignal(swigCPtr), false);
218 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
223 /// The progress value of progress bar, progress runs form 0 to 1.<br>
224 /// If Value is set to 0, progress bar will be set to beginning.<br>
225 /// If Value is set to 1, progress bar will be set to end.<br>
226 /// Any Value outside of the range is ignored.<br>
228 public float ProgressValue
233 GetProperty(ProgressBar.Property.PROGRESS_VALUE).Get(out temp);
238 SetProperty(ProgressBar.Property.PROGRESS_VALUE, new Tizen.NUI.PropertyValue(value));
242 /// The secondary progress value of progress bar, secondary progress runs form 0 to 1.<br>
243 /// Optional. If not supplied, the default is 0.<br>
244 /// If Value is set to 0, progress bar will be set secondary progress to beginning.<br>
245 /// If Value is set to 1, progress bar will be set secondary progress to end.<br>
246 /// Any Value outside of the range is ignored.<br>
248 public float SecondaryProgressValue
253 GetProperty(ProgressBar.Property.SECONDARY_PROGRESS_VALUE).Get(out temp);
258 SetProperty(ProgressBar.Property.SECONDARY_PROGRESS_VALUE, new Tizen.NUI.PropertyValue(value));
262 /// Sets the progress-bar as \e indeterminate state.
264 public bool Indeterminate
269 GetProperty(ProgressBar.Property.INDETERMINATE).Get(out temp);
274 SetProperty(ProgressBar.Property.INDETERMINATE, new Tizen.NUI.PropertyValue(value));
278 /// The track Visual value of progress bar, it's a full progress area and it's shown behind PROGRESS_VISUAL.<br>
279 /// Optional. If not supplied, the default track visual will be shown.<br>
281 public Tizen.NUI.PropertyMap TrackVisual
285 Tizen.NUI.PropertyMap temp = new Tizen.NUI.PropertyMap();
286 GetProperty(ProgressBar.Property.TRACK_VISUAL).Get(temp);
291 SetProperty(ProgressBar.Property.TRACK_VISUAL, new Tizen.NUI.PropertyValue(value));
295 /// The progress Visual value of progress bar, size of the progress visual is changed based on PROGRESS_VALUE.<br>
296 /// Optional. If not supplied, the default progress visual will be shown.<br>
298 public Tizen.NUI.PropertyMap ProgressVisual
302 Tizen.NUI.PropertyMap temp = new Tizen.NUI.PropertyMap();
303 GetProperty(ProgressBar.Property.PROGRESS_VISUAL).Get(temp);
308 SetProperty(ProgressBar.Property.PROGRESS_VISUAL, new Tizen.NUI.PropertyValue(value));
312 /// The secondary progress visual of progress bar, size of the secondary progress visual is changed based on SECONDARY_PROGRESS_VALUE.<br>
313 /// Optional. If not supplied, the secondary progress visual will not be shown.<br>
315 public Tizen.NUI.PropertyMap SecondaryProgressVisual
319 Tizen.NUI.PropertyMap temp = new Tizen.NUI.PropertyMap();
320 GetProperty(ProgressBar.Property.SECONDARY_PROGRESS_VISUAL).Get(temp);
325 SetProperty(ProgressBar.Property.SECONDARY_PROGRESS_VISUAL, new Tizen.NUI.PropertyValue(value));
329 /// The indeterminate visual of progress bar.<br>
330 /// Optional. If not supplied, the default inditerminate visual will be shown.<br>
332 public Tizen.NUI.PropertyMap IndeterminateVisual
336 Tizen.NUI.PropertyMap temp = new Tizen.NUI.PropertyMap();
337 GetProperty(ProgressBar.Property.INDETERMINATE_VISUAL).Get(temp);
342 SetProperty(ProgressBar.Property.INDETERMINATE_VISUAL, new Tizen.NUI.PropertyValue(value));
346 /// The transition data for indeterminate visual animation.<br>
347 /// Optional. If not supplied, default animation will be played.<br>
349 public Tizen.NUI.PropertyArray IndeterminateVisualAnimation
353 Tizen.NUI.PropertyArray temp = new Tizen.NUI.PropertyArray();
354 GetProperty(ProgressBar.Property.INDETERMINATE_VISUAL_ANIMATION).Get(temp);
359 SetProperty(ProgressBar.Property.INDETERMINATE_VISUAL_ANIMATION, new Tizen.NUI.PropertyValue(value));
363 /// The Label visual of progress bar.
365 public Tizen.NUI.PropertyMap LabelVisual
369 Tizen.NUI.PropertyMap temp = new Tizen.NUI.PropertyMap();
370 GetProperty(ProgressBar.Property.LABEL_VISUAL).Get(temp);
375 SetProperty(ProgressBar.Property.LABEL_VISUAL, new Tizen.NUI.PropertyValue(value));