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