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
174 public static readonly int PROGRESS_VALUE = NDalicPINVOKE.ProgressBar_Property_PROGRESS_VALUE_get();
175 public static readonly int SECONDARY_PROGRESS_VALUE = NDalicPINVOKE.ProgressBar_Property_SECONDARY_PROGRESS_VALUE_get();
176 public static readonly int INDETERMINATE = NDalicPINVOKE.ProgressBar_Property_INDETERMINATE_get();
177 public static readonly int TRACK_VISUAL = NDalicPINVOKE.ProgressBar_Property_TRACK_VISUAL_get();
178 public static readonly int PROGRESS_VISUAL = NDalicPINVOKE.ProgressBar_Property_PROGRESS_VISUAL_get();
179 public static readonly int SECONDARY_PROGRESS_VISUAL = NDalicPINVOKE.ProgressBar_Property_SECONDARY_PROGRESS_VISUAL_get();
180 public static readonly int INDETERMINATE_VISUAL = NDalicPINVOKE.ProgressBar_Property_INDETERMINATE_VISUAL_get();
181 public static readonly int INDETERMINATE_VISUAL_ANIMATION = NDalicPINVOKE.ProgressBar_Property_INDETERMINATE_VISUAL_ANIMATION_get();
182 public static readonly int LABEL_VISUAL = NDalicPINVOKE.ProgressBar_Property_LABEL_VISUAL_get();
185 public ProgressBar () : this (NDalicPINVOKE.ProgressBar_New(), true) {
186 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
189 public ProgressBar(ProgressBar handle) : this(NDalicPINVOKE.new_ProgressBar__SWIG_1(ProgressBar.getCPtr(handle)), true) {
190 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
193 public ProgressBar Assign(ProgressBar handle) {
194 ProgressBar ret = new ProgressBar(NDalicPINVOKE.ProgressBar_Assign(swigCPtr, ProgressBar.getCPtr(handle)), false);
195 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
199 public new static ProgressBar DownCast(BaseHandle handle) {
200 ProgressBar ret = new ProgressBar(NDalicPINVOKE.ProgressBar_DownCast(BaseHandle.getCPtr(handle)), true);
201 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
205 internal ProgressBarValueChangedSignal ValueChangedSignal() {
206 ProgressBarValueChangedSignal ret = new ProgressBarValueChangedSignal(NDalicPINVOKE.ProgressBar_ValueChangedSignal(swigCPtr), false);
207 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
211 public float ProgressValue
216 GetProperty( ProgressBar.Property.PROGRESS_VALUE).Get( out temp );
221 SetProperty( ProgressBar.Property.PROGRESS_VALUE, new Dali.Property.Value( value ) );
224 public float SecondaryProgressValue
229 GetProperty( ProgressBar.Property.SECONDARY_PROGRESS_VALUE).Get( out temp );
234 SetProperty( ProgressBar.Property.SECONDARY_PROGRESS_VALUE, new Dali.Property.Value( value ) );
237 public bool Indeterminate
242 GetProperty( ProgressBar.Property.INDETERMINATE).Get( out temp );
247 SetProperty( ProgressBar.Property.INDETERMINATE, new Dali.Property.Value( value ) );
250 public Dali.Property.Map TrackVisual
254 Dali.Property.Map temp = new Dali.Property.Map();
255 GetProperty( ProgressBar.Property.TRACK_VISUAL).Get( temp );
260 SetProperty( ProgressBar.Property.TRACK_VISUAL, new Dali.Property.Value( value ) );
263 public Dali.Property.Map ProgressVisual
267 Dali.Property.Map temp = new Dali.Property.Map();
268 GetProperty( ProgressBar.Property.PROGRESS_VISUAL).Get( temp );
273 SetProperty( ProgressBar.Property.PROGRESS_VISUAL, new Dali.Property.Value( value ) );
276 public Dali.Property.Map SecondaryProgressVisual
280 Dali.Property.Map temp = new Dali.Property.Map();
281 GetProperty( ProgressBar.Property.SECONDARY_PROGRESS_VISUAL).Get( temp );
286 SetProperty( ProgressBar.Property.SECONDARY_PROGRESS_VISUAL, new Dali.Property.Value( value ) );
289 public Dali.Property.Map IndeterminateVisual
293 Dali.Property.Map temp = new Dali.Property.Map();
294 GetProperty( ProgressBar.Property.INDETERMINATE_VISUAL).Get( temp );
299 SetProperty( ProgressBar.Property.INDETERMINATE_VISUAL, new Dali.Property.Value( value ) );
302 public Dali.Property.Array IndeterminateVisualAnimation
306 Dali.Property.Array temp = new Dali.Property.Array();
307 GetProperty( ProgressBar.Property.INDETERMINATE_VISUAL_ANIMATION).Get( temp );
312 SetProperty( ProgressBar.Property.INDETERMINATE_VISUAL_ANIMATION, new Dali.Property.Value( value ) );
315 public Dali.Property.Map LabelVisual
319 Dali.Property.Map temp = new Dali.Property.Map();
320 GetProperty( ProgressBar.Property.LABEL_VISUAL).Get( temp );
325 SetProperty( ProgressBar.Property.LABEL_VISUAL, new Dali.Property.Value( value ) );