[ACR-564] deprecate unused API
[platform/core/csapi/tizenfx.git] / src / Tizen.NUI.Wearable / src / public / WearableStyle / CircularSliderStyle.cs
1 /*
2  * Copyright(c) 2020 Samsung Electronics Co., Ltd.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  *
16  */
17 using System.ComponentModel;
18 using Tizen.NUI.BaseComponents;
19 using Tizen.NUI.Binding;
20 using Tizen.NUI.Components;
21 using System;
22
23 namespace Tizen.NUI.Wearable
24 {
25     /// <summary>
26     /// CircularSliderStyle is a class which saves CircularSlider's ux data.
27     /// </summary>
28     [Obsolete("This has been deprecated in API12")]
29     [EditorBrowsable(EditorBrowsableState.Never)]
30     public class CircularSliderStyle : ControlStyle
31     {
32         /// <summary>Bindable property of Thickness</summary>
33         [EditorBrowsable(EditorBrowsableState.Never)]
34         public static readonly BindableProperty ThicknessProperty = BindableProperty.Create(nameof(Thickness), typeof(float?), typeof(CircularSliderStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
35         {
36             ((CircularSliderStyle)bindable).thickness = (float?)newValue;
37         },
38         defaultValueCreator: (bindable) =>
39         {
40             return ((CircularSliderStyle)bindable).thickness;
41         });
42
43         /// <summary>Bindable property of MaxValue</summary>
44         [EditorBrowsable(EditorBrowsableState.Never)]
45         public static readonly BindableProperty MaxValueProperty = BindableProperty.Create(nameof(MaxValue), typeof(float), typeof(CircularSliderStyle), default(float), propertyChanged: (bindable, oldValue, newValue) =>
46         {
47             ((CircularSliderStyle)bindable).maxValue = (float)newValue;
48         },
49         defaultValueCreator: (bindable) =>
50         {
51             return ((CircularSliderStyle)bindable).maxValue;
52         });
53
54         /// <summary>Bindable property of MinValue</summary>
55         [EditorBrowsable(EditorBrowsableState.Never)]
56         public static readonly BindableProperty MinValueProperty = BindableProperty.Create(nameof(MinValue), typeof(float), typeof(CircularSliderStyle), default(float), propertyChanged: (bindable, oldValue, newValue) =>
57         {
58             ((CircularSliderStyle)bindable).minValue = (float)newValue;
59         },
60         defaultValueCreator: (bindable) =>
61         {
62             return ((CircularSliderStyle)bindable).minValue;
63         });
64
65         /// <summary>Bindable property of CurrentValue</summary>
66         [EditorBrowsable(EditorBrowsableState.Never)]
67         public static readonly BindableProperty CurrentValueProperty = BindableProperty.Create(nameof(CurrentValue), typeof(float), typeof(CircularSliderStyle), default(float), propertyChanged: (bindable, oldValue, newValue) =>
68         {
69             ((CircularSliderStyle)bindable).currentValue = (float)newValue;
70         },
71         defaultValueCreator: (bindable) =>
72         {
73             return ((CircularSliderStyle)bindable).currentValue;
74         });
75
76         /// <summary>Bindable property of TrackColor</summary>
77         [EditorBrowsable(EditorBrowsableState.Never)]
78         public static readonly BindableProperty TrackColorProperty = BindableProperty.Create(nameof(TrackColor), typeof(Color), typeof(CircularSliderStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
79         {
80             ((CircularSliderStyle)bindable).trackColor = newValue == null ? null : new Color((Color)newValue);
81         },
82         defaultValueCreator: (bindable) =>
83         {
84             return ((CircularSliderStyle)bindable).trackColor;
85         });
86
87         /// <summary>Bindable property of ProgressColor</summary>
88         [EditorBrowsable(EditorBrowsableState.Never)]
89         public static readonly BindableProperty ProgressColorProperty = BindableProperty.Create(nameof(ProgressColor), typeof(Color), typeof(CircularSliderStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
90         {
91             ((CircularSliderStyle)bindable).progressColor = newValue == null ? null : new Color((Color)newValue);
92         },
93         defaultValueCreator: (bindable) =>
94         {
95             return ((CircularSliderStyle)bindable).progressColor;
96         });
97
98         /// <summary>Bindable property of ThumbSize</summary>
99         [EditorBrowsable(EditorBrowsableState.Never)]
100         public static readonly BindableProperty ThumbSizeProperty = BindableProperty.Create(nameof(ThumbSize), typeof(Size), typeof(CircularSliderStyle), new Size(0, 0), propertyChanged: (bindable, oldValue, newValue) =>
101         {
102             ((CircularSliderStyle)bindable).thumbSize = (Size)newValue;
103         },
104         defaultValueCreator: (bindable) =>
105         {
106             return ((CircularSliderStyle)bindable).thumbSize;
107         });
108
109         /// <summary>Bindable property of ThumbColor</summary>
110         [EditorBrowsable(EditorBrowsableState.Never)]
111         public static readonly BindableProperty ThumbColorProperty = BindableProperty.Create(nameof(ThumbColor), typeof(Color), typeof(CircularSliderStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
112         {
113             ((CircularSliderStyle)bindable).thumbColor = newValue == null ? null : new Color((Color)newValue);
114         },
115         defaultValueCreator: (bindable) =>
116         {
117             return ((CircularSliderStyle)bindable).thumbColor;
118         });
119
120         /// <summary>Bindable property of IsEnabled</summary>
121         [EditorBrowsable(EditorBrowsableState.Never)]
122         public new static readonly BindableProperty IsEnabledProperty = BindableProperty.Create(nameof(IsEnabled), typeof(bool?), typeof(CircularSliderStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
123         {
124             ((CircularSliderStyle)bindable).isEnabled = (bool?)newValue;
125         },
126         defaultValueCreator: (bindable) =>
127         {
128             return ((CircularSliderStyle)bindable).isEnabled;
129         });
130
131         private float? thickness;
132         private float maxValue;
133         private float minValue;
134         private float currentValue;
135         private Color trackColor;
136         private Color progressColor;
137         private Color thumbColor;
138         private Size thumbSize;
139         private bool? isEnabled;
140
141         static CircularSliderStyle() { }
142
143         /// <summary>
144         /// Creates a new instance of a CircularSliderStyle.
145         /// </summary>
146         [Obsolete("This has been deprecated in API12")]
147         [EditorBrowsable(EditorBrowsableState.Never)]
148         public CircularSliderStyle() : base()
149         {
150             Initialize();
151         }
152
153         /// <summary>
154         /// Creates a new instance of a CircularSliderStyle with style.
155         /// </summary>
156         /// <param name="style">Create CircularSliderStyle by style customized by user.</param>
157         [Obsolete("This has been deprecated in API12")]
158         [EditorBrowsable(EditorBrowsableState.Never)]
159         public CircularSliderStyle(CircularSliderStyle style) : base(style)
160         {
161         }
162
163         /// <summary>
164         /// The thickness of the track and progress.
165         /// </summary>
166         [Obsolete("This has been deprecated in API12")]
167         [EditorBrowsable(EditorBrowsableState.Never)]
168         public float? Thickness
169         {
170             get
171             {
172                 return (float?)GetValue(ThicknessProperty);
173             }
174             set
175             {
176                 SetValue(ThicknessProperty, value);
177             }
178         }
179
180         /// <summary>
181         /// The property to get/set the maximum value of the CircularSlider.
182         /// </summary>
183         [Obsolete("This has been deprecated in API12")]
184         [EditorBrowsable(EditorBrowsableState.Never)]
185         public float MaxValue
186         {
187             get
188             {
189                 return (float)GetValue(MaxValueProperty);
190             }
191             set
192             {
193                 SetValue(MaxValueProperty, value);
194             }
195         }
196
197         /// <summary>
198         /// The property to get/set the minim value of the CircularSlider.
199         /// </summary>
200         [Obsolete("This has been deprecated in API12")]
201         [EditorBrowsable(EditorBrowsableState.Never)]
202         public float MinValue
203         {
204             get
205             {
206                 return (float)GetValue(MinValueProperty);
207             }
208             set
209             {
210                 SetValue(MinValueProperty, value);
211             }
212         }
213
214         /// <summary>
215         /// The property to get/set the current value of the CircularSlider.
216         /// </summary>
217         [Obsolete("This has been deprecated in API12")]
218         [EditorBrowsable(EditorBrowsableState.Never)]
219         public float CurrentValue
220         {
221             get
222             {
223                 return (float)GetValue(CurrentValueProperty);
224             }
225             set
226             {
227                 SetValue(CurrentValueProperty, value);
228             }
229         }
230
231         /// <summary>
232         /// The property to get/set Track object color of the CircularSlider.
233         /// </summary>
234         [Obsolete("This has been deprecated in API12")]
235         [EditorBrowsable(EditorBrowsableState.Never)]
236         public Color TrackColor
237         {
238             get
239             {
240                 return (Color)GetValue(TrackColorProperty);
241             }
242             set
243             {
244                 SetValue(TrackColorProperty, value);
245             }
246         }
247
248         /// <summary>
249         /// The property to get/set Progress object color of the CircularSlider.
250         /// </summary>
251         [Obsolete("This has been deprecated in API12")]
252         [EditorBrowsable(EditorBrowsableState.Never)]
253         public Color ProgressColor
254         {
255             get
256             {
257                 return (Color)GetValue(ProgressColorProperty);
258             }
259             set
260             {
261                 SetValue(ProgressColorProperty, value);
262             }
263         }
264
265         /// <summary>
266         /// Gets or sets the size of the thumb of Slider.
267         /// </summary>
268         [Obsolete("This has been deprecated in API12")]
269         [EditorBrowsable(EditorBrowsableState.Never)]
270         public Size ThumbSize
271         {
272             get
273             {
274                 return (Size)GetValue(ThumbSizeProperty);
275             }
276             set
277             {
278                 SetValue(ThumbSizeProperty, value);
279             }
280         }
281
282         /// <summary>
283         /// The property to get/set Thumb object color of the CircularSlider.
284         /// </summary>
285         [Obsolete("This has been deprecated in API12")]
286         [EditorBrowsable(EditorBrowsableState.Never)]
287         public Color ThumbColor
288         {
289             get
290             {
291                 return (Color)GetValue(ThumbColorProperty);
292             }
293             set
294             {
295                 SetValue(ThumbColorProperty, value);
296             }
297         }
298
299         /// <summary>
300         /// Flag to be enabled or disabled in CircularSlider.
301         /// </summary>
302         /// <since_tizen> 8 </since_tizen>
303         [Obsolete("This has been deprecated in API12")]
304         public new bool? IsEnabled
305         {
306             get
307             {
308                 return (bool?)GetValue(IsEnabledProperty);
309             }
310             set
311             {
312                 SetValue(IsEnabledProperty, value);
313             }
314         }
315
316         private void Initialize()
317         {
318             isEnabled = true;
319             thickness = 6.0f;
320             maxValue = 100.0f;
321             minValue = 0.0f;
322             currentValue = 0.0f;
323             trackColor = new Color(0.0f, 0.16f, 0.30f, 1.0f); // #002A4D
324             progressColor = new Color(0.0f, 0.55f, 1.0f, 1.0f); // #008CFF
325             thumbSize = new Size(19, 19);
326             thumbColor = new Color(0.0f, 0.55f, 1.0f, 1.0f); // #008CFF
327         }
328     }
329 }