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