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