e282968fa94fc201874f2f4321048f4a883ba8c4
[platform/core/csapi/tizenfx.git] / src / Tizen.NUI.CommonUI / Attributes / SliderAttributes.cs
1 /*
2  * Copyright(c) 2019 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
19 namespace Tizen.NUI.CommonUI
20 {
21     /// <summary>
22     /// SliderAttributes is a class which saves Slider's ux data.
23     /// </summary>
24     /// <since_tizen> 6 </since_tizen>
25     /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
26     [EditorBrowsable(EditorBrowsableState.Never)]
27     public class SliderAttributes : ViewAttributes
28     {
29         /// <summary>
30         /// Creates a new instance of a SliderAttributes.
31         /// </summary>
32         /// <since_tizen> 6 </since_tizen>
33         /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
34         [EditorBrowsable(EditorBrowsableState.Never)]
35         public SliderAttributes() : base()
36         {
37             IndicatorType = Slider.IndicatorType.None;
38         }
39
40         /// <summary>
41         /// Creates a new instance of a SliderAttributes with attributes.
42         /// </summary>
43         /// <param name="attributes">Create SliderAttributes by attributes customized by user.</param>
44         /// <since_tizen> 6 </since_tizen>
45         /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
46         [EditorBrowsable(EditorBrowsableState.Never)]
47         public SliderAttributes(SliderAttributes attributes) : base(attributes)
48         {
49             if(attributes == null)
50             {
51                 return;
52             }
53             if (attributes.BackgroundTrackAttributes != null)
54             {
55                 BackgroundTrackAttributes = attributes.BackgroundTrackAttributes.Clone() as ImageAttributes;
56             }
57             if (attributes.SlidedTrackAttributes != null)
58             {
59                 SlidedTrackAttributes = attributes.SlidedTrackAttributes.Clone() as ImageAttributes;
60             }
61             if (attributes.ThumbBackgroundAttributes != null)
62             {
63                 ThumbBackgroundAttributes = attributes.ThumbBackgroundAttributes.Clone() as ImageAttributes;
64             }
65             if (attributes.ThumbAttributes != null)
66             {
67                 ThumbAttributes = attributes.ThumbAttributes.Clone() as ImageAttributes;
68             }
69             if (attributes.LowIndicatorImageAttributes != null)
70             {
71                 LowIndicatorImageAttributes = attributes.LowIndicatorImageAttributes.Clone() as ImageAttributes;
72             }
73             if (attributes.HighIndicatorImageAttributes != null)
74             {
75                 HighIndicatorImageAttributes = attributes.HighIndicatorImageAttributes.Clone() as ImageAttributes;
76             }
77             if (attributes.LowIndicatorTextAttributes != null)
78             {
79                 LowIndicatorTextAttributes = attributes.LowIndicatorTextAttributes.Clone() as TextAttributes;
80             }
81             if (attributes.HighIndicatorTextAttributes != null)
82             {
83                 HighIndicatorTextAttributes = attributes.HighIndicatorTextAttributes.Clone() as TextAttributes;
84             }
85             if (attributes.TrackThickness != null)
86             {
87                 TrackThickness = attributes.TrackThickness;
88             }
89             if (attributes.SpaceBetweenTrackAndIndicator != null)
90             {
91                 SpaceBetweenTrackAndIndicator = attributes.SpaceBetweenTrackAndIndicator;
92             }
93             IndicatorType = attributes.IndicatorType;
94         }
95
96         /// <summary>
97         /// Get or set background track attributes
98         /// </summary>
99         /// <since_tizen> 6 </since_tizen>
100         /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
101         [EditorBrowsable(EditorBrowsableState.Never)]
102         public ImageAttributes BackgroundTrackAttributes
103         {
104             get;
105             set;
106         }
107
108         /// <summary>
109         /// Get or set slided track attributes
110         /// </summary>
111         /// <since_tizen> 6 </since_tizen>
112         /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
113         [EditorBrowsable(EditorBrowsableState.Never)]
114         public ImageAttributes SlidedTrackAttributes
115         {
116             get;
117             set;
118         }
119
120         /// <summary>
121         /// Get or set thumb attributes
122         /// </summary>
123         /// <since_tizen> 6 </since_tizen>
124         /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
125         [EditorBrowsable(EditorBrowsableState.Never)]
126         public ImageAttributes ThumbAttributes
127         {
128             get;
129             set;
130         }
131
132         /// <summary>
133         /// Get or set thumb background attributes
134         /// </summary>
135         /// <since_tizen> 6 </since_tizen>
136         /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
137         [EditorBrowsable(EditorBrowsableState.Never)]
138         public ImageAttributes ThumbBackgroundAttributes
139         {
140             get;
141             set;
142         }
143
144         /// <summary>
145         /// Get or set low indicator image attributes
146         /// </summary>
147         /// <since_tizen> 6 </since_tizen>
148         /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
149         [EditorBrowsable(EditorBrowsableState.Never)]
150         public ImageAttributes LowIndicatorImageAttributes
151         {
152             get;
153             set;
154         }
155
156         /// <summary>
157         /// Get or set high indicator image attributes
158         /// </summary>
159         /// <since_tizen> 6 </since_tizen>
160         /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
161         [EditorBrowsable(EditorBrowsableState.Never)]
162         public ImageAttributes HighIndicatorImageAttributes
163         {
164             get;
165             set;
166         }
167
168         /// <summary>
169         /// Get or low indicator text attributes
170         /// </summary>
171         /// <since_tizen> 6 </since_tizen>
172         /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
173         [EditorBrowsable(EditorBrowsableState.Never)]
174         public TextAttributes LowIndicatorTextAttributes
175         {
176             get;
177             set;
178         }
179
180         /// <summary>
181         /// Get or set high indicator text attributes
182         /// </summary>
183         /// <since_tizen> 6 </since_tizen>
184         /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
185         [EditorBrowsable(EditorBrowsableState.Never)]
186         public TextAttributes HighIndicatorTextAttributes
187         {
188             get;
189             set;
190         }
191
192         /// <summary>
193         /// Get or set track thickness
194         /// </summary>
195         /// <since_tizen> 6 </since_tizen>
196         /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
197         [EditorBrowsable(EditorBrowsableState.Never)]
198         public uint? TrackThickness
199         {
200             get;
201             set;
202         }
203
204         /// <summary>
205         /// Get or set space between track and indicator
206         /// </summary>
207         /// <since_tizen> 6 </since_tizen>
208         /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
209         [EditorBrowsable(EditorBrowsableState.Never)]
210         public uint? SpaceBetweenTrackAndIndicator
211         {
212             get;
213             set;
214         }
215
216         /// <summary>
217         /// Get or set Indicator type
218         /// </summary>
219         /// <since_tizen> 6 </since_tizen>
220         /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
221         [EditorBrowsable(EditorBrowsableState.Never)]
222         public Slider.IndicatorType IndicatorType
223         {
224             get;
225             set;
226         }
227
228         /// <summary>
229         /// Attributes's clone function.
230         /// </summary>
231         /// <since_tizen> 6 </since_tizen>
232         /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
233         [EditorBrowsable(EditorBrowsableState.Never)]
234         public override Attributes Clone()
235         {
236             return new SliderAttributes(this);
237         }
238     }
239 }