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