a63a90f78fba75238a62d9692a3c06aa2bbc29b6
[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                 SetValue(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         [System.Diagnostics.CodeAnalysis.SuppressMessage("Naming", "CA1721: Property names should not match get methods")]
207         public PropertyMap FontStyle
208         {
209             get
210             {
211                 return (PropertyMap)GetValue(FontStyleProperty);
212             }
213             set
214             {
215                 SetValue(FontStyleProperty, value);
216                 NotifyPropertyChanged();
217             }
218         }
219
220         /// <summary>
221         /// Set FontStyle to TextEditor. <br />
222         /// </summary>
223         /// <param name="fontStyle">The FontStyle</param>
224         /// <remarks>
225         /// SetFontStyle specifies the requested font style through <see cref="Tizen.NUI.Text.FontStyle"/>. <br />
226         /// </remarks>
227         /// <example>
228         /// The following example demonstrates how to use the SetFontStyle method.
229         /// <code>
230         /// var fontStyle = new Tizen.NUI.Text.FontStyle();
231         /// fontStyle.Width = FontWidthType.Expanded;
232         /// fontStyle.Weight = FontWeightType.Bold;
233         /// fontStyle.Slant = FontSlantType.Italic;
234         /// editor.SetFontStyle(fontStyle);
235         /// </code>
236         /// </example>
237         [EditorBrowsable(EditorBrowsableState.Never)]
238         public void SetFontStyle(FontStyle fontStyle)
239         {
240             SetValue(FontStyleProperty, TextUtils.GetFontStyleMap(fontStyle));
241         }
242
243         /// <summary>
244         /// Get FontStyle from TextEditor. <br />
245         /// </summary>
246         /// <returns>The FontStyle</returns>
247         /// <remarks>
248         /// <see cref="Tizen.NUI.Text.FontStyle"/>
249         /// </remarks>
250         [EditorBrowsable(EditorBrowsableState.Never)]
251         public FontStyle GetFontStyle()
252         {
253             return TextUtils.GetFontStyleStruct((PropertyMap)GetValue(FontStyleProperty));
254         }
255
256         /// <summary>
257         /// The PointSize property.
258         /// </summary>
259         /// <since_tizen> 3 </since_tizen>
260         public float PointSize
261         {
262             get
263             {
264                 return (float)GetValue(PointSizeProperty);
265             }
266             set
267             {
268                 SetValue(PointSizeProperty, value);
269                 NotifyPropertyChanged();
270             }
271         }
272
273         /// <summary>
274         /// The HorizontalAlignment property.
275         /// </summary>
276         /// <since_tizen> 3 </since_tizen>
277         public HorizontalAlignment HorizontalAlignment
278         {
279             get
280             {
281                 return (HorizontalAlignment)GetValue(HorizontalAlignmentProperty);
282             }
283             set
284             {
285                 SetValue(HorizontalAlignmentProperty, value);
286                 NotifyPropertyChanged();
287             }
288         }
289
290         /// <summary>
291         /// The ScrollThreshold property.
292         /// </summary>
293         /// <since_tizen> 3 </since_tizen>
294         public float ScrollThreshold
295         {
296             get
297             {
298                 return (float)GetValue(ScrollThresholdProperty);
299             }
300             set
301             {
302                 SetValue(ScrollThresholdProperty, value);
303                 NotifyPropertyChanged();
304             }
305         }
306
307         /// <summary>
308         /// The ScrollSpeed property.
309         /// </summary>
310         /// <since_tizen> 3 </since_tizen>
311         public float ScrollSpeed
312         {
313             get
314             {
315                 return (float)GetValue(ScrollSpeedProperty);
316             }
317             set
318             {
319                 SetValue(ScrollSpeedProperty, value);
320                 NotifyPropertyChanged();
321             }
322         }
323
324         /// <summary>
325         /// The PrimaryCursorColor property.
326         /// </summary>
327         /// <remarks>
328         /// The property cascade chaining set is possible. For example, this (textEditor.PrimaryCursorColor.X = 0.1f;) is possible.
329         /// </remarks>
330         /// <since_tizen> 3 </since_tizen>
331         public Vector4 PrimaryCursorColor
332         {
333             get
334             {
335                 Vector4 temp = (Vector4)GetValue(PrimaryCursorColorProperty);
336                 return new Vector4(OnPrimaryCursorColorChanged, temp.X, temp.Y, temp.Z, temp.W);
337             }
338             set
339             {
340                 SetValue(PrimaryCursorColorProperty, value);
341                 NotifyPropertyChanged();
342             }
343         }
344
345         /// <summary>
346         /// The SecondaryCursorColor property.
347         /// </summary>
348         /// <remarks>
349         /// The property cascade chaining set is possible. For example, this (textEditor.SecondaryCursorColor.X = 0.1f;) is possible.
350         /// </remarks>
351         /// <since_tizen> 3 </since_tizen>
352         public Vector4 SecondaryCursorColor
353         {
354             get
355             {
356                 Vector4 temp = (Vector4)GetValue(SecondaryCursorColorProperty);
357                 return new Vector4(OnSecondaryCursorColorChanged, temp.X, temp.Y, temp.Z, temp.W);
358             }
359             set
360             {
361                 SetValue(SecondaryCursorColorProperty, value);
362                 NotifyPropertyChanged();
363             }
364         }
365
366         /// <summary>
367         /// The EnableCursorBlink property.
368         /// </summary>
369         /// <since_tizen> 3 </since_tizen>
370         public bool EnableCursorBlink
371         {
372             get
373             {
374                 return (bool)GetValue(EnableCursorBlinkProperty);
375             }
376             set
377             {
378                 SetValue(EnableCursorBlinkProperty, value);
379                 NotifyPropertyChanged();
380             }
381         }
382
383         /// <summary>
384         /// The CursorBlinkInterval property.
385         /// </summary>
386         /// <since_tizen> 3 </since_tizen>
387         public float CursorBlinkInterval
388         {
389             get
390             {
391                 return (float)GetValue(CursorBlinkIntervalProperty);
392             }
393             set
394             {
395                 SetValue(CursorBlinkIntervalProperty, value);
396                 NotifyPropertyChanged();
397             }
398         }
399
400         /// <summary>
401         /// The CursorBlinkDuration property.
402         /// </summary>
403         /// <since_tizen> 3 </since_tizen>
404         public float CursorBlinkDuration
405         {
406             get
407             {
408                 return (float)GetValue(CursorBlinkDurationProperty);
409             }
410             set
411             {
412                 SetValue(CursorBlinkDurationProperty, value);
413                 NotifyPropertyChanged();
414             }
415         }
416
417         /// <summary>
418         /// The CursorWidth property.
419         /// </summary>
420         /// <since_tizen> 3 </since_tizen>
421         public int CursorWidth
422         {
423             get
424             {
425                 return (int)GetValue(CursorWidthProperty);
426             }
427             set
428             {
429                 SetValue(CursorWidthProperty, value);
430                 NotifyPropertyChanged();
431             }
432         }
433
434         /// <summary>
435         /// The GrabHandleImage property.
436         /// </summary>
437         /// <since_tizen> 3 </since_tizen>
438         public string GrabHandleImage
439         {
440             get
441             {
442                 return (string)GetValue(GrabHandleImageProperty);
443             }
444             set
445             {
446                 SetValue(GrabHandleImageProperty, value);
447                 NotifyPropertyChanged();
448             }
449         }
450
451         /// <summary>
452         /// The GrabHandlePressedImage property.
453         /// </summary>
454         /// <since_tizen> 3 </since_tizen>
455         public string GrabHandlePressedImage
456         {
457             get
458             {
459                 return (string)GetValue(GrabHandlePressedImageProperty);
460             }
461             set
462             {
463                 SetValue(GrabHandlePressedImageProperty, value);
464                 NotifyPropertyChanged();
465             }
466         }
467
468         /// <summary>
469         /// The SelectionHandleImageLeft property.
470         /// The selectionHandleImageLeft map contains the following key :<br />
471         /// <list type="table">
472         /// <item><term>filename (string)</term><description>The path of image file</description></item>
473         /// </list>
474         /// </summary>
475         /// <since_tizen> 3 </since_tizen>
476         public PropertyMap SelectionHandleImageLeft
477         {
478             get
479             {
480                 return (PropertyMap)GetValue(SelectionHandleImageLeftProperty);
481             }
482             set
483             {
484                 SetValue(SelectionHandleImageLeftProperty, value);
485                 NotifyPropertyChanged();
486             }
487         }
488
489         /// <summary>
490         /// The SelectionHandleImageRight property.
491         /// The selectionHandleImageRight map contains the following key :<br />
492         /// <list type="table">
493         /// <item><term>filename (string)</term><description>The path of image file</description></item>
494         /// </list>
495         /// </summary>
496         /// <since_tizen> 3 </since_tizen>
497         public PropertyMap SelectionHandleImageRight
498         {
499             get
500             {
501                 return (PropertyMap)GetValue(SelectionHandleImageRightProperty);
502             }
503             set
504             {
505                 SetValue(SelectionHandleImageRightProperty, value);
506                 NotifyPropertyChanged();
507             }
508         }
509
510         /// <summary>
511         /// Set SelectionHandleImage to TextEditor. <br />
512         /// </summary>
513         /// <param name="selectionHandleImage">The SelectionHandleImage</param>
514         /// <remarks>
515         /// SetSelectionHandleImage specifies the display image used for the selection handle through <see cref="Tizen.NUI.Text.SelectionHandleImage"/>. <br />
516         /// </remarks>
517         /// <example>
518         /// The following example demonstrates how to use the SetSelectionHandleImage method.
519         /// <code>
520         /// var selectionHandleImage = new Tizen.NUI.Text.SelectionHandleImage();
521         /// selectionHandleImage.LeftImageUrl = "handle_downleft.png";
522         /// selectionHandleImage.RightImageUrl = "handle_downright.png";
523         /// editor.SetSelectionHandleImage(selectionHandleImage);
524         /// </code>
525         /// </example>
526         [EditorBrowsable(EditorBrowsableState.Never)]
527         public void SetSelectionHandleImage(SelectionHandleImage selectionHandleImage)
528         {
529             if (!String.IsNullOrEmpty(selectionHandleImage.LeftImageUrl))
530             {
531                 SetValue(SelectionHandleImageLeftProperty, TextUtils.GetFileNameMap(selectionHandleImage.LeftImageUrl));
532             }
533
534             if (!String.IsNullOrEmpty(selectionHandleImage.RightImageUrl))
535             {
536                 SetValue(SelectionHandleImageRightProperty, TextUtils.GetFileNameMap(selectionHandleImage.RightImageUrl));
537             }
538         }
539
540         /// <summary>
541         /// Get SelectionHandleImage from TextEditor. <br />
542         /// </summary>
543         /// <returns>The SelectionHandleImage</returns>
544         /// <remarks>
545         /// <see cref="Tizen.NUI.Text.SelectionHandleImage"/>
546         /// </remarks>
547         [EditorBrowsable(EditorBrowsableState.Never)]
548         public SelectionHandleImage GetSelectionHandleImage()
549         {
550             return TextUtils.GetSelectionHandleImageStruct((PropertyMap)GetValue(SelectionHandleImageLeftProperty), (PropertyMap)GetValue(SelectionHandleImageRightProperty));
551         }
552
553         /// <summary>
554         /// The SelectionHandlePressedImageLeft property.
555         /// The selectionHandlePressedImageLeft 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 SelectionHandlePressedImageLeft
562         {
563             get
564             {
565                 return (PropertyMap)GetValue(SelectionHandlePressedImageLeftProperty);
566             }
567             set
568             {
569                 SetValue(SelectionHandlePressedImageLeftProperty, value);
570                 NotifyPropertyChanged();
571             }
572         }
573
574         /// <summary>
575         /// The SelectionHandlePressedImageRight property.
576         /// The selectionHandlePressedImageRight 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 SelectionHandlePressedImageRight
583         {
584             get
585             {
586                 return (PropertyMap)GetValue(SelectionHandlePressedImageRightProperty);
587             }
588             set
589             {
590                 SetValue(SelectionHandlePressedImageRightProperty, value);
591                 NotifyPropertyChanged();
592             }
593         }
594
595         /// <summary>
596         /// Set SelectionHandlePressedImage to TextEditor. <br />
597         /// </summary>
598         /// <param name="selectionHandlePressedImage">The SelectionHandleImage</param>
599         /// <remarks>
600         /// SetSelectionHandlePressedImage specifies the display image used for the selection handle through <see cref="Tizen.NUI.Text.SelectionHandleImage"/>. <br />
601         /// </remarks>
602         /// <example>
603         /// The following example demonstrates how to use the SetSelectionHandlePressedImage method.
604         /// <code>
605         /// var selectionHandlePressedImage = new Tizen.NUI.Text.SelectionHandleImage();
606         /// selectionHandlePressedImage.LeftImageUrl = "handle_pressed_downleft.png";
607         /// selectionHandlePressedImage.RightImageUrl = "handle_pressed_downright.png";
608         /// editor.SetSelectionHandlePressedImage(selectionHandlePressedImage);
609         /// </code>
610         /// </example>
611         [EditorBrowsable(EditorBrowsableState.Never)]
612         public void SetSelectionHandlePressedImage(SelectionHandleImage selectionHandlePressedImage)
613         {
614             if (!String.IsNullOrEmpty(selectionHandlePressedImage.LeftImageUrl))
615             {
616                 SetValue(SelectionHandlePressedImageLeftProperty, TextUtils.GetFileNameMap(selectionHandlePressedImage.LeftImageUrl));
617             }
618
619             if (!String.IsNullOrEmpty(selectionHandlePressedImage.RightImageUrl))
620             {
621                 SetValue(SelectionHandlePressedImageRightProperty, TextUtils.GetFileNameMap(selectionHandlePressedImage.RightImageUrl));
622             }
623         }
624
625         /// <summary>
626         /// Get SelectionHandlePressedImage from TextEditor. <br />
627         /// </summary>
628         /// <returns>The SelectionHandlePressedImage</returns>
629         /// <remarks>
630         /// <see cref="Tizen.NUI.Text.SelectionHandleImage"/>
631         /// </remarks>
632         [EditorBrowsable(EditorBrowsableState.Never)]
633         public SelectionHandleImage GetSelectionHandlePressedImage()
634         {
635             return TextUtils.GetSelectionHandleImageStruct((PropertyMap)GetValue(SelectionHandlePressedImageLeftProperty), (PropertyMap)GetValue(SelectionHandlePressedImageRightProperty));
636         }
637
638         /// <summary>
639         /// The SelectionHandleMarkerImageLeft property.
640         /// The selectionHandleMarkerImageLeft map contains the following key :<br />
641         /// <list type="table">
642         /// <item><term>filename (string)</term><description>The path of image file</description></item>
643         /// </list>
644         /// </summary>
645         /// <since_tizen> 3 </since_tizen>
646         public PropertyMap SelectionHandleMarkerImageLeft
647         {
648             get
649             {
650                 return (PropertyMap)GetValue(SelectionHandleMarkerImageLeftProperty);
651             }
652             set
653             {
654                 SetValue(SelectionHandleMarkerImageLeftProperty, value);
655                 NotifyPropertyChanged();
656             }
657         }
658
659         /// <summary>
660         /// The SelectionHandleMarkerImageRight property.
661         /// The selectionHandleMarkerImageRight map contains the following key :<br />
662         /// <list type="table">
663         /// <item><term>filename (string)</term><description>The path of image file</description></item>
664         /// </list>
665         /// </summary>
666         /// <since_tizen> 3 </since_tizen>
667         public PropertyMap SelectionHandleMarkerImageRight
668         {
669             get
670             {
671                 return (PropertyMap)GetValue(SelectionHandleMarkerImageRightProperty);
672             }
673             set
674             {
675                 SetValue(SelectionHandleMarkerImageRightProperty, value);
676                 NotifyPropertyChanged();
677             }
678         }
679
680         /// <summary>
681         /// Set SelectionHandleMarkerImage to TextEditor. <br />
682         /// </summary>
683         /// <param name="selectionHandleMarkerImage">The SelectionHandleImage</param>
684         /// <remarks>
685         /// SetSelectionHandleMarkerImage specifies the display image used for the selection handle through <see cref="Tizen.NUI.Text.SelectionHandleImage"/>. <br />
686         /// </remarks>
687         /// <example>
688         /// The following example demonstrates how to use the SetSelectionHandleMarkerImage method.
689         /// <code>
690         /// var selectionHandleMarkerImage = new Tizen.NUI.Text.SelectionHandleImage();
691         /// selectionHandleMarkerImage.LeftImageUrl = "handle_pressed_downleft.png";
692         /// selectionHandleMarkerImage.RightImageUrl = "handle_pressed_downright.png";
693         /// editor.SetSelectionHandleMarkerImage(selectionHandleMarkerImage);
694         /// </code>
695         /// </example>
696         [EditorBrowsable(EditorBrowsableState.Never)]
697         public void SetSelectionHandleMarkerImage(SelectionHandleImage selectionHandleMarkerImage)
698         {
699             if (!String.IsNullOrEmpty(selectionHandleMarkerImage.LeftImageUrl))
700             {
701                 SetValue(SelectionHandleMarkerImageLeftProperty, TextUtils.GetFileNameMap(selectionHandleMarkerImage.LeftImageUrl));
702             }
703
704             if (!String.IsNullOrEmpty(selectionHandleMarkerImage.RightImageUrl))
705             {
706                 SetValue(SelectionHandleMarkerImageRightProperty, TextUtils.GetFileNameMap(selectionHandleMarkerImage.RightImageUrl));
707             }
708         }
709
710         /// <summary>
711         /// Get SelectionHandleMarkerImage from TextEditor. <br />
712         /// </summary>
713         /// <returns>The SelectionHandleMarkerImage</returns>
714         /// <remarks>
715         /// <see cref="Tizen.NUI.Text.SelectionHandleImage"/>
716         /// </remarks>
717         [EditorBrowsable(EditorBrowsableState.Never)]
718         public SelectionHandleImage GetSelectionHandleMarkerImage()
719         {
720             return TextUtils.GetSelectionHandleImageStruct((PropertyMap)GetValue(SelectionHandleMarkerImageLeftProperty), (PropertyMap)GetValue(SelectionHandleMarkerImageRightProperty));
721         }
722
723         /// <summary>
724         /// The SelectionHighlightColor property.
725         /// </summary>
726         /// <remarks>
727         /// The property cascade chaining set is possible. For example, this (textEditor.SelectionHighlightColor.X = 0.1f;) is possible.
728         /// </remarks>
729         /// <since_tizen> 3 </since_tizen>
730         public Vector4 SelectionHighlightColor
731         {
732             get
733             {
734                 Vector4 temp = (Vector4)GetValue(SelectionHighlightColorProperty);
735                 return new Vector4(OnSelectionHighlightColorChanged, temp.X, temp.Y, temp.Z, temp.W);
736             }
737             set
738             {
739                 SetValue(SelectionHighlightColorProperty, value);
740                 NotifyPropertyChanged();
741             }
742         }
743
744         /// <summary>
745         /// The DecorationBoundingBox property.
746         /// </summary>
747         /// <remarks>
748         /// The property cascade chaining set is possible. For example, this (textEditor.DecorationBoundingBox.X = 1;) is possible.
749         /// </remarks>
750         /// <since_tizen> 3 </since_tizen>
751         public Rectangle DecorationBoundingBox
752         {
753             get
754             {
755                 Rectangle temp = (Rectangle)GetValue(DecorationBoundingBoxProperty);
756                 return new Rectangle(OnDecorationBoundingBoxChanged, temp.X, temp.Y, temp.Width, temp.Height);
757             }
758             set
759             {
760                 SetValue(DecorationBoundingBoxProperty, value);
761                 NotifyPropertyChanged();
762             }
763         }
764
765         /// <summary>
766         /// The EnableMarkup property.
767         /// </summary>
768         /// <since_tizen> 3 </since_tizen>
769         public bool EnableMarkup
770         {
771             get
772             {
773                 return (bool)GetValue(EnableMarkupProperty);
774             }
775             set
776             {
777                 SetValue(EnableMarkupProperty, value);
778                 NotifyPropertyChanged();
779             }
780         }
781
782         /// <summary>
783         /// The InputColor property.
784         /// </summary>
785         /// <remarks>
786         /// The property cascade chaining set is possible. For example, this (textEditor.InputColor.X = 0.1f;) is possible.
787         /// </remarks>
788         /// <since_tizen> 3 </since_tizen>
789         public Vector4 InputColor
790         {
791             get
792             {
793                 Vector4 temp = (Vector4)GetValue(InputColorProperty);
794                 return new Vector4(OnInputColorChanged, temp.X, temp.Y, temp.Z, temp.W);
795             }
796             set
797             {
798                 SetValue(InputColorProperty, value);
799                 NotifyPropertyChanged();
800             }
801         }
802
803         /// <summary>
804         /// The InputFontFamily property.
805         /// </summary>
806         /// <since_tizen> 3 </since_tizen>
807         public string InputFontFamily
808         {
809             get
810             {
811                 return (string)GetValue(InputFontFamilyProperty);
812             }
813             set
814             {
815                 SetValue(InputFontFamilyProperty, value);
816                 NotifyPropertyChanged();
817             }
818         }
819
820         /// <summary>
821         /// The InputFontStyle property.
822         /// The inputFontStyle map contains the following keys :<br />
823         /// <list type="table">
824         /// <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>
825         /// <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>
826         /// <item><term>slant (string)</term><description>The slant key defines whether to use italics. (values: normal, roman, italic, oblique)</description></item>
827         /// </list>
828         /// </summary>
829         /// <since_tizen> 3 </since_tizen>
830         [System.Diagnostics.CodeAnalysis.SuppressMessage("Naming", "CA1721: Property names should not match get methods")]
831         public PropertyMap InputFontStyle
832         {
833             get
834             {
835                 return (PropertyMap)GetValue(InputFontStyleProperty);
836             }
837             set
838             {
839                 SetValue(InputFontStyleProperty, value);
840                 NotifyPropertyChanged();
841             }
842         }
843
844         /// <summary>
845         /// Set InputFontStyle to TextEditor. <br />
846         /// </summary>
847         /// <param name="fontStyle">The FontStyle</param>
848         /// <remarks>
849         /// SetInputFontStyle specifies the requested font style for new input text through <see cref="Tizen.NUI.Text.FontStyle"/>. <br />
850         /// </remarks>
851         /// <example>
852         /// The following example demonstrates how to use the SetInputFontStyle method.
853         /// <code>
854         /// var fontStyle = new Tizen.NUI.Text.FontStyle();
855         /// fontStyle.Width = FontWidthType.Expanded;
856         /// fontStyle.Weight = FontWeightType.Bold;
857         /// fontStyle.Slant = FontSlantType.Italic;
858         /// editor.SetInputFontStyle(fontStyle);
859         /// </code>
860         /// </example>
861         [EditorBrowsable(EditorBrowsableState.Never)]
862         public void SetInputFontStyle(FontStyle fontStyle)
863         {
864             SetValue(InputFontStyleProperty, TextUtils.GetFontStyleMap(fontStyle));
865         }
866
867         /// <summary>
868         /// Get InputFontStyle from TextEditor. <br />
869         /// </summary>
870         /// <returns>The FontStyle</returns>
871         /// <remarks>
872         /// <see cref="Tizen.NUI.Text.FontStyle"/>
873         /// </remarks>
874         [EditorBrowsable(EditorBrowsableState.Never)]
875         public FontStyle GetInputFontStyle()
876         {
877             return TextUtils.GetFontStyleStruct((PropertyMap)GetValue(InputFontStyleProperty));
878         }
879
880         /// <summary>
881         /// The InputPointSize property.
882         /// </summary>
883         /// <since_tizen> 3 </since_tizen>
884         public float InputPointSize
885         {
886             get
887             {
888                 return (float)GetValue(InputPointSizeProperty);
889             }
890             set
891             {
892                 SetValue(InputPointSizeProperty, value);
893                 NotifyPropertyChanged();
894             }
895         }
896
897         /// <summary>
898         /// The LineSpacing property.
899         /// </summary>
900         /// <since_tizen> 3 </since_tizen>
901         public float LineSpacing
902         {
903             get
904             {
905                 return (float)GetValue(LineSpacingProperty);
906             }
907             set
908             {
909                 SetValue(LineSpacingProperty, value);
910                 NotifyPropertyChanged();
911             }
912         }
913
914         /// <summary>
915         /// The InputLineSpacing property.
916         /// </summary>
917         /// <since_tizen> 3 </since_tizen>
918         public float InputLineSpacing
919         {
920             get
921             {
922                 return (float)GetValue(InputLineSpacingProperty);
923             }
924             set
925             {
926                 SetValue(InputLineSpacingProperty, value);
927                 NotifyPropertyChanged();
928             }
929         }
930
931         /// <summary>
932         /// The Underline property.
933         /// The underline map contains the following keys :<br />
934         /// <list type="table">
935         /// <item><term>enable (bool)</term><description>Whether the underline is enabled (the default value is false)</description></item>
936         /// <item><term>color (Color)</term><description>The color of the underline (If not provided then the color of the text is used)</description></item>
937         /// <item><term>height (float)</term><description>The height in pixels of the underline (the default value is 1.f)</description></item>
938         /// </list>
939         /// </summary>
940         /// <since_tizen> 3 </since_tizen>
941         [System.Diagnostics.CodeAnalysis.SuppressMessage("Naming", "CA1721: Property names should not match get methods")]
942         public PropertyMap Underline
943         {
944             get
945             {
946                 return (PropertyMap)GetValue(UnderlineProperty);
947             }
948             set
949             {
950                 SetValue(UnderlineProperty, value);
951                 NotifyPropertyChanged();
952             }
953         }
954
955         /// <summary>
956         /// Set Underline to TextEditor. <br />
957         /// </summary>
958         /// <param name="underline">The Underline</param>
959         /// <remarks>
960         /// SetUnderline specifies the underline of the text through <see cref="Tizen.NUI.Text.Underline"/>. <br />
961         /// </remarks>
962         /// <example>
963         /// The following example demonstrates how to use the SetUnderline method.
964         /// <code>
965         /// var underline = new Tizen.NUI.Text.Underline();
966         /// underline.Enable = true;
967         /// underline.Color = new Color("#3498DB");
968         /// underline.Height = 2.0f;
969         /// editor.SetUnderline(underline);
970         /// </code>
971         /// </example>
972         [EditorBrowsable(EditorBrowsableState.Never)]
973         public void SetUnderline(Underline underline)
974         {
975             SetValue(UnderlineProperty, TextUtils.GetUnderlineMap(underline));
976         }
977
978         /// <summary>
979         /// Get Underline from TextEditor. <br />
980         /// </summary>
981         /// <returns>The Underline</returns>
982         /// <remarks>
983         /// <see cref="Tizen.NUI.Text.Underline"/>
984         /// </remarks>
985         [EditorBrowsable(EditorBrowsableState.Never)]
986         public Underline GetUnderline()
987         {
988             return TextUtils.GetUnderlineStruct((PropertyMap)GetValue(UnderlineProperty));
989         }
990
991         /// <summary>
992         /// The InputUnderline property.
993         /// </summary>
994         /// <since_tizen> 3 </since_tizen>
995         public string InputUnderline
996         {
997             get
998             {
999                 return (string)GetValue(InputUnderlineProperty);
1000             }
1001             set
1002             {
1003                 SetValue(InputUnderlineProperty, value);
1004                 NotifyPropertyChanged();
1005             }
1006         }
1007
1008         /// <summary>
1009         /// The Shadow property.
1010         /// The shadow map contains the following keys :<br />
1011         /// <list type="table">
1012         /// <item><term>color (Color)</term><description>The color of the shadow (the default color is Color.Black)</description></item>
1013         /// <item><term>offset (Vector2)</term><description>The offset in pixels of the shadow (If not provided then the shadow is not enabled)</description></item>
1014         /// <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>
1015         /// </list>
1016         /// </summary>
1017         /// <since_tizen> 3 </since_tizen>
1018         [System.Diagnostics.CodeAnalysis.SuppressMessage("Naming", "CA1721: Property names should not match get methods")]
1019         public PropertyMap Shadow
1020         {
1021             get
1022             {
1023                 return (PropertyMap)GetValue(ShadowProperty);
1024             }
1025             set
1026             {
1027                 SetValue(ShadowProperty, value);
1028                 NotifyPropertyChanged();
1029             }
1030         }
1031
1032         /// <summary>
1033         /// Set Shadow to TextEditor. <br />
1034         /// </summary>
1035         /// <param name="shadow">The Shadow</param>
1036         /// <remarks>
1037         /// SetShadow specifies the shadow of the text through <see cref="Tizen.NUI.Text.Shadow"/>. <br />
1038         /// </remarks>
1039         /// <example>
1040         /// The following example demonstrates how to use the SetShadow method.
1041         /// <code>
1042         /// var shadow = new Tizen.NUI.Text.Shadow();
1043         /// shadow.Offset = new Vector2(3, 3);
1044         /// shadow.Color = new Color("#F1C40F");
1045         /// editor.SetShadow(shadow);
1046         /// </code>
1047         /// </example>
1048         [EditorBrowsable(EditorBrowsableState.Never)]
1049         public void SetShadow(Tizen.NUI.Text.Shadow shadow)
1050         {
1051             SetValue(ShadowProperty, TextUtils.GetShadowMap(shadow));
1052         }
1053
1054         /// <summary>
1055         /// Get Shadow from TextEditor. <br />
1056         /// </summary>
1057         /// <returns>The Shadow</returns>
1058         /// <remarks>
1059         /// <see cref="Tizen.NUI.Text.Shadow"/>
1060         /// </remarks>
1061         [EditorBrowsable(EditorBrowsableState.Never)]
1062         public Tizen.NUI.Text.Shadow GetShadow()
1063         {
1064             return TextUtils.GetShadowStruct((PropertyMap)GetValue(ShadowProperty));
1065         }
1066
1067         /// <summary>
1068         /// The InputShadow property.
1069         /// </summary>
1070         /// <since_tizen> 3 </since_tizen>
1071         public string InputShadow
1072         {
1073             get
1074             {
1075                 return (string)GetValue(InputShadowProperty);
1076             }
1077             set
1078             {
1079                 SetValue(InputShadowProperty, value);
1080                 NotifyPropertyChanged();
1081             }
1082         }
1083
1084         /// <summary>
1085         /// The Emboss property.
1086         /// </summary>
1087         /// <since_tizen> 3 </since_tizen>
1088         public string Emboss
1089         {
1090             get
1091             {
1092                 return (string)GetValue(EmbossProperty);
1093             }
1094             set
1095             {
1096                 SetValue(EmbossProperty, value);
1097                 NotifyPropertyChanged();
1098             }
1099         }
1100
1101         /// <summary>
1102         /// The InputEmboss property.
1103         /// </summary>
1104         /// <since_tizen> 3 </since_tizen>
1105         public string InputEmboss
1106         {
1107             get
1108             {
1109                 return (string)GetValue(InputEmbossProperty);
1110             }
1111             set
1112             {
1113                 SetValue(InputEmbossProperty, value);
1114                 NotifyPropertyChanged();
1115             }
1116         }
1117
1118         /// <summary>
1119         /// The Outline property.
1120         /// The outline map contains the following keys :<br />
1121         /// <list type="table">
1122         /// <item><term>color (Color)</term><description>The color of the outline (the default color is Color.White)</description></item>
1123         /// <item><term>width (float)</term><description>The width in pixels of the outline (If not provided then the outline is not enabled)</description></item>
1124         /// </list>
1125         /// </summary>
1126         /// <since_tizen> 3 </since_tizen>
1127         [System.Diagnostics.CodeAnalysis.SuppressMessage("Naming", "CA1721: Property names should not match get methods")]
1128         public PropertyMap Outline
1129         {
1130             get
1131             {
1132                 return (PropertyMap)GetValue(OutlineProperty);
1133             }
1134             set
1135             {
1136                 SetValue(OutlineProperty, value);
1137                 NotifyPropertyChanged();
1138             }
1139         }
1140
1141         /// <summary>
1142         /// Set Outline to TextEditor. <br />
1143         /// </summary>
1144         /// <param name="outline">The Outline</param>
1145         /// <remarks>
1146         /// SetOutline specifies the outline of the text through <see cref="Tizen.NUI.Text.Outline"/>. <br />
1147         /// </remarks>
1148         /// <example>
1149         /// The following example demonstrates how to use the SetOutline method.
1150         /// <code>
1151         /// var outline = new Tizen.NUI.Text.Outline();
1152         /// outline.Width = 2.0f;
1153         /// outline.Color = new Color("#45B39D");
1154         /// editor.SetOutline(outline);
1155         /// </code>
1156         /// </example>
1157         [EditorBrowsable(EditorBrowsableState.Never)]
1158         public void SetOutline(Outline outline)
1159         {
1160             SetValue(OutlineProperty, TextUtils.GetOutlineMap(outline));
1161         }
1162
1163         /// <summary>
1164         /// Get Outline from TextEditor. <br />
1165         /// </summary>
1166         /// <returns>The Outline</returns>
1167         /// <remarks>
1168         /// <see cref="Tizen.NUI.Text.Outline"/>
1169         /// </remarks>
1170         [EditorBrowsable(EditorBrowsableState.Never)]
1171         public Outline GetOutline()
1172         {
1173             return TextUtils.GetOutlineStruct((PropertyMap)GetValue(OutlineProperty));
1174         }
1175
1176         /// <summary>
1177         /// The InputOutline property.
1178         /// </summary>
1179         /// <since_tizen> 3 </since_tizen>
1180         public string InputOutline
1181         {
1182             get
1183             {
1184                 return (string)GetValue(InputOutlineProperty);
1185             }
1186             set
1187             {
1188                 SetValue(InputOutlineProperty, value);
1189                 NotifyPropertyChanged();
1190             }
1191         }
1192
1193         /// <summary>
1194         /// The SmoothScroll property.
1195         /// </summary>
1196         /// <since_tizen> 3 </since_tizen>
1197         public bool SmoothScroll
1198         {
1199             get
1200             {
1201                 return (bool)GetValue(SmoothScrollProperty);
1202             }
1203             set
1204             {
1205                 SetValue(SmoothScrollProperty, value);
1206                 NotifyPropertyChanged();
1207             }
1208         }
1209
1210         /// <summary>
1211         /// The SmoothScrollDuration property.
1212         /// </summary>
1213         /// <since_tizen> 3 </since_tizen>
1214         public float SmoothScrollDuration
1215         {
1216             get
1217             {
1218                 return (float)GetValue(SmoothScrollDurationProperty);
1219             }
1220             set
1221             {
1222                 SetValue(SmoothScrollDurationProperty, value);
1223                 NotifyPropertyChanged();
1224             }
1225         }
1226
1227         /// <summary>
1228         /// The EnableScrollBar property.
1229         /// </summary>
1230         /// <since_tizen> 3 </since_tizen>
1231         public bool EnableScrollBar
1232         {
1233             get
1234             {
1235                 return (bool)GetValue(EnableScrollBarProperty);
1236             }
1237             set
1238             {
1239                 SetValue(EnableScrollBarProperty, value);
1240                 NotifyPropertyChanged();
1241             }
1242         }
1243
1244         /// <summary>
1245         /// The ScrollBarShowDuration property.
1246         /// </summary>
1247         /// <since_tizen> 3 </since_tizen>
1248         public float ScrollBarShowDuration
1249         {
1250             get
1251             {
1252                 return (float)GetValue(ScrollBarShowDurationProperty);
1253             }
1254             set
1255             {
1256                 SetValue(ScrollBarShowDurationProperty, value);
1257                 NotifyPropertyChanged();
1258             }
1259         }
1260
1261         /// <summary>
1262         /// The ScrollBarFadeDuration property.
1263         /// </summary>
1264         /// <since_tizen> 3 </since_tizen>
1265         public float ScrollBarFadeDuration
1266         {
1267             get
1268             {
1269                 return (float)GetValue(ScrollBarFadeDurationProperty);
1270             }
1271             set
1272             {
1273                 SetValue(ScrollBarFadeDurationProperty, value);
1274                 NotifyPropertyChanged();
1275             }
1276         }
1277
1278         /// <summary>
1279         /// The PixelSize property.
1280         /// </summary>
1281         /// <since_tizen> 3 </since_tizen>
1282         public float PixelSize
1283         {
1284             get
1285             {
1286                 return (float)GetValue(PixelSizeProperty);
1287             }
1288             set
1289             {
1290                 SetValue(PixelSizeProperty, value);
1291                 NotifyPropertyChanged();
1292             }
1293         }
1294
1295         /// <summary>
1296         /// The line count of the text.
1297         /// </summary>
1298         /// <since_tizen> 3 </since_tizen>
1299         public int LineCount
1300         {
1301             get
1302             {
1303                 int temp = 0;
1304                 GetProperty(TextEditor.Property.LineCount).Get(out temp);
1305                 return temp;
1306             }
1307         }
1308
1309         /// <summary>
1310         /// The text to display when the TextEditor is empty and inactive.
1311         /// </summary>
1312         /// <since_tizen> 3 </since_tizen>
1313         public string PlaceholderText
1314         {
1315             get
1316             {
1317                 return (string)GetValue(PlaceholderTextProperty);
1318             }
1319             set
1320             {
1321                 SetValue(PlaceholderTextProperty, value);
1322                 NotifyPropertyChanged();
1323             }
1324         }
1325
1326         /// <summary>
1327         /// The Selected Text property (read-only).
1328         /// </summary>
1329         [EditorBrowsable(EditorBrowsableState.Never)]
1330         public string SelectedText
1331         {
1332             get
1333             {
1334                 string temp;
1335                 GetProperty(TextEditor.Property.SelectedText).Get(out temp);
1336                 return temp;
1337             }
1338         }
1339
1340         /// <summary>
1341         /// The Placeholder text color.
1342         /// </summary>
1343         /// <remarks>
1344         /// The property cascade chaining set is possible. For example, this (textEditor.PlaceholderTextColor.X = 0.1f;) is possible.
1345         /// </remarks>
1346         /// <since_tizen> 3 </since_tizen>
1347         public Color PlaceholderTextColor
1348         {
1349             get
1350             {
1351                 Color temp = (Color)GetValue(PlaceholderTextColorProperty);
1352                 return new Color(OnPlaceholderTextColorChanged, temp.R, temp.G, temp.B, temp.A);
1353             }
1354             set
1355             {
1356                 SetValue(PlaceholderTextColorProperty, value);
1357                 NotifyPropertyChanged();
1358             }
1359         }
1360
1361         /// <summary>
1362         /// The EnableSelection property.
1363         /// </summary>
1364         /// <since_tizen> 3 </since_tizen>
1365         public bool EnableSelection
1366         {
1367             get
1368             {
1369                 return (bool)GetValue(EnableSelectionProperty);
1370             }
1371             set
1372             {
1373                 SetValue(EnableSelectionProperty, value);
1374                 NotifyPropertyChanged();
1375             }
1376         }
1377
1378         /// <summary>
1379         /// The start index for selection.
1380         /// </summary>
1381         /// <since_tizen> 8 </since_tizen>
1382         /// This will be public opened in tizen_6.0 after ACR done, Before ACR, need to be hidden as inhouse API.
1383         [EditorBrowsable(EditorBrowsableState.Never)]
1384         public int SelectedTextStart
1385         {
1386             get
1387             {
1388                 int temp;
1389                 GetProperty(TextEditor.Property.SelectedTextStart).Get(out temp);
1390                 return temp;
1391             }
1392         }
1393
1394         /// <summary>
1395         /// The end index for selection.
1396         /// </summary>
1397         /// <since_tizen> 8 </since_tizen>
1398         /// This will be public opened in tizen_6.0 after ACR done, Before ACR, need to be hidden as inhouse API.
1399         [EditorBrowsable(EditorBrowsableState.Never)]
1400         public int SelectedTextEnd
1401         {
1402             get
1403             {
1404                 int temp;
1405                 GetProperty(TextEditor.Property.SelectedTextEnd).Get(out temp);
1406                 return temp;
1407             }
1408         }
1409
1410         /// <summary>
1411         /// Enable editing in text control.
1412         /// </summary>
1413         /// <since_tizen> 8 </since_tizen>
1414         /// This will be public opened in tizen_6.0 after ACR done, Before ACR, need to be hidden as inhouse API.
1415         [EditorBrowsable(EditorBrowsableState.Never)]
1416         public bool EnableEditing
1417         {
1418             get
1419             {
1420                 bool temp;
1421                 GetProperty(TextEditor.Property.EnableEditing).Get(out temp);
1422                 return temp;
1423             }
1424             set
1425             {
1426                 SetProperty(TextEditor.Property.EnableEditing, new PropertyValue(value));
1427                 NotifyPropertyChanged();
1428             }
1429         }
1430
1431         /// <summary>
1432         /// Specify horizontal scroll position in text control.
1433         /// </summary>
1434         [EditorBrowsable(EditorBrowsableState.Never)]
1435         public int HorizontalScrollPosition
1436         {
1437             get
1438             {
1439                 int temp;
1440                 using (PropertyValue propertyValue = GetProperty(TextEditor.Property.HorizontalScrollPosition))
1441                 {
1442                     propertyValue.Get(out temp);
1443                 }
1444                 return temp;
1445             }
1446             set
1447             {
1448                 using (PropertyValue propertyValue = new PropertyValue(value))
1449                 {
1450                     SetProperty(TextEditor.Property.HorizontalScrollPosition, propertyValue);
1451                     NotifyPropertyChanged();
1452                 }
1453             }
1454         }
1455
1456         /// <summary>
1457         /// Specify vertical scroll position in text control.
1458         /// </summary>
1459         [EditorBrowsable(EditorBrowsableState.Never)]
1460         public int VerticalScrollPosition
1461         {
1462             get
1463             {
1464                 int temp;
1465                 using (PropertyValue propertyValue = GetProperty(TextEditor.Property.VerticalScrollPosition))
1466                 {
1467                     propertyValue.Get(out temp);
1468                 }
1469                 return temp;
1470             }
1471             set
1472             {
1473                 using (PropertyValue propertyValue = new PropertyValue(value))
1474                 {
1475                     SetProperty(TextEditor.Property.VerticalScrollPosition, propertyValue);
1476                     NotifyPropertyChanged();
1477                 }
1478             }
1479         }
1480
1481         /// <summary>
1482         /// Specify primary cursor (caret) position in text control.
1483         /// </summary>
1484         [EditorBrowsable(EditorBrowsableState.Never)]
1485         public int PrimaryCursorPosition
1486         {
1487             get
1488             {
1489                 int temp;
1490                 using (PropertyValue propertyValue = GetProperty(TextEditor.Property.PrimaryCursorPosition))
1491                 {
1492                     propertyValue.Get(out temp);
1493                 }
1494                 return temp;
1495             }
1496             set
1497             {
1498                 using (PropertyValue propertyValue = new PropertyValue(value))
1499                 {
1500                     SetProperty(TextEditor.Property.PrimaryCursorPosition, propertyValue);
1501                     NotifyPropertyChanged();
1502                 }
1503             }
1504         }
1505
1506         /// <summary>
1507         /// The GrabHandleColor property.
1508         /// </summary>
1509         /// <remarks>
1510         /// The property cascade chaining set is possible. For example, this (textEditor.GrabHandleColor.X = 0.1f;) is possible.
1511         /// </remarks>
1512         [EditorBrowsable(EditorBrowsableState.Never)]
1513         public Color GrabHandleColor
1514         {
1515             get
1516             {
1517                 Color temp = (Color)GetValue(GrabHandleColorProperty);
1518                 return new Color(OnGrabHandleColorChanged, temp.R, temp.G, temp.B, temp.A);
1519             }
1520             set
1521             {
1522                 SetValue(GrabHandleColorProperty, value);
1523                 NotifyPropertyChanged();
1524             }
1525         }
1526
1527         /// <summary>
1528         /// Set InputFilter to TextEditor. <br />
1529         /// </summary>
1530         /// <param name="inputFilter">The InputFilter</param>
1531         /// <remarks>
1532         /// <see cref="Tizen.NUI.Text.InputFilter"/> filters input based on regular expressions. <br />
1533         /// Users can set the Accepted or Rejected regular expression set, or both. <br />
1534         /// If both are used, Rejected has higher priority. <br />
1535         /// The character set must follow the regular expression rules. <br />
1536         /// Behaviour can not be guaranteed for incorrect grammars. <br />
1537         /// Refer the link below for detailed rules. <br />
1538         /// The functions in std::regex library use the ECMAScript grammar: <br />
1539         /// http://cplusplus.com/reference/regex/ECMAScript/ <br />
1540         /// InputFiltered signal is emitted when the input is filtered by InputFilter <br />
1541         /// See <see cref="InputFiltered"/>, <see cref="InputFilterType"/> and <see cref="InputFilteredEventArgs"/> for a detailed description. <br />
1542         /// </remarks>
1543         /// <example>
1544         /// The following example demonstrates how to use the SetInputFilter method.
1545         /// <code>
1546         /// var inputFilter = new Tizen.NUI.Text.InputFilter();
1547         /// inputFilter.Accepted = @"[\d]"; // accept whole digits
1548         /// inputFilter.Rejected = "[0-3]"; // reject 0, 1, 2, 3
1549         /// editor.SetInputFilter(inputFilter); // acceptable inputs are 4, 5, 6, 7, 8, 9
1550         /// </code>
1551         /// </example>
1552         [EditorBrowsable(EditorBrowsableState.Never)]
1553         public void SetInputFilter(InputFilter inputFilter)
1554         {
1555             SetProperty(TextEditor.Property.InputFilter, new PropertyValue(TextUtils.GetInputFilterMap(inputFilter)));
1556         }
1557
1558         /// <summary>
1559         /// Get InputFilter from TextEditor. <br />
1560         /// </summary>
1561         /// <returns>The InputFilter</returns>
1562         /// <remarks>
1563         /// <see cref="Tizen.NUI.Text.InputFilter"/>
1564         /// </remarks>
1565         [EditorBrowsable(EditorBrowsableState.Never)]
1566         public InputFilter GetInputFilter()
1567         {
1568             var map = new PropertyMap();
1569             GetProperty(TextEditor.Property.InputFilter).Get(map);
1570             return TextUtils.GetInputFilterStruct(map);
1571         }
1572
1573         /// <summary>
1574         /// The Placeholder property.
1575         /// The placeholder map contains the following keys :<br />
1576         /// <list type="table">
1577         /// <item><term>text (string)</term><description>The text to display when the TextEditor is empty and inactive</description></item>
1578         /// <item><term>textFocused (string)</term><description>The text to display when the placeholder has focus</description></item>
1579         /// <item><term>color (Color)</term><description>The color of the placeholder text</description></item>
1580         /// <item><term>fontFamily (string)</term><description>The fontFamily of the placeholder text</description></item>
1581         /// <item><term>fontStyle (PropertyMap)</term><description>The fontStyle of the placeholder text</description></item>
1582         /// <item><term>pointSize (float)</term><description>The pointSize of the placeholder text</description></item>
1583         /// <item><term>pixelSize (float)</term><description>The pixelSize of the placeholder text</description></item>
1584         /// <item><term>ellipsis (bool)</term><description>The ellipsis of the placeholder text</description></item>
1585         /// </list>
1586         /// </summary>
1587         /// <example>
1588         /// The following example demonstrates how to set the placeholder property.
1589         /// <code>
1590         /// PropertyMap propertyMap = new PropertyMap();
1591         /// propertyMap.Add("text", new PropertyValue("Setting Placeholder Text"));
1592         /// propertyMap.Add("textFocused", new PropertyValue("Setting Placeholder Text Focused"));
1593         /// propertyMap.Add("color", new PropertyValue(Color.Red));
1594         /// propertyMap.Add("fontFamily", new PropertyValue("Arial"));
1595         /// propertyMap.Add("pointSize", new PropertyValue(12.0f));
1596         ///
1597         /// PropertyMap fontStyleMap = new PropertyMap();
1598         /// fontStyleMap.Add("weight", new PropertyValue("bold"));
1599         /// fontStyleMap.Add("width", new PropertyValue("condensed"));
1600         /// fontStyleMap.Add("slant", new PropertyValue("italic"));
1601         /// propertyMap.Add("fontStyle", new PropertyValue(fontStyleMap));
1602         ///
1603         /// TextEditor editor = new TextEditor();
1604         /// editor.Placeholder = propertyMap;
1605         /// </code>
1606         /// </example>
1607         /// <since_tizen> 3 </since_tizen>
1608         [System.Diagnostics.CodeAnalysis.SuppressMessage("Naming", "CA1721: Property names should not match get methods")]
1609         public Tizen.NUI.PropertyMap Placeholder
1610         {
1611             get
1612             {
1613                 PropertyMap map = (PropertyMap)GetValue(PlaceholderProperty);
1614                 PropertyValue value = null;
1615
1616                 // text
1617                 value = map.Find(0);
1618                 if (null != value)
1619                 {
1620                     value.Get(out string text);
1621                     map.Add("text", new PropertyValue(text));
1622                 }
1623
1624                 // textFocused
1625                 value = map.Find(1);
1626                 if (null != value)
1627                 {
1628                     value.Get(out string textFocused);
1629                     map.Add("textFocused", new PropertyValue(textFocused));
1630                 }
1631
1632                 // color
1633                 value = map.Find(2);
1634                 if (null != value)
1635                 {
1636                     Color color = new Color();
1637                     value.Get(color);
1638                     map.Add("color", new PropertyValue(color));
1639                 }
1640
1641                 // fontFamily
1642                 value = map.Find(3);
1643                 if (null != value)
1644                 {
1645                     value.Get(out string fontFamily);
1646                     map.Add("fontFamily", new PropertyValue(fontFamily));
1647                 }
1648
1649                 // fontStyle
1650                 value = map.Find(4);
1651                 if (null != value)
1652                 {
1653                     PropertyMap fontStyle = new PropertyMap();
1654                     value.Get(fontStyle);
1655                     map.Add("fontStyle", new PropertyValue(fontStyle));
1656                 }
1657
1658                 // pointSize
1659                 value = map.Find(5);
1660                 if (null != value)
1661                 {
1662                     value.Get(out float pointSize);
1663                     map.Add("pointSize", new PropertyValue(pointSize));
1664                 }
1665
1666                 // pixelSize
1667                 value = map.Find(6);
1668                 if (null != value)
1669                 {
1670                     value.Get(out float pixelSize);
1671                     map.Add("pixelSize", new PropertyValue(pixelSize));
1672                 }
1673
1674                 // ellipsis
1675                 value = map.Find(7);
1676                 if (null != value)
1677                 {
1678                     value.Get(out bool ellipsis);
1679                     map.Add("ellipsis", new PropertyValue(ellipsis));
1680                 }
1681
1682                 return map;
1683             }
1684             set
1685             {
1686                 SetValue(PlaceholderProperty, value);
1687                 NotifyPropertyChanged();
1688             }
1689         }
1690
1691         /// <summary>
1692         /// Set Placeholder to TextEditor. <br />
1693         /// </summary>
1694         /// <param name="placeholder">The Placeholder</param>
1695         /// <remarks>
1696         /// SetPlaceholder specifies the attributes of the placeholder property through <see cref="Tizen.NUI.Text.Placeholder"/>. <br />
1697         /// </remarks>
1698         /// <example>
1699         /// The following example demonstrates how to use the SetPlaceholder method.
1700         /// <code>
1701         /// var placeholder = new Tizen.NUI.Text.Placeholder();
1702         /// placeholder.Text = "placeholder text";
1703         /// placeholder.TextFocused = "placeholder textFocused";
1704         /// placeholder.Color = new Color("#45B39D");
1705         /// placeholder.FontFamily = "BreezeSans";
1706         /// placeholder.FontStyle = new Tizen.NUI.Text.FontStyle()
1707         /// {
1708         ///     Width = FontWidthType.Expanded,
1709         ///     Weight = FontWeightType.ExtraLight,
1710         ///     Slant = FontSlantType.Italic,
1711         /// };
1712         /// placeholder.PointSize = 25.0f;
1713         /// //placeholder.PixelSize = 50.0f;
1714         /// placeholder.Ellipsis = true;
1715         /// editor.SetPlaceholder(placeholder);
1716         /// </code>
1717         /// </example>
1718         [EditorBrowsable(EditorBrowsableState.Never)]
1719         public void SetPlaceholder(Placeholder placeholder)
1720         {
1721             SetValue(PlaceholderProperty, TextUtils.GetPlaceholderMap(placeholder));
1722         }
1723
1724         /// <summary>
1725         /// Get Placeholder from TextEditor. <br />
1726         /// </summary>
1727         /// <returns>The Placeholder</returns>
1728         /// <remarks>
1729         /// <see cref="Tizen.NUI.Text.Placeholder"/>
1730         /// </remarks>
1731         [EditorBrowsable(EditorBrowsableState.Never)]
1732         public Placeholder GetPlaceholder()
1733         {
1734             return TextUtils.GetPlaceholderStruct((PropertyMap)GetValue(PlaceholderProperty));
1735         }
1736
1737         /// <summary>
1738         /// The Ellipsis property.<br />
1739         /// Enable or disable the ellipsis.<br />
1740         /// </summary>
1741         /// <since_tizen> 9 </since_tizen>
1742         public bool Ellipsis
1743         {
1744             get
1745             {
1746                 return (bool)GetValue(EllipsisProperty);
1747             }
1748             set
1749             {
1750                 SetValue(EllipsisProperty, value);
1751                 NotifyPropertyChanged();
1752             }
1753         }
1754
1755
1756         /// <summary>
1757         /// The ellipsis position of the text.
1758         /// Specifies which portion of the text should be replaced with an ellipsis when the text size exceeds the layout size.<br />
1759         /// </summary>
1760         /// <since_tizen> 9 </since_tizen>
1761         public EllipsisPosition EllipsisPosition
1762         {
1763             get
1764             {
1765                 return (EllipsisPosition)GetValue(EllipsisPositionProperty);
1766             }
1767             set
1768             {
1769                 SetValue(EllipsisPositionProperty, value);
1770                 NotifyPropertyChanged();
1771             }
1772         }
1773
1774         /// <summary>
1775         /// The LineWrapMode property.<br />
1776         /// The line wrap mode when the text lines over the layout width.<br />
1777         /// </summary>
1778         /// <since_tizen> 4 </since_tizen>
1779         public LineWrapMode LineWrapMode
1780         {
1781             get
1782             {
1783                 return (LineWrapMode)GetValue(LineWrapModeProperty);
1784             }
1785             set
1786             {
1787                 SetValue(LineWrapModeProperty, value);
1788                 NotifyPropertyChanged();
1789             }
1790         }
1791
1792         /// <summary>
1793         /// Enables Text selection using Shift key.
1794         /// </summary>
1795         /// <since_tizen> 5 </since_tizen>
1796         /// This will be released at Tizen.NET API Level 5, so currently this would be used as inhouse API.
1797         [EditorBrowsable(EditorBrowsableState.Never)]
1798         public bool EnableShiftSelection
1799         {
1800             get
1801             {
1802                 return (bool)GetValue(EnableShiftSelectionProperty);
1803             }
1804             set
1805             {
1806                 SetValue(EnableShiftSelectionProperty, value);
1807                 NotifyPropertyChanged();
1808             }
1809         }
1810
1811         /// <summary>
1812         /// The text alignment to match the direction of the system language.
1813         /// </summary>
1814         /// <since_tizen> 6 </since_tizen>
1815         public bool MatchSystemLanguageDirection
1816         {
1817             get
1818             {
1819                 return (bool)GetValue(MatchSystemLanguageDirectionProperty);
1820             }
1821             set
1822             {
1823                 SetValue(MatchSystemLanguageDirectionProperty, value);
1824                 NotifyPropertyChanged();
1825             }
1826         }
1827
1828         /// <summary>
1829         /// The MaxLength property.
1830         /// </summary>
1831         /// This will be public opened in tizen_6.5 after ACR done. Before ACR, need to be hidden as inhouse API.
1832         [EditorBrowsable(EditorBrowsableState.Never)]
1833         public int MaxLength
1834         {
1835             get
1836             {
1837                 return (int)GetValue(MaxLengthProperty);
1838             }
1839             set
1840             {
1841                 SetValue(MaxLengthProperty, value);
1842                 NotifyPropertyChanged();
1843             }
1844         }
1845
1846         internal override bool IsBinded
1847         {
1848             get
1849             {
1850                 return base.IsBinded;
1851             }
1852             set
1853             {
1854                 base.IsBinded = value;
1855
1856                 if (value == true)
1857                 {
1858                     TextChanged += TextEditorTextChanged;
1859                 }
1860                 else
1861                 {
1862                     TextChanged -= TextEditorTextChanged;
1863                 }
1864             }
1865         }
1866
1867         private void TextEditorTextChanged(object sender, TextChangedEventArgs e)
1868         {
1869             ForceNotifyBindedInstance(TextProperty);
1870         }
1871
1872         /// <summary>
1873         /// The FontSizeScale property. <br />
1874         /// The default value is 1.0. <br />
1875         /// If FontSizeScale.UseSystemSetting, will use the SystemSettings.FontSize internally. <br />
1876         /// </summary>
1877         /// <since_tizen> 9 </since_tizen>
1878         public float FontSizeScale
1879         {
1880             get
1881             {
1882                 return fontSizeScale;
1883             }
1884             set
1885             {
1886                 float newFontSizeScale;
1887
1888                 if (fontSizeScale == value) return;
1889
1890                 fontSizeScale = value;
1891                 if (fontSizeScale == Tizen.NUI.FontSizeScale.UseSystemSetting)
1892                 {
1893                     SystemSettingsFontSize systemSettingsFontSize;
1894
1895                     try
1896                     {
1897                         systemSettingsFontSize = SystemSettings.FontSize;
1898                     }
1899                     catch (Exception e)
1900                     {
1901                         Console.WriteLine("{0} Exception caught.", e);
1902                         systemSettingsFontSize = SystemSettingsFontSize.Normal;
1903                     }
1904                     newFontSizeScale = TextUtils.GetFontSizeScale(systemSettingsFontSize);
1905                     addFontSizeChangedCallback();
1906                 }
1907                 else
1908                 {
1909                     newFontSizeScale = fontSizeScale;
1910                     removeFontSizeChangedCallback();
1911                 }
1912
1913                 SetValue(FontSizeScaleProperty, newFontSizeScale);
1914                 NotifyPropertyChanged();
1915             }
1916         }
1917
1918         /// <summary>
1919         /// The InputMethodSettings property.
1920         /// </summary>
1921         /// <remarks>
1922         /// <see cref="InputMethod"/> is a class encapsulating the input method map. Please use the <see cref="InputMethod"/> class for this property.
1923         /// </remarks>
1924         /// <example>
1925         /// The following example demonstrates how to set the InputMethodSettings property.
1926         /// <code>
1927         /// InputMethod method = new InputMethod();
1928         /// method.PanelLayout = InputMethod.PanelLayoutType.Normal;
1929         /// method.ActionButton = InputMethod.ActionButtonTitleType.Default;
1930         /// method.AutoCapital = InputMethod.AutoCapitalType.Word;
1931         /// method.Variation = 1;
1932         /// textEditor.InputMethodSettings = method.OutputMap;
1933         /// </code>
1934         /// </example>
1935         [EditorBrowsable(EditorBrowsableState.Never)]
1936         public PropertyMap InputMethodSettings
1937         {
1938             get
1939             {
1940                 return (PropertyMap)GetValue(InputMethodSettingsProperty);
1941             }
1942             set
1943             {
1944                 SetValue(InputMethodSettingsProperty, value);
1945                 NotifyPropertyChanged();
1946             }
1947         }
1948
1949         /// <summary>
1950         /// Scroll the text control by specific amount..
1951         /// </summary>
1952         /// <param name="scroll">The amount (in pixels) of scrolling in horizontal &amp; vertical directions.</param>
1953         [EditorBrowsable(EditorBrowsableState.Never)]
1954         public void ScrollBy(Vector2 scroll)
1955         {
1956             Interop.TextEditor.ScrollBy(SwigCPtr, Vector2.getCPtr(scroll));
1957             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1958         }
1959
1960         /// <summary>
1961         /// Get the InputMethodContext instance.
1962         /// </summary>
1963         /// <returns>The InputMethodContext instance.</returns>
1964         /// <since_tizen> 5 </since_tizen>
1965         public InputMethodContext GetInputMethodContext()
1966         {
1967             if (inputMethodContext == null)
1968             {
1969                 /*Avoid raising InputMethodContext reference count.*/
1970                 inputMethodContext = new InputMethodContext(Interop.TextEditor.GetInputMethodContext(SwigCPtr), true);
1971                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1972             }
1973             return inputMethodContext;
1974         }
1975
1976         /// <summary>
1977         /// Select the whole text.
1978         /// </summary>
1979         [EditorBrowsable(EditorBrowsableState.Never)]
1980         public void SelectWholeText()
1981         {
1982             Interop.TextEditor.SelectWholeText(SwigCPtr);
1983             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1984         }
1985
1986         /// <summary>
1987         /// Select text from start to end index. <br />
1988         /// The index is valid when 0 or positive. <br />
1989         /// </summary>
1990         /// <param name="start">The start index for selection.</param>
1991         /// <param name="end">The end index for selection.</param>
1992         [EditorBrowsable(EditorBrowsableState.Never)]
1993         public void SelectText(int start, int end)
1994         {
1995             if (start < 0)
1996                 throw new global::System.ArgumentOutOfRangeException(nameof(start), "Value is less than zero");
1997             if (end < 0)
1998                 throw new global::System.ArgumentOutOfRangeException(nameof(end), "Value is less than zero");
1999
2000             Interop.TextEditor.SelectText(SwigCPtr, (uint)start, (uint)end);
2001             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
2002         }
2003
2004         /// <summary>
2005         /// Clear selection of the text.
2006         /// </summary>
2007         [EditorBrowsable(EditorBrowsableState.Never)]
2008         public void SelectNone()
2009         {
2010             _ = Interop.TextEditor.SelectNone(SwigCPtr);
2011             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
2012         }
2013
2014         /// <summary>
2015         /// Enable grab handle property.
2016         /// </summary>
2017         [EditorBrowsable(EditorBrowsableState.Never)]
2018         public bool EnableGrabHandle
2019         {
2020             get
2021             {
2022                 return (bool)GetValue(EnableGrabHandleProperty);
2023             }
2024             set
2025             {
2026                 SetValue(EnableGrabHandleProperty, value);
2027                 NotifyPropertyChanged();
2028             }
2029         }
2030
2031         /// <summary>
2032         /// Enable grab handle popup property.
2033         /// </summary>
2034         [EditorBrowsable(EditorBrowsableState.Never)]
2035         public bool EnableGrabHandlePopup
2036         {
2037             get
2038             {
2039                 return (bool)GetValue(EnableGrabHandlePopupProperty);
2040             }
2041             set
2042             {
2043                 SetValue(EnableGrabHandlePopupProperty, value);
2044                 NotifyPropertyChanged();
2045             }
2046         }
2047
2048         /// <summary>
2049         /// Minimum line size to be used.
2050         /// </summary>
2051         [EditorBrowsable(EditorBrowsableState.Never)]
2052         public float MinLineSize
2053         {
2054             get
2055             {
2056                 return (float)GetValue(MinLineSizeProperty);
2057             }
2058             set
2059             {
2060                 SetValue(MinLineSizeProperty, value);
2061                 NotifyPropertyChanged();
2062             }
2063         }
2064
2065         internal SWIGTYPE_p_Dali__SignalT_void_fDali__Toolkit__TextEditor_Dali__Toolkit__TextEditor__InputStyle__MaskF_t InputStyleChangedSignal()
2066         {
2067             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));
2068             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
2069             return ret;
2070         }
2071
2072         /// <summary>
2073         /// Dispose.
2074         /// </summary>
2075         /// <since_tizen> 3 </since_tizen>
2076         protected override void Dispose(DisposeTypes type)
2077         {
2078             if (disposed)
2079             {
2080                 return;
2081             }
2082
2083             if (systemlangTextFlag)
2084             {
2085                 SystemSettings.LocaleLanguageChanged -= SystemSettings_LocaleLanguageChanged;
2086             }
2087
2088             removeFontSizeChangedCallback();
2089
2090             //Release your own unmanaged resources here.
2091             //You should not access any managed member here except static instance.
2092             //because the execution order of Finalizes is non-deterministic.
2093
2094             if (this.HasBody())
2095             {
2096                 if (textEditorTextChangedCallbackDelegate != null)
2097                 {
2098                     TextChangedSignal().Disconnect(textEditorTextChangedCallbackDelegate);
2099                 }
2100
2101                 if (textEditorMaxLengthReachedCallbackDelegate != null)
2102                 {
2103                     this.MaxLengthReachedSignal().Disconnect(textEditorMaxLengthReachedCallbackDelegate);
2104                 }
2105
2106                 if (textEditorSelectionClearedCallbackDelegate != null)
2107                 {
2108                     this.SelectionClearedSignal().Disconnect(textEditorSelectionClearedCallbackDelegate);
2109                 }
2110
2111                 if (textEditorCursorPositionChangedCallbackDelegate != null)
2112                 {
2113                     this.CursorPositionChangedSignal().Disconnect(textEditorCursorPositionChangedCallbackDelegate);
2114                 }
2115
2116                 if (textEditorSelectionChangedCallbackDelegate != null)
2117                 {
2118                     this.SelectionChangedSignal().Disconnect(textEditorSelectionChangedCallbackDelegate);
2119                 }
2120             }
2121
2122             if (IsBinded)
2123             {
2124                 TextChanged -= TextEditorTextChanged;
2125             }
2126
2127             base.Dispose(type);
2128         }
2129
2130         /// This will not be public opened.
2131         [EditorBrowsable(EditorBrowsableState.Never)]
2132         protected override void ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef swigCPtr)
2133         {
2134             // In order to speed up IME hide, temporarily add
2135             GetInputMethodContext()?.DestroyContext();
2136             Interop.TextEditor.DeleteTextEditor(swigCPtr);
2137         }
2138
2139         private string SetTranslatable(string textEditorSid)
2140         {
2141             string translatableText = null;
2142             translatableText = NUIApplication.MultilingualResourceManager?.GetString(textEditorSid, new CultureInfo(SystemSettings.LocaleLanguage.Replace("_", "-")));
2143             if (translatableText != null)
2144             {
2145                 if (systemlangTextFlag == false)
2146                 {
2147                     SystemSettings.LocaleLanguageChanged += SystemSettings_LocaleLanguageChanged;
2148                     systemlangTextFlag = true;
2149                 }
2150                 return translatableText;
2151             }
2152             else
2153             {
2154                 translatableText = "";
2155                 return translatableText;
2156             }
2157         }
2158
2159         private void SystemSettings_LocaleLanguageChanged(object sender, LocaleLanguageChangedEventArgs e)
2160         {
2161             if (textEditorTextSid != null)
2162             {
2163                 Text = NUIApplication.MultilingualResourceManager?.GetString(textEditorTextSid, new CultureInfo(e.Value.Replace("_", "-")));
2164             }
2165             if (textEditorPlaceHolderTextSid != null)
2166             {
2167                 PlaceholderText = NUIApplication.MultilingualResourceManager?.GetString(textEditorPlaceHolderTextSid, new CultureInfo(e.Value.Replace("_", "-")));
2168             }
2169         }
2170
2171         private void SystemSettingsFontSizeChanged(object sender, FontSizeChangedEventArgs e)
2172         {
2173             float newFontSizeScale = TextUtils.GetFontSizeScale(e.Value);
2174             SetValue(FontSizeScaleProperty, newFontSizeScale);
2175             NotifyPropertyChanged();
2176         }
2177
2178         private void addFontSizeChangedCallback()
2179         {
2180             if (hasFontSizeChangedCallback != true)
2181             {
2182                 try
2183                 {
2184                     SystemSettings.FontSizeChanged += SystemSettingsFontSizeChanged;
2185                     hasFontSizeChangedCallback = true;
2186                 }
2187                 catch (Exception e)
2188                 {
2189                     Console.WriteLine("{0} Exception caught.", e);
2190                     hasFontSizeChangedCallback = false;
2191                 }
2192             }
2193         }
2194
2195         private void removeFontSizeChangedCallback()
2196         {
2197             if (hasFontSizeChangedCallback == true)
2198             {
2199                 try
2200                 {
2201                     SystemSettings.FontSizeChanged -= SystemSettingsFontSizeChanged;
2202                     hasFontSizeChangedCallback = false;
2203                 }
2204                 catch (Exception e)
2205                 {
2206                     Console.WriteLine("{0} Exception caught.", e);
2207                     hasFontSizeChangedCallback = true;
2208                 }
2209             }
2210         }
2211
2212         internal new class Property
2213         {
2214             internal static readonly int TEXT = Interop.TextEditor.TextGet();
2215             internal static readonly int TextColor = Interop.TextEditor.TextColorGet();
2216             internal static readonly int FontFamily = Interop.TextEditor.FontFamilyGet();
2217             internal static readonly int FontStyle = Interop.TextEditor.FontStyleGet();
2218             internal static readonly int PointSize = Interop.TextEditor.PointSizeGet();
2219             internal static readonly int HorizontalAlignment = Interop.TextEditor.HorizontalAlignmentGet();
2220             internal static readonly int ScrollThreshold = Interop.TextEditor.ScrollThresholdGet();
2221             internal static readonly int ScrollSpeed = Interop.TextEditor.ScrollSpeedGet();
2222             internal static readonly int PrimaryCursorColor = Interop.TextEditor.PrimaryCursorColorGet();
2223             internal static readonly int SecondaryCursorColor = Interop.TextEditor.SecondaryCursorColorGet();
2224             internal static readonly int EnableCursorBlink = Interop.TextEditor.EnableCursorBlinkGet();
2225             internal static readonly int CursorBlinkInterval = Interop.TextEditor.CursorBlinkIntervalGet();
2226             internal static readonly int CursorBlinkDuration = Interop.TextEditor.CursorBlinkDurationGet();
2227             internal static readonly int CursorWidth = Interop.TextEditor.CursorWidthGet();
2228             internal static readonly int GrabHandleImage = Interop.TextEditor.GrabHandleImageGet();
2229             internal static readonly int GrabHandlePressedImage = Interop.TextEditor.GrabHandlePressedImageGet();
2230             internal static readonly int SelectionHandleImageLeft = Interop.TextEditor.SelectionHandleImageLeftGet();
2231             internal static readonly int SelectionHandleImageRight = Interop.TextEditor.SelectionHandleImageRightGet();
2232             internal static readonly int SelectionHandlePressedImageLeft = Interop.TextEditor.SelectionHandlePressedImageLeftGet();
2233             internal static readonly int SelectionHandlePressedImageRight = Interop.TextEditor.SelectionHandlePressedImageRightGet();
2234             internal static readonly int SelectionHandleMarkerImageLeft = Interop.TextEditor.SelectionHandleMarkerImageLeftGet();
2235             internal static readonly int SelectionHandleMarkerImageRight = Interop.TextEditor.SelectionHandleMarkerImageRightGet();
2236             internal static readonly int SelectionHighlightColor = Interop.TextEditor.SelectionHighlightColorGet();
2237             internal static readonly int DecorationBoundingBox = Interop.TextEditor.DecorationBoundingBoxGet();
2238             internal static readonly int EnableMarkup = Interop.TextEditor.EnableMarkupGet();
2239             internal static readonly int InputColor = Interop.TextEditor.InputColorGet();
2240             internal static readonly int InputFontFamily = Interop.TextEditor.InputFontFamilyGet();
2241             internal static readonly int InputFontStyle = Interop.TextEditor.InputFontStyleGet();
2242             internal static readonly int InputPointSize = Interop.TextEditor.InputPointSizeGet();
2243             internal static readonly int LineSpacing = Interop.TextEditor.LineSpacingGet();
2244             internal static readonly int InputLineSpacing = Interop.TextEditor.InputLineSpacingGet();
2245             internal static readonly int UNDERLINE = Interop.TextEditor.UnderlineGet();
2246             internal static readonly int InputUnderline = Interop.TextEditor.InputUnderlineGet();
2247             internal static readonly int SHADOW = Interop.TextEditor.ShadowGet();
2248             internal static readonly int InputShadow = Interop.TextEditor.InputShadowGet();
2249             internal static readonly int EMBOSS = Interop.TextEditor.EmbossGet();
2250             internal static readonly int InputEmboss = Interop.TextEditor.InputEmbossGet();
2251             internal static readonly int OUTLINE = Interop.TextEditor.OutlineGet();
2252             internal static readonly int InputOutline = Interop.TextEditor.InputOutlineGet();
2253             internal static readonly int SmoothScroll = Interop.TextEditor.SmoothScrollGet();
2254             internal static readonly int SmoothScrollDuration = Interop.TextEditor.SmoothScrollDurationGet();
2255             internal static readonly int EnableScrollBar = Interop.TextEditor.EnableScrollBarGet();
2256             internal static readonly int ScrollBarShowDuration = Interop.TextEditor.ScrollBarShowDurationGet();
2257             internal static readonly int ScrollBarFadeDuration = Interop.TextEditor.ScrollBarFadeDurationGet();
2258             internal static readonly int PixelSize = Interop.TextEditor.PixelSizeGet();
2259             internal static readonly int LineCount = Interop.TextEditor.LineCountGet();
2260             internal static readonly int EnableSelection = Interop.TextEditor.EnableSelectionGet();
2261             internal static readonly int PLACEHOLDER = Interop.TextEditor.PlaceholderGet();
2262             internal static readonly int LineWrapMode = Interop.TextEditor.LineWrapModeGet();
2263             internal static readonly int PlaceholderText = Interop.TextEditor.PlaceholderTextGet();
2264             internal static readonly int PlaceholderTextColor = Interop.TextEditor.PlaceholderTextColorGet();
2265             internal static readonly int EnableShiftSelection = Interop.TextEditor.EnableShiftSelectionGet();
2266             internal static readonly int MatchSystemLanguageDirection = Interop.TextEditor.MatchSystemLanguageDirectionGet();
2267             internal static readonly int MaxLength = Interop.TextEditor.MaxLengthGet();
2268             internal static readonly int SelectedTextStart = Interop.TextEditor.SelectedTextStartGet();
2269             internal static readonly int SelectedTextEnd = Interop.TextEditor.SelectedTextEndGet();
2270             internal static readonly int EnableEditing = Interop.TextEditor.EnableEditingGet();
2271             internal static readonly int SelectedText = Interop.TextEditor.SelectedTextGet();
2272             internal static readonly int HorizontalScrollPosition = Interop.TextEditor.HorizontalScrollPositionGet();
2273             internal static readonly int VerticalScrollPosition = Interop.TextEditor.VerticalScrollPositionGet();
2274             internal static readonly int PrimaryCursorPosition = Interop.TextEditor.PrimaryCursorPositionGet();
2275             internal static readonly int FontSizeScale = Interop.TextEditor.FontSizeScaleGet();
2276             internal static readonly int GrabHandleColor = Interop.TextEditor.GrabHandleColorGet();
2277             internal static readonly int EnableGrabHandle = Interop.TextEditor.EnableGrabHandleGet();
2278             internal static readonly int EnableGrabHandlePopup = Interop.TextEditor.EnableGrabHandlePopupGet();
2279             internal static readonly int InputMethodSettings = Interop.TextEditor.InputMethodSettingsGet();
2280             internal static readonly int ELLIPSIS = Interop.TextEditor.EllipsisGet();
2281             internal static readonly int EllipsisPosition = Interop.TextEditor.EllipsisPositionGet();
2282             internal static readonly int MinLineSize = Interop.TextEditor.MinLineSizeGet();
2283             internal static readonly int InputFilter = Interop.TextEditor.InputFilterGet();
2284         }
2285
2286         internal class InputStyle
2287         {
2288             internal enum Mask
2289             {
2290                 None = 0x0000,
2291                 Color = 0x0001,
2292                 FontFamily = 0x0002,
2293                 PointSize = 0x0004,
2294                 FontStyle = 0x0008,
2295                 LineSpacing = 0x0010,
2296                 Underline = 0x0020,
2297                 Shadow = 0x0040,
2298                 Emboss = 0x0080,
2299                 Outline = 0x0100
2300             }
2301         }
2302
2303         private void OnDecorationBoundingBoxChanged(int x, int y, int width, int height)
2304         {
2305             DecorationBoundingBox = new Rectangle(x, y, width, height);
2306         }
2307         private void OnInputColorChanged(float x, float y, float z, float w)
2308         {
2309             InputColor = new Vector4(x, y, z, w);
2310         }
2311         private void OnPlaceholderTextColorChanged(float r, float g, float b, float a)
2312         {
2313             PlaceholderTextColor = new Color(r, g, b, a);
2314         }
2315         private void OnPrimaryCursorColorChanged(float x, float y, float z, float w)
2316         {
2317             PrimaryCursorColor = new Vector4(x, y, z, w);
2318         }
2319         private void OnSecondaryCursorColorChanged(float x, float y, float z, float w)
2320         {
2321             SecondaryCursorColor = new Vector4(x, y, z, w);
2322         }
2323         private void OnSelectionHighlightColorChanged(float x, float y, float z, float w)
2324         {
2325             SelectionHighlightColor = new Vector4(x, y, z, w);
2326         }
2327         private void OnTextColorChanged(float x, float y, float z, float w)
2328         {
2329             TextColor = new Vector4(x, y, z, w);
2330         }
2331         private void OnGrabHandleColorChanged(float r, float g, float b, float a)
2332         {
2333             GrabHandleColor = new Color(r, g, b, a);
2334         }
2335     }
2336 }