[NUI] Add SetUnderline, GetUnderline to Text Components
[platform/core/csapi/tizenfx.git] / src / Tizen.NUI / src / public / BaseComponents / TextEditor.cs
1 /*
2  * Copyright(c) 2021 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
18 extern alias TizenSystemSettings;
19 using TizenSystemSettings.Tizen.System;
20
21 using System;
22 using System.Globalization;
23 using System.ComponentModel;
24 using Tizen.NUI.Text;
25
26 namespace Tizen.NUI.BaseComponents
27 {
28     /// <summary>
29     /// A control which provides a multi-line editable text editor.
30     /// </summary>
31     /// <since_tizen> 3 </since_tizen>
32     public partial class TextEditor : View
33     {
34         private string textEditorTextSid = null;
35         private string textEditorPlaceHolderTextSid = null;
36         private bool systemlangTextFlag = false;
37         private InputMethodContext inputMethodContext = null;
38         private float fontSizeScale = 1.0f;
39         private bool hasFontSizeChangedCallback = false;
40
41         static TextEditor() { }
42
43         /// <summary>
44         /// Creates the TextEditor control.
45         /// </summary>
46         /// <since_tizen> 3 </since_tizen>
47         public TextEditor() : this(Interop.TextEditor.New(), true)
48         {
49             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
50         }
51
52         /// <summary>
53         /// Creates the TextEditor with specified style.
54         /// </summary>
55         [EditorBrowsable(EditorBrowsableState.Never)]
56         public TextEditor(TextEditorStyle style) : this(Interop.TextLabel.New(), true, style: style)
57         {
58         }
59
60         /// <summary>
61         /// Creates the TextEditor with setting the status of shown or hidden.
62         /// </summary>
63         /// <param name="shown">false : Not displayed (hidden), true : displayed (shown)</param>
64         /// This will be public opened in next release of tizen after ACR done. Before ACR, it is used as HiddenAPI (InhouseAPI).
65         [EditorBrowsable(EditorBrowsableState.Never)]
66         public TextEditor(bool shown) : this(Interop.TextEditor.New(), true)
67         {
68             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
69             SetVisible(shown);
70         }
71
72         internal TextEditor(TextEditor handle, bool shown = true) : this(Interop.TextEditor.NewTextEditor(TextEditor.getCPtr(handle)), true)
73         {
74             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
75
76             if (!shown)
77             {
78                 SetVisible(false);
79             }
80         }
81
82         internal TextEditor(global::System.IntPtr cPtr, bool cMemoryOwn, bool shown = true, TextEditorStyle style = null) : base(cPtr, cMemoryOwn, style)
83         {
84             if (!shown)
85             {
86                 SetVisible(false);
87             }
88         }
89
90         /// <summary>
91         /// The TranslatableText property.<br />
92         /// The text can set the SID value.<br />
93         /// </summary>
94         /// <exception cref='ArgumentNullException'>
95         /// ResourceManager about multilingual is null.
96         /// </exception>
97         /// <since_tizen> 4 </since_tizen>
98         public string TranslatableText
99         {
100             get
101             {
102                 return textEditorTextSid;
103             }
104             set
105             {
106                 if (NUIApplication.MultilingualResourceManager == null)
107                 {
108                     throw new ArgumentNullException(null, "ResourceManager about multilingual is null");
109                 }
110                 textEditorTextSid = value;
111                 Text = SetTranslatable(textEditorTextSid);
112                 NotifyPropertyChanged();
113             }
114         }
115         /// <summary>
116         /// The TranslatablePlaceholderText property.<br />
117         /// The text can set the SID value.<br />
118         /// </summary>
119         /// <exception cref='ArgumentNullException'>
120         /// ResourceManager about multilingual is null.
121         /// </exception>
122         /// <since_tizen> 4 </since_tizen>
123         public string TranslatablePlaceholderText
124         {
125             get
126             {
127                 return textEditorPlaceHolderTextSid;
128             }
129             set
130             {
131                 if (NUIApplication.MultilingualResourceManager == null)
132                 {
133                     throw new ArgumentNullException(null, "ResourceManager about multilingual is null");
134                 }
135                 textEditorPlaceHolderTextSid = value;
136                 PlaceholderText = SetTranslatable(textEditorPlaceHolderTextSid);
137                 NotifyPropertyChanged();
138             }
139         }
140
141         /// <summary>
142         /// The Text property.
143         /// </summary>
144         /// <since_tizen> 3 </since_tizen>
145         public string Text
146         {
147             get
148             {
149                 return (string)GetValue(TextProperty);
150             }
151             set
152             {
153                 SetValueAndForceSendChangeSignal(TextProperty, value);
154                 NotifyPropertyChanged();
155             }
156         }
157
158         /// <summary>
159         /// The TextColor property.
160         /// </summary>
161         /// <remarks>
162         /// The property cascade chaining set is possible. For example, this (textEditor.TextColor.X = 0.1f;) is possible.
163         /// </remarks>
164         /// <since_tizen> 3 </since_tizen>
165         public Vector4 TextColor
166         {
167             get
168             {
169                 Vector4 temp = (Vector4)GetValue(TextColorProperty);
170                 return new Vector4(OnTextColorChanged, temp.X, temp.Y, temp.Z, temp.W);
171             }
172             set
173             {
174                 SetValue(TextColorProperty, value);
175                 NotifyPropertyChanged();
176             }
177         }
178
179         /// <summary>
180         /// The FontFamily property.
181         /// </summary>
182         /// <since_tizen> 3 </since_tizen>
183         public string FontFamily
184         {
185             get
186             {
187                 return (string)GetValue(FontFamilyProperty);
188             }
189             set
190             {
191                 SetValue(FontFamilyProperty, value);
192                 NotifyPropertyChanged();
193             }
194         }
195
196         /// <summary>
197         /// The FontStyle property.
198         /// The fontStyle map contains the following keys :<br />
199         /// <list type="table">
200         /// <item><term>width (string)</term><description>The width key defines occupied by each glyph. (values: ultraCondensed, extraCondensed, condensed, semiCondensed, normal, semiExpanded, expanded, extraExpanded, ultraExpanded)</description></item>
201         /// <item><term>weight (string)</term><description>The weight key defines the thickness or darkness of the glyphs. (values: thin, ultraLight, extraLight, light, demiLight, semiLight, book, normal, regular, medium, demiBold, semiBold, bold, ultraBold, extraBold, black, heavy, extraBlack)</description></item>
202         /// <item><term>slant (string)</term><description>The slant key defines whether to use italics. (values: normal, roman, italic, oblique)</description></item>
203         /// </list>
204         /// </summary>
205         /// <since_tizen> 3 </since_tizen>
206         public PropertyMap FontStyle
207         {
208             get
209             {
210                 return (PropertyMap)GetValue(FontStyleProperty);
211             }
212             set
213             {
214                 SetValue(FontStyleProperty, value);
215                 NotifyPropertyChanged();
216             }
217         }
218
219         /// <summary>
220         /// Set FontStyle to TextEditor. <br />
221         /// </summary>
222         /// <param name="fontStyle">The FontStyle</param>
223         /// <remarks>
224         /// SetFontStyle specifies the requested font style through <see cref="Tizen.NUI.Text.FontStyle"/>. <br />
225         /// </remarks>
226         /// <example>
227         /// The following example demonstrates how to use the SetFontStyle method.
228         /// <code>
229         /// var fontStyle = new Tizen.NUI.Text.FontStyle();
230         /// fontStyle.Width = FontWidthType.Expanded;
231         /// fontStyle.Weight = FontWeightType.Bold;
232         /// fontStyle.Slant = FontSlantType.Italic;
233         /// editor.SetFontStyle(fontStyle);
234         /// </code>
235         /// </example>
236         [EditorBrowsable(EditorBrowsableState.Never)]
237         public void SetFontStyle(FontStyle fontStyle)
238         {
239             SetProperty(TextEditor.Property.FontStyle, new PropertyValue(TextUtils.GetFontStyleMap(fontStyle)));
240         }
241
242         /// <summary>
243         /// Get FontStyle from TextEditor. <br />
244         /// </summary>
245         /// <returns>The FontStyle</returns>
246         /// <remarks>
247         /// <see cref="Tizen.NUI.Text.FontStyle"/>
248         /// </remarks>
249         [EditorBrowsable(EditorBrowsableState.Never)]
250         public FontStyle GetFontStyle()
251         {
252             var map = new PropertyMap();
253             GetProperty(TextEditor.Property.FontStyle).Get(map);
254             return TextUtils.GetFontStyleStruct(map);
255         }
256
257         /// <summary>
258         /// The PointSize property.
259         /// </summary>
260         /// <since_tizen> 3 </since_tizen>
261         public float PointSize
262         {
263             get
264             {
265                 return (float)GetValue(PointSizeProperty);
266             }
267             set
268             {
269                 SetValue(PointSizeProperty, value);
270                 NotifyPropertyChanged();
271             }
272         }
273
274         /// <summary>
275         /// The HorizontalAlignment property.
276         /// </summary>
277         /// <since_tizen> 3 </since_tizen>
278         public HorizontalAlignment HorizontalAlignment
279         {
280             get
281             {
282                 return (HorizontalAlignment)GetValue(HorizontalAlignmentProperty);
283             }
284             set
285             {
286                 SetValue(HorizontalAlignmentProperty, value);
287                 NotifyPropertyChanged();
288             }
289         }
290
291         /// <summary>
292         /// The ScrollThreshold property.
293         /// </summary>
294         /// <since_tizen> 3 </since_tizen>
295         public float ScrollThreshold
296         {
297             get
298             {
299                 return (float)GetValue(ScrollThresholdProperty);
300             }
301             set
302             {
303                 SetValue(ScrollThresholdProperty, value);
304                 NotifyPropertyChanged();
305             }
306         }
307
308         /// <summary>
309         /// The ScrollSpeed property.
310         /// </summary>
311         /// <since_tizen> 3 </since_tizen>
312         public float ScrollSpeed
313         {
314             get
315             {
316                 return (float)GetValue(ScrollSpeedProperty);
317             }
318             set
319             {
320                 SetValue(ScrollSpeedProperty, value);
321                 NotifyPropertyChanged();
322             }
323         }
324
325         /// <summary>
326         /// The PrimaryCursorColor property.
327         /// </summary>
328         /// <remarks>
329         /// The property cascade chaining set is possible. For example, this (textEditor.PrimaryCursorColor.X = 0.1f;) is possible.
330         /// </remarks>
331         /// <since_tizen> 3 </since_tizen>
332         public Vector4 PrimaryCursorColor
333         {
334             get
335             {
336                 Vector4 temp = (Vector4)GetValue(PrimaryCursorColorProperty);
337                 return new Vector4(OnPrimaryCursorColorChanged, temp.X, temp.Y, temp.Z, temp.W);
338             }
339             set
340             {
341                 SetValue(PrimaryCursorColorProperty, value);
342                 NotifyPropertyChanged();
343             }
344         }
345
346         /// <summary>
347         /// The SecondaryCursorColor property.
348         /// </summary>
349         /// <remarks>
350         /// The property cascade chaining set is possible. For example, this (textEditor.SecondaryCursorColor.X = 0.1f;) is possible.
351         /// </remarks>
352         /// <since_tizen> 3 </since_tizen>
353         public Vector4 SecondaryCursorColor
354         {
355             get
356             {
357                 Vector4 temp = (Vector4)GetValue(SecondaryCursorColorProperty);
358                 return new Vector4(OnSecondaryCursorColorChanged, temp.X, temp.Y, temp.Z, temp.W);
359             }
360             set
361             {
362                 SetValue(SecondaryCursorColorProperty, value);
363                 NotifyPropertyChanged();
364             }
365         }
366
367         /// <summary>
368         /// The EnableCursorBlink property.
369         /// </summary>
370         /// <since_tizen> 3 </since_tizen>
371         public bool EnableCursorBlink
372         {
373             get
374             {
375                 return (bool)GetValue(EnableCursorBlinkProperty);
376             }
377             set
378             {
379                 SetValue(EnableCursorBlinkProperty, value);
380                 NotifyPropertyChanged();
381             }
382         }
383
384         /// <summary>
385         /// The CursorBlinkInterval property.
386         /// </summary>
387         /// <since_tizen> 3 </since_tizen>
388         public float CursorBlinkInterval
389         {
390             get
391             {
392                 return (float)GetValue(CursorBlinkIntervalProperty);
393             }
394             set
395             {
396                 SetValue(CursorBlinkIntervalProperty, value);
397                 NotifyPropertyChanged();
398             }
399         }
400
401         /// <summary>
402         /// The CursorBlinkDuration property.
403         /// </summary>
404         /// <since_tizen> 3 </since_tizen>
405         public float CursorBlinkDuration
406         {
407             get
408             {
409                 return (float)GetValue(CursorBlinkDurationProperty);
410             }
411             set
412             {
413                 SetValue(CursorBlinkDurationProperty, value);
414                 NotifyPropertyChanged();
415             }
416         }
417
418         /// <summary>
419         /// The CursorWidth property.
420         /// </summary>
421         /// <since_tizen> 3 </since_tizen>
422         public int CursorWidth
423         {
424             get
425             {
426                 return (int)GetValue(CursorWidthProperty);
427             }
428             set
429             {
430                 SetValue(CursorWidthProperty, value);
431                 NotifyPropertyChanged();
432             }
433         }
434
435         /// <summary>
436         /// The GrabHandleImage property.
437         /// </summary>
438         /// <since_tizen> 3 </since_tizen>
439         public string GrabHandleImage
440         {
441             get
442             {
443                 return (string)GetValue(GrabHandleImageProperty);
444             }
445             set
446             {
447                 SetValue(GrabHandleImageProperty, value);
448                 NotifyPropertyChanged();
449             }
450         }
451
452         /// <summary>
453         /// The GrabHandlePressedImage property.
454         /// </summary>
455         /// <since_tizen> 3 </since_tizen>
456         public string GrabHandlePressedImage
457         {
458             get
459             {
460                 return (string)GetValue(GrabHandlePressedImageProperty);
461             }
462             set
463             {
464                 SetValue(GrabHandlePressedImageProperty, value);
465                 NotifyPropertyChanged();
466             }
467         }
468
469         /// <summary>
470         /// The SelectionHandleImageLeft property.
471         /// The selectionHandleImageLeft map contains the following key :<br />
472         /// <list type="table">
473         /// <item><term>filename (string)</term><description>The path of image file</description></item>
474         /// </list>
475         /// </summary>
476         /// <since_tizen> 3 </since_tizen>
477         public PropertyMap SelectionHandleImageLeft
478         {
479             get
480             {
481                 return (PropertyMap)GetValue(SelectionHandleImageLeftProperty);
482             }
483             set
484             {
485                 SetValue(SelectionHandleImageLeftProperty, value);
486                 NotifyPropertyChanged();
487             }
488         }
489
490         /// <summary>
491         /// The SelectionHandleImageRight property.
492         /// The selectionHandleImageRight map contains the following key :<br />
493         /// <list type="table">
494         /// <item><term>filename (string)</term><description>The path of image file</description></item>
495         /// </list>
496         /// </summary>
497         /// <since_tizen> 3 </since_tizen>
498         public PropertyMap SelectionHandleImageRight
499         {
500             get
501             {
502                 return (PropertyMap)GetValue(SelectionHandleImageRightProperty);
503             }
504             set
505             {
506                 SetValue(SelectionHandleImageRightProperty, value);
507                 NotifyPropertyChanged();
508             }
509         }
510
511         /// <summary>
512         /// The SelectionHandlePressedImageLeft property.
513         /// The selectionHandlePressedImageLeft map contains the following key :<br />
514         /// <list type="table">
515         /// <item><term>filename (string)</term><description>The path of image file</description></item>
516         /// </list>
517         /// </summary>
518         /// <since_tizen> 3 </since_tizen>
519         public PropertyMap SelectionHandlePressedImageLeft
520         {
521             get
522             {
523                 return (PropertyMap)GetValue(SelectionHandlePressedImageLeftProperty);
524             }
525             set
526             {
527                 SetValue(SelectionHandlePressedImageLeftProperty, value);
528                 NotifyPropertyChanged();
529             }
530         }
531
532         /// <summary>
533         /// The SelectionHandlePressedImageRight property.
534         /// The selectionHandlePressedImageRight map contains the following key :<br />
535         /// <list type="table">
536         /// <item><term>filename (string)</term><description>The path of image file</description></item>
537         /// </list>
538         /// </summary>
539         /// <since_tizen> 3 </since_tizen>
540         public PropertyMap SelectionHandlePressedImageRight
541         {
542             get
543             {
544                 return (PropertyMap)GetValue(SelectionHandlePressedImageRightProperty);
545             }
546             set
547             {
548                 SetValue(SelectionHandlePressedImageRightProperty, value);
549                 NotifyPropertyChanged();
550             }
551         }
552
553         /// <summary>
554         /// The SelectionHandleMarkerImageLeft property.
555         /// The selectionHandleMarkerImageLeft map contains the following key :<br />
556         /// <list type="table">
557         /// <item><term>filename (string)</term><description>The path of image file</description></item>
558         /// </list>
559         /// </summary>
560         /// <since_tizen> 3 </since_tizen>
561         public PropertyMap SelectionHandleMarkerImageLeft
562         {
563             get
564             {
565                 return (PropertyMap)GetValue(SelectionHandleMarkerImageLeftProperty);
566             }
567             set
568             {
569                 SetValue(SelectionHandleMarkerImageLeftProperty, value);
570                 NotifyPropertyChanged();
571             }
572         }
573
574         /// <summary>
575         /// The SelectionHandleMarkerImageRight property.
576         /// The selectionHandleMarkerImageRight map contains the following key :<br />
577         /// <list type="table">
578         /// <item><term>filename (string)</term><description>The path of image file</description></item>
579         /// </list>
580         /// </summary>
581         /// <since_tizen> 3 </since_tizen>
582         public PropertyMap SelectionHandleMarkerImageRight
583         {
584             get
585             {
586                 return (PropertyMap)GetValue(SelectionHandleMarkerImageRightProperty);
587             }
588             set
589             {
590                 SetValue(SelectionHandleMarkerImageRightProperty, value);
591                 NotifyPropertyChanged();
592             }
593         }
594
595         /// <summary>
596         /// The SelectionHighlightColor property.
597         /// </summary>
598         /// <remarks>
599         /// The property cascade chaining set is possible. For example, this (textEditor.SelectionHighlightColor.X = 0.1f;) is possible.
600         /// </remarks>
601         /// <since_tizen> 3 </since_tizen>
602         public Vector4 SelectionHighlightColor
603         {
604             get
605             {
606                 Vector4 temp = (Vector4)GetValue(SelectionHighlightColorProperty);
607                 return new Vector4(OnSelectionHighlightColorChanged, temp.X, temp.Y, temp.Z, temp.W);
608             }
609             set
610             {
611                 SetValue(SelectionHighlightColorProperty, value);
612                 NotifyPropertyChanged();
613             }
614         }
615
616         /// <summary>
617         /// The DecorationBoundingBox property.
618         /// </summary>
619         /// <remarks>
620         /// The property cascade chaining set is possible. For example, this (textEditor.DecorationBoundingBox.X = 1;) is possible.
621         /// </remarks>
622         /// <since_tizen> 3 </since_tizen>
623         public Rectangle DecorationBoundingBox
624         {
625             get
626             {
627                 Rectangle temp = (Rectangle)GetValue(DecorationBoundingBoxProperty);
628                 return new Rectangle(OnDecorationBoundingBoxChanged, temp.X, temp.Y, temp.Width, temp.Height);
629             }
630             set
631             {
632                 SetValue(DecorationBoundingBoxProperty, value);
633                 NotifyPropertyChanged();
634             }
635         }
636
637         /// <summary>
638         /// The EnableMarkup property.
639         /// </summary>
640         /// <since_tizen> 3 </since_tizen>
641         public bool EnableMarkup
642         {
643             get
644             {
645                 return (bool)GetValue(EnableMarkupProperty);
646             }
647             set
648             {
649                 SetValue(EnableMarkupProperty, value);
650                 NotifyPropertyChanged();
651             }
652         }
653
654         /// <summary>
655         /// The InputColor property.
656         /// </summary>
657         /// <remarks>
658         /// The property cascade chaining set is possible. For example, this (textEditor.InputColor.X = 0.1f;) is possible.
659         /// </remarks>
660         /// <since_tizen> 3 </since_tizen>
661         public Vector4 InputColor
662         {
663             get
664             {
665                 Vector4 temp = (Vector4)GetValue(InputColorProperty);
666                 return new Vector4(OnInputColorChanged, temp.X, temp.Y, temp.Z, temp.W);
667             }
668             set
669             {
670                 SetValue(InputColorProperty, value);
671                 NotifyPropertyChanged();
672             }
673         }
674
675         /// <summary>
676         /// The InputFontFamily property.
677         /// </summary>
678         /// <since_tizen> 3 </since_tizen>
679         public string InputFontFamily
680         {
681             get
682             {
683                 return (string)GetValue(InputFontFamilyProperty);
684             }
685             set
686             {
687                 SetValue(InputFontFamilyProperty, value);
688                 NotifyPropertyChanged();
689             }
690         }
691
692         /// <summary>
693         /// The InputFontStyle property.
694         /// The inputFontStyle map contains the following keys :<br />
695         /// <list type="table">
696         /// <item><term>width (string)</term><description>The width key defines occupied by each glyph. (values: ultraCondensed, extraCondensed, condensed, semiCondensed, normal, semiExpanded, expanded, extraExpanded, ultraExpanded)</description></item>
697         /// <item><term>weight (string)</term><description>The weight key defines the thickness or darkness of the glyphs. (values: thin, ultraLight, extraLight, light, demiLight, semiLight, book, normal, regular, medium, demiBold, semiBold, bold, ultraBold, extraBold, black, heavy, extraBlack)</description></item>
698         /// <item><term>slant (string)</term><description>The slant key defines whether to use italics. (values: normal, roman, italic, oblique)</description></item>
699         /// </list>
700         /// </summary>
701         /// <since_tizen> 3 </since_tizen>
702         public PropertyMap InputFontStyle
703         {
704             get
705             {
706                 return (PropertyMap)GetValue(InputFontStyleProperty);
707             }
708             set
709             {
710                 SetValue(InputFontStyleProperty, value);
711                 NotifyPropertyChanged();
712             }
713         }
714
715         /// <summary>
716         /// Set InputFontStyle to TextEditor. <br />
717         /// </summary>
718         /// <param name="fontStyle">The FontStyle</param>
719         /// <remarks>
720         /// SetInputFontStyle specifies the requested font style for new input text through <see cref="Tizen.NUI.Text.FontStyle"/>. <br />
721         /// </remarks>
722         /// <example>
723         /// The following example demonstrates how to use the SetInputFontStyle method.
724         /// <code>
725         /// var fontStyle = new Tizen.NUI.Text.FontStyle();
726         /// fontStyle.Width = FontWidthType.Expanded;
727         /// fontStyle.Weight = FontWeightType.Bold;
728         /// fontStyle.Slant = FontSlantType.Italic;
729         /// editor.SetInputFontStyle(fontStyle);
730         /// </code>
731         /// </example>
732         [EditorBrowsable(EditorBrowsableState.Never)]
733         public void SetInputFontStyle(FontStyle fontStyle)
734         {
735             SetProperty(TextEditor.Property.InputFontStyle, new PropertyValue(TextUtils.GetFontStyleMap(fontStyle)));
736             NotifyPropertyChanged();
737         }
738
739         /// <summary>
740         /// Get InputFontStyle from TextEditor. <br />
741         /// </summary>
742         /// <returns>The FontStyle</returns>
743         /// <remarks>
744         /// <see cref="Tizen.NUI.Text.FontStyle"/>
745         /// </remarks>
746         [EditorBrowsable(EditorBrowsableState.Never)]
747         public FontStyle GetInputFontStyle()
748         {
749             var map = new PropertyMap();
750             GetProperty(TextEditor.Property.InputFontStyle).Get(map);
751             return TextUtils.GetFontStyleStruct(map);
752         }
753
754         /// <summary>
755         /// The InputPointSize property.
756         /// </summary>
757         /// <since_tizen> 3 </since_tizen>
758         public float InputPointSize
759         {
760             get
761             {
762                 return (float)GetValue(InputPointSizeProperty);
763             }
764             set
765             {
766                 SetValue(InputPointSizeProperty, value);
767                 NotifyPropertyChanged();
768             }
769         }
770
771         /// <summary>
772         /// The LineSpacing property.
773         /// </summary>
774         /// <since_tizen> 3 </since_tizen>
775         public float LineSpacing
776         {
777             get
778             {
779                 return (float)GetValue(LineSpacingProperty);
780             }
781             set
782             {
783                 SetValue(LineSpacingProperty, value);
784                 NotifyPropertyChanged();
785             }
786         }
787
788         /// <summary>
789         /// The InputLineSpacing property.
790         /// </summary>
791         /// <since_tizen> 3 </since_tizen>
792         public float InputLineSpacing
793         {
794             get
795             {
796                 return (float)GetValue(InputLineSpacingProperty);
797             }
798             set
799             {
800                 SetValue(InputLineSpacingProperty, value);
801                 NotifyPropertyChanged();
802             }
803         }
804
805         /// <summary>
806         /// The Underline property.
807         /// The underline map contains the following keys :<br />
808         /// <list type="table">
809         /// <item><term>enable (bool)</term><description>Whether the underline is enabled (the default value is false)</description></item>
810         /// <item><term>color (Color)</term><description>The color of the underline (If not provided then the color of the text is used)</description></item>
811         /// <item><term>height (float)</term><description>The height in pixels of the underline (the default value is 1.f)</description></item>
812         /// </list>
813         /// </summary>
814         /// <since_tizen> 3 </since_tizen>
815         public PropertyMap Underline
816         {
817             get
818             {
819                 return (PropertyMap)GetValue(UnderlineProperty);
820             }
821             set
822             {
823                 SetValue(UnderlineProperty, value);
824                 NotifyPropertyChanged();
825             }
826         }
827
828         /// <summary>
829         /// Set Underline to TextEditor. <br />
830         /// </summary>
831         /// <param name="underline">The Underline</param>
832         /// <remarks>
833         /// SetUnderline specifies the underline of the text through <see cref="Tizen.NUI.Text.Underline"/>. <br />
834         /// </remarks>
835         /// <example>
836         /// The following example demonstrates how to use the SetUnderline method.
837         /// <code>
838         /// var underline = new Tizen.NUI.Text.Underline();
839         /// underline.Enable = true;
840         /// underline.Color = new Color("#3498DB");
841         /// underline.Height = 2.0f;
842         /// editor.SetUnderline(underline);
843         /// </code>
844         /// </example>
845         [EditorBrowsable(EditorBrowsableState.Never)]
846         public void SetUnderline(Underline underline)
847         {
848             SetProperty(TextEditor.Property.UNDERLINE, new PropertyValue(TextUtils.GetUnderlineMap(underline)));
849         }
850
851         /// <summary>
852         /// Get Underline from TextEditor. <br />
853         /// </summary>
854         /// <returns>The Underline</returns>
855         /// <remarks>
856         /// <see cref="Tizen.NUI.Text.Underline"/>
857         /// </remarks>
858         [EditorBrowsable(EditorBrowsableState.Never)]
859         public Underline GetUnderline()
860         {
861             var map = new PropertyMap();
862             GetProperty(TextEditor.Property.UNDERLINE).Get(map);
863             return TextUtils.GetUnderlineStruct(map);
864         }
865
866         /// <summary>
867         /// The InputUnderline property.
868         /// </summary>
869         /// <since_tizen> 3 </since_tizen>
870         public string InputUnderline
871         {
872             get
873             {
874                 return (string)GetValue(InputUnderlineProperty);
875             }
876             set
877             {
878                 SetValue(InputUnderlineProperty, value);
879                 NotifyPropertyChanged();
880             }
881         }
882
883         /// <summary>
884         /// The Shadow property.
885         /// The shadow map contains the following keys :<br />
886         /// <list type="table">
887         /// <item><term>color (Color)</term><description>The color of the shadow (the default color is Color.Black)</description></item>
888         /// <item><term>offset (Vector2)</term><description>The offset in pixels of the shadow (If not provided then the shadow is not enabled)</description></item>
889         /// <item><term>blurRadius (float)</term><description>The radius of the Gaussian blur for the soft shadow (If not provided then the soft shadow is not enabled)</description></item>
890         /// </list>
891         /// </summary>
892         /// <since_tizen> 3 </since_tizen>
893         public PropertyMap Shadow
894         {
895             get
896             {
897                 return (PropertyMap)GetValue(ShadowProperty);
898             }
899             set
900             {
901                 SetValue(ShadowProperty, value);
902                 NotifyPropertyChanged();
903             }
904         }
905
906         /// <summary>
907         /// The InputShadow property.
908         /// </summary>
909         /// <since_tizen> 3 </since_tizen>
910         public string InputShadow
911         {
912             get
913             {
914                 return (string)GetValue(InputShadowProperty);
915             }
916             set
917             {
918                 SetValue(InputShadowProperty, value);
919                 NotifyPropertyChanged();
920             }
921         }
922
923         /// <summary>
924         /// The Emboss property.
925         /// </summary>
926         /// <since_tizen> 3 </since_tizen>
927         public string Emboss
928         {
929             get
930             {
931                 return (string)GetValue(EmbossProperty);
932             }
933             set
934             {
935                 SetValue(EmbossProperty, value);
936                 NotifyPropertyChanged();
937             }
938         }
939
940         /// <summary>
941         /// The InputEmboss property.
942         /// </summary>
943         /// <since_tizen> 3 </since_tizen>
944         public string InputEmboss
945         {
946             get
947             {
948                 return (string)GetValue(InputEmbossProperty);
949             }
950             set
951             {
952                 SetValue(InputEmbossProperty, value);
953                 NotifyPropertyChanged();
954             }
955         }
956
957         /// <summary>
958         /// The Outline property.
959         /// The outline map contains the following keys :<br />
960         /// <list type="table">
961         /// <item><term>color (Color)</term><description>The color of the outline (the default color is Color.White)</description></item>
962         /// <item><term>width (float)</term><description>The width in pixels of the outline (If not provided then the outline is not enabled)</description></item>
963         /// </list>
964         /// </summary>
965         /// <since_tizen> 3 </since_tizen>
966         public PropertyMap Outline
967         {
968             get
969             {
970                 return (PropertyMap)GetValue(OutlineProperty);
971             }
972             set
973             {
974                 SetValue(OutlineProperty, value);
975                 NotifyPropertyChanged();
976             }
977         }
978
979         /// <summary>
980         /// The InputOutline property.
981         /// </summary>
982         /// <since_tizen> 3 </since_tizen>
983         public string InputOutline
984         {
985             get
986             {
987                 return (string)GetValue(InputOutlineProperty);
988             }
989             set
990             {
991                 SetValue(InputOutlineProperty, value);
992                 NotifyPropertyChanged();
993             }
994         }
995
996         /// <summary>
997         /// The SmoothScroll property.
998         /// </summary>
999         /// <since_tizen> 3 </since_tizen>
1000         public bool SmoothScroll
1001         {
1002             get
1003             {
1004                 return (bool)GetValue(SmoothScrollProperty);
1005             }
1006             set
1007             {
1008                 SetValue(SmoothScrollProperty, value);
1009                 NotifyPropertyChanged();
1010             }
1011         }
1012
1013         /// <summary>
1014         /// The SmoothScrollDuration property.
1015         /// </summary>
1016         /// <since_tizen> 3 </since_tizen>
1017         public float SmoothScrollDuration
1018         {
1019             get
1020             {
1021                 return (float)GetValue(SmoothScrollDurationProperty);
1022             }
1023             set
1024             {
1025                 SetValue(SmoothScrollDurationProperty, value);
1026                 NotifyPropertyChanged();
1027             }
1028         }
1029
1030         /// <summary>
1031         /// The EnableScrollBar property.
1032         /// </summary>
1033         /// <since_tizen> 3 </since_tizen>
1034         public bool EnableScrollBar
1035         {
1036             get
1037             {
1038                 return (bool)GetValue(EnableScrollBarProperty);
1039             }
1040             set
1041             {
1042                 SetValue(EnableScrollBarProperty, value);
1043                 NotifyPropertyChanged();
1044             }
1045         }
1046
1047         /// <summary>
1048         /// The ScrollBarShowDuration property.
1049         /// </summary>
1050         /// <since_tizen> 3 </since_tizen>
1051         public float ScrollBarShowDuration
1052         {
1053             get
1054             {
1055                 return (float)GetValue(ScrollBarShowDurationProperty);
1056             }
1057             set
1058             {
1059                 SetValue(ScrollBarShowDurationProperty, value);
1060                 NotifyPropertyChanged();
1061             }
1062         }
1063
1064         /// <summary>
1065         /// The ScrollBarFadeDuration property.
1066         /// </summary>
1067         /// <since_tizen> 3 </since_tizen>
1068         public float ScrollBarFadeDuration
1069         {
1070             get
1071             {
1072                 return (float)GetValue(ScrollBarFadeDurationProperty);
1073             }
1074             set
1075             {
1076                 SetValue(ScrollBarFadeDurationProperty, value);
1077                 NotifyPropertyChanged();
1078             }
1079         }
1080
1081         /// <summary>
1082         /// The PixelSize property.
1083         /// </summary>
1084         /// <since_tizen> 3 </since_tizen>
1085         public float PixelSize
1086         {
1087             get
1088             {
1089                 return (float)GetValue(PixelSizeProperty);
1090             }
1091             set
1092             {
1093                 SetValue(PixelSizeProperty, value);
1094                 NotifyPropertyChanged();
1095             }
1096         }
1097
1098         /// <summary>
1099         /// The line count of the text.
1100         /// </summary>
1101         /// <since_tizen> 3 </since_tizen>
1102         public int LineCount
1103         {
1104             get
1105             {
1106                 int temp = 0;
1107                 GetProperty(TextEditor.Property.LineCount).Get(out temp);
1108                 return temp;
1109             }
1110         }
1111
1112         /// <summary>
1113         /// The text to display when the TextEditor is empty and inactive.
1114         /// </summary>
1115         /// <since_tizen> 3 </since_tizen>
1116         public string PlaceholderText
1117         {
1118             get
1119             {
1120                 return (string)GetValue(PlaceholderTextProperty);
1121             }
1122             set
1123             {
1124                 SetValue(PlaceholderTextProperty, value);
1125                 NotifyPropertyChanged();
1126             }
1127         }
1128
1129         /// <summary>
1130         /// The Selected Text property (read-only).
1131         /// </summary>
1132         [EditorBrowsable(EditorBrowsableState.Never)]
1133         public string SelectedText
1134         {
1135             get
1136             {
1137                 string temp;
1138                 GetProperty(TextEditor.Property.SelectedText).Get(out temp);
1139                 return temp;
1140             }
1141         }
1142
1143         /// <summary>
1144         /// The Placeholder text color.
1145         /// </summary>
1146         /// <remarks>
1147         /// The property cascade chaining set is possible. For example, this (textEditor.PlaceholderTextColor.X = 0.1f;) is possible.
1148         /// </remarks>
1149         /// <since_tizen> 3 </since_tizen>
1150         public Color PlaceholderTextColor
1151         {
1152             get
1153             {
1154                 Color temp = (Color)GetValue(PlaceholderTextColorProperty);
1155                 return new Color(OnPlaceholderTextColorChanged, temp.R, temp.G, temp.B, temp.A);
1156             }
1157             set
1158             {
1159                 SetValue(PlaceholderTextColorProperty, value);
1160                 NotifyPropertyChanged();
1161             }
1162         }
1163
1164         /// <summary>
1165         /// The EnableSelection property.
1166         /// </summary>
1167         /// <since_tizen> 3 </since_tizen>
1168         public bool EnableSelection
1169         {
1170             get
1171             {
1172                 return (bool)GetValue(EnableSelectionProperty);
1173             }
1174             set
1175             {
1176                 SetValue(EnableSelectionProperty, value);
1177                 NotifyPropertyChanged();
1178             }
1179         }
1180
1181         /// <summary>
1182         /// The start index for selection.
1183         /// </summary>
1184         /// <since_tizen> 8 </since_tizen>
1185         /// This will be public opened in tizen_6.0 after ACR done, Before ACR, need to be hidden as inhouse API.
1186         [EditorBrowsable(EditorBrowsableState.Never)]
1187         public int SelectedTextStart
1188         {
1189             get
1190             {
1191                 int temp;
1192                 GetProperty(TextEditor.Property.SelectedTextStart).Get(out temp);
1193                 return temp;
1194             }
1195             set
1196             {
1197                 SetProperty(TextEditor.Property.SelectedTextStart, new PropertyValue(value));
1198                 NotifyPropertyChanged();
1199             }
1200         }
1201
1202         /// <summary>
1203         /// The end index for selection.
1204         /// </summary>
1205         /// <since_tizen> 8 </since_tizen>
1206         /// This will be public opened in tizen_6.0 after ACR done, Before ACR, need to be hidden as inhouse API.
1207         [EditorBrowsable(EditorBrowsableState.Never)]
1208         public int SelectedTextEnd
1209         {
1210             get
1211             {
1212                 int temp;
1213                 GetProperty(TextEditor.Property.SelectedTextEnd).Get(out temp);
1214                 return temp;
1215             }
1216             set
1217             {
1218                 SetProperty(TextEditor.Property.SelectedTextEnd, new PropertyValue(value));
1219                 NotifyPropertyChanged();
1220             }
1221         }
1222
1223         /// <summary>
1224         /// Enable editing in text control.
1225         /// </summary>
1226         /// <since_tizen> 8 </since_tizen>
1227         /// This will be public opened in tizen_6.0 after ACR done, Before ACR, need to be hidden as inhouse API.
1228         [EditorBrowsable(EditorBrowsableState.Never)]
1229         public bool EnableEditing
1230         {
1231             get
1232             {
1233                 bool temp;
1234                 GetProperty(TextEditor.Property.EnableEditing).Get(out temp);
1235                 return temp;
1236             }
1237             set
1238             {
1239                 SetProperty(TextEditor.Property.EnableEditing, new PropertyValue(value));
1240                 NotifyPropertyChanged();
1241             }
1242         }
1243
1244         /// <summary>
1245         /// Specify horizontal scroll position in text control.
1246         /// </summary>
1247         [EditorBrowsable(EditorBrowsableState.Never)]
1248         public int HorizontalScrollPosition
1249         {
1250             get
1251             {
1252                 int temp;
1253                 using (PropertyValue propertyValue = GetProperty(TextEditor.Property.HorizontalScrollPosition))
1254                 {
1255                     propertyValue.Get(out temp);
1256                 }
1257                 return temp;
1258             }
1259             set
1260             {
1261                 using (PropertyValue propertyValue = new PropertyValue(value))
1262                 {
1263                     SetProperty(TextEditor.Property.HorizontalScrollPosition, propertyValue);
1264                     NotifyPropertyChanged();
1265                 }
1266             }
1267         }
1268
1269         /// <summary>
1270         /// Specify vertical scroll position in text control.
1271         /// </summary>
1272         [EditorBrowsable(EditorBrowsableState.Never)]
1273         public int VerticalScrollPosition
1274         {
1275             get
1276             {
1277                 int temp;
1278                 using (PropertyValue propertyValue = GetProperty(TextEditor.Property.VerticalScrollPosition))
1279                 {
1280                     propertyValue.Get(out temp);
1281                 }
1282                 return temp;
1283             }
1284             set
1285             {
1286                 using (PropertyValue propertyValue = new PropertyValue(value))
1287                 {
1288                     SetProperty(TextEditor.Property.VerticalScrollPosition, propertyValue);
1289                     NotifyPropertyChanged();
1290                 }
1291             }
1292         }
1293
1294         /// <summary>
1295         /// Specify primary cursor (caret) position in text control.
1296         /// </summary>
1297         [EditorBrowsable(EditorBrowsableState.Never)]
1298         public int PrimaryCursorPosition
1299         {
1300             get
1301             {
1302                 int temp;
1303                 using (PropertyValue propertyValue = GetProperty(TextEditor.Property.PrimaryCursorPosition))
1304                 {
1305                     propertyValue.Get(out temp);
1306                 }
1307                 return temp;
1308             }
1309             set
1310             {
1311                 using (PropertyValue propertyValue = new PropertyValue(value))
1312                 {
1313                     SetProperty(TextEditor.Property.PrimaryCursorPosition, propertyValue);
1314                     NotifyPropertyChanged();
1315                 }
1316             }
1317         }
1318
1319         /// <summary>
1320         /// The GrabHandleColor property.
1321         /// </summary>
1322         /// <remarks>
1323         /// The property cascade chaining set is possible. For example, this (textEditor.GrabHandleColor.X = 0.1f;) is possible.
1324         /// </remarks>
1325         [EditorBrowsable(EditorBrowsableState.Never)]
1326         public Color GrabHandleColor
1327         {
1328             get
1329             {
1330                 Color temp = (Color)GetValue(GrabHandleColorProperty);
1331                 return new Color(OnGrabHandleColorChanged, temp.R, temp.G, temp.B, temp.A);
1332             }
1333             set
1334             {
1335                 SetValue(GrabHandleColorProperty, value);
1336                 NotifyPropertyChanged();
1337             }
1338         }
1339
1340         /// <summary>
1341         /// Set InputFilter to TextEditor. <br />
1342         /// </summary>
1343         /// <param name="inputFilter">The InputFilter</param>
1344         /// <remarks>
1345         /// <see cref="Tizen.NUI.Text.InputFilter"/> filters input based on regular expressions. <br />
1346         /// Users can set the Accepted or Rejected regular expression set, or both. <br />
1347         /// If both are used, Rejected has higher priority. <br />
1348         /// InputFiltered signal is emitted when the input is filtered by InputFilter <br />
1349         /// See <see cref="InputFiltered"/>, <see cref="InputFilterType"/> and <see cref="InputFilteredEventArgs"/> for a detailed description. <br />
1350         /// </remarks>
1351         /// <example>
1352         /// The following example demonstrates how to use the SetInputFilter method.
1353         /// <code>
1354         /// Tizen.NUI.Text.InputFilter inputFilter;
1355         /// inputFilter.Accepted = new Regex(@"[\d]"); // accept whole digits
1356         /// inputFilter.Rejected = new Regex("[0-3]"); // reject 0, 1, 2, 3
1357         /// editor.SetInputFilter(inputFilter); // acceptable inputs are 4, 5, 6, 7, 8, 9
1358         /// </code>
1359         /// </example>
1360         [EditorBrowsable(EditorBrowsableState.Never)]
1361         public void SetInputFilter(InputFilter inputFilter)
1362         {
1363             SetProperty(TextEditor.Property.InputFilter, new PropertyValue(TextUtils.GetInputFilterMap(inputFilter)));
1364         }
1365
1366         /// <summary>
1367         /// Get InputFilter from TextEditor. <br />
1368         /// </summary>
1369         /// <returns>The InputFilter</returns>
1370         /// <remarks>
1371         /// <see cref="Tizen.NUI.Text.InputFilter"/>
1372         /// </remarks>
1373         [EditorBrowsable(EditorBrowsableState.Never)]
1374         public InputFilter GetInputFilter()
1375         {
1376             var map = new PropertyMap();
1377             GetProperty(TextEditor.Property.InputFilter).Get(map);
1378             return TextUtils.GetInputFilterStruct(map);
1379         }
1380
1381         /// <summary>
1382         /// The Placeholder property.
1383         /// The placeholder map contains the following keys :<br />
1384         /// <list type="table">
1385         /// <item><term>text (string)</term><description>The text to display when the TextEditor is empty and inactive</description></item>
1386         /// <item><term>textFocused (string)</term><description>The text to display when the placeholder has focus</description></item>
1387         /// <item><term>color (Color)</term><description>The color of the placeholder text</description></item>
1388         /// <item><term>fontFamily (string)</term><description>The fontFamily of the placeholder text</description></item>
1389         /// <item><term>fontStyle (PropertyMap)</term><description>The fontStyle of the placeholder text</description></item>
1390         /// <item><term>pointSize (float)</term><description>The pointSize of the placeholder text</description></item>
1391         /// <item><term>pixelSize (float)</term><description>The pixelSize of the placeholder text</description></item>
1392         /// <item><term>ellipsis (bool)</term><description>The ellipsis of the placeholder text</description></item>
1393         /// </list>
1394         /// </summary>
1395         /// <example>
1396         /// The following example demonstrates how to set the placeholder property.
1397         /// <code>
1398         /// PropertyMap propertyMap = new PropertyMap();
1399         /// propertyMap.Add("text", new PropertyValue("Setting Placeholder Text"));
1400         /// propertyMap.Add("textFocused", new PropertyValue("Setting Placeholder Text Focused"));
1401         /// propertyMap.Add("color", new PropertyValue(Color.Red));
1402         /// propertyMap.Add("fontFamily", new PropertyValue("Arial"));
1403         /// propertyMap.Add("pointSize", new PropertyValue(12.0f));
1404         ///
1405         /// PropertyMap fontStyleMap = new PropertyMap();
1406         /// fontStyleMap.Add("weight", new PropertyValue("bold"));
1407         /// fontStyleMap.Add("width", new PropertyValue("condensed"));
1408         /// fontStyleMap.Add("slant", new PropertyValue("italic"));
1409         /// propertyMap.Add("fontStyle", new PropertyValue(fontStyleMap));
1410         ///
1411         /// TextEditor editor = new TextEditor();
1412         /// editor.Placeholder = propertyMap;
1413         /// </code>
1414         /// </example>
1415         /// <since_tizen> 3 </since_tizen>
1416         public Tizen.NUI.PropertyMap Placeholder
1417         {
1418             get
1419             {
1420                 PropertyMap map = (PropertyMap)GetValue(PlaceholderProperty);
1421                 PropertyValue value = null;
1422
1423                 // text
1424                 value = map.Find(0);
1425                 if (null != value)
1426                 {
1427                     value.Get(out string text);
1428                     map.Add("text", new PropertyValue(text));
1429                 }
1430
1431                 // textFocused
1432                 value = map.Find(1);
1433                 if (null != value)
1434                 {
1435                     value.Get(out string textFocused);
1436                     map.Add("textFocused", new PropertyValue(textFocused));
1437                 }
1438
1439                 // color
1440                 value = map.Find(2);
1441                 if (null != value)
1442                 {
1443                     Color color = new Color();
1444                     value.Get(color);
1445                     map.Add("color", new PropertyValue(color));
1446                 }
1447
1448                 // fontFamily
1449                 value = map.Find(3);
1450                 if (null != value)
1451                 {
1452                     value.Get(out string fontFamily);
1453                     map.Add("fontFamily", new PropertyValue(fontFamily));
1454                 }
1455
1456                 // fontStyle
1457                 value = map.Find(4);
1458                 if (null != value)
1459                 {
1460                     PropertyMap fontStyle = new PropertyMap();
1461                     value.Get(fontStyle);
1462                     map.Add("fontStyle", new PropertyValue(fontStyle));
1463                 }
1464
1465                 // pointSize
1466                 value = map.Find(5);
1467                 if (null != value)
1468                 {
1469                     value.Get(out float pointSize);
1470                     map.Add("pointSize", new PropertyValue(pointSize));
1471                 }
1472
1473                 // pixelSize
1474                 value = map.Find(6);
1475                 if (null != value)
1476                 {
1477                     value.Get(out float pixelSize);
1478                     map.Add("pixelSize", new PropertyValue(pixelSize));
1479                 }
1480
1481                 // ellipsis
1482                 value = map.Find(7);
1483                 if (null != value)
1484                 {
1485                     value.Get(out bool ellipsis);
1486                     map.Add("ellipsis", new PropertyValue(ellipsis));
1487                 }
1488
1489                 return map;
1490             }
1491             set
1492             {
1493                 SetValue(PlaceholderProperty, value);
1494                 NotifyPropertyChanged();
1495             }
1496         }
1497
1498         /// <summary>
1499         /// The Ellipsis property.<br />
1500         /// Enable or disable the ellipsis.<br />
1501         /// </summary>
1502         [EditorBrowsable(EditorBrowsableState.Never)]
1503         public bool Ellipsis
1504         {
1505             get
1506             {
1507                 return (bool)GetValue(EllipsisProperty);
1508             }
1509             set
1510             {
1511                 SetValue(EllipsisProperty, value);
1512                 NotifyPropertyChanged();
1513             }
1514         }
1515
1516
1517         /// <summary>
1518         /// The ellipsis position of the text.
1519         /// The ellipsis position type when the text size over the layout size.<br />
1520         /// The ellipsis position: End, Start or Middle.<br />
1521         /// </summary>
1522         [EditorBrowsable(EditorBrowsableState.Never)]
1523         public EllipsisPosition EllipsisPosition
1524         {
1525             get
1526             {
1527                 return (EllipsisPosition)GetValue(EllipsisPositionProperty);
1528             }
1529             set
1530             {
1531                 SetValue(EllipsisPositionProperty, value);
1532                 NotifyPropertyChanged();
1533             }
1534         }
1535
1536         /// <summary>
1537         /// The LineWrapMode property.<br />
1538         /// The line wrap mode when the text lines over the layout width.<br />
1539         /// </summary>
1540         /// <since_tizen> 4 </since_tizen>
1541         public LineWrapMode LineWrapMode
1542         {
1543             get
1544             {
1545                 return (LineWrapMode)GetValue(LineWrapModeProperty);
1546             }
1547             set
1548             {
1549                 SetValue(LineWrapModeProperty, value);
1550                 NotifyPropertyChanged();
1551             }
1552         }
1553
1554         /// <summary>
1555         /// Enables Text selection using Shift key.
1556         /// </summary>
1557         /// <since_tizen> 5 </since_tizen>
1558         /// This will be released at Tizen.NET API Level 5, so currently this would be used as inhouse API.
1559         [EditorBrowsable(EditorBrowsableState.Never)]
1560         public bool EnableShiftSelection
1561         {
1562             get
1563             {
1564                 return (bool)GetValue(EnableShiftSelectionProperty);
1565             }
1566             set
1567             {
1568                 SetValue(EnableShiftSelectionProperty, value);
1569                 NotifyPropertyChanged();
1570             }
1571         }
1572
1573         /// <summary>
1574         /// The text alignment to match the direction of the system language.
1575         /// </summary>
1576         /// <since_tizen> 6 </since_tizen>
1577         public bool MatchSystemLanguageDirection
1578         {
1579             get
1580             {
1581                 return (bool)GetValue(MatchSystemLanguageDirectionProperty);
1582             }
1583             set
1584             {
1585                 SetValue(MatchSystemLanguageDirectionProperty, value);
1586                 NotifyPropertyChanged();
1587             }
1588         }
1589
1590         /// <summary>
1591         /// The MaxLength property.
1592         /// </summary>
1593         /// This will be public opened in tizen_6.5 after ACR done. Before ACR, need to be hidden as inhouse API.
1594         [EditorBrowsable(EditorBrowsableState.Never)]
1595         public int MaxLength
1596         {
1597             get
1598             {
1599                 return (int)GetValue(MaxLengthProperty);
1600             }
1601             set
1602             {
1603                 SetValue(MaxLengthProperty, value);
1604                 NotifyPropertyChanged();
1605             }
1606         }
1607
1608         /// Only used by the IL of xaml, will never changed to not hidden.
1609         [EditorBrowsable(EditorBrowsableState.Never)]
1610         public override bool IsCreateByXaml
1611         {
1612             get
1613             {
1614                 return base.IsCreateByXaml;
1615             }
1616             set
1617             {
1618                 base.IsCreateByXaml = value;
1619
1620                 if (value == true)
1621                 {
1622                     this.TextChanged += (obj, e) =>
1623                     {
1624                         this.Text = e.TextEditor.Text;
1625                     };
1626                 }
1627             }
1628         }
1629
1630         /// <summary>
1631         /// The FontSizeScale property. <br />
1632         /// The default value is 1.0. <br />
1633         /// If FontSizeScale.UseSystemSetting, will use the SystemSettings.FontSize internally. <br />
1634         /// </summary>
1635         /// <since_tizen> 9 </since_tizen>
1636         public float FontSizeScale
1637         {
1638             get
1639             {
1640                 return fontSizeScale;
1641             }
1642             set
1643             {
1644                 float newFontSizeScale;
1645
1646                 if (fontSizeScale == value) return;
1647
1648                 fontSizeScale = value;
1649                 if (fontSizeScale == Tizen.NUI.FontSizeScale.UseSystemSetting)
1650                 {
1651                     SystemSettingsFontSize systemSettingsFontSize;
1652
1653                     try
1654                     {
1655                         systemSettingsFontSize = SystemSettings.FontSize;
1656                     }
1657                     catch (Exception e)
1658                     {
1659                         Console.WriteLine("{0} Exception caught.", e);
1660                         systemSettingsFontSize = SystemSettingsFontSize.Normal;
1661                     }
1662                     newFontSizeScale = TextUtils.GetFontSizeScale(systemSettingsFontSize);
1663                     addFontSizeChangedCallback();
1664                 }
1665                 else
1666                 {
1667                     newFontSizeScale = fontSizeScale;
1668                     removeFontSizeChangedCallback();
1669                 }
1670
1671                 SetValue(FontSizeScaleProperty, newFontSizeScale);
1672                 NotifyPropertyChanged();
1673             }
1674         }
1675
1676         /// <summary>
1677         /// The InputMethodSettings property.
1678         /// </summary>
1679         /// <remarks>
1680         /// <see cref="InputMethod"/> is a class encapsulating the input method map. Please use the <see cref="InputMethod"/> class for this property.
1681         /// </remarks>
1682         /// <example>
1683         /// The following example demonstrates how to set the InputMethodSettings property.
1684         /// <code>
1685         /// InputMethod method = new InputMethod();
1686         /// method.PanelLayout = InputMethod.PanelLayoutType.Normal;
1687         /// method.ActionButton = InputMethod.ActionButtonTitleType.Default;
1688         /// method.AutoCapital = InputMethod.AutoCapitalType.Word;
1689         /// method.Variation = 1;
1690         /// textEditor.InputMethodSettings = method.OutputMap;
1691         /// </code>
1692         /// </example>
1693         [EditorBrowsable(EditorBrowsableState.Never)]
1694         public PropertyMap InputMethodSettings
1695         {
1696             get
1697             {
1698                 return (PropertyMap)GetValue(InputMethodSettingsProperty);
1699             }
1700             set
1701             {
1702                 SetValue(InputMethodSettingsProperty, value);
1703                 NotifyPropertyChanged();
1704             }
1705         }
1706
1707         /// <summary>
1708         /// Scroll the text control by specific amount..
1709         /// </summary>
1710         /// <param name="scroll">The amount (in pixels) of scrolling in horizontal &amp; vertical directions.</param>
1711         [EditorBrowsable(EditorBrowsableState.Never)]
1712         public void ScrollBy(Vector2 scroll)
1713         {
1714             Interop.TextEditor.ScrollBy(SwigCPtr, Vector2.getCPtr(scroll));
1715             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1716         }
1717
1718         /// <summary>
1719         /// Get the InputMethodContext instance.
1720         /// </summary>
1721         /// <returns>The InputMethodContext instance.</returns>
1722         /// <since_tizen> 5 </since_tizen>
1723         public InputMethodContext GetInputMethodContext()
1724         {
1725             if (inputMethodContext == null)
1726             {
1727                 /*Avoid raising InputMethodContext reference count.*/
1728                 inputMethodContext = new InputMethodContext(Interop.TextEditor.GetInputMethodContext(SwigCPtr), true);
1729                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1730             }
1731             return inputMethodContext;
1732         }
1733
1734         /// <summary>
1735         /// Select the whole text.
1736         /// </summary>
1737         [EditorBrowsable(EditorBrowsableState.Never)]
1738         public void SelectWholeText()
1739         {
1740             Interop.TextEditor.SelectWholeText(SwigCPtr);
1741             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1742         }
1743
1744         /// <summary>
1745         /// Select text from start to end index.
1746         /// </summary>
1747         /// <param name="start">The start index for selection.</param>
1748         /// <param name="end">The end index for selection.</param>
1749         [EditorBrowsable(EditorBrowsableState.Never)]
1750         public void SelectText(uint start, uint end)
1751         {
1752             Interop.TextEditor.SelectText(SwigCPtr, start, end);
1753             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1754         }
1755
1756         /// <summary>
1757         /// Clear selection of the text.
1758         /// </summary>
1759         [EditorBrowsable(EditorBrowsableState.Never)]
1760         public void SelectNone()
1761         {
1762             _ = Interop.TextEditor.SelectNone(SwigCPtr);
1763             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1764         }
1765
1766         /// <summary>
1767         /// Enable grab handle property.
1768         /// </summary>
1769         [EditorBrowsable(EditorBrowsableState.Never)]
1770         public bool EnableGrabHandle
1771         {
1772             get
1773             {
1774                 return (bool)GetValue(EnableGrabHandleProperty);
1775             }
1776             set
1777             {
1778                 SetValue(EnableGrabHandleProperty, value);
1779                 NotifyPropertyChanged();
1780             }
1781         }
1782
1783         /// <summary>
1784         /// Enable grab handle popup property.
1785         /// </summary>
1786         [EditorBrowsable(EditorBrowsableState.Never)]
1787         public bool EnableGrabHandlePopup
1788         {
1789             get
1790             {
1791                 return (bool)GetValue(EnableGrabHandlePopupProperty);
1792             }
1793             set
1794             {
1795                 SetValue(EnableGrabHandlePopupProperty, value);
1796                 NotifyPropertyChanged();
1797             }
1798         }
1799
1800         internal static global::System.Runtime.InteropServices.HandleRef getCPtr(TextEditor obj)
1801         {
1802             return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.SwigCPtr;
1803         }
1804
1805         internal SWIGTYPE_p_Dali__SignalT_void_fDali__Toolkit__TextEditor_Dali__Toolkit__TextEditor__InputStyle__MaskF_t InputStyleChangedSignal()
1806         {
1807             SWIGTYPE_p_Dali__SignalT_void_fDali__Toolkit__TextEditor_Dali__Toolkit__TextEditor__InputStyle__MaskF_t ret = new SWIGTYPE_p_Dali__SignalT_void_fDali__Toolkit__TextEditor_Dali__Toolkit__TextEditor__InputStyle__MaskF_t(Interop.TextEditor.InputStyleChangedSignal(SwigCPtr));
1808             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1809             return ret;
1810         }
1811
1812         /// <summary>
1813         /// Dispose.
1814         /// </summary>
1815         /// <since_tizen> 3 </since_tizen>
1816         protected override void Dispose(DisposeTypes type)
1817         {
1818             if (disposed)
1819             {
1820                 return;
1821             }
1822
1823             if (systemlangTextFlag)
1824             {
1825                 SystemSettings.LocaleLanguageChanged -= SystemSettings_LocaleLanguageChanged;
1826             }
1827
1828             removeFontSizeChangedCallback();
1829
1830             //Release your own unmanaged resources here.
1831             //You should not access any managed member here except static instance.
1832             //because the execution order of Finalizes is non-deterministic.
1833
1834             if (this.HasBody())
1835             {
1836                 if (textEditorTextChangedCallbackDelegate != null)
1837                 {
1838                     TextChangedSignal().Disconnect(textEditorTextChangedCallbackDelegate);
1839                 }
1840
1841                 if (textEditorMaxLengthReachedCallbackDelegate != null)
1842                 {
1843                     this.MaxLengthReachedSignal().Disconnect(textEditorMaxLengthReachedCallbackDelegate);
1844                 }
1845             }
1846
1847             base.Dispose(type);
1848         }
1849
1850         /// This will not be public opened.
1851         [EditorBrowsable(EditorBrowsableState.Never)]
1852         protected override void ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef swigCPtr)
1853         {
1854             // In order to speed up IME hide, temporarily add
1855             GetInputMethodContext()?.DestroyContext();
1856             Interop.TextEditor.DeleteTextEditor(swigCPtr);
1857         }
1858
1859         private string SetTranslatable(string textEditorSid)
1860         {
1861             string translatableText = null;
1862             translatableText = NUIApplication.MultilingualResourceManager?.GetString(textEditorSid, new CultureInfo(SystemSettings.LocaleLanguage.Replace("_", "-")));
1863             if (translatableText != null)
1864             {
1865                 if (systemlangTextFlag == false)
1866                 {
1867                     SystemSettings.LocaleLanguageChanged += SystemSettings_LocaleLanguageChanged;
1868                     systemlangTextFlag = true;
1869                 }
1870                 return translatableText;
1871             }
1872             else
1873             {
1874                 translatableText = "";
1875                 return translatableText;
1876             }
1877         }
1878
1879         private void SystemSettings_LocaleLanguageChanged(object sender, LocaleLanguageChangedEventArgs e)
1880         {
1881             if (textEditorTextSid != null)
1882             {
1883                 Text = NUIApplication.MultilingualResourceManager?.GetString(textEditorTextSid, new CultureInfo(e.Value.Replace("_", "-")));
1884             }
1885             if (textEditorPlaceHolderTextSid != null)
1886             {
1887                 PlaceholderText = NUIApplication.MultilingualResourceManager?.GetString(textEditorPlaceHolderTextSid, new CultureInfo(e.Value.Replace("_", "-")));
1888             }
1889         }
1890
1891         private void SystemSettingsFontSizeChanged(object sender, FontSizeChangedEventArgs e)
1892         {
1893             float newFontSizeScale = TextUtils.GetFontSizeScale(e.Value);
1894             SetValue(FontSizeScaleProperty, newFontSizeScale);
1895             NotifyPropertyChanged();
1896         }
1897
1898         private void addFontSizeChangedCallback()
1899         {
1900             if (hasFontSizeChangedCallback != true)
1901             {
1902                 try
1903                 {
1904                     SystemSettings.FontSizeChanged += SystemSettingsFontSizeChanged;
1905                     hasFontSizeChangedCallback = true;
1906                 }
1907                 catch (Exception e)
1908                 {
1909                     Console.WriteLine("{0} Exception caught.", e);
1910                     hasFontSizeChangedCallback = false;
1911                 }
1912             }
1913         }
1914
1915         private void removeFontSizeChangedCallback()
1916         {
1917             if (hasFontSizeChangedCallback == true)
1918             {
1919                 try
1920                 {
1921                     SystemSettings.FontSizeChanged -= SystemSettingsFontSizeChanged;
1922                     hasFontSizeChangedCallback = false;
1923                 }
1924                 catch (Exception e)
1925                 {
1926                     Console.WriteLine("{0} Exception caught.", e);
1927                     hasFontSizeChangedCallback = true;
1928                 }
1929             }
1930         }
1931
1932         internal new class Property
1933         {
1934             internal static readonly int TEXT = Interop.TextEditor.TextGet();
1935             internal static readonly int TextColor = Interop.TextEditor.TextColorGet();
1936             internal static readonly int FontFamily = Interop.TextEditor.FontFamilyGet();
1937             internal static readonly int FontStyle = Interop.TextEditor.FontStyleGet();
1938             internal static readonly int PointSize = Interop.TextEditor.PointSizeGet();
1939             internal static readonly int HorizontalAlignment = Interop.TextEditor.HorizontalAlignmentGet();
1940             internal static readonly int ScrollThreshold = Interop.TextEditor.ScrollThresholdGet();
1941             internal static readonly int ScrollSpeed = Interop.TextEditor.ScrollSpeedGet();
1942             internal static readonly int PrimaryCursorColor = Interop.TextEditor.PrimaryCursorColorGet();
1943             internal static readonly int SecondaryCursorColor = Interop.TextEditor.SecondaryCursorColorGet();
1944             internal static readonly int EnableCursorBlink = Interop.TextEditor.EnableCursorBlinkGet();
1945             internal static readonly int CursorBlinkInterval = Interop.TextEditor.CursorBlinkIntervalGet();
1946             internal static readonly int CursorBlinkDuration = Interop.TextEditor.CursorBlinkDurationGet();
1947             internal static readonly int CursorWidth = Interop.TextEditor.CursorWidthGet();
1948             internal static readonly int GrabHandleImage = Interop.TextEditor.GrabHandleImageGet();
1949             internal static readonly int GrabHandlePressedImage = Interop.TextEditor.GrabHandlePressedImageGet();
1950             internal static readonly int SelectionHandleImageLeft = Interop.TextEditor.SelectionHandleImageLeftGet();
1951             internal static readonly int SelectionHandleImageRight = Interop.TextEditor.SelectionHandleImageRightGet();
1952             internal static readonly int SelectionHandlePressedImageLeft = Interop.TextEditor.SelectionHandlePressedImageLeftGet();
1953             internal static readonly int SelectionHandlePressedImageRight = Interop.TextEditor.SelectionHandlePressedImageRightGet();
1954             internal static readonly int SelectionHandleMarkerImageLeft = Interop.TextEditor.SelectionHandleMarkerImageLeftGet();
1955             internal static readonly int SelectionHandleMarkerImageRight = Interop.TextEditor.SelectionHandleMarkerImageRightGet();
1956             internal static readonly int SelectionHighlightColor = Interop.TextEditor.SelectionHighlightColorGet();
1957             internal static readonly int DecorationBoundingBox = Interop.TextEditor.DecorationBoundingBoxGet();
1958             internal static readonly int EnableMarkup = Interop.TextEditor.EnableMarkupGet();
1959             internal static readonly int InputColor = Interop.TextEditor.InputColorGet();
1960             internal static readonly int InputFontFamily = Interop.TextEditor.InputFontFamilyGet();
1961             internal static readonly int InputFontStyle = Interop.TextEditor.InputFontStyleGet();
1962             internal static readonly int InputPointSize = Interop.TextEditor.InputPointSizeGet();
1963             internal static readonly int LineSpacing = Interop.TextEditor.LineSpacingGet();
1964             internal static readonly int InputLineSpacing = Interop.TextEditor.InputLineSpacingGet();
1965             internal static readonly int UNDERLINE = Interop.TextEditor.UnderlineGet();
1966             internal static readonly int InputUnderline = Interop.TextEditor.InputUnderlineGet();
1967             internal static readonly int SHADOW = Interop.TextEditor.ShadowGet();
1968             internal static readonly int InputShadow = Interop.TextEditor.InputShadowGet();
1969             internal static readonly int EMBOSS = Interop.TextEditor.EmbossGet();
1970             internal static readonly int InputEmboss = Interop.TextEditor.InputEmbossGet();
1971             internal static readonly int OUTLINE = Interop.TextEditor.OutlineGet();
1972             internal static readonly int InputOutline = Interop.TextEditor.InputOutlineGet();
1973             internal static readonly int SmoothScroll = Interop.TextEditor.SmoothScrollGet();
1974             internal static readonly int SmoothScrollDuration = Interop.TextEditor.SmoothScrollDurationGet();
1975             internal static readonly int EnableScrollBar = Interop.TextEditor.EnableScrollBarGet();
1976             internal static readonly int ScrollBarShowDuration = Interop.TextEditor.ScrollBarShowDurationGet();
1977             internal static readonly int ScrollBarFadeDuration = Interop.TextEditor.ScrollBarFadeDurationGet();
1978             internal static readonly int PixelSize = Interop.TextEditor.PixelSizeGet();
1979             internal static readonly int LineCount = Interop.TextEditor.LineCountGet();
1980             internal static readonly int EnableSelection = Interop.TextEditor.EnableSelectionGet();
1981             internal static readonly int PLACEHOLDER = Interop.TextEditor.PlaceholderGet();
1982             internal static readonly int LineWrapMode = Interop.TextEditor.LineWrapModeGet();
1983             internal static readonly int PlaceholderText = Interop.TextEditor.PlaceholderTextGet();
1984             internal static readonly int PlaceholderTextColor = Interop.TextEditor.PlaceholderTextColorGet();
1985             internal static readonly int EnableShiftSelection = Interop.TextEditor.EnableShiftSelectionGet();
1986             internal static readonly int MatchSystemLanguageDirection = Interop.TextEditor.MatchSystemLanguageDirectionGet();
1987             internal static readonly int MaxLength = Interop.TextEditor.MaxLengthGet();
1988             internal static readonly int SelectedTextStart = Interop.TextEditor.SelectedTextStartGet();
1989             internal static readonly int SelectedTextEnd = Interop.TextEditor.SelectedTextEndGet();
1990             internal static readonly int EnableEditing = Interop.TextEditor.EnableEditingGet();
1991             internal static readonly int SelectedText = Interop.TextEditor.SelectedTextGet();
1992             internal static readonly int HorizontalScrollPosition = Interop.TextEditor.HorizontalScrollPositionGet();
1993             internal static readonly int VerticalScrollPosition = Interop.TextEditor.VerticalScrollPositionGet();
1994             internal static readonly int PrimaryCursorPosition = Interop.TextEditor.PrimaryCursorPositionGet();
1995             internal static readonly int FontSizeScale = Interop.TextEditor.FontSizeScaleGet();
1996             internal static readonly int GrabHandleColor = Interop.TextEditor.GrabHandleColorGet();
1997             internal static readonly int EnableGrabHandle = Interop.TextEditor.EnableGrabHandleGet();
1998             internal static readonly int EnableGrabHandlePopup = Interop.TextEditor.EnableGrabHandlePopupGet();
1999             internal static readonly int InputMethodSettings = Interop.TextEditor.InputMethodSettingsGet();
2000             internal static readonly int ELLIPSIS = Interop.TextEditor.EllipsisGet();
2001             internal static readonly int EllipsisPosition = Interop.TextEditor.EllipsisPositionGet();
2002             internal static readonly int InputFilter = Interop.TextEditor.InputFilterGet();
2003         }
2004
2005         internal class InputStyle
2006         {
2007             internal enum Mask
2008             {
2009                 None = 0x0000,
2010                 Color = 0x0001,
2011                 FontFamily = 0x0002,
2012                 PointSize = 0x0004,
2013                 FontStyle = 0x0008,
2014                 LineSpacing = 0x0010,
2015                 Underline = 0x0020,
2016                 Shadow = 0x0040,
2017                 Emboss = 0x0080,
2018                 Outline = 0x0100
2019             }
2020         }
2021
2022         private void OnDecorationBoundingBoxChanged(int x, int y, int width, int height)
2023         {
2024             DecorationBoundingBox = new Rectangle(x, y, width, height);
2025         }
2026         private void OnInputColorChanged(float x, float y, float z, float w)
2027         {
2028             InputColor = new Vector4(x, y, z, w);
2029         }
2030         private void OnPlaceholderTextColorChanged(float r, float g, float b, float a)
2031         {
2032             PlaceholderTextColor = new Color(r, g, b, a);
2033         }
2034         private void OnPrimaryCursorColorChanged(float x, float y, float z, float w)
2035         {
2036             PrimaryCursorColor = new Vector4(x, y, z, w);
2037         }
2038         private void OnSecondaryCursorColorChanged(float x, float y, float z, float w)
2039         {
2040             SecondaryCursorColor = new Vector4(x, y, z, w);
2041         }
2042         private void OnSelectionHighlightColorChanged(float x, float y, float z, float w)
2043         {
2044             SelectionHighlightColor = new Vector4(x, y, z, w);
2045         }
2046         private void OnTextColorChanged(float x, float y, float z, float w)
2047         {
2048             TextColor = new Vector4(x, y, z, w);
2049         }
2050         private void OnGrabHandleColorChanged(float r, float g, float b, float a)
2051         {
2052             GrabHandleColor = new Color(r, g, b, a);
2053         }
2054     }
2055 }