[NUI] Change the name of Tizen.NUI.CommonUI as Tizen.NUI.Components (#958)
[platform/core/csapi/tizenfx.git] / src / Tizen.NUI.Components / Attributes / ViewAttributes.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     /// The base class for Children attributes in Components.
23     /// </summary>
24     /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
25     [EditorBrowsable(EditorBrowsableState.Never)]
26     public class ViewAttributes : Attributes
27     {
28         /// <summary>
29         /// Construct ViewAttributes.
30         /// </summary>
31         /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
32         [EditorBrowsable(EditorBrowsableState.Never)]
33         public ViewAttributes() : base() { }
34         /// <summary>
35         /// Constructs a ViewAttributes that is a copy of attrs.
36         /// </summary>
37         /// <param name="attributes">Construct Attributes</param>
38         /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
39         [EditorBrowsable(EditorBrowsableState.Never)]
40         public ViewAttributes(ViewAttributes attributes)
41         {
42             if (attributes == null)
43             {
44                 return;
45             }
46
47             if (attributes.Position2D != null)
48             {
49                 Position2D = new Position2D(attributes.Position2D.X, attributes.Position2D.Y);
50             }
51
52             if (attributes.Size2D != null)
53             {
54                 Size2D = new Size2D(attributes.Size2D.Width, attributes.Size2D.Height);
55             }
56
57             if (attributes.BackgroundColor != null)
58             {
59                 BackgroundColor = attributes.BackgroundColor.Clone() as ColorSelector;
60             }
61
62             if (attributes.PositionUsesPivotPoint != null)
63             {
64                 PositionUsesPivotPoint = attributes.PositionUsesPivotPoint;
65             }
66
67             if (attributes.ParentOrigin != null)
68             {
69                 ParentOrigin = new Position(attributes.ParentOrigin.X, attributes.ParentOrigin.Y, attributes.ParentOrigin.Z);
70             }
71
72             if (attributes.PivotPoint != null)
73             {
74                 PivotPoint = new Position(attributes.PivotPoint.X, attributes.PivotPoint.Y, attributes.PivotPoint.Z);
75             }
76
77             if (attributes.WidthResizePolicy != null)
78             {
79                 WidthResizePolicy = attributes.WidthResizePolicy;
80             }
81
82             if (attributes.HeightResizePolicy != null)
83             {
84                 HeightResizePolicy = attributes.HeightResizePolicy;
85             }
86
87             if (attributes.MinimumSize != null)
88             {
89                 MinimumSize = new Size2D(attributes.MinimumSize.Width, attributes.MinimumSize.Height);
90             }
91
92             if (attributes.SizeModeFactor != null)
93             {
94                 SizeModeFactor = new Vector3(attributes.SizeModeFactor.X, attributes.SizeModeFactor.Y, attributes.SizeModeFactor.Z);
95             }
96
97             if (attributes.Opacity != null)
98             {
99                 Opacity = attributes.Opacity.Clone() as FloatSelector;
100             }
101
102             PaddingLeft = attributes.PaddingLeft;
103             PaddingRight = attributes.PaddingRight;
104             PaddingTop = attributes.PaddingTop;
105             PaddingBottom = attributes.PaddingBottom;
106         }
107         /// <summary>
108         /// View Position
109         /// </summary>
110         /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
111         [EditorBrowsable(EditorBrowsableState.Never)]
112         public Position2D Position2D
113         {
114             get;
115             set;
116         }
117         /// <summary>
118         /// View Size
119         /// </summary>
120         /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
121         [EditorBrowsable(EditorBrowsableState.Never)]
122         public Size2D Size2D
123         {
124             get;
125             set;
126         }
127         /// <summary>
128         /// View BackgroundColor
129         /// </summary>
130         /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
131         [EditorBrowsable(EditorBrowsableState.Never)]
132         public ColorSelector BackgroundColor
133         {
134             get;
135             set;
136         }
137         /// <summary>
138         /// View PositionUsesPivotPoint
139         /// </summary>
140         /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
141         [EditorBrowsable(EditorBrowsableState.Never)]
142         public bool? PositionUsesPivotPoint
143         {
144             get;
145             set;
146         }
147         /// <summary>
148         /// View ParentOrigin
149         /// </summary>
150         /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
151         [EditorBrowsable(EditorBrowsableState.Never)]
152         public Position ParentOrigin
153         {
154             get;
155             set;
156         }
157         /// <summary>
158         /// View PivotPoint
159         /// </summary>
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 Position PivotPoint
163         {
164             get;
165             set;
166         }
167         /// <summary>
168         /// View WidthResizePolicy
169         /// </summary>
170         /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
171         [EditorBrowsable(EditorBrowsableState.Never)]
172         public ResizePolicyType? WidthResizePolicy
173         {
174             get;
175             set;
176         }
177         /// <summary>
178         /// View HeightResizePolicy
179         /// </summary>
180         /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
181         [EditorBrowsable(EditorBrowsableState.Never)]
182         public ResizePolicyType? HeightResizePolicy
183         {
184             get;
185             set;
186         }
187         /// <summary>
188         /// View MinimumSize
189         /// </summary>
190         /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
191         [EditorBrowsable(EditorBrowsableState.Never)]
192         public Size2D MinimumSize
193         {
194             get;
195             set;
196         }
197         /// <summary>
198         /// View SizeModeFactor
199         /// </summary>
200         /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
201         [EditorBrowsable(EditorBrowsableState.Never)]
202         public Vector3 SizeModeFactor
203         {
204             get;
205             set;
206         }
207         /// <summary>
208         /// View Opacity
209         /// </summary>
210         /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
211         [EditorBrowsable(EditorBrowsableState.Never)]
212         public FloatSelector Opacity
213         {
214             get;
215             set;
216         }
217         /// <summary>
218         /// View left padding
219         /// </summary>
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 int PaddingLeft
223         {
224             get;
225             set;
226         }
227         /// <summary>
228         /// View right padding
229         /// </summary>
230         /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
231         [EditorBrowsable(EditorBrowsableState.Never)]
232         public int PaddingRight
233         {
234             get;
235             set;
236         }
237         /// <summary>
238         /// View top padding
239         /// </summary>
240         /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
241         [EditorBrowsable(EditorBrowsableState.Never)]
242         public int PaddingTop
243         {
244             get;
245             set;
246         }
247         /// <summary>
248         /// View bottom padding
249         /// </summary>
250         /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
251         [EditorBrowsable(EditorBrowsableState.Never)]
252         public int PaddingBottom
253         {
254             get;
255             set;
256         }
257         /// <summary>
258         /// Attributes's clone function.
259         /// </summary>
260         /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
261         [EditorBrowsable(EditorBrowsableState.Never)]
262         public override Attributes Clone()
263         {
264             return new ViewAttributes(this);
265         }
266
267     }
268 }