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