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 //------------------------------------------------------------------------------
30 using System.Runtime.InteropServices;
33 public class ProgressBar : View {
34 private global::System.Runtime.InteropServices.HandleRef swigCPtr;
36 internal ProgressBar(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.ProgressBar_SWIGUpcast(cPtr), cMemoryOwn) {
37 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
40 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(ProgressBar obj) {
41 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
45 DisposeQueue.Instance.Add(this);
48 public override void Dispose() {
49 if (!Window.IsInstalled()) {
50 DisposeQueue.Instance.Add(this);
55 if (swigCPtr.Handle != global::System.IntPtr.Zero) {
58 NDalicPINVOKE.delete_ProgressBar(swigCPtr);
60 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
62 global::System.GC.SuppressFinalize(this);
69 public class ValueChangedEventArgs : EventArgs
71 private ProgressBar _progressBar;
72 private float _progressValue;
73 private float _secondaryProgressValue;
75 public ProgressBar ProgressBar
87 public float ProgressValue
91 return _progressValue;
95 _progressValue = value;
99 public float SecondaryProgressValue
103 return _secondaryProgressValue;
107 _secondaryProgressValue = value;
113 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
114 private delegate void ValueChangedCallbackDelegate(IntPtr progressBar, float progressValue, float secondaryProgressValue);
115 private DaliEventHandler<object,ValueChangedEventArgs> _progressBarValueChangedEventHandler;
116 private ValueChangedCallbackDelegate _progressBarValueChangedCallbackDelegate;
118 public event DaliEventHandler<object,ValueChangedEventArgs> ValueChanged
124 // Restricted to only one listener
125 if (_progressBarValueChangedEventHandler == null)
127 _progressBarValueChangedEventHandler += value;
129 _progressBarValueChangedCallbackDelegate = new ValueChangedCallbackDelegate(OnValueChanged);
130 this.ValueChangedSignal().Connect(_progressBarValueChangedCallbackDelegate);
139 if (_progressBarValueChangedEventHandler != null)
141 this.ValueChangedSignal().Disconnect(_progressBarValueChangedCallbackDelegate);
144 _progressBarValueChangedEventHandler -= value;
149 // Callback for ProgressBar ValueChanged signal
150 private void OnValueChanged(IntPtr progressBar, float progressValue, float secondaryProgressValue)
152 ValueChangedEventArgs e = new ValueChangedEventArgs();
154 // Populate all members of "e" (ValueChangedEventArgs) with real page
155 e.ProgressBar = ProgressBar.GetProgressBarFromPtr( progressBar );
156 e.ProgressValue = progressValue;
157 e.SecondaryProgressValue = secondaryProgressValue;
159 if (_progressBarValueChangedEventHandler != null)
161 _progressBarValueChangedEventHandler(this, e);
165 public static ProgressBar GetProgressBarFromPtr(global::System.IntPtr cPtr) {
166 ProgressBar ret = new ProgressBar(cPtr, false);
167 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
172 public class Property : global::System.IDisposable {
173 private global::System.Runtime.InteropServices.HandleRef swigCPtr;
174 protected bool swigCMemOwn;
176 internal Property(global::System.IntPtr cPtr, bool cMemoryOwn) {
177 swigCMemOwn = cMemoryOwn;
178 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
181 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Property obj) {
182 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
189 public virtual void Dispose() {
191 if (swigCPtr.Handle != global::System.IntPtr.Zero) {
194 NDalicPINVOKE.delete_ProgressBar_Property(swigCPtr);
196 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
198 global::System.GC.SuppressFinalize(this);
202 public Property() : this(NDalicPINVOKE.new_ProgressBar_Property(), true) {
203 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
206 public static readonly int PROGRESS_VALUE = NDalicPINVOKE.ProgressBar_Property_PROGRESS_VALUE_get();
207 public static readonly int SECONDARY_PROGRESS_VALUE = NDalicPINVOKE.ProgressBar_Property_SECONDARY_PROGRESS_VALUE_get();
208 public static readonly int INDETERMINATE = NDalicPINVOKE.ProgressBar_Property_INDETERMINATE_get();
209 public static readonly int TRACK_VISUAL = NDalicPINVOKE.ProgressBar_Property_TRACK_VISUAL_get();
210 public static readonly int PROGRESS_VISUAL = NDalicPINVOKE.ProgressBar_Property_PROGRESS_VISUAL_get();
211 public static readonly int SECONDARY_PROGRESS_VISUAL = NDalicPINVOKE.ProgressBar_Property_SECONDARY_PROGRESS_VISUAL_get();
212 public static readonly int INDETERMINATE_VISUAL = NDalicPINVOKE.ProgressBar_Property_INDETERMINATE_VISUAL_get();
213 public static readonly int INDETERMINATE_VISUAL_ANIMATION = NDalicPINVOKE.ProgressBar_Property_INDETERMINATE_VISUAL_ANIMATION_get();
214 public static readonly int LABEL_VISUAL = NDalicPINVOKE.ProgressBar_Property_LABEL_VISUAL_get();
218 public ProgressBar () : this (NDalicPINVOKE.ProgressBar_New(), true) {
219 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
222 public ProgressBar(ProgressBar handle) : this(NDalicPINVOKE.new_ProgressBar__SWIG_1(ProgressBar.getCPtr(handle)), true) {
223 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
226 public ProgressBar Assign(ProgressBar handle) {
227 ProgressBar ret = new ProgressBar(NDalicPINVOKE.ProgressBar_Assign(swigCPtr, ProgressBar.getCPtr(handle)), false);
228 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
232 public new static ProgressBar DownCast(BaseHandle handle) {
233 ProgressBar ret = new ProgressBar(NDalicPINVOKE.ProgressBar_DownCast(BaseHandle.getCPtr(handle)), true);
234 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
238 public ProgressBarValueChangedSignal ValueChangedSignal() {
239 ProgressBarValueChangedSignal ret = new ProgressBarValueChangedSignal(NDalicPINVOKE.ProgressBar_ValueChangedSignal(swigCPtr), false);
240 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
244 public enum PropertyRange {
245 PROPERTY_START_INDEX = PropertyRanges.PROPERTY_REGISTRATION_START_INDEX,
246 PROPERTY_END_INDEX = View.PropertyRange.PROPERTY_START_INDEX+1000
249 public float ProgressValue
254 GetProperty( ProgressBar.Property.PROGRESS_VALUE).Get( ref temp );
259 SetProperty( ProgressBar.Property.PROGRESS_VALUE, new Dali.Property.Value( value ) );
262 public float SecondaryProgressValue
267 GetProperty( ProgressBar.Property.SECONDARY_PROGRESS_VALUE).Get( ref temp );
272 SetProperty( ProgressBar.Property.SECONDARY_PROGRESS_VALUE, new Dali.Property.Value( value ) );
275 public bool Indeterminate
280 GetProperty( ProgressBar.Property.INDETERMINATE).Get( ref temp );
285 SetProperty( ProgressBar.Property.INDETERMINATE, new Dali.Property.Value( value ) );
288 public Dali.Property.Map TrackVisual
292 Dali.Property.Map temp = new Dali.Property.Map();
293 GetProperty( ProgressBar.Property.TRACK_VISUAL).Get( temp );
298 SetProperty( ProgressBar.Property.TRACK_VISUAL, new Dali.Property.Value( value ) );
301 public Dali.Property.Map ProgressVisual
305 Dali.Property.Map temp = new Dali.Property.Map();
306 GetProperty( ProgressBar.Property.PROGRESS_VISUAL).Get( temp );
311 SetProperty( ProgressBar.Property.PROGRESS_VISUAL, new Dali.Property.Value( value ) );
314 public Dali.Property.Map SecondaryProgressVisual
318 Dali.Property.Map temp = new Dali.Property.Map();
319 GetProperty( ProgressBar.Property.SECONDARY_PROGRESS_VISUAL).Get( temp );
324 SetProperty( ProgressBar.Property.SECONDARY_PROGRESS_VISUAL, new Dali.Property.Value( value ) );
327 public Dali.Property.Map IndeterminateVisual
331 Dali.Property.Map temp = new Dali.Property.Map();
332 GetProperty( ProgressBar.Property.INDETERMINATE_VISUAL).Get( temp );
337 SetProperty( ProgressBar.Property.INDETERMINATE_VISUAL, new Dali.Property.Value( value ) );
340 public Dali.Property.Array IndeterminateVisualAnimation
344 Dali.Property.Array temp = new Dali.Property.Array();
345 GetProperty( ProgressBar.Property.INDETERMINATE_VISUAL_ANIMATION).Get( temp );
350 SetProperty( ProgressBar.Property.INDETERMINATE_VISUAL_ANIMATION, new Dali.Property.Value( value ) );
353 public Dali.Property.Map LabelVisual
357 Dali.Property.Map temp = new Dali.Property.Map();
358 GetProperty( ProgressBar.Property.LABEL_VISUAL).Get( temp );
363 SetProperty( ProgressBar.Property.LABEL_VISUAL, new Dali.Property.Value( value ) );