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