2 * Copyright(c) 2019 Samsung Electronics Co., Ltd.
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
17 using System.ComponentModel;
19 namespace Tizen.NUI.CommonUI
22 /// The base class for Children attributes in Components.
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
29 /// Construct ViewAttributes.
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() { }
35 /// Constructs a ViewAttributes that is a copy of attrs.
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)
42 if (attributes == null)
47 if (attributes.Position2D != null)
49 Position2D = new Position2D(attributes.Position2D.X, attributes.Position2D.Y);
52 if (attributes.Size2D != null)
54 Size2D = new Size2D(attributes.Size2D.Width, attributes.Size2D.Height);
57 if (attributes.BackgroundColor != null)
59 BackgroundColor = attributes.BackgroundColor.Clone() as ColorSelector;
62 if (attributes.PositionUsesPivotPoint != null)
64 PositionUsesPivotPoint = attributes.PositionUsesPivotPoint;
67 if (attributes.ParentOrigin != null)
69 ParentOrigin = new Position(attributes.ParentOrigin.X, attributes.ParentOrigin.Y, attributes.ParentOrigin.Z);
72 if (attributes.PivotPoint != null)
74 PivotPoint = new Position(attributes.PivotPoint.X, attributes.PivotPoint.Y, attributes.PivotPoint.Z);
77 if (attributes.WidthResizePolicy != null)
79 WidthResizePolicy = attributes.WidthResizePolicy;
82 if (attributes.HeightResizePolicy != null)
84 HeightResizePolicy = attributes.HeightResizePolicy;
87 if (attributes.MinimumSize != null)
89 MinimumSize = new Size2D(attributes.MinimumSize.Width, attributes.MinimumSize.Height);
92 if (attributes.SizeModeFactor != null)
94 SizeModeFactor = new Vector3(attributes.SizeModeFactor.X, attributes.SizeModeFactor.Y, attributes.SizeModeFactor.Z);
97 if (attributes.Opacity != null)
99 Opacity = attributes.Opacity.Clone() as FloatSelector;
102 PaddingLeft = attributes.PaddingLeft;
103 PaddingRight = attributes.PaddingRight;
104 PaddingTop = attributes.PaddingTop;
105 PaddingBottom = attributes.PaddingBottom;
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
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)]
128 /// View BackgroundColor
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
138 /// View PositionUsesPivotPoint
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
148 /// View ParentOrigin
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
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
168 /// View WidthResizePolicy
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
178 /// View HeightResizePolicy
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
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
198 /// View SizeModeFactor
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
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
218 /// View left padding
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
228 /// View right padding
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
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
248 /// View bottom padding
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
258 /// Attributes's clone function.
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()
264 return new ViewAttributes(this);