[NUI] Change the name of Tizen.NUI.CommonUI as Tizen.NUI.Components (#958)
[platform/core/csapi/tizenfx.git] / src / Tizen.NUI.Components / Attributes / DropDownAttributes.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.Components
20 {
21     /// <summary>
22     /// DropDownAttributes is a class which saves DropDown'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 DropDownAttributes : ViewAttributes
28     {
29         /// <summary>
30         /// Creates a new instance of a DropDownAttributes.
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 DropDownAttributes() : base()
36         {
37             SpaceBetweenButtonTextAndIcon = 0;
38             Space = new Vector4(0, 0, 0, 0);
39             ListRelativeOrientation = DropDown.ListOrientation.Left;
40             ListMargin = new Vector4(0, 0, 0, 0);
41             FocusedItemIndex = 0;
42         }
43         /// <summary>
44         /// Creates a new instance of a DropDownAttributes with attributes.
45         /// </summary>
46         /// <param name="attributes">Create DropDownAttributes by attributes customized by user.</param>
47         /// <since_tizen> 6 </since_tizen>
48         /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
49         [EditorBrowsable(EditorBrowsableState.Never)]
50         public DropDownAttributes(DropDownAttributes attributes) : base(attributes)
51         {
52             if(attributes == null)
53             {
54                 return;
55             }
56
57             if (attributes.ButtonAttributes != null)
58             {
59                 ButtonAttributes = attributes.ButtonAttributes.Clone() as ButtonAttributes;
60             }
61
62             if (attributes.HeaderTextAttributes != null)
63             {
64                 HeaderTextAttributes = attributes.HeaderTextAttributes.Clone() as TextAttributes;
65             }
66
67             if (attributes.ListBackgroundImageAttributes != null)
68             {
69                 ListBackgroundImageAttributes = attributes.ListBackgroundImageAttributes.Clone() as ImageAttributes;
70             }
71
72             if (attributes.Space != null)
73             {
74                 Space = new Vector4(attributes.Space.X, attributes.Space.Y, attributes.Space.Z, attributes.Space.W);
75             }
76
77             if (attributes.ListMargin != null)
78             {
79                 ListMargin = new Vector4(attributes.ListMargin.X, attributes.ListMargin.Y, attributes.ListMargin.Z, attributes.ListMargin.W);
80             }
81
82             if (attributes.ListSize2D != null)
83             {
84                 ListSize2D = new Size2D(attributes.ListSize2D.Width, attributes.ListSize2D.Height);
85             }
86
87             if (attributes.ListPadding != null)
88             {
89                 ListPadding = attributes.ListPadding;
90             }
91
92             SpaceBetweenButtonTextAndIcon = attributes.SpaceBetweenButtonTextAndIcon;
93             ListRelativeOrientation = attributes.ListRelativeOrientation;
94             FocusedItemIndex = attributes.FocusedItemIndex;
95         }
96
97         /// <summary>
98         /// DropDown button's attributes.
99         /// </summary>
100         /// <since_tizen> 6 </since_tizen>
101         /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
102         [EditorBrowsable(EditorBrowsableState.Never)]
103         public ButtonAttributes ButtonAttributes
104         {
105             get;
106             set;
107         }
108
109         /// <summary>
110         /// Header text's attributes.
111         /// </summary>
112         /// <since_tizen> 6 </since_tizen>
113         /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
114         [EditorBrowsable(EditorBrowsableState.Never)]
115         public TextAttributes HeaderTextAttributes
116         {
117             get;
118             set;
119         }
120
121         /// <summary>
122         /// Space between button text and button icon.
123         /// </summary>
124         /// <since_tizen> 6 </since_tizen>
125         /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
126         [EditorBrowsable(EditorBrowsableState.Never)]
127         public int SpaceBetweenButtonTextAndIcon
128         {
129             get;
130             set;
131         }
132
133         /// <summary>
134         /// List background image's attributes.
135         /// </summary>
136         /// <since_tizen> 6 </since_tizen>
137         /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
138         [EditorBrowsable(EditorBrowsableState.Never)]
139         public ImageAttributes ListBackgroundImageAttributes
140         {
141             get;
142             set;
143         }
144
145         /// <summary>
146         /// Space in DropDown.
147         /// </summary>
148         /// <since_tizen> 6 </since_tizen>
149         /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
150         [EditorBrowsable(EditorBrowsableState.Never)]
151         public Vector4 Space
152         {
153             get;
154             set;
155         }
156
157         /// <summary>
158         /// List relative orientation.
159         /// </summary>
160         /// <since_tizen> 6 </since_tizen>
161         /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
162         [EditorBrowsable(EditorBrowsableState.Never)]
163         public DropDown.ListOrientation ListRelativeOrientation
164         {
165             get;
166             set;
167         }
168
169         /// <summary>
170         /// List margin.
171         /// </summary>
172         /// <since_tizen> 6 </since_tizen>
173         /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
174         [EditorBrowsable(EditorBrowsableState.Never)]
175         public Vector4 ListMargin
176         {
177             get;
178             set;
179         }
180
181         /// <summary>
182         /// Focused item index.
183         /// </summary>
184         /// <since_tizen> 6 </since_tizen>
185         /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
186         [EditorBrowsable(EditorBrowsableState.Never)]
187         public int FocusedItemIndex
188         {
189             get;
190             set;
191         }
192
193         /// <summary>
194         /// List size.
195         /// </summary>
196         /// <since_tizen> 6 </since_tizen>
197         /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
198         [EditorBrowsable(EditorBrowsableState.Never)]
199         public Size2D ListSize2D
200         {
201             get;
202             set;
203         }
204
205         /// <summary>
206         /// List padding.
207         /// </summary>
208         /// <since_tizen> 6 </since_tizen>
209         /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
210         [EditorBrowsable(EditorBrowsableState.Never)]
211         public Extents ListPadding
212         {
213             get;
214             set;
215         }
216
217         /// <summary>
218         /// Attributes's clone function.
219         /// </summary>
220         /// <since_tizen> 6 </since_tizen>
221         /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
222         [EditorBrowsable(EditorBrowsableState.Never)]
223         public override Attributes Clone()
224         {
225             return new DropDownAttributes(this);
226         }
227     }
228
229     /// <summary>
230     /// DropDownItemAttributes is a class which saves DropDownItem's ux data.
231     /// </summary>
232     /// <since_tizen> 6 </since_tizen>
233     /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
234     [EditorBrowsable(EditorBrowsableState.Never)]
235     public class DropDownItemAttributes : ViewAttributes
236     {
237         /// <summary>
238         /// Creates a new instance of a DropDownItemAttributes.
239         /// </summary>
240         /// <since_tizen> 6 </since_tizen>
241         /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
242         [EditorBrowsable(EditorBrowsableState.Never)]
243         public DropDownItemAttributes() : base() { }
244         /// <summary>
245         /// Creates a new instance of a DropDownItemAttributes with attributes.
246         /// </summary>
247         /// <param name="attributes">Create DropDownItemAttributes by attributes customized by user.</param>
248         /// <since_tizen> 6 </since_tizen>
249         /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
250         [EditorBrowsable(EditorBrowsableState.Never)]
251         public DropDownItemAttributes(DropDownItemAttributes attributes) : base(attributes)
252         {
253             if (attributes.TextAttributes != null)
254             {
255                 TextAttributes = attributes.TextAttributes.Clone() as TextAttributes;
256             }
257
258             if (attributes.IconAttributes != null)
259             {
260                 IconAttributes = attributes.IconAttributes.Clone() as ImageAttributes;
261             }
262
263             if (attributes.CheckImageAttributes != null)
264             {
265                 CheckImageAttributes = attributes.CheckImageAttributes.Clone() as ImageAttributes;
266             }
267
268             CheckImageRightSpace = attributes.CheckImageRightSpace;
269             IsSelected = attributes.IsSelected;
270         }
271
272         /// <summary>
273         /// Text's attributes.
274         /// </summary>
275         /// <since_tizen> 6 </since_tizen>
276         /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
277         [EditorBrowsable(EditorBrowsableState.Never)]
278         public TextAttributes TextAttributes
279         {
280             get;
281             set;
282         }
283
284         /// <summary>
285         /// Icon's attributes.
286         /// </summary>
287         /// <since_tizen> 6 </since_tizen>
288         /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
289         [EditorBrowsable(EditorBrowsableState.Never)]
290         public ImageAttributes IconAttributes
291         {
292             get;
293             set;
294         }
295
296         /// <summary>
297         /// Check image's attributes.
298         /// </summary>
299         /// <since_tizen> 6 </since_tizen>
300         /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
301         [EditorBrowsable(EditorBrowsableState.Never)]
302         public ImageAttributes CheckImageAttributes
303         {
304             get;
305             set;
306         }
307
308         /// <summary>
309         /// Right space from check image.
310         /// </summary>
311         /// <since_tizen> 6 </since_tizen>
312         /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
313         [EditorBrowsable(EditorBrowsableState.Never)]
314         public int CheckImageRightSpace
315         {
316             get;
317             set;
318         }
319
320         /// <summary>
321         /// Flag to decide item is selected or not.
322         /// </summary>
323         /// <since_tizen> 6 </since_tizen>
324         /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
325         [EditorBrowsable(EditorBrowsableState.Never)]
326         public bool IsSelected
327         {
328             get;
329             set;
330         }
331
332         /// <summary>
333         /// Attributes's clone function.
334         /// </summary>
335         /// <since_tizen> 6 </since_tizen>
336         /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
337         [EditorBrowsable(EditorBrowsableState.Never)]
338         public override Attributes Clone()
339         {
340             return new DropDownItemAttributes(this);
341         }
342     }
343 }