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