remove DOT_NET_CORE define, clean up debug log
[platform/core/csapi/tizenfx.git] / src / Tizen.NUI / src / 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.9
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 Tizen.NUI.UIComponents
28 {
29
30     using System;
31     using System.Runtime.InteropServices;
32     using Tizen.NUI.BaseComponents;
33
34     /// <summary>
35     /// ProgressBar is a control to give the user an indication of the progress of an operation.
36     /// </summary>
37     public class ProgressBar : View
38     {
39         private global::System.Runtime.InteropServices.HandleRef swigCPtr;
40
41         internal ProgressBar(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.ProgressBar_SWIGUpcast(cPtr), cMemoryOwn)
42         {
43             swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
44         }
45
46         internal static global::System.Runtime.InteropServices.HandleRef getCPtr(ProgressBar obj)
47         {
48             return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
49         }
50
51         /// <summary>
52         /// To make ProgressBar instance be disposed.
53         /// </summary>
54         protected override void Dispose(DisposeTypes type)
55         {
56             if (disposed)
57             {
58                 return;
59             }
60
61             if (type == DisposeTypes.Explicit)
62             {
63                 //Called by User
64                 //Release your own managed resources here.
65                 //You should release all of your own disposable objects here.
66
67             }
68
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.
72
73             if (swigCPtr.Handle != global::System.IntPtr.Zero)
74             {
75                 if (swigCMemOwn)
76                 {
77                     swigCMemOwn = false;
78                     NDalicPINVOKE.delete_ProgressBar(swigCPtr);
79                 }
80                 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
81             }
82
83             base.Dispose(type);
84         }
85
86
87         /// <summary>
88         /// Event arguments that passed via ValueChangedEventArgs
89         /// </summary>
90         public class ValueChangedEventArgs : EventArgs
91         {
92             private ProgressBar _progressBar;
93             private float _progressValue;
94             private float _secondaryProgressValue;
95
96             public ProgressBar ProgressBar
97             {
98                 get
99                 {
100                     return _progressBar;
101                 }
102                 set
103                 {
104                     _progressBar = value;
105                 }
106             }
107
108             public float ProgressValue
109             {
110                 get
111                 {
112                     return _progressValue;
113                 }
114                 set
115                 {
116                     _progressValue = value;
117                 }
118             }
119
120             public float SecondaryProgressValue
121             {
122                 get
123                 {
124                     return _secondaryProgressValue;
125                 }
126                 set
127                 {
128                     _secondaryProgressValue = value;
129                 }
130             }
131
132         }
133
134         [UnmanagedFunctionPointer(CallingConvention.StdCall)]
135         private delegate void ValueChangedCallbackDelegate(IntPtr progressBar, float progressValue, float secondaryProgressValue);
136         private EventHandler<ValueChangedEventArgs> _progressBarValueChangedEventHandler;
137         private ValueChangedCallbackDelegate _progressBarValueChangedCallbackDelegate;
138
139         /// <summary>
140         /// Event is sent when the ProgressBar value changes.
141         /// </summary>
142         public event EventHandler<ValueChangedEventArgs> ValueChanged
143         {
144             add
145             {
146                 if (_progressBarValueChangedEventHandler == null)
147                 {
148                     _progressBarValueChangedCallbackDelegate = (OnValueChanged);
149                     ValueChangedSignal().Connect(_progressBarValueChangedCallbackDelegate);
150                 }
151                 _progressBarValueChangedEventHandler += value;
152             }
153             remove
154             {
155                 _progressBarValueChangedEventHandler -= value;
156                 if (_progressBarValueChangedEventHandler == null && ValueChangedSignal().Empty() == false)
157                 {
158                     ValueChangedSignal().Disconnect(_progressBarValueChangedCallbackDelegate);
159                 }
160             }
161         }
162
163         // Callback for ProgressBar ValueChanged signal
164         private void OnValueChanged(IntPtr progressBar, float progressValue, float secondaryProgressValue)
165         {
166             ValueChangedEventArgs e = new ValueChangedEventArgs();
167
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;
172
173             if (_progressBarValueChangedEventHandler != null)
174             {
175                 _progressBarValueChangedEventHandler(this, e);
176             }
177         }
178
179         internal class Property
180         {
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();
190         }
191
192         /// <summary>
193         /// Creates the ProgressBar.
194         /// </summary>
195         public ProgressBar() : this(NDalicPINVOKE.ProgressBar_New(), true)
196         {
197             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
198
199         }
200
201         internal ProgressBarValueChangedSignal ValueChangedSignal()
202         {
203             ProgressBarValueChangedSignal ret = new ProgressBarValueChangedSignal(NDalicPINVOKE.ProgressBar_ValueChangedSignal(swigCPtr), false);
204             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
205             return ret;
206         }
207
208         /// <summary>
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>
213         /// </summary>
214         public float ProgressValue
215         {
216             get
217             {
218                 float temp = 0.0f;
219                 GetProperty(ProgressBar.Property.PROGRESS_VALUE).Get(out temp);
220                 return temp;
221             }
222             set
223             {
224                 SetProperty(ProgressBar.Property.PROGRESS_VALUE, new Tizen.NUI.PropertyValue(value));
225             }
226         }
227         /// <summary>
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>
233         /// </summary>
234         public float SecondaryProgressValue
235         {
236             get
237             {
238                 float temp = 0.0f;
239                 GetProperty(ProgressBar.Property.SECONDARY_PROGRESS_VALUE).Get(out temp);
240                 return temp;
241             }
242             set
243             {
244                 SetProperty(ProgressBar.Property.SECONDARY_PROGRESS_VALUE, new Tizen.NUI.PropertyValue(value));
245             }
246         }
247         /// <summary>
248         /// Sets the progress-bar as \e indeterminate state.
249         /// </summary>
250         public bool Indeterminate
251         {
252             get
253             {
254                 bool temp = false;
255                 GetProperty(ProgressBar.Property.INDETERMINATE).Get(out temp);
256                 return temp;
257             }
258             set
259             {
260                 SetProperty(ProgressBar.Property.INDETERMINATE, new Tizen.NUI.PropertyValue(value));
261             }
262         }
263         /// <summary>
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>
266         /// </summary>
267         public Tizen.NUI.PropertyMap TrackVisual
268         {
269             get
270             {
271                 Tizen.NUI.PropertyMap temp = new Tizen.NUI.PropertyMap();
272                 GetProperty(ProgressBar.Property.TRACK_VISUAL).Get(temp);
273                 return temp;
274             }
275             set
276             {
277                 SetProperty(ProgressBar.Property.TRACK_VISUAL, new Tizen.NUI.PropertyValue(value));
278             }
279         }
280         /// <summary>
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>
283         /// </summary>
284         public Tizen.NUI.PropertyMap ProgressVisual
285         {
286             get
287             {
288                 Tizen.NUI.PropertyMap temp = new Tizen.NUI.PropertyMap();
289                 GetProperty(ProgressBar.Property.PROGRESS_VISUAL).Get(temp);
290                 return temp;
291             }
292             set
293             {
294                 SetProperty(ProgressBar.Property.PROGRESS_VISUAL, new Tizen.NUI.PropertyValue(value));
295             }
296         }
297         /// <summary>
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>
300         /// </summary>
301         public Tizen.NUI.PropertyMap SecondaryProgressVisual
302         {
303             get
304             {
305                 Tizen.NUI.PropertyMap temp = new Tizen.NUI.PropertyMap();
306                 GetProperty(ProgressBar.Property.SECONDARY_PROGRESS_VISUAL).Get(temp);
307                 return temp;
308             }
309             set
310             {
311                 SetProperty(ProgressBar.Property.SECONDARY_PROGRESS_VISUAL, new Tizen.NUI.PropertyValue(value));
312             }
313         }
314         /// <summary>
315         /// The indeterminate visual of progress bar.<br>
316         /// Optional. If not supplied, the default inditerminate visual will be shown.<br>
317         /// </summary>
318         public Tizen.NUI.PropertyMap IndeterminateVisual
319         {
320             get
321             {
322                 Tizen.NUI.PropertyMap temp = new Tizen.NUI.PropertyMap();
323                 GetProperty(ProgressBar.Property.INDETERMINATE_VISUAL).Get(temp);
324                 return temp;
325             }
326             set
327             {
328                 SetProperty(ProgressBar.Property.INDETERMINATE_VISUAL, new Tizen.NUI.PropertyValue(value));
329             }
330         }
331         /// <summary>
332         /// The transition data for indeterminate visual animation.<br>
333         /// Optional. If not supplied, default animation will be played.<br>
334         /// </summary>
335         public Tizen.NUI.PropertyArray IndeterminateVisualAnimation
336         {
337             get
338             {
339                 Tizen.NUI.PropertyArray temp = new Tizen.NUI.PropertyArray();
340                 GetProperty(ProgressBar.Property.INDETERMINATE_VISUAL_ANIMATION).Get(temp);
341                 return temp;
342             }
343             set
344             {
345                 SetProperty(ProgressBar.Property.INDETERMINATE_VISUAL_ANIMATION, new Tizen.NUI.PropertyValue(value));
346             }
347         }
348         /// <summary>
349         /// The Label visual of progress bar.
350         /// </summary>
351         public Tizen.NUI.PropertyMap LabelVisual
352         {
353             get
354             {
355                 Tizen.NUI.PropertyMap temp = new Tizen.NUI.PropertyMap();
356                 GetProperty(ProgressBar.Property.LABEL_VISUAL).Get(temp);
357                 return temp;
358             }
359             set
360             {
361                 SetProperty(ProgressBar.Property.LABEL_VISUAL, new Tizen.NUI.PropertyValue(value));
362             }
363         }
364
365     }
366
367 }