[NUI] Add Component Application (#1148)
[platform/core/csapi/tizenfx.git] / src / Tizen.NUI.Components / Attributes / TextFieldAttributes.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     /// TextFieldAttributes is a class which saves TextField'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 TextFieldAttributes : ViewAttributes
28     {
29         /// <summary>
30         /// Creates a new instance of a TextFieldAttributes.
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 TextFieldAttributes() : base() { }
36
37         /// <summary>
38         /// Construct with specified attribute.
39         /// </summary>
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)
45         {
46             if(null == attributes)
47             {
48                 return;
49             }
50             if (null != attributes.Text)
51             {
52                 Text = attributes.Text.Clone() as StringSelector;
53             }
54             if (null != attributes.PlaceholderText)
55             {
56                 PlaceholderText = attributes.PlaceholderText.Clone() as StringSelector;
57             }
58             if (null != attributes.TranslatablePlaceholderText)
59             {
60                 TranslatablePlaceholderText = attributes.TranslatablePlaceholderText.Clone() as StringSelector;
61             }
62             if (null != attributes.HorizontalAlignment)
63             {
64                 HorizontalAlignment = attributes.HorizontalAlignment;
65             }
66             if (null != attributes.VerticalAlignment)
67             {
68                 VerticalAlignment = attributes.VerticalAlignment;
69             }
70             if (null != attributes.EnableMarkup)
71             {
72                 EnableMarkup = attributes.EnableMarkup;
73             }
74             if (null != attributes.TextColor)
75             {
76                 TextColor = attributes.TextColor.Clone() as ColorSelector;
77             }
78             if (null != attributes.PlaceholderTextColor)
79             {
80                 PlaceholderTextColor = attributes.PlaceholderTextColor.Clone() as ColorSelector;
81             }
82             if (null != attributes.PrimaryCursorColor)
83             {
84                 PrimaryCursorColor = attributes.PrimaryCursorColor.Clone() as ColorSelector;
85             }
86             if (null != attributes.SecondaryCursorColor)
87             {
88                 SecondaryCursorColor = attributes.SecondaryCursorColor.Clone() as ColorSelector;
89             }
90             if (null != attributes.FontFamily)
91             {
92                 FontFamily = attributes.FontFamily;
93             }
94             if (null != attributes.PointSize)
95             {
96                 PointSize = attributes.PointSize.Clone() as FloatSelector;
97             }
98             if (null != attributes.EnableCursorBlink)
99             {
100                 EnableCursorBlink = attributes.EnableCursorBlink;
101             }
102             if (null != attributes.EnableSelection)
103             {
104                 EnableSelection = attributes.EnableSelection;
105             }
106             if (null != attributes.CursorWidth)
107             {
108                 CursorWidth = attributes.CursorWidth;
109             }
110             if (null != attributes.EnableEllipsis)
111             {
112                 EnableEllipsis = attributes.EnableEllipsis;
113             }
114         }
115
116         /// <summary>
117         /// Gets or sets text.
118         /// </summary>
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
123         {
124             get;
125             set;
126         }
127
128         /// <summary>
129         /// Gets or sets place holder text.
130         /// </summary>
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
135         {
136             get;
137             set;
138         }
139
140         /// <summary>
141         /// Gets or sets translatable place holder text.
142         /// </summary>
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
147         {
148             get;
149             set;
150         }
151
152         /// <summary>
153         /// Gets or sets horizontal alignment of text.
154         /// </summary>
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
159         {
160             get;
161             set;
162         }
163
164         /// <summary>
165         /// Gets or sets vertical alignment of text.
166         /// </summary>
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
171         {
172             get;
173             set;
174         }
175
176         /// <summary>
177         /// Gets or sets enable mark up.
178         /// </summary>
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
183         {
184             get;
185             set;
186         }
187
188         /// <summary>
189         /// Gets or sets text color.
190         /// </summary>
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
195         {
196             get;
197             set;
198         }
199
200         /// <summary>
201         /// Gets or sets place holder text color.
202         /// </summary>
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
207         {
208             get;
209             set;
210         }
211
212         /// <summary>
213         /// Gets or sets primary cursor color.
214         /// </summary>
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
219         {
220             get;
221             set;
222         }
223
224         /// <summary>
225         /// Gets or sets secondary cursor color.
226         /// </summary>
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
231         {
232             get;
233             set;
234         }
235
236         /// <summary>
237         /// Gets or sets font family of text.
238         /// </summary>
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
243         {
244             get;
245             set;
246         }
247
248         /// <summary>
249         /// Gets or sets point size of text.
250         /// </summary>
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
255         {
256             get;
257             set;
258         }
259
260         /// <summary>
261         /// Gets or sets enable cursor blink.
262         /// </summary>
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
267         {
268             get;
269             set;
270         }
271
272         /// <summary>
273         /// Gets or sets enable selection.
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 bool? EnableSelection
279         {
280             get;
281             set;
282         }
283
284         /// <summary>
285         /// Gets or sets cursor width.
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 int? CursorWidth
291         {
292             get;
293             set;
294         }
295
296         /// <summary>
297         /// Gets or sets if enable ellipsis.
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 bool? EnableEllipsis
303         {
304             get;
305             set;
306         }
307
308         /// <summary>
309         /// Attributes's clone function.
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 override Attributes Clone()
315         {
316             return new TextFieldAttributes(this);
317         }
318     }
319 }