[NUI] Change the name of Tizen.NUI.CommonUI as Tizen.NUI.Components (#958)
[platform/core/csapi/tizenfx.git] / src / Tizen.NUI.Components / Attributes / TextAttributes.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 Text Attributes class.
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 TextAttributes : ViewAttributes
27     {
28         /// <summary>
29         /// Construct TextAttributes.
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 TextAttributes() : base() { }
34         /// <summary>
35         /// Construct with specified attribute.
36         /// </summary>
37         /// <param name="attributes">The specified TextAttributes.</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 TextAttributes(TextAttributes attributes) : base(attributes)
41         {
42             if(attributes == null)
43             {
44                 return;
45             }
46             if (attributes.Text != null)
47             {
48                 Text = attributes.Text.Clone() as StringSelector;
49             }
50
51             if (attributes.TranslatableText != null)
52             {
53                 TranslatableText = attributes.TranslatableText.Clone() as StringSelector;
54             }
55
56             if (attributes.MultiLine != null)
57             {
58                 MultiLine = attributes.MultiLine;
59             }
60
61             if (attributes.HorizontalAlignment != null)
62             {
63                 HorizontalAlignment = attributes.HorizontalAlignment;
64             }
65
66             if (attributes.VerticalAlignment != null)
67             {
68                 VerticalAlignment = attributes.VerticalAlignment;
69             }
70
71             if (attributes.EnableMarkup != null)
72             {
73                 EnableMarkup = attributes.EnableMarkup;
74             }
75
76             if (attributes.EnableAutoScroll != null)
77             {
78                 EnableAutoScroll = attributes.EnableAutoScroll;
79             }
80
81             if (attributes.AutoScrollSpeed != null)
82             {
83                 AutoScrollSpeed = attributes.AutoScrollSpeed;
84             }
85
86             if (attributes.AutoScrollLoopCount != null)
87             {
88                 AutoScrollLoopCount = attributes.AutoScrollLoopCount;
89             }
90
91             if (attributes.AutoScrollGap != null)
92             {
93                 AutoScrollGap = attributes.AutoScrollGap;
94             }
95
96             if (attributes.AutoScrollLoopDelay != null)
97             {
98                 AutoScrollLoopDelay = attributes.AutoScrollLoopDelay;
99             }
100
101             if (attributes.AutoScrollStopMode != null)
102             {
103                 AutoScrollStopMode = attributes.AutoScrollStopMode;
104             }
105
106             if (attributes.LineSpacing != null)
107             {
108                 LineSpacing = attributes.LineSpacing;
109             }
110
111             if (attributes.TextColor != null)
112             {
113                 TextColor = attributes.TextColor.Clone() as ColorSelector;
114             }
115
116             if (attributes.FontFamily != null)
117             {
118                 FontFamily = attributes.FontFamily;
119             }
120
121             if (attributes.PointSize != null)
122             {
123                 PointSize = attributes.PointSize.Clone() as FloatSelector;
124             }
125
126             if (attributes.ShadowOffset != null)
127             {
128                 ShadowOffset = attributes.ShadowOffset.Clone() as Vector2Selector;
129             }
130
131             if (attributes.ShadowColor != null)
132             {
133                 ShadowColor = attributes.ShadowColor.Clone() as ColorSelector;
134             }
135
136             if (attributes.OutstrokeColor != null)
137             {
138                 OutstrokeColor = attributes.OutstrokeColor.Clone() as ColorSelector;
139             }
140             if (attributes.OutstrokeThickness != null)
141             {
142                 OutstrokeThickness = attributes.OutstrokeThickness.Clone() as IntSelector;
143             }
144         }
145         /// <summary>
146         /// TextLabel Text
147         /// </summary>
148         /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
149         [EditorBrowsable(EditorBrowsableState.Never)]
150         public StringSelector Text
151         {
152             get;
153             set;
154         }
155         /// <summary>
156         /// The TranslatableText property
157         /// </summary>
158         /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
159         [EditorBrowsable(EditorBrowsableState.Never)]
160         public StringSelector TranslatableText
161         {
162             get;
163             set;
164         }
165         /// <summary>
166         /// TextLabel MultiLine
167         /// </summary>
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 bool? MultiLine
171         {
172             get;
173             set;
174         }
175         /// <summary>
176         /// TextLabel HorizontalAlignment
177         /// </summary>
178         /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
179         [EditorBrowsable(EditorBrowsableState.Never)]
180         public HorizontalAlignment? HorizontalAlignment
181         {
182             get;
183             set;
184         }
185         /// <summary>
186         /// TextLabel VerticalAlignment
187         /// </summary>
188         /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
189         [EditorBrowsable(EditorBrowsableState.Never)]
190         public VerticalAlignment? VerticalAlignment
191         {
192             get;
193             set;
194         }
195         /// <summary>
196         /// TextLabel EnableMarkup
197         /// </summary>
198         /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
199         [EditorBrowsable(EditorBrowsableState.Never)]
200         public bool? EnableMarkup
201         {
202             get;
203             set;
204         }
205         /// <summary>
206         /// TextLabel EnableAutoScroll
207         /// </summary>
208         /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
209         [EditorBrowsable(EditorBrowsableState.Never)]
210         public bool? EnableAutoScroll
211         {
212             get;
213             set;
214         }
215         /// <summary>
216         /// TextLabel AutoScrollSpeed
217         /// </summary>
218         /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
219         [EditorBrowsable(EditorBrowsableState.Never)]
220         public int? AutoScrollSpeed
221         {
222             get;
223             set;
224         }
225         /// <summary>
226         /// TextLabel AutoScrollLoopCount
227         /// </summary>
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 int? AutoScrollLoopCount
231 {
232             get;
233             set;
234         }
235         /// <summary>
236         /// TextLabel AutoScrollGap
237         /// </summary>
238         /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
239         [EditorBrowsable(EditorBrowsableState.Never)]
240         public float? AutoScrollGap
241         {
242             get;
243             set;
244         }
245         /// <summary>
246         /// TextLabel AutoScrollLoopDelay
247         /// </summary>
248         /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
249         [EditorBrowsable(EditorBrowsableState.Never)]
250         public float? AutoScrollLoopDelay
251         {
252             get;
253             set;
254         }
255         /// <summary>
256         /// TextLabel AutoScrollStopMode
257         /// </summary>
258         /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
259         [EditorBrowsable(EditorBrowsableState.Never)]
260         public AutoScrollStopMode? AutoScrollStopMode
261         {
262             get;
263             set;
264         }
265         /// <summary>
266         /// TextLabel LineSpacing
267         /// </summary>
268         /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
269         [EditorBrowsable(EditorBrowsableState.Never)]
270         public float? LineSpacing
271         {
272             get;
273             set;
274         }
275         /// <summary>
276         /// TextLabel TextColor
277         /// </summary>
278         /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
279         [EditorBrowsable(EditorBrowsableState.Never)]
280         public ColorSelector TextColor
281         {
282             get;
283             set;
284         }
285         /// <summary>
286         /// TextLabel FontFamily
287         /// </summary>
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 string FontFamily
291         {
292             get;
293             set;
294         }
295         /// <summary>
296         /// TextLabel PointSize
297         /// </summary>
298         /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
299         [EditorBrowsable(EditorBrowsableState.Never)]
300         public FloatSelector PointSize
301         {
302             get;
303             set;
304         }
305         /// <summary>
306         /// TextLabel ShadowOffset
307         /// </summary>
308         /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
309         [EditorBrowsable(EditorBrowsableState.Never)]
310         public Vector2Selector ShadowOffset
311         {
312             get;
313             set;
314         }
315         /// <summary>
316         /// TextLabel ShadowColor
317         /// </summary>
318         /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
319         [EditorBrowsable(EditorBrowsableState.Never)]
320         public ColorSelector ShadowColor
321         {
322             get;
323             set;
324         }
325         /// <summary>
326         /// TextLabel OutstrokeColor
327         /// </summary>
328         /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
329         [EditorBrowsable(EditorBrowsableState.Never)]
330         public ColorSelector OutstrokeColor
331         {
332             get;
333             set;
334         }
335         /// <summary>
336         /// TextLabel OutstrokeThickness
337         /// </summary>
338         /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
339         [EditorBrowsable(EditorBrowsableState.Never)]
340         public IntSelector OutstrokeThickness
341         {
342             get;
343             set;
344         }
345         /// <summary>
346         /// Attributes's clone function.
347         /// </summary>
348         /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
349         [EditorBrowsable(EditorBrowsableState.Never)]
350         public override Attributes Clone()
351         {
352             return new TextAttributes(this);
353         }
354     }
355 }