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