Ensure text-controller returns false when it doesn't use key.
[platform/core/uifw/dali-toolkit.git] / plugins / dali-sharp / sharp / public / ProgressBar.cs
1 /** Copyright (c) 2017 Samsung Electronics Co., Ltd.
2 *
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
6 *
7 * http://www.apache.org/licenses/LICENSE-2.0
8 *
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.
14 *
15 */
16 // This File has been auto-generated by SWIG and then modified using DALi Ruby Scripts
17 //------------------------------------------------------------------------------
18 // <auto-generated />
19 //
20 // This file was automatically generated by SWIG (http://www.swig.org).
21 // Version 3.0.10
22 //
23 // Do not make changes to this file unless you know what you are doing--modify
24 // the SWIG interface file instead.
25 //------------------------------------------------------------------------------
26
27 namespace Dali {
28
29 using System;
30 using System.Runtime.InteropServices;
31
32
33 public class ProgressBar : View {
34   private global::System.Runtime.InteropServices.HandleRef swigCPtr;
35
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);
38   }
39
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;
42   }
43
44   ~ProgressBar() {
45     DisposeQueue.Instance.Add(this);
46   }
47
48   public override void Dispose() {
49     if (!Window.IsInstalled()) {
50       DisposeQueue.Instance.Add(this);
51       return;
52     }
53
54     lock(this) {
55       if (swigCPtr.Handle != global::System.IntPtr.Zero) {
56         if (swigCMemOwn) {
57           swigCMemOwn = false;
58           NDalicPINVOKE.delete_ProgressBar(swigCPtr);
59         }
60         swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
61       }
62       global::System.GC.SuppressFinalize(this);
63       base.Dispose();
64     }
65   }
66
67
68
69 public class ValueChangedEventArgs : EventArgs
70 {
71    private ProgressBar _progressBar;
72    private float _progressValue;
73    private float _secondaryProgressValue;
74
75    public ProgressBar ProgressBar
76    {
77       get
78       {
79          return _progressBar;
80       }
81       set
82       {
83          _progressBar = value;
84       }
85    }
86
87    public float ProgressValue
88    {
89       get
90       {
91          return _progressValue;
92       }
93       set
94       {
95          _progressValue = value;
96       }
97    }
98
99    public float SecondaryProgressValue
100    {
101       get
102       {
103          return _secondaryProgressValue;
104       }
105       set
106       {
107          _secondaryProgressValue = value;
108       }
109    }
110
111 }
112
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;
117
118   public event DaliEventHandler<object,ValueChangedEventArgs> ValueChanged
119   {
120      add
121      {
122         lock(this)
123         {
124            // Restricted to only one listener
125            if (_progressBarValueChangedEventHandler == null)
126            {
127               _progressBarValueChangedEventHandler += value;
128
129               _progressBarValueChangedCallbackDelegate = new ValueChangedCallbackDelegate(OnValueChanged);
130               this.ValueChangedSignal().Connect(_progressBarValueChangedCallbackDelegate);
131            }
132         }
133      }
134
135      remove
136      {
137         lock(this)
138         {
139            if (_progressBarValueChangedEventHandler != null)
140            {
141               this.ValueChangedSignal().Disconnect(_progressBarValueChangedCallbackDelegate);
142            }
143
144            _progressBarValueChangedEventHandler -= value;
145         }
146      }
147   }
148
149   // Callback for ProgressBar ValueChanged signal
150   private void OnValueChanged(IntPtr progressBar, float progressValue, float secondaryProgressValue)
151   {
152      ValueChangedEventArgs e = new ValueChangedEventArgs();
153
154      // Populate all members of "e" (ValueChangedEventArgs) with real page
155      e.ProgressBar = ProgressBar.GetProgressBarFromPtr( progressBar );
156      e.ProgressValue = progressValue;
157      e.SecondaryProgressValue = secondaryProgressValue;
158
159      if (_progressBarValueChangedEventHandler != null)
160      {
161        _progressBarValueChangedEventHandler(this, e);
162      }
163   }
164
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();
168     return ret;
169   }
170
171
172   public class Property
173   {
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();
183   }
184
185   public ProgressBar () : this (NDalicPINVOKE.ProgressBar_New(), true) {
186       if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
187
188   }
189   public ProgressBar(ProgressBar handle) : this(NDalicPINVOKE.new_ProgressBar__SWIG_1(ProgressBar.getCPtr(handle)), true) {
190     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
191   }
192
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();
196     return ret;
197   }
198
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();
202     return ret;
203   }
204
205   internal ProgressBarValueChangedSignal ValueChangedSignal() {
206     ProgressBarValueChangedSignal ret = new ProgressBarValueChangedSignal(NDalicPINVOKE.ProgressBar_ValueChangedSignal(swigCPtr), false);
207     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
208     return ret;
209   }
210
211   public float ProgressValue
212   {
213     get
214     {
215       float temp = 0.0f;
216       GetProperty( ProgressBar.Property.PROGRESS_VALUE).Get( out temp );
217       return temp;
218     }
219     set
220     {
221       SetProperty( ProgressBar.Property.PROGRESS_VALUE, new Dali.Property.Value( value ) );
222     }
223   }
224   public float SecondaryProgressValue
225   {
226     get
227     {
228       float temp = 0.0f;
229       GetProperty( ProgressBar.Property.SECONDARY_PROGRESS_VALUE).Get( out temp );
230       return temp;
231     }
232     set
233     {
234       SetProperty( ProgressBar.Property.SECONDARY_PROGRESS_VALUE, new Dali.Property.Value( value ) );
235     }
236   }
237   public bool Indeterminate
238   {
239     get
240     {
241       bool temp = false;
242       GetProperty( ProgressBar.Property.INDETERMINATE).Get( out temp );
243       return temp;
244     }
245     set
246     {
247       SetProperty( ProgressBar.Property.INDETERMINATE, new Dali.Property.Value( value ) );
248     }
249   }
250   public Dali.Property.Map TrackVisual
251   {
252     get
253     {
254       Dali.Property.Map temp = new Dali.Property.Map();
255       GetProperty( ProgressBar.Property.TRACK_VISUAL).Get(  temp );
256       return temp;
257     }
258     set
259     {
260       SetProperty( ProgressBar.Property.TRACK_VISUAL, new Dali.Property.Value( value ) );
261     }
262   }
263   public Dali.Property.Map ProgressVisual
264   {
265     get
266     {
267       Dali.Property.Map temp = new Dali.Property.Map();
268       GetProperty( ProgressBar.Property.PROGRESS_VISUAL).Get(  temp );
269       return temp;
270     }
271     set
272     {
273       SetProperty( ProgressBar.Property.PROGRESS_VISUAL, new Dali.Property.Value( value ) );
274     }
275   }
276   public Dali.Property.Map SecondaryProgressVisual
277   {
278     get
279     {
280       Dali.Property.Map temp = new Dali.Property.Map();
281       GetProperty( ProgressBar.Property.SECONDARY_PROGRESS_VISUAL).Get(  temp );
282       return temp;
283     }
284     set
285     {
286       SetProperty( ProgressBar.Property.SECONDARY_PROGRESS_VISUAL, new Dali.Property.Value( value ) );
287     }
288   }
289   public Dali.Property.Map IndeterminateVisual
290   {
291     get
292     {
293       Dali.Property.Map temp = new Dali.Property.Map();
294       GetProperty( ProgressBar.Property.INDETERMINATE_VISUAL).Get(  temp );
295       return temp;
296     }
297     set
298     {
299       SetProperty( ProgressBar.Property.INDETERMINATE_VISUAL, new Dali.Property.Value( value ) );
300     }
301   }
302   public Dali.Property.Array IndeterminateVisualAnimation
303   {
304     get
305     {
306       Dali.Property.Array temp = new Dali.Property.Array();
307       GetProperty( ProgressBar.Property.INDETERMINATE_VISUAL_ANIMATION).Get(  temp );
308       return temp;
309     }
310     set
311     {
312       SetProperty( ProgressBar.Property.INDETERMINATE_VISUAL_ANIMATION, new Dali.Property.Value( value ) );
313     }
314   }
315   public Dali.Property.Map LabelVisual
316   {
317     get
318     {
319       Dali.Property.Map temp = new Dali.Property.Map();
320       GetProperty( ProgressBar.Property.LABEL_VISUAL).Get(  temp );
321       return temp;
322     }
323     set
324     {
325       SetProperty( ProgressBar.Property.LABEL_VISUAL, new Dali.Property.Value( value ) );
326     }
327   }
328
329 }
330
331 }