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