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