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