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