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