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