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.Components
22 /// TextFieldAttributes is a class which saves TextField's ux data.
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 TextFieldAttributes : ViewAttributes
30 /// Creates a new instance of a TextFieldAttributes.
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 TextFieldAttributes() : base() { }
38 /// Construct with specified attribute.
40 /// <param name="attributes">The specified TextFieldAttributes.</param>
41 /// <since_tizen> 6 </since_tizen>
42 /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
43 [EditorBrowsable(EditorBrowsableState.Never)]
44 public TextFieldAttributes(TextFieldAttributes attributes) : base(attributes)
46 if(null == attributes)
50 if (null != attributes.Text)
52 Text = attributes.Text.Clone() as StringSelector;
54 if (null != attributes.PlaceholderText)
56 PlaceholderText = attributes.PlaceholderText.Clone() as StringSelector;
58 if (null != attributes.TranslatablePlaceholderText)
60 TranslatablePlaceholderText = attributes.TranslatablePlaceholderText.Clone() as StringSelector;
62 if (null != attributes.HorizontalAlignment)
64 HorizontalAlignment = attributes.HorizontalAlignment;
66 if (null != attributes.VerticalAlignment)
68 VerticalAlignment = attributes.VerticalAlignment;
70 if (null != attributes.EnableMarkup)
72 EnableMarkup = attributes.EnableMarkup;
74 if (null != attributes.TextColor)
76 TextColor = attributes.TextColor.Clone() as ColorSelector;
78 if (null != attributes.PlaceholderTextColor)
80 PlaceholderTextColor = attributes.PlaceholderTextColor.Clone() as ColorSelector;
82 if (null != attributes.PrimaryCursorColor)
84 PrimaryCursorColor = attributes.PrimaryCursorColor.Clone() as ColorSelector;
86 if (null != attributes.SecondaryCursorColor)
88 SecondaryCursorColor = attributes.SecondaryCursorColor.Clone() as ColorSelector;
90 if (null != attributes.FontFamily)
92 FontFamily = attributes.FontFamily;
94 if (null != attributes.PointSize)
96 PointSize = attributes.PointSize.Clone() as FloatSelector;
98 if (null != attributes.EnableCursorBlink)
100 EnableCursorBlink = attributes.EnableCursorBlink;
102 if (null != attributes.EnableSelection)
104 EnableSelection = attributes.EnableSelection;
106 if (null != attributes.CursorWidth)
108 CursorWidth = attributes.CursorWidth;
110 if (null != attributes.EnableEllipsis)
112 EnableEllipsis = attributes.EnableEllipsis;
117 /// Gets or sets text.
119 /// <since_tizen> 6 </since_tizen>
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 StringSelector Text
129 /// Gets or sets place holder text.
131 /// <since_tizen> 6 </since_tizen>
132 /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
133 [EditorBrowsable(EditorBrowsableState.Never)]
134 public StringSelector PlaceholderText
141 /// Gets or sets translatable place holder text.
143 /// <since_tizen> 6 </since_tizen>
144 /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
145 [EditorBrowsable(EditorBrowsableState.Never)]
146 public StringSelector TranslatablePlaceholderText
153 /// Gets or sets horizontal alignment of text.
155 /// <since_tizen> 6 </since_tizen>
156 /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
157 [EditorBrowsable(EditorBrowsableState.Never)]
158 public HorizontalAlignment? HorizontalAlignment
165 /// Gets or sets vertical alignment of text.
167 /// <since_tizen> 6 </since_tizen>
168 /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
169 [EditorBrowsable(EditorBrowsableState.Never)]
170 public VerticalAlignment? VerticalAlignment
177 /// Gets or sets enable mark up.
179 /// <since_tizen> 6 </since_tizen>
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 bool? EnableMarkup
189 /// Gets or sets text color.
191 /// <since_tizen> 6 </since_tizen>
192 /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
193 [EditorBrowsable(EditorBrowsableState.Never)]
194 public ColorSelector TextColor
201 /// Gets or sets place holder text color.
203 /// <since_tizen> 6 </since_tizen>
204 /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
205 [EditorBrowsable(EditorBrowsableState.Never)]
206 public ColorSelector PlaceholderTextColor
213 /// Gets or sets primary cursor color.
215 /// <since_tizen> 6 </since_tizen>
216 /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
217 [EditorBrowsable(EditorBrowsableState.Never)]
218 public ColorSelector PrimaryCursorColor
225 /// Gets or sets secondary cursor color.
227 /// <since_tizen> 6 </since_tizen>
228 /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
229 [EditorBrowsable(EditorBrowsableState.Never)]
230 public ColorSelector SecondaryCursorColor
237 /// Gets or sets font family of text.
239 /// <since_tizen> 6 </since_tizen>
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 string FontFamily
249 /// Gets or sets point size of text.
251 /// <since_tizen> 6 </since_tizen>
252 /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
253 [EditorBrowsable(EditorBrowsableState.Never)]
254 public FloatSelector PointSize
261 /// Gets or sets enable cursor blink.
263 /// <since_tizen> 6 </since_tizen>
264 /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
265 [EditorBrowsable(EditorBrowsableState.Never)]
266 public bool? EnableCursorBlink
273 /// Gets or sets enable selection.
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 bool? EnableSelection
285 /// Gets or sets cursor width.
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 int? CursorWidth
297 /// Gets or sets if enable ellipsis.
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 bool? EnableEllipsis
309 /// Attributes's clone function.
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 override Attributes Clone()
316 return new TextFieldAttributes(this);