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