Change PositionUsesAnchorPoint property to PositionUsesPivotPoint
[platform/core/csapi/tizenfx.git] / src / Tizen.NUI / src / public / BaseComponents / TextLabel.cs
1 /** Copyright (c) 2017 Samsung Electronics Co., Ltd.
2 *
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at
6 *
7 * http://www.apache.org/licenses/LICENSE-2.0
8 *
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
14 *
15 */
16 // This File has been auto-generated by SWIG and then modified using DALi Ruby Scripts
17 //------------------------------------------------------------------------------
18 // <auto-generated />
19 //
20 // This file was automatically generated by SWIG (http://www.swig.org).
21 // Version 3.0.9
22 //
23 // Do not make changes to this file unless you know what you are doing--modify
24 // the SWIG interface file instead.
25 //------------------------------------------------------------------------------
26
27 namespace Tizen.NUI.BaseComponents
28 {
29
30     /// <summary>
31     /// A control which renders a short text string.<br>
32     /// Text labels are lightweight, non-editable and do not respond to user input.<br>
33     /// </summary>
34     public class TextLabel : View
35     {
36         private global::System.Runtime.InteropServices.HandleRef swigCPtr;
37
38         internal TextLabel(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.TextLabel_SWIGUpcast(cPtr), cMemoryOwn)
39         {
40             swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
41         }
42
43         internal static global::System.Runtime.InteropServices.HandleRef getCPtr(TextLabel obj)
44         {
45             return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
46         }
47
48         /// <summary>
49         /// Dispose
50         /// </summary>
51         protected override void Dispose(DisposeTypes type)
52         {
53             if (disposed)
54             {
55                 return;
56             }
57
58             if(type == DisposeTypes.Explicit)
59             {
60                 //Called by User
61                 //Release your own managed resources here.
62                 //You should release all of your own disposable objects here.
63             }
64
65             //Release your own unmanaged resources here.
66             //You should not access any managed member here except static instance.
67             //because the execution order of Finalizes is non-deterministic.
68
69             if (swigCPtr.Handle != global::System.IntPtr.Zero)
70             {
71                 if (swigCMemOwn)
72                 {
73                     swigCMemOwn = false;
74                     NDalicPINVOKE.delete_TextLabel(swigCPtr);
75                 }
76                 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
77             }
78
79             base.Dispose(type);
80         }
81
82         internal class Property
83         {
84             internal static readonly int RENDERING_BACKEND = NDalicPINVOKE.TextLabel_Property_RENDERING_BACKEND_get();
85             internal static readonly int TEXT = NDalicPINVOKE.TextLabel_Property_TEXT_get();
86             internal static readonly int FONT_FAMILY = NDalicPINVOKE.TextLabel_Property_FONT_FAMILY_get();
87             internal static readonly int FONT_STYLE = NDalicPINVOKE.TextLabel_Property_FONT_STYLE_get();
88             internal static readonly int POINT_SIZE = NDalicPINVOKE.TextLabel_Property_POINT_SIZE_get();
89             internal static readonly int MULTI_LINE = NDalicPINVOKE.TextLabel_Property_MULTI_LINE_get();
90             internal static readonly int HORIZONTAL_ALIGNMENT = NDalicPINVOKE.TextLabel_Property_HORIZONTAL_ALIGNMENT_get();
91             internal static readonly int VERTICAL_ALIGNMENT = NDalicPINVOKE.TextLabel_Property_VERTICAL_ALIGNMENT_get();
92             internal static readonly int TEXT_COLOR = NDalicPINVOKE.TextLabel_Property_TEXT_COLOR_get();
93             internal static readonly int SHADOW_OFFSET = NDalicPINVOKE.TextLabel_Property_SHADOW_OFFSET_get();
94             internal static readonly int SHADOW_COLOR = NDalicPINVOKE.TextLabel_Property_SHADOW_COLOR_get();
95             internal static readonly int UNDERLINE_ENABLED = NDalicPINVOKE.TextLabel_Property_UNDERLINE_ENABLED_get();
96             internal static readonly int UNDERLINE_COLOR = NDalicPINVOKE.TextLabel_Property_UNDERLINE_COLOR_get();
97             internal static readonly int UNDERLINE_HEIGHT = NDalicPINVOKE.TextLabel_Property_UNDERLINE_HEIGHT_get();
98             internal static readonly int ENABLE_MARKUP = NDalicPINVOKE.TextLabel_Property_ENABLE_MARKUP_get();
99             internal static readonly int ENABLE_AUTO_SCROLL = NDalicPINVOKE.TextLabel_Property_ENABLE_AUTO_SCROLL_get();
100             internal static readonly int AUTO_SCROLL_SPEED = NDalicPINVOKE.TextLabel_Property_AUTO_SCROLL_SPEED_get();
101             internal static readonly int AUTO_SCROLL_LOOP_COUNT = NDalicPINVOKE.TextLabel_Property_AUTO_SCROLL_LOOP_COUNT_get();
102             internal static readonly int AUTO_SCROLL_GAP = NDalicPINVOKE.TextLabel_Property_AUTO_SCROLL_GAP_get();
103             internal static readonly int LINE_SPACING = NDalicPINVOKE.TextLabel_Property_LINE_SPACING_get();
104             internal static readonly int UNDERLINE = NDalicPINVOKE.TextLabel_Property_UNDERLINE_get();
105             internal static readonly int SHADOW = NDalicPINVOKE.TextLabel_Property_SHADOW_get();
106             internal static readonly int EMBOSS = NDalicPINVOKE.TextLabel_Property_EMBOSS_get();
107             internal static readonly int OUTLINE = NDalicPINVOKE.TextLabel_Property_OUTLINE_get();
108             internal static readonly int PIXEL_SIZE = NDalicManualPINVOKE.TextLabel_Property_PIXEL_SIZE_get();
109             internal static readonly int ELLIPSIS = NDalicManualPINVOKE.TextLabel_Property_ELLIPSIS_get();
110             internal static readonly int AUTO_SCROLL_STOP_MODE = NDalicManualPINVOKE.TextLabel_Property_AUTO_SCROLL_STOP_MODE_get();
111             internal static readonly int AUTO_SCROLL_LOOP_DELAY = NDalicManualPINVOKE.TextLabel_Property_AUTO_SCROLL_LOOP_DELAY_get();
112
113         }
114
115         /// <summary>
116         /// Creates the TextLabel control.
117         /// </summary>
118         public TextLabel() : this(NDalicPINVOKE.TextLabel_New__SWIG_0(), true)
119         {
120             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
121
122         }
123
124         /// <summary>
125         /// Creates the TextLabel control.
126         /// </summary>
127         /// <param name="text">The text to display</param>
128         public TextLabel(string text) : this(NDalicPINVOKE.TextLabel_New__SWIG_1(text), true)
129         {
130             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
131
132         }
133         internal TextLabel(TextLabel handle) : this(NDalicPINVOKE.new_TextLabel__SWIG_1(TextLabel.getCPtr(handle)), true)
134         {
135             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
136         }
137
138         /// <summary>
139         /// Text property.<br>
140         /// The text to display in UTF-8 format.<br>
141         /// </summary>
142         public string Text
143         {
144             get
145             {
146                 string temp;
147                 GetProperty(TextLabel.Property.TEXT).Get(out temp);
148                 return temp;
149             }
150             set
151             {
152                 SetProperty(TextLabel.Property.TEXT, new Tizen.NUI.PropertyValue(value));
153             }
154         }
155
156         /// <summary>
157         /// FontFamily property.<br>
158         /// The requested font family to use.<br>
159         /// </summary>
160         public string FontFamily
161         {
162             get
163             {
164                 string temp;
165                 GetProperty(TextLabel.Property.FONT_FAMILY).Get(out temp);
166                 return temp;
167             }
168             set
169             {
170                 SetProperty(TextLabel.Property.FONT_FAMILY, new Tizen.NUI.PropertyValue(value));
171             }
172         }
173
174         /// <summary>
175         /// FontStyle property.<br>
176         /// The requested font style to use.<br>
177         /// </summary>
178         public PropertyMap FontStyle
179         {
180             get
181             {
182                 PropertyMap temp = new PropertyMap();
183                 GetProperty(TextLabel.Property.FONT_STYLE).Get(temp);
184                 return temp;
185             }
186             set
187             {
188                 SetProperty(TextLabel.Property.FONT_STYLE, new Tizen.NUI.PropertyValue(value));
189             }
190         }
191
192         /// <summary>
193         /// PointSize property.<br>
194         /// The size of font in points.<br>
195         /// </summary>
196         public float PointSize
197         {
198             get
199             {
200                 float temp = 0.0f;
201                 GetProperty(TextLabel.Property.POINT_SIZE).Get(out temp);
202                 return temp;
203             }
204             set
205             {
206                 SetProperty(TextLabel.Property.POINT_SIZE, new Tizen.NUI.PropertyValue(value));
207             }
208         }
209
210         /// <summary>
211         /// MultiLine property.<br>
212         /// The single-line or multi-line layout option.<br>
213         /// </summary>
214         public bool MultiLine
215         {
216             get
217             {
218                 bool temp = false;
219                 GetProperty(TextLabel.Property.MULTI_LINE).Get(out temp);
220                 return temp;
221             }
222             set
223             {
224                 SetProperty(TextLabel.Property.MULTI_LINE, new Tizen.NUI.PropertyValue(value));
225             }
226         }
227
228         /// <summary>
229         /// HorizontalAlignment property.<br>
230         /// The line horizontal alignment.<br>
231         /// </summary>
232         public HorizontalAlignment HorizontalAlignment
233         {
234             get
235             {
236                 string temp;
237                 if (GetProperty(TextLabel.Property.HORIZONTAL_ALIGNMENT).Get(out temp) == false)
238                 {
239 #if DEBUG_ON
240                     Tizen.Log.Error("NUI", "HorizontalAlignment get error!");
241 #endif
242                 }
243                 switch (temp)
244                 {
245                     case "BEGIN":
246                         return HorizontalAlignment.Begin;
247                     case "CENTER":
248                         return HorizontalAlignment.Center;
249                     case "END":
250                         return HorizontalAlignment.End;
251                     default:
252                         return HorizontalAlignment.Begin;
253                 }
254             }
255             set
256             {
257                 string valueToString = "";
258                 switch (value)
259                 {
260                     case HorizontalAlignment.Begin:
261                     {
262                         valueToString = "BEGIN";
263                         break;
264                     }
265                     case HorizontalAlignment.Center:
266                     {
267                         valueToString = "CENTER";
268                         break;
269                     }
270                     case HorizontalAlignment.End:
271                     {
272                         valueToString = "END";
273                         break;
274                     }
275                     default:
276                     {
277                         valueToString = "BEGIN";
278                         break;
279                     }
280                 }
281                 SetProperty(TextLabel.Property.HORIZONTAL_ALIGNMENT, new Tizen.NUI.PropertyValue(valueToString));
282             }
283         }
284
285         /// <summary>
286         /// VerticalAlignment property.<br>
287         /// The line vertical alignment.<br>
288         /// </summary>
289         public VerticalAlignment VerticalAlignment
290         {
291             get
292             {
293                 string temp;
294                 if (GetProperty(TextLabel.Property.VERTICAL_ALIGNMENT).Get(out temp) == false)
295                 {
296 #if DEBUG_ON
297                     Tizen.Log.Error("NUI", "VerticalAlignment get error!");
298 #endif
299                 }
300
301                 switch (temp)
302                 {
303                     case "TOP":
304                         return VerticalAlignment.Top;
305                     case "CENTER":
306                         return VerticalAlignment.Center;
307                     case "BOTTOM":
308                         return VerticalAlignment.Bottom;
309                     default:
310                         return VerticalAlignment.Bottom;
311                 }
312             }
313             set
314             {
315                 string valueToString = "";
316                 switch (value)
317                 {
318                     case VerticalAlignment.Top:
319                     {
320                         valueToString = "TOP";
321                         break;
322                     }
323                     case VerticalAlignment.Center:
324                     {
325                         valueToString = "CENTER";
326                         break;
327                     }
328                     case VerticalAlignment.Bottom:
329                     {
330                         valueToString = "BOTTOM";
331                         break;
332                     }
333                     default:
334                     {
335                         valueToString = "BOTTOM";
336                         break;
337                     }
338                 }
339                 SetProperty(TextLabel.Property.VERTICAL_ALIGNMENT, new Tizen.NUI.PropertyValue(valueToString));
340             }
341         }
342
343         /// <summary>
344         /// TextColor property.<br>
345         /// The color of the text.<br>
346         /// </summary>
347         public Color TextColor
348         {
349             get
350             {
351                 Color temp = new Color(0.0f, 0.0f, 0.0f, 0.0f);
352                 GetProperty(TextLabel.Property.TEXT_COLOR).Get(temp);
353                 return temp;
354             }
355             set
356             {
357                 SetProperty(TextLabel.Property.TEXT_COLOR, new Tizen.NUI.PropertyValue(value));
358             }
359         }
360
361         /// <summary>
362         /// ShadowOffset property.<br>
363         /// The drop shadow offset 0 indicates no shadow.<br>
364         /// </summary>
365         public Vector2 ShadowOffset
366         {
367             get
368             {
369                 Vector2 temp = new Vector2(0.0f, 0.0f);
370                 GetProperty(TextLabel.Property.SHADOW_OFFSET).Get(temp);
371                 return temp;
372             }
373             set
374             {
375                 SetProperty(TextLabel.Property.SHADOW_OFFSET, new Tizen.NUI.PropertyValue(value));
376             }
377         }
378
379         /// <summary>
380         /// ShadowColor property.<br>
381         /// The color of a drop shadow.<br>
382         /// </summary>
383         public Vector4 ShadowColor
384         {
385             get
386             {
387                 Vector4 temp = new Vector4(0.0f, 0.0f, 0.0f, 0.0f);
388                 GetProperty(TextLabel.Property.SHADOW_COLOR).Get(temp);
389                 return temp;
390             }
391             set
392             {
393                 SetProperty(TextLabel.Property.SHADOW_COLOR, new Tizen.NUI.PropertyValue(value));
394             }
395         }
396
397         /// <summary>
398         /// UnderlineEnabled property.<br>
399         /// The underline enabled flag.<br>
400         /// </summary>
401         public bool UnderlineEnabled
402         {
403             get
404             {
405                 bool temp = false;
406                 GetProperty(TextLabel.Property.UNDERLINE_ENABLED).Get(out temp);
407                 return temp;
408             }
409             set
410             {
411                 SetProperty(TextLabel.Property.UNDERLINE_ENABLED, new Tizen.NUI.PropertyValue(value));
412             }
413         }
414
415         /// <summary>
416         /// UnderlineColor property.<br>
417         /// Overrides the underline height from font metrics.<br>
418         /// </summary>
419         public Vector4 UnderlineColor
420         {
421             get
422             {
423                 Vector4 temp = new Vector4(0.0f, 0.0f, 0.0f, 0.0f);
424                 GetProperty(TextLabel.Property.UNDERLINE_COLOR).Get(temp);
425                 return temp;
426             }
427             set
428             {
429                 SetProperty(TextLabel.Property.UNDERLINE_COLOR, new Tizen.NUI.PropertyValue(value));
430             }
431         }
432
433         /// <summary>
434         /// UnderlineHeight property.<br>
435         /// Overrides the underline height from font metrics.<br>
436         /// </summary>
437         public float UnderlineHeight
438         {
439             get
440             {
441                 float temp = 0.0f;
442                 GetProperty(TextLabel.Property.UNDERLINE_HEIGHT).Get(out temp);
443                 return temp;
444             }
445             set
446             {
447                 SetProperty(TextLabel.Property.UNDERLINE_HEIGHT, new Tizen.NUI.PropertyValue(value));
448             }
449         }
450
451         /// <summary>
452         /// EnableMarkup property.<br>
453         /// Whether the mark-up processing is enabled.<br>
454         /// </summary>
455         public bool EnableMarkup
456         {
457             get
458             {
459                 bool temp = false;
460                 GetProperty(TextLabel.Property.ENABLE_MARKUP).Get(out temp);
461                 return temp;
462             }
463             set
464             {
465                 SetProperty(TextLabel.Property.ENABLE_MARKUP, new Tizen.NUI.PropertyValue(value));
466             }
467         }
468
469         /// <summary>
470         /// EnableAutoScroll property.<br>
471         /// Starts or stops auto scrolling.<br>
472         /// </summary>
473         public bool EnableAutoScroll
474         {
475             get
476             {
477                 bool temp = false;
478                 GetProperty(TextLabel.Property.ENABLE_AUTO_SCROLL).Get(out temp);
479                 return temp;
480             }
481             set
482             {
483                 SetProperty(TextLabel.Property.ENABLE_AUTO_SCROLL, new Tizen.NUI.PropertyValue(value));
484             }
485         }
486
487         /// <summary>
488         /// AutoScrollSpeed property.<br>
489         /// Sets the speed of scrolling in pixels per second.<br>
490         /// </summary>
491         public int AutoScrollSpeed
492         {
493             get
494             {
495                 int temp = 0;
496                 GetProperty(TextLabel.Property.AUTO_SCROLL_SPEED).Get(out temp);
497                 return temp;
498             }
499             set
500             {
501                 SetProperty(TextLabel.Property.AUTO_SCROLL_SPEED, new Tizen.NUI.PropertyValue(value));
502             }
503         }
504
505         /// <summary>
506         /// AutoScrollLoopCount property.<br>
507         /// Number of complete loops when scrolling enabled.<br>
508         /// </summary>
509         public int AutoScrollLoopCount
510         {
511             get
512             {
513                 int temp = 0;
514                 GetProperty(TextLabel.Property.AUTO_SCROLL_LOOP_COUNT).Get(out temp);
515                 return temp;
516             }
517             set
518             {
519                 SetProperty(TextLabel.Property.AUTO_SCROLL_LOOP_COUNT, new Tizen.NUI.PropertyValue(value));
520             }
521         }
522
523         /// <summary>
524         /// AutoScrollGap property.<br>
525         /// Gap before scrolling wraps.<br>
526         /// </summary>
527         public float AutoScrollGap
528         {
529             get
530             {
531                 float temp = 0.0f;
532                 GetProperty(TextLabel.Property.AUTO_SCROLL_GAP).Get(out temp);
533                 return temp;
534             }
535             set
536             {
537                 SetProperty(TextLabel.Property.AUTO_SCROLL_GAP, new Tizen.NUI.PropertyValue(value));
538             }
539         }
540
541         /// <summary>
542         /// LineSpacing property.<br>
543         /// The default extra space between lines in points.<br>
544         /// </summary>
545         public float LineSpacing
546         {
547             get
548             {
549                 float temp = 0.0f;
550                 GetProperty(TextLabel.Property.LINE_SPACING).Get(out temp);
551                 return temp;
552             }
553             set
554             {
555                 SetProperty(TextLabel.Property.LINE_SPACING, new Tizen.NUI.PropertyValue(value));
556             }
557         }
558
559         /// <summary>
560         /// Underline property.<br>
561         /// The default underline parameters.<br>
562         /// </summary>
563         public PropertyMap Underline
564         {
565             get
566             {
567                 PropertyMap temp = new PropertyMap();
568                 GetProperty(TextLabel.Property.UNDERLINE).Get(temp);
569                 return temp;
570             }
571             set
572             {
573                 SetProperty(TextLabel.Property.UNDERLINE, new Tizen.NUI.PropertyValue(value));
574             }
575         }
576
577         /// <summary>
578         /// Shadow property.<br>
579         /// The default shadow parameters.<br>
580         /// </summary>
581         public PropertyMap Shadow
582         {
583             get
584             {
585                 PropertyMap temp = new PropertyMap();
586                 GetProperty(TextLabel.Property.SHADOW).Get(temp);
587                 return temp;
588             }
589             set
590             {
591                 SetProperty(TextLabel.Property.SHADOW, new Tizen.NUI.PropertyValue(value));
592             }
593         }
594
595         /// <summary>
596         /// Emboss property.<br>
597         /// The default emboss parameters.<br>
598         /// </summary>
599         public string Emboss
600         {
601             get
602             {
603                 string temp;
604                 GetProperty(TextLabel.Property.EMBOSS).Get( out temp);
605                 return temp;
606             }
607             set
608             {
609                 SetProperty(TextLabel.Property.EMBOSS, new Tizen.NUI.PropertyValue(value));
610             }
611         }
612
613         /// <summary>
614         /// Outline property.<br>
615         /// The default outline parameters.<br>
616         /// </summary>
617         public string Outline
618         {
619             get
620             {
621                 string temp;
622                 GetProperty(TextLabel.Property.OUTLINE).Get(out temp);
623                 return temp;
624             }
625             set
626             {
627                 SetProperty(TextLabel.Property.OUTLINE, new Tizen.NUI.PropertyValue(value));
628             }
629         }
630
631         /// <summary>
632         /// PixelSize property.<br>
633         /// The size of font in pixels.<br>
634         /// </summary>
635         public float PixelSize
636         {
637             get
638             {
639                 float temp = 0.0f;
640                 GetProperty(TextLabel.Property.PIXEL_SIZE).Get(out temp);
641                 return temp;
642             }
643             set
644             {
645                 SetProperty(TextLabel.Property.PIXEL_SIZE, new Tizen.NUI.PropertyValue(value));
646             }
647         }
648
649         /// <summary>
650         /// Ellipsis property.<br>
651         /// Enable or disable the ellipsis.<br>
652         /// </summary>
653         public bool Ellipsis
654         {
655             get
656             {
657                 bool temp = false;
658                 GetProperty(TextLabel.Property.ELLIPSIS).Get(out temp);
659                 return temp;
660             }
661             set
662             {
663                 SetProperty(TextLabel.Property.ELLIPSIS, new Tizen.NUI.PropertyValue(value));
664             }
665         }
666
667         /// <summary>
668         /// AutoScrollLoopDelay property.<br>
669         /// do something.<br>
670         /// </summary>
671         public float AutoScrollLoopDelay
672         {
673             get
674             {
675                 float temp = 0.0f;
676                 GetProperty(TextLabel.Property.AUTO_SCROLL_LOOP_DELAY).Get(out temp);
677                 return temp;
678             }
679             set
680             {
681                 SetProperty(TextLabel.Property.AUTO_SCROLL_LOOP_DELAY, new Tizen.NUI.PropertyValue(value));
682             }
683         }
684
685         /// <summary>
686         /// AutoScrollStopMode property.<br>
687         /// do something.<br>
688         /// </summary>
689         public AutoScrollStopMode AutoScrollStopMode
690         {
691             get
692             {
693                 string temp;
694                 if(GetProperty(TextLabel.Property.AUTO_SCROLL_STOP_MODE).Get(out temp) == false)
695                 {
696 #if DEBUG_ON
697                     Tizen.Log.Error("NUI", "AutoScrollStopMode get error!");
698 #endif
699                 }
700                 switch (temp)
701                 {
702                     case "FINISH_LOOP":
703                     return AutoScrollStopMode.FinishLoop;
704                     case "IMMEDIATE":
705                     return AutoScrollStopMode.Immediate;
706                     default:
707                     return AutoScrollStopMode.FinishLoop;
708                 }
709             }
710             set
711             {
712                 SetProperty(TextLabel.Property.AUTO_SCROLL_STOP_MODE, new Tizen.NUI.PropertyValue((int)value));
713             }
714         }
715
716     }
717 }