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