6873541983ac743a6203d86666750f863fb433e5
[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 portion of the text that has been selected by the user.
1333         /// </summary>
1334         /// <remarks>
1335         /// Empty string when nothing is selected.
1336         /// </remarks>
1337         /// <since_tizen> 9 </since_tizen>
1338         public string SelectedText
1339         {
1340             get
1341             {
1342                 string temp;
1343                 GetProperty(TextEditor.Property.SelectedText).Get(out temp);
1344                 return temp;
1345             }
1346         }
1347
1348         /// <summary>
1349         /// The Placeholder text color.
1350         /// </summary>
1351         /// <remarks>
1352         /// The property cascade chaining set is possible. For example, this (textEditor.PlaceholderTextColor.X = 0.1f;) is possible.
1353         /// </remarks>
1354         /// <since_tizen> 3 </since_tizen>
1355         public Color PlaceholderTextColor
1356         {
1357             get
1358             {
1359                 Color temp = (Color)GetValue(PlaceholderTextColorProperty);
1360                 return new Color(OnPlaceholderTextColorChanged, temp.R, temp.G, temp.B, temp.A);
1361             }
1362             set
1363             {
1364                 SetValue(PlaceholderTextColorProperty, value);
1365                 NotifyPropertyChanged();
1366             }
1367         }
1368
1369         /// <summary>
1370         /// The EnableSelection property.
1371         /// </summary>
1372         /// <since_tizen> 3 </since_tizen>
1373         public bool EnableSelection
1374         {
1375             get
1376             {
1377                 return (bool)GetValue(EnableSelectionProperty);
1378             }
1379             set
1380             {
1381                 SetValue(EnableSelectionProperty, value);
1382                 NotifyPropertyChanged();
1383             }
1384         }
1385
1386         /// <summary>
1387         /// The start index for selection.
1388         /// </summary>
1389         /// <remarks>
1390         /// When there is no selection, the index is current cursor position.
1391         /// </remarks>
1392         /// <since_tizen> 9 </since_tizen>
1393         public int SelectedTextStart
1394         {
1395             get
1396             {
1397                 int temp;
1398                 GetProperty(TextEditor.Property.SelectedTextStart).Get(out temp);
1399                 return temp;
1400             }
1401         }
1402
1403         /// <summary>
1404         /// The end index for selection.
1405         /// </summary>
1406         /// <remarks>
1407         /// When there is no selection, the index is current cursor position.
1408         /// </remarks>
1409         /// <since_tizen> 9 </since_tizen>
1410         public int SelectedTextEnd
1411         {
1412             get
1413             {
1414                 int temp;
1415                 GetProperty(TextEditor.Property.SelectedTextEnd).Get(out temp);
1416                 return temp;
1417             }
1418         }
1419
1420         /// <summary>
1421         /// Enable editing in text control.
1422         /// </summary>
1423         /// <since_tizen> 8 </since_tizen>
1424         /// This will be public opened in tizen_6.0 after ACR done, Before ACR, need to be hidden as inhouse API.
1425         [EditorBrowsable(EditorBrowsableState.Never)]
1426         public bool EnableEditing
1427         {
1428             get
1429             {
1430                 bool temp;
1431                 GetProperty(TextEditor.Property.EnableEditing).Get(out temp);
1432                 return temp;
1433             }
1434             set
1435             {
1436                 SetProperty(TextEditor.Property.EnableEditing, new PropertyValue(value));
1437                 NotifyPropertyChanged();
1438             }
1439         }
1440
1441         /// <summary>
1442         /// Specify horizontal scroll position in text control.
1443         /// </summary>
1444         [EditorBrowsable(EditorBrowsableState.Never)]
1445         public int HorizontalScrollPosition
1446         {
1447             get
1448             {
1449                 int temp;
1450                 using (PropertyValue propertyValue = GetProperty(TextEditor.Property.HorizontalScrollPosition))
1451                 {
1452                     propertyValue.Get(out temp);
1453                 }
1454                 return temp;
1455             }
1456             set
1457             {
1458                 using (PropertyValue propertyValue = new PropertyValue(value))
1459                 {
1460                     SetProperty(TextEditor.Property.HorizontalScrollPosition, propertyValue);
1461                     NotifyPropertyChanged();
1462                 }
1463             }
1464         }
1465
1466         /// <summary>
1467         /// Specify vertical scroll position in text control.
1468         /// </summary>
1469         [EditorBrowsable(EditorBrowsableState.Never)]
1470         public int VerticalScrollPosition
1471         {
1472             get
1473             {
1474                 int temp;
1475                 using (PropertyValue propertyValue = GetProperty(TextEditor.Property.VerticalScrollPosition))
1476                 {
1477                     propertyValue.Get(out temp);
1478                 }
1479                 return temp;
1480             }
1481             set
1482             {
1483                 using (PropertyValue propertyValue = new PropertyValue(value))
1484                 {
1485                     SetProperty(TextEditor.Property.VerticalScrollPosition, propertyValue);
1486                     NotifyPropertyChanged();
1487                 }
1488             }
1489         }
1490
1491         /// <summary>
1492         /// Specify primary cursor (caret) position in text control.
1493         /// </summary>
1494         [EditorBrowsable(EditorBrowsableState.Never)]
1495         public int PrimaryCursorPosition
1496         {
1497             get
1498             {
1499                 int temp;
1500                 using (PropertyValue propertyValue = GetProperty(TextEditor.Property.PrimaryCursorPosition))
1501                 {
1502                     propertyValue.Get(out temp);
1503                 }
1504                 return temp;
1505             }
1506             set
1507             {
1508                 using (PropertyValue propertyValue = new PropertyValue(value))
1509                 {
1510                     SetProperty(TextEditor.Property.PrimaryCursorPosition, propertyValue);
1511                     NotifyPropertyChanged();
1512                 }
1513             }
1514         }
1515
1516         /// <summary>
1517         /// The GrabHandleColor property.
1518         /// </summary>
1519         /// <remarks>
1520         /// The property cascade chaining set is possible. For example, this (textEditor.GrabHandleColor.X = 0.1f;) is possible.
1521         /// </remarks>
1522         [EditorBrowsable(EditorBrowsableState.Never)]
1523         public Color GrabHandleColor
1524         {
1525             get
1526             {
1527                 Color temp = (Color)GetValue(GrabHandleColorProperty);
1528                 return new Color(OnGrabHandleColorChanged, temp.R, temp.G, temp.B, temp.A);
1529             }
1530             set
1531             {
1532                 SetValue(GrabHandleColorProperty, value);
1533                 NotifyPropertyChanged();
1534             }
1535         }
1536
1537         /// <summary>
1538         /// Set InputFilter to TextEditor. <br />
1539         /// </summary>
1540         /// <param name="inputFilter">The InputFilter</param>
1541         /// <remarks>
1542         /// <see cref="Tizen.NUI.Text.InputFilter"/> filters input based on regular expressions. <br />
1543         /// Users can set the Accepted or Rejected regular expression set, or both. <br />
1544         /// If both are used, Rejected has higher priority. <br />
1545         /// The character set must follow the regular expression rules. <br />
1546         /// Behaviour can not be guaranteed for incorrect grammars. <br />
1547         /// Refer the link below for detailed rules. <br />
1548         /// The functions in std::regex library use the ECMAScript grammar: <br />
1549         /// http://cplusplus.com/reference/regex/ECMAScript/ <br />
1550         /// InputFiltered signal is emitted when the input is filtered by InputFilter <br />
1551         /// See <see cref="InputFiltered"/>, <see cref="InputFilterType"/> and <see cref="InputFilteredEventArgs"/> for a detailed description. <br />
1552         /// </remarks>
1553         /// <example>
1554         /// The following example demonstrates how to use the SetInputFilter method.
1555         /// <code>
1556         /// var inputFilter = new Tizen.NUI.Text.InputFilter();
1557         /// inputFilter.Accepted = @"[\d]"; // accept whole digits
1558         /// inputFilter.Rejected = "[0-3]"; // reject 0, 1, 2, 3
1559         /// editor.SetInputFilter(inputFilter); // acceptable inputs are 4, 5, 6, 7, 8, 9
1560         /// </code>
1561         /// </example>
1562         [EditorBrowsable(EditorBrowsableState.Never)]
1563         public void SetInputFilter(InputFilter inputFilter)
1564         {
1565             SetProperty(TextEditor.Property.InputFilter, new PropertyValue(TextUtils.GetInputFilterMap(inputFilter)));
1566         }
1567
1568         /// <summary>
1569         /// Get InputFilter from TextEditor. <br />
1570         /// </summary>
1571         /// <returns>The InputFilter</returns>
1572         /// <remarks>
1573         /// <see cref="Tizen.NUI.Text.InputFilter"/>
1574         /// </remarks>
1575         [EditorBrowsable(EditorBrowsableState.Never)]
1576         public InputFilter GetInputFilter()
1577         {
1578             var map = new PropertyMap();
1579             GetProperty(TextEditor.Property.InputFilter).Get(map);
1580             return TextUtils.GetInputFilterStruct(map);
1581         }
1582
1583         /// <summary>
1584         /// The Placeholder property.
1585         /// The placeholder map contains the following keys :<br />
1586         /// <list type="table">
1587         /// <item><term>text (string)</term><description>The text to display when the TextEditor is empty and inactive</description></item>
1588         /// <item><term>textFocused (string)</term><description>The text to display when the placeholder has focus</description></item>
1589         /// <item><term>color (Color)</term><description>The color of the placeholder text</description></item>
1590         /// <item><term>fontFamily (string)</term><description>The fontFamily of the placeholder text</description></item>
1591         /// <item><term>fontStyle (PropertyMap)</term><description>The fontStyle of the placeholder text</description></item>
1592         /// <item><term>pointSize (float)</term><description>The pointSize of the placeholder text</description></item>
1593         /// <item><term>pixelSize (float)</term><description>The pixelSize of the placeholder text</description></item>
1594         /// <item><term>ellipsis (bool)</term><description>The ellipsis of the placeholder text</description></item>
1595         /// </list>
1596         /// </summary>
1597         /// <example>
1598         /// The following example demonstrates how to set the placeholder property.
1599         /// <code>
1600         /// PropertyMap propertyMap = new PropertyMap();
1601         /// propertyMap.Add("text", new PropertyValue("Setting Placeholder Text"));
1602         /// propertyMap.Add("textFocused", new PropertyValue("Setting Placeholder Text Focused"));
1603         /// propertyMap.Add("color", new PropertyValue(Color.Red));
1604         /// propertyMap.Add("fontFamily", new PropertyValue("Arial"));
1605         /// propertyMap.Add("pointSize", new PropertyValue(12.0f));
1606         ///
1607         /// PropertyMap fontStyleMap = new PropertyMap();
1608         /// fontStyleMap.Add("weight", new PropertyValue("bold"));
1609         /// fontStyleMap.Add("width", new PropertyValue("condensed"));
1610         /// fontStyleMap.Add("slant", new PropertyValue("italic"));
1611         /// propertyMap.Add("fontStyle", new PropertyValue(fontStyleMap));
1612         ///
1613         /// TextEditor editor = new TextEditor();
1614         /// editor.Placeholder = propertyMap;
1615         /// </code>
1616         /// </example>
1617         /// <since_tizen> 3 </since_tizen>
1618         [System.Diagnostics.CodeAnalysis.SuppressMessage("Naming", "CA1721: Property names should not match get methods")]
1619         public Tizen.NUI.PropertyMap Placeholder
1620         {
1621             get
1622             {
1623                 PropertyMap map = (PropertyMap)GetValue(PlaceholderProperty);
1624                 PropertyValue value = null;
1625
1626                 // text
1627                 value = map.Find(0);
1628                 if (null != value)
1629                 {
1630                     value.Get(out string text);
1631                     map.Add("text", new PropertyValue(text));
1632                 }
1633
1634                 // textFocused
1635                 value = map.Find(1);
1636                 if (null != value)
1637                 {
1638                     value.Get(out string textFocused);
1639                     map.Add("textFocused", new PropertyValue(textFocused));
1640                 }
1641
1642                 // color
1643                 value = map.Find(2);
1644                 if (null != value)
1645                 {
1646                     Color color = new Color();
1647                     value.Get(color);
1648                     map.Add("color", new PropertyValue(color));
1649                 }
1650
1651                 // fontFamily
1652                 value = map.Find(3);
1653                 if (null != value)
1654                 {
1655                     value.Get(out string fontFamily);
1656                     map.Add("fontFamily", new PropertyValue(fontFamily));
1657                 }
1658
1659                 // fontStyle
1660                 value = map.Find(4);
1661                 if (null != value)
1662                 {
1663                     PropertyMap fontStyle = new PropertyMap();
1664                     value.Get(fontStyle);
1665                     map.Add("fontStyle", new PropertyValue(fontStyle));
1666                 }
1667
1668                 // pointSize
1669                 value = map.Find(5);
1670                 if (null != value)
1671                 {
1672                     value.Get(out float pointSize);
1673                     map.Add("pointSize", new PropertyValue(pointSize));
1674                 }
1675
1676                 // pixelSize
1677                 value = map.Find(6);
1678                 if (null != value)
1679                 {
1680                     value.Get(out float pixelSize);
1681                     map.Add("pixelSize", new PropertyValue(pixelSize));
1682                 }
1683
1684                 // ellipsis
1685                 value = map.Find(7);
1686                 if (null != value)
1687                 {
1688                     value.Get(out bool ellipsis);
1689                     map.Add("ellipsis", new PropertyValue(ellipsis));
1690                 }
1691
1692                 return map;
1693             }
1694             set
1695             {
1696                 SetValue(PlaceholderProperty, value);
1697                 NotifyPropertyChanged();
1698             }
1699         }
1700
1701         /// <summary>
1702         /// Set Placeholder to TextEditor. <br />
1703         /// </summary>
1704         /// <param name="placeholder">The Placeholder</param>
1705         /// <remarks>
1706         /// SetPlaceholder specifies the attributes of the placeholder property through <see cref="Tizen.NUI.Text.Placeholder"/>. <br />
1707         /// </remarks>
1708         /// <example>
1709         /// The following example demonstrates how to use the SetPlaceholder method.
1710         /// <code>
1711         /// var placeholder = new Tizen.NUI.Text.Placeholder();
1712         /// placeholder.Text = "placeholder text";
1713         /// placeholder.TextFocused = "placeholder textFocused";
1714         /// placeholder.Color = new Color("#45B39D");
1715         /// placeholder.FontFamily = "BreezeSans";
1716         /// placeholder.FontStyle = new Tizen.NUI.Text.FontStyle()
1717         /// {
1718         ///     Width = FontWidthType.Expanded,
1719         ///     Weight = FontWeightType.ExtraLight,
1720         ///     Slant = FontSlantType.Italic,
1721         /// };
1722         /// placeholder.PointSize = 25.0f;
1723         /// //placeholder.PixelSize = 50.0f;
1724         /// placeholder.Ellipsis = true;
1725         /// editor.SetPlaceholder(placeholder);
1726         /// </code>
1727         /// </example>
1728         [EditorBrowsable(EditorBrowsableState.Never)]
1729         public void SetPlaceholder(Placeholder placeholder)
1730         {
1731             SetValue(PlaceholderProperty, TextUtils.GetPlaceholderMap(placeholder));
1732         }
1733
1734         /// <summary>
1735         /// Get Placeholder from TextEditor. <br />
1736         /// </summary>
1737         /// <returns>The Placeholder</returns>
1738         /// <remarks>
1739         /// <see cref="Tizen.NUI.Text.Placeholder"/>
1740         /// </remarks>
1741         [EditorBrowsable(EditorBrowsableState.Never)]
1742         public Placeholder GetPlaceholder()
1743         {
1744             return TextUtils.GetPlaceholderStruct((PropertyMap)GetValue(PlaceholderProperty));
1745         }
1746
1747         /// <summary>
1748         /// The Ellipsis property.<br />
1749         /// Enable or disable the ellipsis.<br />
1750         /// </summary>
1751         /// <since_tizen> 9 </since_tizen>
1752         public bool Ellipsis
1753         {
1754             get
1755             {
1756                 return (bool)GetValue(EllipsisProperty);
1757             }
1758             set
1759             {
1760                 SetValue(EllipsisProperty, value);
1761                 NotifyPropertyChanged();
1762             }
1763         }
1764
1765
1766         /// <summary>
1767         /// The ellipsis position of the text.
1768         /// Specifies which portion of the text should be replaced with an ellipsis when the text size exceeds the layout size.<br />
1769         /// </summary>
1770         /// <since_tizen> 9 </since_tizen>
1771         public EllipsisPosition EllipsisPosition
1772         {
1773             get
1774             {
1775                 return (EllipsisPosition)GetValue(EllipsisPositionProperty);
1776             }
1777             set
1778             {
1779                 SetValue(EllipsisPositionProperty, value);
1780                 NotifyPropertyChanged();
1781             }
1782         }
1783
1784         /// <summary>
1785         /// The LineWrapMode property.<br />
1786         /// The line wrap mode when the text lines over the layout width.<br />
1787         /// </summary>
1788         /// <since_tizen> 4 </since_tizen>
1789         public LineWrapMode LineWrapMode
1790         {
1791             get
1792             {
1793                 return (LineWrapMode)GetValue(LineWrapModeProperty);
1794             }
1795             set
1796             {
1797                 SetValue(LineWrapModeProperty, value);
1798                 NotifyPropertyChanged();
1799             }
1800         }
1801
1802         /// <summary>
1803         /// Enables Text selection using Shift key.
1804         /// </summary>
1805         /// <since_tizen> 5 </since_tizen>
1806         /// This will be released at Tizen.NET API Level 5, so currently this would be used as inhouse API.
1807         [EditorBrowsable(EditorBrowsableState.Never)]
1808         public bool EnableShiftSelection
1809         {
1810             get
1811             {
1812                 return (bool)GetValue(EnableShiftSelectionProperty);
1813             }
1814             set
1815             {
1816                 SetValue(EnableShiftSelectionProperty, value);
1817                 NotifyPropertyChanged();
1818             }
1819         }
1820
1821         /// <summary>
1822         /// The text alignment to match the direction of the system language.
1823         /// </summary>
1824         /// <since_tizen> 6 </since_tizen>
1825         public bool MatchSystemLanguageDirection
1826         {
1827             get
1828             {
1829                 return (bool)GetValue(MatchSystemLanguageDirectionProperty);
1830             }
1831             set
1832             {
1833                 SetValue(MatchSystemLanguageDirectionProperty, value);
1834                 NotifyPropertyChanged();
1835             }
1836         }
1837
1838         /// <summary>
1839         /// The MaxLength property.
1840         /// </summary>
1841         /// This will be public opened in tizen_6.5 after ACR done. Before ACR, need to be hidden as inhouse API.
1842         [EditorBrowsable(EditorBrowsableState.Never)]
1843         public int MaxLength
1844         {
1845             get
1846             {
1847                 return (int)GetValue(MaxLengthProperty);
1848             }
1849             set
1850             {
1851                 SetValue(MaxLengthProperty, value);
1852                 NotifyPropertyChanged();
1853             }
1854         }
1855
1856         /// <summary>
1857         /// The FontSizeScale property. <br />
1858         /// The default value is 1.0. <br />
1859         /// If FontSizeScale.UseSystemSetting, will use the SystemSettings.FontSize internally. <br />
1860         /// </summary>
1861         /// <since_tizen> 9 </since_tizen>
1862         public float FontSizeScale
1863         {
1864             get
1865             {
1866                 return fontSizeScale;
1867             }
1868             set
1869             {
1870                 float newFontSizeScale;
1871
1872                 if (fontSizeScale == value) return;
1873
1874                 fontSizeScale = value;
1875                 if (fontSizeScale == Tizen.NUI.FontSizeScale.UseSystemSetting)
1876                 {
1877                     SystemSettingsFontSize systemSettingsFontSize;
1878
1879                     try
1880                     {
1881                         systemSettingsFontSize = SystemSettings.FontSize;
1882                     }
1883                     catch (Exception e)
1884                     {
1885                         Console.WriteLine("{0} Exception caught.", e);
1886                         systemSettingsFontSize = SystemSettingsFontSize.Normal;
1887                     }
1888                     newFontSizeScale = TextUtils.GetFontSizeScale(systemSettingsFontSize);
1889                     addFontSizeChangedCallback();
1890                 }
1891                 else
1892                 {
1893                     newFontSizeScale = fontSizeScale;
1894                     removeFontSizeChangedCallback();
1895                 }
1896
1897                 SetValue(FontSizeScaleProperty, newFontSizeScale);
1898                 NotifyPropertyChanged();
1899             }
1900         }
1901
1902         /// <summary>
1903         /// The InputMethodSettings property.
1904         /// </summary>
1905         /// <remarks>
1906         /// <see cref="InputMethod"/> is a class encapsulating the input method map. Please use the <see cref="InputMethod"/> class for this property.
1907         /// </remarks>
1908         /// <example>
1909         /// The following example demonstrates how to set the InputMethodSettings property.
1910         /// <code>
1911         /// InputMethod method = new InputMethod();
1912         /// method.PanelLayout = InputMethod.PanelLayoutType.Normal;
1913         /// method.ActionButton = InputMethod.ActionButtonTitleType.Default;
1914         /// method.AutoCapital = InputMethod.AutoCapitalType.Word;
1915         /// method.Variation = 1;
1916         /// textEditor.InputMethodSettings = method.OutputMap;
1917         /// </code>
1918         /// </example>
1919         [EditorBrowsable(EditorBrowsableState.Never)]
1920         public PropertyMap InputMethodSettings
1921         {
1922             get
1923             {
1924                 return (PropertyMap)GetValue(InputMethodSettingsProperty);
1925             }
1926             set
1927             {
1928                 SetValue(InputMethodSettingsProperty, value);
1929                 NotifyPropertyChanged();
1930             }
1931         }
1932
1933         /// <summary>
1934         /// Scroll the text control by specific amount..
1935         /// </summary>
1936         /// <param name="scroll">The amount (in pixels) of scrolling in horizontal &amp; vertical directions.</param>
1937         [EditorBrowsable(EditorBrowsableState.Never)]
1938         public void ScrollBy(Vector2 scroll)
1939         {
1940             Interop.TextEditor.ScrollBy(SwigCPtr, Vector2.getCPtr(scroll));
1941             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1942         }
1943
1944         /// <summary>
1945         /// Get the InputMethodContext instance.
1946         /// </summary>
1947         /// <returns>The InputMethodContext instance.</returns>
1948         /// <since_tizen> 5 </since_tizen>
1949         public InputMethodContext GetInputMethodContext()
1950         {
1951             if (inputMethodContext == null)
1952             {
1953                 /*Avoid raising InputMethodContext reference count.*/
1954                 inputMethodContext = new InputMethodContext(Interop.TextEditor.GetInputMethodContext(SwigCPtr), true);
1955                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1956             }
1957             return inputMethodContext;
1958         }
1959
1960         /// <summary>
1961         /// Select the whole text.
1962         /// </summary>
1963         /// <since_tizen> 9 </since_tizen>
1964         public void SelectWholeText()
1965         {
1966             Interop.TextEditor.SelectWholeText(SwigCPtr);
1967             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1968         }
1969
1970         /// <summary>
1971         /// Select text from start to end index. <br />
1972         /// The index is valid when 0 or positive.
1973         /// </summary>
1974         /// <param name="start">The start index for selection.</param>
1975         /// <param name="end">The end index for selection.</param>
1976         /// <remarks>
1977         /// If the end index exceeds the maximum value, it is set to the length of the text.
1978         /// </remarks>
1979         /// <since_tizen> 9 </since_tizen>
1980         public void SelectText(int start, int end)
1981         {
1982             if (start < 0)
1983                 throw new global::System.ArgumentOutOfRangeException(nameof(start), "Value is less than zero");
1984             if (end < 0)
1985                 throw new global::System.ArgumentOutOfRangeException(nameof(end), "Value is less than zero");
1986
1987             Interop.TextEditor.SelectText(SwigCPtr, (uint)start, (uint)end);
1988             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1989         }
1990
1991         /// <summary>
1992         /// Clear selection of the text. <br />
1993         /// Valid when selection is activate.
1994         /// </summary>
1995         /// <since_tizen> 9 </since_tizen>
1996         public void SelectNone()
1997         {
1998             _ = Interop.TextEditor.SelectNone(SwigCPtr);
1999             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
2000         }
2001
2002         /// <summary>
2003         /// Enable grab handle property.
2004         /// </summary>
2005         [EditorBrowsable(EditorBrowsableState.Never)]
2006         public bool EnableGrabHandle
2007         {
2008             get
2009             {
2010                 return (bool)GetValue(EnableGrabHandleProperty);
2011             }
2012             set
2013             {
2014                 SetValue(EnableGrabHandleProperty, value);
2015                 NotifyPropertyChanged();
2016             }
2017         }
2018
2019         /// <summary>
2020         /// Enable grab handle popup property.
2021         /// </summary>
2022         [EditorBrowsable(EditorBrowsableState.Never)]
2023         public bool EnableGrabHandlePopup
2024         {
2025             get
2026             {
2027                 return (bool)GetValue(EnableGrabHandlePopupProperty);
2028             }
2029             set
2030             {
2031                 SetValue(EnableGrabHandlePopupProperty, value);
2032                 NotifyPropertyChanged();
2033             }
2034         }
2035
2036         /// <summary>
2037         /// Minimum line size to be used.
2038         /// </summary>
2039         [EditorBrowsable(EditorBrowsableState.Never)]
2040         public float MinLineSize
2041         {
2042             get
2043             {
2044                 return (float)GetValue(MinLineSizeProperty);
2045             }
2046             set
2047             {
2048                 SetValue(MinLineSizeProperty, value);
2049                 NotifyPropertyChanged();
2050             }
2051         }
2052
2053         internal SWIGTYPE_p_Dali__SignalT_void_fDali__Toolkit__TextEditor_Dali__Toolkit__TextEditor__InputStyle__MaskF_t InputStyleChangedSignal()
2054         {
2055             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));
2056             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
2057             return ret;
2058         }
2059
2060         /// <summary>
2061         /// Dispose.
2062         /// </summary>
2063         /// <since_tizen> 3 </since_tizen>
2064         protected override void Dispose(DisposeTypes type)
2065         {
2066             if (disposed)
2067             {
2068                 return;
2069             }
2070
2071             if (systemlangTextFlag)
2072             {
2073                 SystemSettings.LocaleLanguageChanged -= SystemSettings_LocaleLanguageChanged;
2074             }
2075
2076             removeFontSizeChangedCallback();
2077
2078             //Release your own unmanaged resources here.
2079             //You should not access any managed member here except static instance.
2080             //because the execution order of Finalizes is non-deterministic.
2081
2082             if (this.HasBody())
2083             {
2084                 if (textEditorTextChangedCallbackDelegate != null)
2085                 {
2086                     TextChangedSignal().Disconnect(textEditorTextChangedCallbackDelegate);
2087                 }
2088
2089                 if (textEditorMaxLengthReachedCallbackDelegate != null)
2090                 {
2091                     this.MaxLengthReachedSignal().Disconnect(textEditorMaxLengthReachedCallbackDelegate);
2092                 }
2093
2094                 if (textEditorSelectionClearedCallbackDelegate != null)
2095                 {
2096                     this.SelectionClearedSignal().Disconnect(textEditorSelectionClearedCallbackDelegate);
2097                 }
2098
2099                 if (textEditorCursorPositionChangedCallbackDelegate != null)
2100                 {
2101                     this.CursorPositionChangedSignal().Disconnect(textEditorCursorPositionChangedCallbackDelegate);
2102                 }
2103
2104                 if (textEditorSelectionChangedCallbackDelegate != null)
2105                 {
2106                     this.SelectionChangedSignal().Disconnect(textEditorSelectionChangedCallbackDelegate);
2107                 }
2108             }
2109
2110             TextChanged -= TextEditorTextChanged;
2111
2112             base.Dispose(type);
2113         }
2114
2115         /// This will not be public opened.
2116         [EditorBrowsable(EditorBrowsableState.Never)]
2117         protected override void ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef swigCPtr)
2118         {
2119             // In order to speed up IME hide, temporarily add
2120             GetInputMethodContext()?.DestroyContext();
2121             Interop.TextEditor.DeleteTextEditor(swigCPtr);
2122         }
2123
2124         private string SetTranslatable(string textEditorSid)
2125         {
2126             string translatableText = null;
2127             translatableText = NUIApplication.MultilingualResourceManager?.GetString(textEditorSid, new CultureInfo(SystemSettings.LocaleLanguage.Replace("_", "-")));
2128             if (translatableText != null)
2129             {
2130                 if (systemlangTextFlag == false)
2131                 {
2132                     SystemSettings.LocaleLanguageChanged += SystemSettings_LocaleLanguageChanged;
2133                     systemlangTextFlag = true;
2134                 }
2135                 return translatableText;
2136             }
2137             else
2138             {
2139                 translatableText = "";
2140                 return translatableText;
2141             }
2142         }
2143
2144         private void SystemSettings_LocaleLanguageChanged(object sender, LocaleLanguageChangedEventArgs e)
2145         {
2146             if (textEditorTextSid != null)
2147             {
2148                 Text = NUIApplication.MultilingualResourceManager?.GetString(textEditorTextSid, new CultureInfo(e.Value.Replace("_", "-")));
2149             }
2150             if (textEditorPlaceHolderTextSid != null)
2151             {
2152                 PlaceholderText = NUIApplication.MultilingualResourceManager?.GetString(textEditorPlaceHolderTextSid, new CultureInfo(e.Value.Replace("_", "-")));
2153             }
2154         }
2155
2156         private void SystemSettingsFontSizeChanged(object sender, FontSizeChangedEventArgs e)
2157         {
2158             float newFontSizeScale = TextUtils.GetFontSizeScale(e.Value);
2159             SetValue(FontSizeScaleProperty, newFontSizeScale);
2160             NotifyPropertyChanged();
2161         }
2162
2163         private void addFontSizeChangedCallback()
2164         {
2165             if (hasFontSizeChangedCallback != true)
2166             {
2167                 try
2168                 {
2169                     SystemSettings.FontSizeChanged += SystemSettingsFontSizeChanged;
2170                     hasFontSizeChangedCallback = true;
2171                 }
2172                 catch (Exception e)
2173                 {
2174                     Console.WriteLine("{0} Exception caught.", e);
2175                     hasFontSizeChangedCallback = false;
2176                 }
2177             }
2178         }
2179
2180         private void removeFontSizeChangedCallback()
2181         {
2182             if (hasFontSizeChangedCallback == true)
2183             {
2184                 try
2185                 {
2186                     SystemSettings.FontSizeChanged -= SystemSettingsFontSizeChanged;
2187                     hasFontSizeChangedCallback = false;
2188                 }
2189                 catch (Exception e)
2190                 {
2191                     Console.WriteLine("{0} Exception caught.", e);
2192                     hasFontSizeChangedCallback = true;
2193                 }
2194             }
2195         }
2196
2197         private void TextEditorTextChanged(object sender, TextChangedEventArgs e)
2198         {
2199             if (!isSettingTextInCSharp)
2200             {
2201                 EnforceNotifyBindedInstance(TextProperty);
2202             }
2203         }
2204
2205         internal new class Property
2206         {
2207             internal static readonly int TEXT = Interop.TextEditor.TextGet();
2208             internal static readonly int TextColor = Interop.TextEditor.TextColorGet();
2209             internal static readonly int FontFamily = Interop.TextEditor.FontFamilyGet();
2210             internal static readonly int FontStyle = Interop.TextEditor.FontStyleGet();
2211             internal static readonly int PointSize = Interop.TextEditor.PointSizeGet();
2212             internal static readonly int HorizontalAlignment = Interop.TextEditor.HorizontalAlignmentGet();
2213             internal static readonly int ScrollThreshold = Interop.TextEditor.ScrollThresholdGet();
2214             internal static readonly int ScrollSpeed = Interop.TextEditor.ScrollSpeedGet();
2215             internal static readonly int PrimaryCursorColor = Interop.TextEditor.PrimaryCursorColorGet();
2216             internal static readonly int SecondaryCursorColor = Interop.TextEditor.SecondaryCursorColorGet();
2217             internal static readonly int EnableCursorBlink = Interop.TextEditor.EnableCursorBlinkGet();
2218             internal static readonly int CursorBlinkInterval = Interop.TextEditor.CursorBlinkIntervalGet();
2219             internal static readonly int CursorBlinkDuration = Interop.TextEditor.CursorBlinkDurationGet();
2220             internal static readonly int CursorWidth = Interop.TextEditor.CursorWidthGet();
2221             internal static readonly int GrabHandleImage = Interop.TextEditor.GrabHandleImageGet();
2222             internal static readonly int GrabHandlePressedImage = Interop.TextEditor.GrabHandlePressedImageGet();
2223             internal static readonly int SelectionHandleImageLeft = Interop.TextEditor.SelectionHandleImageLeftGet();
2224             internal static readonly int SelectionHandleImageRight = Interop.TextEditor.SelectionHandleImageRightGet();
2225             internal static readonly int SelectionHandlePressedImageLeft = Interop.TextEditor.SelectionHandlePressedImageLeftGet();
2226             internal static readonly int SelectionHandlePressedImageRight = Interop.TextEditor.SelectionHandlePressedImageRightGet();
2227             internal static readonly int SelectionHandleMarkerImageLeft = Interop.TextEditor.SelectionHandleMarkerImageLeftGet();
2228             internal static readonly int SelectionHandleMarkerImageRight = Interop.TextEditor.SelectionHandleMarkerImageRightGet();
2229             internal static readonly int SelectionHighlightColor = Interop.TextEditor.SelectionHighlightColorGet();
2230             internal static readonly int DecorationBoundingBox = Interop.TextEditor.DecorationBoundingBoxGet();
2231             internal static readonly int EnableMarkup = Interop.TextEditor.EnableMarkupGet();
2232             internal static readonly int InputColor = Interop.TextEditor.InputColorGet();
2233             internal static readonly int InputFontFamily = Interop.TextEditor.InputFontFamilyGet();
2234             internal static readonly int InputFontStyle = Interop.TextEditor.InputFontStyleGet();
2235             internal static readonly int InputPointSize = Interop.TextEditor.InputPointSizeGet();
2236             internal static readonly int LineSpacing = Interop.TextEditor.LineSpacingGet();
2237             internal static readonly int InputLineSpacing = Interop.TextEditor.InputLineSpacingGet();
2238             internal static readonly int UNDERLINE = Interop.TextEditor.UnderlineGet();
2239             internal static readonly int InputUnderline = Interop.TextEditor.InputUnderlineGet();
2240             internal static readonly int SHADOW = Interop.TextEditor.ShadowGet();
2241             internal static readonly int InputShadow = Interop.TextEditor.InputShadowGet();
2242             internal static readonly int EMBOSS = Interop.TextEditor.EmbossGet();
2243             internal static readonly int InputEmboss = Interop.TextEditor.InputEmbossGet();
2244             internal static readonly int OUTLINE = Interop.TextEditor.OutlineGet();
2245             internal static readonly int InputOutline = Interop.TextEditor.InputOutlineGet();
2246             internal static readonly int SmoothScroll = Interop.TextEditor.SmoothScrollGet();
2247             internal static readonly int SmoothScrollDuration = Interop.TextEditor.SmoothScrollDurationGet();
2248             internal static readonly int EnableScrollBar = Interop.TextEditor.EnableScrollBarGet();
2249             internal static readonly int ScrollBarShowDuration = Interop.TextEditor.ScrollBarShowDurationGet();
2250             internal static readonly int ScrollBarFadeDuration = Interop.TextEditor.ScrollBarFadeDurationGet();
2251             internal static readonly int PixelSize = Interop.TextEditor.PixelSizeGet();
2252             internal static readonly int LineCount = Interop.TextEditor.LineCountGet();
2253             internal static readonly int EnableSelection = Interop.TextEditor.EnableSelectionGet();
2254             internal static readonly int PLACEHOLDER = Interop.TextEditor.PlaceholderGet();
2255             internal static readonly int LineWrapMode = Interop.TextEditor.LineWrapModeGet();
2256             internal static readonly int PlaceholderText = Interop.TextEditor.PlaceholderTextGet();
2257             internal static readonly int PlaceholderTextColor = Interop.TextEditor.PlaceholderTextColorGet();
2258             internal static readonly int EnableShiftSelection = Interop.TextEditor.EnableShiftSelectionGet();
2259             internal static readonly int MatchSystemLanguageDirection = Interop.TextEditor.MatchSystemLanguageDirectionGet();
2260             internal static readonly int MaxLength = Interop.TextEditor.MaxLengthGet();
2261             internal static readonly int SelectedTextStart = Interop.TextEditor.SelectedTextStartGet();
2262             internal static readonly int SelectedTextEnd = Interop.TextEditor.SelectedTextEndGet();
2263             internal static readonly int EnableEditing = Interop.TextEditor.EnableEditingGet();
2264             internal static readonly int SelectedText = Interop.TextEditor.SelectedTextGet();
2265             internal static readonly int HorizontalScrollPosition = Interop.TextEditor.HorizontalScrollPositionGet();
2266             internal static readonly int VerticalScrollPosition = Interop.TextEditor.VerticalScrollPositionGet();
2267             internal static readonly int PrimaryCursorPosition = Interop.TextEditor.PrimaryCursorPositionGet();
2268             internal static readonly int FontSizeScale = Interop.TextEditor.FontSizeScaleGet();
2269             internal static readonly int GrabHandleColor = Interop.TextEditor.GrabHandleColorGet();
2270             internal static readonly int EnableGrabHandle = Interop.TextEditor.EnableGrabHandleGet();
2271             internal static readonly int EnableGrabHandlePopup = Interop.TextEditor.EnableGrabHandlePopupGet();
2272             internal static readonly int InputMethodSettings = Interop.TextEditor.InputMethodSettingsGet();
2273             internal static readonly int ELLIPSIS = Interop.TextEditor.EllipsisGet();
2274             internal static readonly int EllipsisPosition = Interop.TextEditor.EllipsisPositionGet();
2275             internal static readonly int MinLineSize = Interop.TextEditor.MinLineSizeGet();
2276             internal static readonly int InputFilter = Interop.TextEditor.InputFilterGet();
2277         }
2278
2279         internal class InputStyle
2280         {
2281             internal enum Mask
2282             {
2283                 None = 0x0000,
2284                 Color = 0x0001,
2285                 FontFamily = 0x0002,
2286                 PointSize = 0x0004,
2287                 FontStyle = 0x0008,
2288                 LineSpacing = 0x0010,
2289                 Underline = 0x0020,
2290                 Shadow = 0x0040,
2291                 Emboss = 0x0080,
2292                 Outline = 0x0100
2293             }
2294         }
2295
2296         private void OnDecorationBoundingBoxChanged(int x, int y, int width, int height)
2297         {
2298             DecorationBoundingBox = new Rectangle(x, y, width, height);
2299         }
2300         private void OnInputColorChanged(float x, float y, float z, float w)
2301         {
2302             InputColor = new Vector4(x, y, z, w);
2303         }
2304         private void OnPlaceholderTextColorChanged(float r, float g, float b, float a)
2305         {
2306             PlaceholderTextColor = new Color(r, g, b, a);
2307         }
2308         private void OnPrimaryCursorColorChanged(float x, float y, float z, float w)
2309         {
2310             PrimaryCursorColor = new Vector4(x, y, z, w);
2311         }
2312         private void OnSecondaryCursorColorChanged(float x, float y, float z, float w)
2313         {
2314             SecondaryCursorColor = new Vector4(x, y, z, w);
2315         }
2316         private void OnSelectionHighlightColorChanged(float x, float y, float z, float w)
2317         {
2318             SelectionHighlightColor = new Vector4(x, y, z, w);
2319         }
2320         private void OnTextColorChanged(float x, float y, float z, float w)
2321         {
2322             TextColor = new Vector4(x, y, z, w);
2323         }
2324         private void OnGrabHandleColorChanged(float r, float g, float b, float a)
2325         {
2326             GrabHandleColor = new Color(r, g, b, a);
2327         }
2328     }
2329 }