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