[NUI] Fix duplicated TextChanged event handler
[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("Please do not use this ShadowOffset(Deprecated). Please 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("Please do not use this ShadowColor(Deprecated). Please 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 SelectionHandleImageLeft property.<br />
787         /// The image to display for the left selection handle.<br />
788         /// The selectionHandleImageLeft map contains the following key :<br />
789         /// <list type="table">
790         /// <item><term>filename (string)</term><description>The path of image file</description></item>
791         /// </list>
792         /// </summary>
793         /// <since_tizen> 3 </since_tizen>
794         public PropertyMap SelectionHandleImageLeft
795         {
796             get
797             {
798                 return (PropertyMap)GetValue(SelectionHandleImageLeftProperty);
799             }
800             set
801             {
802                 SetValue(SelectionHandleImageLeftProperty, value);
803                 NotifyPropertyChanged();
804             }
805         }
806
807         /// <summary>
808         /// The SelectionHandleImageRight property.<br />
809         /// The image to display for the right selection handle.<br />
810         /// The selectionHandleImageRight map contains the following key :<br />
811         /// <list type="table">
812         /// <item><term>filename (string)</term><description>The path of image file</description></item>
813         /// </list>
814         /// </summary>
815         /// <since_tizen> 3 </since_tizen>
816         public PropertyMap SelectionHandleImageRight
817         {
818             get
819             {
820                 return (PropertyMap)GetValue(SelectionHandleImageRightProperty);
821             }
822             set
823             {
824                 SetValue(SelectionHandleImageRightProperty, value);
825                 NotifyPropertyChanged();
826             }
827         }
828
829         /// <summary>
830         /// Set SelectionHandleImage to TextField. <br />
831         /// </summary>
832         /// <param name="selectionHandleImage">The SelectionHandleImage</param>
833         /// <remarks>
834         /// SetSelectionHandleImage specifies the display image used for the selection handle through <see cref="Tizen.NUI.Text.SelectionHandleImage"/>. <br />
835         /// </remarks>
836         /// <example>
837         /// The following example demonstrates how to use the SetSelectionHandleImage method.
838         /// <code>
839         /// var selectionHandleImage = new Tizen.NUI.Text.SelectionHandleImage();
840         /// selectionHandleImage.LeftImageUrl = "handle_downleft.png";
841         /// selectionHandleImage.RightImageUrl = "handle_downright.png";
842         /// field.SetSelectionHandleImage(selectionHandleImage);
843         /// </code>
844         /// </example>
845         [EditorBrowsable(EditorBrowsableState.Never)]
846         public void SetSelectionHandleImage(SelectionHandleImage selectionHandleImage)
847         {
848             if (!String.IsNullOrEmpty(selectionHandleImage.LeftImageUrl))
849             {
850                 using (var leftImageMap = TextMapHelper.GetFileNameMap(selectionHandleImage.LeftImageUrl))
851                 {
852                     SetValue(SelectionHandleImageLeftProperty, leftImageMap);
853                 }
854             }
855
856             if (!String.IsNullOrEmpty(selectionHandleImage.RightImageUrl))
857             {
858                 using (var rightImageMap = TextMapHelper.GetFileNameMap(selectionHandleImage.RightImageUrl))
859                 {
860                     SetValue(SelectionHandleImageRightProperty, rightImageMap);
861                 }
862             }
863         }
864
865         /// <summary>
866         /// Get SelectionHandleImage from TextField. <br />
867         /// </summary>
868         /// <returns>The SelectionHandleImage</returns>
869         /// <remarks>
870         /// <see cref="Tizen.NUI.Text.SelectionHandleImage"/>
871         /// </remarks>
872         [EditorBrowsable(EditorBrowsableState.Never)]
873         public SelectionHandleImage GetSelectionHandleImage()
874         {
875             SelectionHandleImage selectionHandleImage;
876             using (var leftImageMap = (PropertyMap)GetValue(SelectionHandleImageLeftProperty))
877             using (var rightImageMap = (PropertyMap)GetValue(SelectionHandleImageRightProperty))
878             {
879                 selectionHandleImage = TextMapHelper.GetSelectionHandleImageStruct(leftImageMap, rightImageMap);
880             }
881             return selectionHandleImage;
882         }
883
884         /// <summary>
885         /// The SelectionHandlePressedImageLeft property.<br />
886         /// The image to display when the left selection handle is pressed.<br />
887         /// The selectionHandlePressedImageLeft map contains the following key :<br />
888         /// <list type="table">
889         /// <item><term>filename (string)</term><description>The path of image file</description></item>
890         /// </list>
891         /// </summary>
892         /// <since_tizen> 3 </since_tizen>
893         public PropertyMap SelectionHandlePressedImageLeft
894         {
895             get
896             {
897                 return (PropertyMap)GetValue(SelectionHandlePressedImageLeftProperty);
898             }
899             set
900             {
901                 SetValue(SelectionHandlePressedImageLeftProperty, value);
902                 NotifyPropertyChanged();
903             }
904         }
905
906         /// <summary>
907         /// The SelectionHandlePressedImageRight property.<br />
908         /// The image to display when the right selection handle is pressed.<br />
909         /// The selectionHandlePressedImageRight map contains the following key :<br />
910         /// <list type="table">
911         /// <item><term>filename (string)</term><description>The path of image file</description></item>
912         /// </list>
913         /// </summary>
914         /// <since_tizen> 3 </since_tizen>
915         public PropertyMap SelectionHandlePressedImageRight
916         {
917             get
918             {
919                 return (PropertyMap)GetValue(SelectionHandlePressedImageRightProperty);
920             }
921             set
922             {
923                 SetValue(SelectionHandlePressedImageRightProperty, value);
924                 NotifyPropertyChanged();
925             }
926         }
927
928         /// <summary>
929         /// Set SelectionHandlePressedImage to TextField. <br />
930         /// </summary>
931         /// <param name="selectionHandlePressedImage">The SelectionHandleImage</param>
932         /// <remarks>
933         /// SetSelectionHandlePressedImage specifies the display image used for the selection handle through <see cref="Tizen.NUI.Text.SelectionHandleImage"/>. <br />
934         /// </remarks>
935         /// <example>
936         /// The following example demonstrates how to use the SetSelectionHandlePressedImage method.
937         /// <code>
938         /// var selectionHandlePressedImage = new Tizen.NUI.Text.SelectionHandleImage();
939         /// selectionHandlePressedImage.LeftImageUrl = "handle_pressed_downleft.png";
940         /// selectionHandlePressedImage.RightImageUrl = "handle_pressed_downright.png";
941         /// field.SetSelectionHandlePressedImage(selectionHandlePressedImage);
942         /// </code>
943         /// </example>
944         [EditorBrowsable(EditorBrowsableState.Never)]
945         public void SetSelectionHandlePressedImage(SelectionHandleImage selectionHandlePressedImage)
946         {
947             if (!String.IsNullOrEmpty(selectionHandlePressedImage.LeftImageUrl))
948             {
949                 using (var leftImageMap = TextMapHelper.GetFileNameMap(selectionHandlePressedImage.LeftImageUrl))
950                 {
951                     SetValue(SelectionHandlePressedImageLeftProperty, leftImageMap);
952                 }
953             }
954
955             if (!String.IsNullOrEmpty(selectionHandlePressedImage.RightImageUrl))
956             {
957                 using (var rightImageMap = TextMapHelper.GetFileNameMap(selectionHandlePressedImage.RightImageUrl))
958                 {
959                     SetValue(SelectionHandlePressedImageRightProperty, rightImageMap);
960                 }
961             }
962         }
963
964         /// <summary>
965         /// Get SelectionHandlePressedImage from TextField. <br />
966         /// </summary>
967         /// <returns>The SelectionHandlePressedImage</returns>
968         /// <remarks>
969         /// <see cref="Tizen.NUI.Text.SelectionHandleImage"/>
970         /// </remarks>
971         [EditorBrowsable(EditorBrowsableState.Never)]
972         public SelectionHandleImage GetSelectionHandlePressedImage()
973         {
974             SelectionHandleImage selectionHandleImage;
975             using (var leftImageMap = (PropertyMap)GetValue(SelectionHandlePressedImageLeftProperty))
976             using (var rightImageMap = (PropertyMap)GetValue(SelectionHandlePressedImageRightProperty))
977             {
978                 selectionHandleImage = TextMapHelper.GetSelectionHandleImageStruct(leftImageMap, rightImageMap);
979             }
980             return selectionHandleImage;
981         }
982
983         /// <summary>
984         /// The SelectionHandleMarkerImageLeft property.<br />
985         /// The image to display for the left selection handle marker.<br />
986         /// The selectionHandleMarkerImageLeft map contains the following key :<br />
987         /// <list type="table">
988         /// <item><term>filename (string)</term><description>The path of image file</description></item>
989         /// </list>
990         /// </summary>
991         /// <since_tizen> 3 </since_tizen>
992         public PropertyMap SelectionHandleMarkerImageLeft
993         {
994             get
995             {
996                 return (PropertyMap)GetValue(SelectionHandleMarkerImageLeftProperty);
997             }
998             set
999             {
1000                 SetValue(SelectionHandleMarkerImageLeftProperty, value);
1001                 NotifyPropertyChanged();
1002             }
1003         }
1004
1005         /// <summary>
1006         /// The SelectionHandleMarkerImageRight property.<br />
1007         /// The image to display for the right selection handle marker.<br />
1008         /// The selectionHandleMarkerImageRight map contains the following key :<br />
1009         /// <list type="table">
1010         /// <item><term>filename (string)</term><description>The path of image file</description></item>
1011         /// </list>
1012         /// </summary>
1013         /// <since_tizen> 3 </since_tizen>
1014         public PropertyMap SelectionHandleMarkerImageRight
1015         {
1016             get
1017             {
1018                 return (PropertyMap)GetValue(SelectionHandleMarkerImageRightProperty);
1019             }
1020             set
1021             {
1022                 SetValue(SelectionHandleMarkerImageRightProperty, value);
1023                 NotifyPropertyChanged();
1024             }
1025         }
1026
1027         /// <summary>
1028         /// Set SelectionHandleMarkerImage to TextField. <br />
1029         /// </summary>
1030         /// <param name="selectionHandleMarkerImage">The SelectionHandleImage</param>
1031         /// <remarks>
1032         /// SetSelectionHandleMarkerImage specifies the display image used for the selection handle through <see cref="Tizen.NUI.Text.SelectionHandleImage"/>. <br />
1033         /// </remarks>
1034         /// <example>
1035         /// The following example demonstrates how to use the SetSelectionHandleMarkerImage method.
1036         /// <code>
1037         /// var selectionHandleMarkerImage = new Tizen.NUI.Text.SelectionHandleImage();
1038         /// selectionHandleMarkerImage.LeftImageUrl = "handle_pressed_downleft.png";
1039         /// selectionHandleMarkerImage.RightImageUrl = "handle_pressed_downright.png";
1040         /// field.SetSelectionHandleMarkerImage(selectionHandleMarkerImage);
1041         /// </code>
1042         /// </example>
1043         [EditorBrowsable(EditorBrowsableState.Never)]
1044         public void SetSelectionHandleMarkerImage(SelectionHandleImage selectionHandleMarkerImage)
1045         {
1046             if (!String.IsNullOrEmpty(selectionHandleMarkerImage.LeftImageUrl))
1047             {
1048                 using (var leftImageMap = TextMapHelper.GetFileNameMap(selectionHandleMarkerImage.LeftImageUrl))
1049                 {
1050                     SetValue(SelectionHandleMarkerImageLeftProperty, leftImageMap);
1051                 }
1052             }
1053
1054             if (!String.IsNullOrEmpty(selectionHandleMarkerImage.RightImageUrl))
1055             {
1056                 using (var rightImageMap = TextMapHelper.GetFileNameMap(selectionHandleMarkerImage.RightImageUrl))
1057                 {
1058                     SetValue(SelectionHandleMarkerImageRightProperty, rightImageMap);
1059                 }
1060             }
1061         }
1062
1063         /// <summary>
1064         /// Get SelectionHandleMarkerImage from TextField. <br />
1065         /// </summary>
1066         /// <returns>The SelectionHandleMarkerImage</returns>
1067         /// <remarks>
1068         /// <see cref="Tizen.NUI.Text.SelectionHandleImage"/>
1069         /// </remarks>
1070         [EditorBrowsable(EditorBrowsableState.Never)]
1071         public SelectionHandleImage GetSelectionHandleMarkerImage()
1072         {
1073             SelectionHandleImage selectionHandleImage;
1074             using (var leftImageMap = (PropertyMap)GetValue(SelectionHandleMarkerImageLeftProperty))
1075             using (var rightImageMap = (PropertyMap)GetValue(SelectionHandleMarkerImageRightProperty))
1076             {
1077                 selectionHandleImage = TextMapHelper.GetSelectionHandleImageStruct(leftImageMap, rightImageMap);
1078             }
1079             return selectionHandleImage;
1080         }
1081
1082         /// <summary>
1083         /// The SelectionHighlightColor property.<br />
1084         /// The color of the selection highlight.<br />
1085         /// </summary>
1086         /// <remarks>
1087         /// The property cascade chaining set is possible. For example, this (textField.SelectionHighlightColor.X = 0.1f;) is possible.
1088         /// </remarks>
1089         /// <since_tizen> 3 </since_tizen>
1090         public Vector4 SelectionHighlightColor
1091         {
1092             get
1093             {
1094                 Vector4 temp = (Vector4)GetValue(SelectionHighlightColorProperty);
1095                 return new Vector4(OnSelectionHighlightColorChanged, temp.X, temp.Y, temp.Z, temp.W);
1096             }
1097             set
1098             {
1099                 SetValue(SelectionHighlightColorProperty, value);
1100                 NotifyPropertyChanged();
1101             }
1102         }
1103
1104         /// <summary>
1105         /// The DecorationBoundingBox property.<br />
1106         /// The decorations (handles etc) will positioned within this area on-screen.<br />
1107         /// </summary>
1108         /// <remarks>
1109         /// The property cascade chaining set is possible. For example, this (textField.DecorationBoundingBox.X = 0.1f;) is possible.
1110         /// </remarks>
1111         /// <since_tizen> 3 </since_tizen>
1112         public Rectangle DecorationBoundingBox
1113         {
1114             get
1115             {
1116                 Rectangle temp = (Rectangle)GetValue(DecorationBoundingBoxProperty);
1117                 return new Rectangle(OnDecorationBoundingBoxChanged, temp.X, temp.Y, temp.Width, temp.Height);
1118             }
1119             set
1120             {
1121                 SetValue(DecorationBoundingBoxProperty, value);
1122                 NotifyPropertyChanged();
1123             }
1124         }
1125
1126         /// <summary>
1127         /// The InputMethodSettings property.<br />
1128         /// The settings to relating to the System's Input Method, Key and Value.<br />
1129         /// </summary>
1130         /// <remarks>
1131         /// <see cref="InputMethod"/> is a class encapsulating the input method map. Please use the <see cref="InputMethod"/> class for this property.
1132         /// </remarks>
1133         /// <example>
1134         /// The following example demonstrates how to set the InputMethodSettings property.
1135         /// <code>
1136         /// InputMethod method = new InputMethod();
1137         /// method.PanelLayout = InputMethod.PanelLayoutType.Normal;
1138         /// method.ActionButton = InputMethod.ActionButtonTitleType.Default;
1139         /// method.AutoCapital = InputMethod.AutoCapitalType.Word;
1140         /// method.Variation = 1;
1141         /// textField.InputMethodSettings = method.OutputMap;
1142         /// </code>
1143         /// </example>
1144         /// <since_tizen> 3 </since_tizen>
1145         public PropertyMap InputMethodSettings
1146         {
1147             get
1148             {
1149                 return (PropertyMap)GetValue(InputMethodSettingsProperty);
1150             }
1151             set
1152             {
1153                 SetValue(InputMethodSettingsProperty, value);
1154                 NotifyPropertyChanged();
1155             }
1156         }
1157
1158         /// <summary>
1159         /// The InputColor property.<br />
1160         /// The color of the new input text.<br />
1161         /// </summary>
1162         /// <remarks>
1163         /// The property cascade chaining set is possible. For example, this (textField.InputColor.X = 0.1f;) is possible.
1164         /// </remarks>
1165         /// <since_tizen> 3 </since_tizen>
1166         public Vector4 InputColor
1167         {
1168             get
1169             {
1170                 Vector4 temp = (Vector4)GetValue(InputColorProperty);
1171                 return new Vector4(OnInputColorChanged, temp.X, temp.Y, temp.Z, temp.W);
1172             }
1173             set
1174             {
1175                 SetValue(InputColorProperty, value);
1176                 NotifyPropertyChanged();
1177             }
1178         }
1179
1180         /// <summary>
1181         /// The EnableMarkup property.<br />
1182         /// Whether the mark-up processing is enabled.<br />
1183         /// </summary>
1184         /// <since_tizen> 3 </since_tizen>
1185         public bool EnableMarkup
1186         {
1187             get
1188             {
1189                 return (bool)GetValue(EnableMarkupProperty);
1190             }
1191             set
1192             {
1193                 SetValue(EnableMarkupProperty, value);
1194                 NotifyPropertyChanged();
1195             }
1196         }
1197
1198         /// <summary>
1199         /// The InputFontFamily property.<br />
1200         /// The font's family of the new input text.<br />
1201         /// </summary>
1202         /// <since_tizen> 3 </since_tizen>
1203         public string InputFontFamily
1204         {
1205             get
1206             {
1207                 return (string)GetValue(InputFontFamilyProperty);
1208             }
1209             set
1210             {
1211                 SetValue(InputFontFamilyProperty, value);
1212                 NotifyPropertyChanged();
1213             }
1214         }
1215
1216         /// <summary>
1217         /// The InputFontStyle property.<br />
1218         /// The font's style of the new input text.<br />
1219         /// The inputFontStyle map contains the following keys :<br />
1220         /// <list type="table">
1221         /// <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>
1222         /// <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>
1223         /// <item><term>slant (string)</term><description>The slant key defines whether to use italics. (values: normal, roman, italic, oblique)</description></item>
1224         /// </list>
1225         /// </summary>
1226         /// <since_tizen> 3 </since_tizen>
1227         [System.Diagnostics.CodeAnalysis.SuppressMessage("Naming", "CA1721: Property names should not match get methods")]
1228         public PropertyMap InputFontStyle
1229         {
1230             get
1231             {
1232                 return (PropertyMap)GetValue(InputFontStyleProperty);
1233             }
1234             set
1235             {
1236                 SetValue(InputFontStyleProperty, value);
1237                 NotifyPropertyChanged();
1238             }
1239         }
1240
1241         /// <summary>
1242         /// Set InputFontStyle to TextField. <br />
1243         /// </summary>
1244         /// <param name="fontStyle">The FontStyle</param>
1245         /// <remarks>
1246         /// SetInputFontStyle specifies the requested font style for new input text through <see cref="Tizen.NUI.Text.FontStyle"/>. <br />
1247         /// </remarks>
1248         /// <example>
1249         /// The following example demonstrates how to use the SetInputFontStyle method.
1250         /// <code>
1251         /// var fontStyle = new Tizen.NUI.Text.FontStyle();
1252         /// fontStyle.Width = FontWidthType.Expanded;
1253         /// fontStyle.Weight = FontWeightType.Bold;
1254         /// fontStyle.Slant = FontSlantType.Italic;
1255         /// field.SetInputFontStyle(fontStyle);
1256         /// </code>
1257         /// </example>
1258         [EditorBrowsable(EditorBrowsableState.Never)]
1259         public void SetInputFontStyle(FontStyle fontStyle)
1260         {
1261             using (var fontStyleMap = TextMapHelper.GetFontStyleMap(fontStyle))
1262             {
1263                 SetValue(InputFontStyleProperty, fontStyleMap);
1264             }
1265         }
1266
1267         /// <summary>
1268         /// Get InputFontStyle from TextField. <br />
1269         /// </summary>
1270         /// <returns>The FontStyle</returns>
1271         /// <remarks>
1272         /// <see cref="Tizen.NUI.Text.FontStyle"/>
1273         /// </remarks>
1274         [EditorBrowsable(EditorBrowsableState.Never)]
1275         public FontStyle GetInputFontStyle()
1276         {
1277             FontStyle fontStyle;
1278             using (var fontStyleMap = (PropertyMap)GetValue(InputFontStyleProperty))
1279             {
1280                 fontStyle = TextMapHelper.GetFontStyleStruct(fontStyleMap);
1281             }
1282             return fontStyle;
1283         }
1284
1285         /// <summary>
1286         /// The InputPointSize property.<br />
1287         /// The font's size of the new input text in points.<br />
1288         /// </summary>
1289         /// <since_tizen> 3 </since_tizen>
1290         [Binding.TypeConverter(typeof(PointSizeTypeConverter))]
1291         public float InputPointSize
1292         {
1293             get
1294             {
1295                 return (float)GetValue(InputPointSizeProperty);
1296             }
1297             set
1298             {
1299                 SetValue(InputPointSizeProperty, value);
1300                 NotifyPropertyChanged();
1301             }
1302         }
1303
1304         /// <summary>
1305         /// The Underline property.<br />
1306         /// The default underline parameters.<br />
1307         /// The underline map contains the following keys :<br />
1308         /// <list type="table">
1309         /// <item><term>enable (bool)</term><description>Whether the underline is enabled (the default value is false)</description></item>
1310         /// <item><term>color (Color)</term><description>The color of the underline (If not provided then the color of the text is used)</description></item>
1311         /// <item><term>height (float)</term><description>The height in pixels of the underline (the default value is 1.f)</description></item>
1312         /// </list>
1313         /// </summary>
1314         /// <since_tizen> 3 </since_tizen>
1315         [System.Diagnostics.CodeAnalysis.SuppressMessage("Naming", "CA1721: Property names should not match get methods")]
1316         public PropertyMap Underline
1317         {
1318             get
1319             {
1320                 return (PropertyMap)GetValue(UnderlineProperty);
1321             }
1322             set
1323             {
1324                 SetValue(UnderlineProperty, value);
1325                 NotifyPropertyChanged();
1326             }
1327         }
1328
1329         /// <summary>
1330         /// Set Underline to TextField. <br />
1331         /// </summary>
1332         /// <param name="underline">The Underline</param>
1333         /// <remarks>
1334         /// SetUnderline specifies the underline of the text through <see cref="Tizen.NUI.Text.Underline"/>. <br />
1335         /// </remarks>
1336         /// <example>
1337         /// The following example demonstrates how to use the SetUnderline method.
1338         /// <code>
1339         /// var underline = new Tizen.NUI.Text.Underline();
1340         /// underline.Enable = true;
1341         /// underline.Color = new Color("#3498DB");
1342         /// underline.Height = 2.0f;
1343         /// field.SetUnderline(underline);
1344         /// </code>
1345         /// </example>
1346         [EditorBrowsable(EditorBrowsableState.Never)]
1347         public void SetUnderline(Underline underline)
1348         {
1349             using (var underlineMap = TextMapHelper.GetUnderlineMap(underline))
1350             {
1351                 SetValue(UnderlineProperty, underlineMap);
1352             }
1353         }
1354
1355         /// <summary>
1356         /// Get Underline from TextField. <br />
1357         /// </summary>
1358         /// <returns>The Underline</returns>
1359         /// <remarks>
1360         /// <see cref="Tizen.NUI.Text.Underline"/>
1361         /// </remarks>
1362         [EditorBrowsable(EditorBrowsableState.Never)]
1363         public Underline GetUnderline()
1364         {
1365             Underline underline;
1366             using (var underlineMap = (PropertyMap)GetValue(UnderlineProperty))
1367             {
1368                 underline = TextMapHelper.GetUnderlineStruct(underlineMap);
1369             }
1370             return underline;
1371         }
1372
1373         /// <summary>
1374         /// The InputUnderline property.<br />
1375         /// The underline parameters of the new input text.<br />
1376         /// </summary>
1377         /// <since_tizen> 3 </since_tizen>
1378         public string InputUnderline
1379         {
1380             get
1381             {
1382                 return (string)GetValue(InputUnderlineProperty);
1383             }
1384             set
1385             {
1386                 SetValue(InputUnderlineProperty, value);
1387                 NotifyPropertyChanged();
1388             }
1389         }
1390
1391         /// <summary>
1392         /// The Shadow property.<br />
1393         /// The default shadow parameters.<br />
1394         /// The shadow map contains the following keys :<br />
1395         /// <list type="table">
1396         /// <item><term>color (Color)</term><description>The color of the shadow (the default color is Color.Black)</description></item>
1397         /// <item><term>offset (Vector2)</term><description>The offset in pixels of the shadow (If not provided then the shadow is not enabled)</description></item>
1398         /// <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>
1399         /// </list>
1400         /// </summary>
1401         /// <since_tizen> 3 </since_tizen>
1402         [System.Diagnostics.CodeAnalysis.SuppressMessage("Naming", "CA1721: Property names should not match get methods")]
1403         public PropertyMap Shadow
1404         {
1405             get
1406             {
1407                 return (PropertyMap)GetValue(ShadowProperty);
1408             }
1409             set
1410             {
1411                 SetValue(ShadowProperty, value);
1412                 NotifyPropertyChanged();
1413             }
1414         }
1415
1416         /// <summary>
1417         /// Set Shadow to TextField. <br />
1418         /// </summary>
1419         /// <param name="shadow">The Shadow</param>
1420         /// <remarks>
1421         /// SetShadow specifies the shadow of the text through <see cref="Tizen.NUI.Text.Shadow"/>. <br />
1422         /// </remarks>
1423         /// <example>
1424         /// The following example demonstrates how to use the SetShadow method.
1425         /// <code>
1426         /// var shadow = new Tizen.NUI.Text.Shadow();
1427         /// shadow.Offset = new Vector2(3, 3);
1428         /// shadow.Color = new Color("#F1C40F");
1429         /// field.SetShadow(shadow);
1430         /// </code>
1431         /// </example>
1432         [EditorBrowsable(EditorBrowsableState.Never)]
1433         public void SetShadow(Tizen.NUI.Text.Shadow shadow)
1434         {
1435             using (var shadowMap = TextMapHelper.GetShadowMap(shadow))
1436             {
1437                 SetValue(ShadowProperty, shadowMap);
1438             }
1439         }
1440
1441         /// <summary>
1442         /// Get Shadow from TextField. <br />
1443         /// </summary>
1444         /// <returns>The Shadow</returns>
1445         /// <remarks>
1446         /// <see cref="Tizen.NUI.Text.Shadow"/>
1447         /// </remarks>
1448         [EditorBrowsable(EditorBrowsableState.Never)]
1449         public Tizen.NUI.Text.Shadow GetShadow()
1450         {
1451             Tizen.NUI.Text.Shadow shadow;
1452             using (var shadowMap = (PropertyMap)GetValue(ShadowProperty))
1453             {
1454                 shadow = TextMapHelper.GetShadowStruct(shadowMap);
1455             }
1456             return shadow;
1457         }
1458
1459         /// <summary>
1460         /// The InputShadow property.<br />
1461         /// The shadow parameters of the new input text.<br />
1462         /// </summary>
1463         /// <since_tizen> 3 </since_tizen>
1464         public string InputShadow
1465         {
1466             get
1467             {
1468                 return (string)GetValue(InputShadowProperty);
1469             }
1470             set
1471             {
1472                 SetValue(InputShadowProperty, value);
1473                 NotifyPropertyChanged();
1474             }
1475         }
1476
1477         /// <summary>
1478         /// The Emboss property.<br />
1479         /// The default emboss parameters.<br />
1480         /// </summary>
1481         /// <since_tizen> 3 </since_tizen>
1482         public string Emboss
1483         {
1484             get
1485             {
1486                 return (string)GetValue(EmbossProperty);
1487             }
1488             set
1489             {
1490                 SetValue(EmbossProperty, value);
1491                 NotifyPropertyChanged();
1492             }
1493         }
1494
1495         /// <summary>
1496         /// The InputEmboss property.<br />
1497         /// The emboss parameters of the new input text.<br />
1498         /// </summary>
1499         /// <since_tizen> 3 </since_tizen>
1500         public string InputEmboss
1501         {
1502             get
1503             {
1504                 return (string)GetValue(InputEmbossProperty);
1505             }
1506             set
1507             {
1508                 SetValue(InputEmbossProperty, value);
1509                 NotifyPropertyChanged();
1510             }
1511         }
1512
1513         /// <summary>
1514         /// The Outline property.<br />
1515         /// The default outline parameters.<br />
1516         /// The outline map contains the following keys :<br />
1517         /// <list type="table">
1518         /// <item><term>color (Color)</term><description>The color of the outline (the default color is Color.White)</description></item>
1519         /// <item><term>width (float)</term><description>The width in pixels of the outline (If not provided then the outline is not enabled)</description></item>
1520         /// </list>
1521         /// </summary>
1522         /// <since_tizen> 3 </since_tizen>
1523         [System.Diagnostics.CodeAnalysis.SuppressMessage("Naming", "CA1721: Property names should not match get methods")]
1524         public PropertyMap Outline
1525         {
1526             get
1527             {
1528                 return (PropertyMap)GetValue(OutlineProperty);
1529             }
1530             set
1531             {
1532                 SetValue(OutlineProperty, value);
1533                 NotifyPropertyChanged();
1534             }
1535         }
1536
1537         /// <summary>
1538         /// Set Outline to TextField. <br />
1539         /// </summary>
1540         /// <param name="outline">The Outline</param>
1541         /// <remarks>
1542         /// SetOutline specifies the outline of the text through <see cref="Tizen.NUI.Text.Outline"/>. <br />
1543         /// </remarks>
1544         /// <example>
1545         /// The following example demonstrates how to use the SetOutline method.
1546         /// <code>
1547         /// var outline = new Tizen.NUI.Text.Outline();
1548         /// outline.Width = 2.0f;
1549         /// outline.Color = new Color("#45B39D");
1550         /// field.SetOutline(outline);
1551         /// </code>
1552         /// </example>
1553         [EditorBrowsable(EditorBrowsableState.Never)]
1554         public void SetOutline(Outline outline)
1555         {
1556             using (var outlineMap = TextMapHelper.GetOutlineMap(outline))
1557             {
1558                 SetValue(OutlineProperty, outlineMap);
1559             }
1560         }
1561
1562         /// <summary>
1563         /// Get Outline from TextField. <br />
1564         /// </summary>
1565         /// <returns>The Outline</returns>
1566         /// <remarks>
1567         /// <see cref="Tizen.NUI.Text.Outline"/>
1568         /// </remarks>
1569         [EditorBrowsable(EditorBrowsableState.Never)]
1570         public Outline GetOutline()
1571         {
1572             Outline outline;
1573             using (var outlineMap = (PropertyMap)GetValue(OutlineProperty))
1574             {
1575                 outline = TextMapHelper.GetOutlineStruct(outlineMap);
1576             }
1577             return outline;
1578         }
1579
1580         /// <summary>
1581         /// The InputOutline property.<br />
1582         /// The outline parameters of the new input text.<br />
1583         /// </summary>
1584         /// <since_tizen> 3 </since_tizen>
1585         public string InputOutline
1586         {
1587             get
1588             {
1589                 return (string)GetValue(InputOutlineProperty);
1590             }
1591             set
1592             {
1593                 SetValue(InputOutlineProperty, value);
1594                 NotifyPropertyChanged();
1595             }
1596         }
1597
1598         /// <summary>
1599         /// The HiddenInputSettings property.<br />
1600         /// Hides the input characters and instead shows a default character for password or pin entry.<br />
1601         /// The hiddenInputSettings map contains the following keys :<br />
1602         /// <list type="table">
1603         /// <item><term>HiddenInputProperty.Mode (int)</term><description>The mode for input text display (Use HiddenInputModeType)</description></item>
1604         /// <item><term>HiddenInputProperty.SubstituteCharacter (int)</term><description>All input characters are substituted by this character</description></item>
1605         /// <item><term>HiddenInputProperty.SubstituteCount (int)</term><description>Length of text to show or hide, available when HideCount/ShowCount mode is used</description></item>
1606         /// <item><term>HiddenInputProperty.ShowLastCharacterDuration (int)</term><description>Hide last character after this duration, available when ShowLastCharacter mode</description></item>
1607         /// </list>
1608         /// </summary>
1609         /// <remarks>
1610         /// See <see cref="HiddenInputProperty"/> and <see cref="HiddenInputModeType"/> for a detailed description.
1611         /// </remarks>
1612         /// <example>
1613         /// The following example demonstrates how to set the HiddenInputSettings property.
1614         /// <code>
1615         /// PropertyMap map = new PropertyMap();
1616         /// map.Add(HiddenInputProperty.Mode, new PropertyValue((int)HiddenInputModeType.ShowLastCharacter));
1617         /// map.Add(HiddenInputProperty.ShowLastCharacterDuration, new PropertyValue(500));
1618         /// map.Add(HiddenInputProperty.SubstituteCharacter, new PropertyValue(0x2A));
1619         /// textField.HiddenInputSettings = map;
1620         /// </code>
1621         /// </example>
1622         /// <since_tizen> 3 </since_tizen>
1623         public Tizen.NUI.PropertyMap HiddenInputSettings
1624         {
1625             get
1626             {
1627                 return (PropertyMap)GetValue(HiddenInputSettingsProperty);
1628             }
1629             set
1630             {
1631                 SetValue(HiddenInputSettingsProperty, value);
1632                 NotifyPropertyChanged();
1633             }
1634         }
1635
1636         /// <summary>
1637         /// Set HiddenInput to TextField. <br />
1638         /// </summary>
1639         /// <param name="hiddenInput">The HiddenInput</param>
1640         /// <remarks>
1641         /// SetHiddenInput specifies the requested font style through <see cref="Tizen.NUI.Text.HiddenInput"/>. <br />
1642         /// </remarks>
1643         /// <example>
1644         /// The following example demonstrates how to use the SetHiddenInput method.
1645         /// <code>
1646         /// var hiddenInput = new Tizen.NUI.Text.HiddenInput();
1647         /// hiddenInput.Mode = HiddenInputModeType.ShowLastCharacter;
1648         /// hiddenInput.SubstituteCharacter = '★';
1649         /// hiddenInput.SubstituteCount = 0;
1650         /// hiddenInput.ShowLastCharacterDuration = 1000;
1651         /// field.SetHiddenInput(hiddenInput);
1652         /// </code>
1653         /// </example>
1654         [EditorBrowsable(EditorBrowsableState.Never)]
1655         public void SetHiddenInput(HiddenInput hiddenInput)
1656         {
1657             using (var hiddenInputMap = TextMapHelper.GetHiddenInputMap(hiddenInput))
1658             {
1659                 SetValue(HiddenInputSettingsProperty, hiddenInputMap);
1660             }
1661         }
1662
1663         /// <summary>
1664         /// Get HiddenInput from TextField. <br />
1665         /// </summary>
1666         /// <returns>The HiddenInput</returns>
1667         /// <remarks>
1668         /// <see cref="Tizen.NUI.Text.HiddenInput"/>
1669         /// </remarks>
1670         [EditorBrowsable(EditorBrowsableState.Never)]
1671         public HiddenInput GetHiddenInput()
1672         {
1673             HiddenInput hiddenInput;
1674             using (var hiddenInputMap = (PropertyMap)GetValue(HiddenInputSettingsProperty))
1675             {
1676                 hiddenInput = TextMapHelper.GetHiddenInputStruct(hiddenInputMap);
1677             }
1678             return hiddenInput;
1679         }
1680
1681         /// <summary>
1682         /// The PixelSize property.<br />
1683         /// The size of font in pixels.<br />
1684         /// </summary>
1685         /// <since_tizen> 3 </since_tizen>
1686         [Binding.TypeConverter(typeof(FloatGraphicsTypeConverter))]
1687         public float PixelSize
1688         {
1689             get
1690             {
1691                 return (float)GetValue(PixelSizeProperty);
1692             }
1693             set
1694             {
1695                 SetValue(PixelSizeProperty, value);
1696                 NotifyPropertyChanged();
1697             }
1698         }
1699
1700         /// <summary>
1701         /// The Enable selection property.<br />
1702         /// Enables Text selection, such as the cursor, handle, clipboard, and highlight color.<br />
1703         /// </summary>
1704         /// <since_tizen> 3 </since_tizen>
1705         public bool EnableSelection
1706         {
1707             get
1708             {
1709                 return (bool)GetValue(EnableSelectionProperty);
1710             }
1711             set
1712             {
1713                 SetValue(EnableSelectionProperty, value);
1714                 NotifyPropertyChanged();
1715             }
1716         }
1717
1718         /// <summary>
1719         /// The Enable grab handle property.<br />
1720         /// Enables the grab handles for text selection.<br />
1721         /// The default value is true, which means the grab handles are enabled by default.<br />
1722         /// </summary>
1723         /// This will be public opened in next release of tizen after ACR done. Before ACR, it is used as HiddenAPI (InhouseAPI).
1724         [EditorBrowsable(EditorBrowsableState.Never)]
1725         public bool EnableGrabHandle
1726         {
1727             get
1728             {
1729                 return (bool)GetValue(EnableGrabHandleProperty);
1730             }
1731             set
1732             {
1733                 SetValue(EnableGrabHandleProperty, value);
1734                 NotifyPropertyChanged();
1735             }
1736         }
1737
1738         /// <summary>
1739         /// The Enable grab handle popup property.<br />
1740         /// Enables the grab handle popup for text selection.<br />
1741         /// The default value is true, which means the grab handle popup is enabled by default.<br />
1742         /// </summary>
1743         /// This will be public opened in next release of tizen after ACR done. Before ACR, it is used as HiddenAPI (InhouseAPI).
1744         [EditorBrowsable(EditorBrowsableState.Never)]
1745         public bool EnableGrabHandlePopup
1746         {
1747             get
1748             {
1749                 return (bool)GetValue(EnableGrabHandlePopupProperty);
1750             }
1751             set
1752             {
1753                 SetValue(EnableGrabHandlePopupProperty, value);
1754                 NotifyPropertyChanged();
1755             }
1756         }
1757
1758         /// <summary>
1759         /// The portion of the text that has been selected by the user.
1760         /// </summary>
1761         /// <remarks>
1762         /// Empty string when nothing is selected.
1763         /// </remarks>
1764         /// <since_tizen> 9 </since_tizen>
1765         public string SelectedText
1766         {
1767             get
1768             {
1769                 string selectedText;
1770                 using (var propertyValue = GetProperty(TextField.Property.SelectedText))
1771                 {
1772                     propertyValue.Get(out selectedText);
1773                 }
1774                 return selectedText;
1775             }
1776         }
1777
1778         /// <summary>
1779         /// The start index for selection.
1780         /// </summary>
1781         /// <remarks>
1782         /// When there is no selection, the index is current cursor position.
1783         /// </remarks>
1784         /// <since_tizen> 9 </since_tizen>
1785         public int SelectedTextStart
1786         {
1787             get
1788             {
1789                 int selectedTextStart;
1790                 using (var propertyValue = GetProperty(TextField.Property.SelectedTextStart))
1791                 {
1792                     propertyValue.Get(out selectedTextStart);
1793                 }
1794                 return selectedTextStart;
1795             }
1796         }
1797
1798         /// <summary>
1799         /// The end index for selection.
1800         /// </summary>
1801         /// <remarks>
1802         /// When there is no selection, the index is current cursor position.
1803         /// </remarks>
1804         /// <since_tizen> 9 </since_tizen>
1805         public int SelectedTextEnd
1806         {
1807             get
1808             {
1809                 int selectedTextEnd;
1810                 using (var propertyValue = GetProperty(TextField.Property.SelectedTextEnd))
1811                 {
1812                     propertyValue.Get(out selectedTextEnd);
1813                 }
1814                 return selectedTextEnd;
1815             }
1816         }
1817
1818         /// <summary>
1819         /// Enable editing in text control.
1820         /// </summary>
1821         /// This will be public opened in next release of tizen after ACR done. Before ACR, it is used as HiddenAPI (InhouseAPI).
1822         [EditorBrowsable(EditorBrowsableState.Never)]
1823         public bool EnableEditing
1824         {
1825             get
1826             {
1827                 return (bool)GetValue(EnableEditingProperty);
1828             }
1829             set
1830             {
1831                 SetValue(EnableEditingProperty, value);
1832             }
1833         }
1834
1835         private bool InternalEnableEditing
1836         {
1837             get
1838             {
1839                 bool enableEditing;
1840                 using (var propertyValue = GetProperty(TextField.Property.EnableEditing))
1841                 {
1842                     propertyValue.Get(out enableEditing);
1843                 }
1844                 return enableEditing;
1845             }
1846             set
1847             {
1848                 using (var propertyValue = new PropertyValue(value))
1849                 {
1850                     SetProperty(TextField.Property.EnableEditing, propertyValue);
1851                     NotifyPropertyChanged();
1852                 }
1853             }
1854         }
1855
1856         /// <summary>
1857         /// Specify primary cursor (caret) position in text control.
1858         /// </summary>
1859         [EditorBrowsable(EditorBrowsableState.Never)]
1860         public int PrimaryCursorPosition
1861         {
1862             get
1863             {
1864                 return (int)GetValue(PrimaryCursorPositionProperty);
1865             }
1866             set
1867             {
1868                 SetValue(PrimaryCursorPositionProperty, value);
1869             }
1870         }
1871
1872         private int InternalPrimaryCursorPosition
1873         {
1874             get
1875             {
1876                 int primaryCursorPosition;
1877                 using (var propertyValue = GetProperty(TextField.Property.PrimaryCursorPosition))
1878                 {
1879                     propertyValue.Get(out primaryCursorPosition);
1880                 }
1881                 return primaryCursorPosition;
1882             }
1883             set
1884             {
1885                 using (PropertyValue propertyValue = new PropertyValue(value))
1886                 {
1887                     SetProperty(TextField.Property.PrimaryCursorPosition, propertyValue);
1888                     NotifyPropertyChanged();
1889                 }
1890             }
1891         }
1892
1893         /// <summary>
1894         /// The GrabHandleColor property.
1895         /// </summary>
1896         /// <remarks>
1897         /// The property cascade chaining set is possible. For example, this (textField.GrabHandleColor.X = 0.1f;) is possible.
1898         /// </remarks>
1899         [EditorBrowsable(EditorBrowsableState.Never)]
1900         public Color GrabHandleColor
1901         {
1902             get
1903             {
1904                 Color temp = (Color)GetValue(GrabHandleColorProperty);
1905                 return new Color(OnGrabHandleColorChanged, temp.R, temp.G, temp.B, temp.A);
1906             }
1907             set
1908             {
1909                 SetValue(GrabHandleColorProperty, value);
1910                 NotifyPropertyChanged();
1911             }
1912         }
1913
1914         /// <summary>
1915         /// The ellipsis position of the text.
1916         /// Specifies which portion of the text should be replaced with an ellipsis when the text size exceeds the layout size.<br />
1917         /// </summary>
1918         /// <since_tizen> 9 </since_tizen>
1919         public EllipsisPosition EllipsisPosition
1920         {
1921             get
1922             {
1923                 return (EllipsisPosition)GetValue(EllipsisPositionProperty);
1924             }
1925             set
1926             {
1927                 SetValue(EllipsisPositionProperty, value);
1928                 NotifyPropertyChanged();
1929             }
1930         }
1931
1932         /// <summary>
1933         /// The spaces between characters in Pixels.
1934         /// <remarks>
1935         /// A positive value will make the characters far apart (expanded) and a negative value will bring them closer (condensed).<br />
1936         /// The default value is 0.f which does nothing.
1937         ///</remarks>
1938         /// </summary>
1939         [EditorBrowsable(EditorBrowsableState.Never)]
1940         public float CharacterSpacing
1941         {
1942             get
1943             {
1944                 return (float)GetValue(CharacterSpacingProperty);
1945             }
1946             set
1947             {
1948                 SetValue(CharacterSpacingProperty, value);
1949                 NotifyPropertyChanged();
1950             }
1951         }
1952
1953         /// <summary>
1954         /// Set InputFilter to TextField.
1955         /// </summary>
1956         /// <param name="inputFilter">The InputFilter</param>
1957         /// <remarks>
1958         /// <see cref="Tizen.NUI.Text.InputFilter"/> filters input based on regular expressions. <br />
1959         /// InputFiltered signal is emitted when the input is filtered by InputFilter <br />
1960         /// See <see cref="InputFiltered"/>, <see cref="InputFilterType"/> and <see cref="InputFilteredEventArgs"/> for a detailed description.
1961         /// </remarks>
1962         /// <example>
1963         /// The following example demonstrates how to use the SetInputFilter method.
1964         /// <code>
1965         /// var inputFilter = new Tizen.NUI.Text.InputFilter();
1966         /// inputFilter.Accepted = @"[\d]"; // accept whole digits
1967         /// inputFilter.Rejected = "[0-3]"; // reject 0, 1, 2, 3
1968         /// field.SetInputFilter(inputFilter); // acceptable inputs are 4, 5, 6, 7, 8, 9
1969         /// </code>
1970         /// </example>
1971         /// <since_tizen> 9 </since_tizen>
1972         public void SetInputFilter(InputFilter inputFilter)
1973         {
1974             using (var map = TextMapHelper.GetInputFilterMap(inputFilter))
1975             using (var propertyValue = new PropertyValue(map))
1976             {
1977                 SetProperty(TextField.Property.InputFilter, propertyValue);
1978             }
1979         }
1980
1981         /// <summary>
1982         /// Get InputFilter from TextField.
1983         /// </summary>
1984         /// <returns>The InputFilter</returns>
1985         /// <remarks>
1986         /// <see cref="Tizen.NUI.Text.InputFilter"/>
1987         /// </remarks>
1988         /// <since_tizen> 9 </since_tizen>
1989         public InputFilter GetInputFilter()
1990         {
1991             InputFilter inputFilter;
1992             using (var propertyValue = GetProperty(TextField.Property.InputFilter))
1993             using (var map = new PropertyMap())
1994             {
1995                 propertyValue.Get(map);
1996                 inputFilter = TextMapHelper.GetInputFilterStruct(map);
1997             }
1998             return inputFilter;
1999         }
2000
2001         /// <summary>
2002         /// Set Strikethrough to TextField. <br />
2003         /// </summary>
2004         /// <param name="strikethrough">The Strikethrough</param>
2005         /// <remarks>
2006         /// SetStrikethrough specifies the strikethrough of the text through <see cref="Tizen.NUI.Text.Strikethrough"/>. <br />
2007         /// </remarks>
2008         /// <example>
2009         /// The following example demonstrates how to use the SetStrikethrough method.
2010         /// <code>
2011         /// var strikethrough = new Tizen.NUI.Text.Strikethrough();
2012         /// strikethrough.Enable = true;
2013         /// strikethrough.Color = new Color("#3498DB");
2014         /// strikethrough.Height = 2.0f;
2015         /// field.SetStrikethrough(strikethrough);
2016         /// </code>
2017         /// </example>
2018         [EditorBrowsable(EditorBrowsableState.Never)]
2019         public void SetStrikethrough(Strikethrough strikethrough)
2020         {
2021             using (var map = TextMapHelper.GetStrikethroughMap(strikethrough))
2022             using (var propertyValue = new PropertyValue(map))
2023             {
2024                 SetProperty(TextField.Property.Strikethrough, propertyValue);
2025             }
2026         }
2027
2028         /// <summary>
2029         /// Get Strikethrough from TextField. <br />
2030         /// </summary>
2031         /// <returns>The Strikethrough</returns>
2032         /// <remarks>
2033         /// <see cref="Tizen.NUI.Text.Strikethrough"/>
2034         /// </remarks>
2035         [EditorBrowsable(EditorBrowsableState.Never)]
2036         public Strikethrough GetStrikethrough()
2037         {
2038             Strikethrough strikethrough;
2039             using (var propertyValue = GetProperty(TextField.Property.Strikethrough))
2040             using (var map = new PropertyMap())
2041             {
2042                 propertyValue.Get(map);
2043                 strikethrough = TextMapHelper.GetStrikethroughStruct(map);
2044             }
2045             return strikethrough;
2046         }
2047
2048         /// <summary>
2049         /// The Placeholder property.
2050         /// The placeholder map contains the following keys :<br />
2051         /// <list type="table">
2052         /// <item><term>text (string)</term><description>The text to display when the TextField is empty and inactive</description></item>
2053         /// <item><term>textFocused (string)</term><description>The text to display when the placeholder has focus</description></item>
2054         /// <item><term>color (Color)</term><description>The color of the placeholder text</description></item>
2055         /// <item><term>fontFamily (string)</term><description>The fontFamily of the placeholder text</description></item>
2056         /// <item><term>fontStyle (PropertyMap)</term><description>The fontStyle of the placeholder text</description></item>
2057         /// <item><term>pointSize (float)</term><description>The pointSize of the placeholder text</description></item>
2058         /// <item><term>pixelSize (float)</term><description>The pixelSize of the placeholder text</description></item>
2059         /// <item><term>ellipsis (bool)</term><description>The ellipsis of the placeholder text</description></item>
2060         /// </list>
2061         /// </summary>
2062         /// <example>
2063         /// The following example demonstrates how to set the Placeholder property.
2064         /// <code>
2065         /// PropertyMap propertyMap = new PropertyMap();
2066         /// propertyMap.Add("text", new PropertyValue("Setting Placeholder Text"));
2067         /// propertyMap.Add("textFocused", new PropertyValue("Setting Placeholder Text Focused"));
2068         /// propertyMap.Add("color", new PropertyValue(Color.Red));
2069         /// propertyMap.Add("fontFamily", new PropertyValue("Arial"));
2070         /// propertyMap.Add("pointSize", new PropertyValue(12.0f));
2071         ///
2072         /// PropertyMap fontStyleMap = new PropertyMap();
2073         /// fontStyleMap.Add("weight", new PropertyValue("bold"));
2074         /// fontStyleMap.Add("width", new PropertyValue("condensed"));
2075         /// fontStyleMap.Add("slant", new PropertyValue("italic"));
2076         /// propertyMap.Add("fontStyle", new PropertyValue(fontStyleMap));
2077         ///
2078         /// TextField field = new TextField();
2079         /// field.Placeholder = propertyMap;
2080         /// </code>
2081         /// </example>
2082         /// <since_tizen> 3 </since_tizen>
2083         [System.Diagnostics.CodeAnalysis.SuppressMessage("Naming", "CA1721: Property names should not match get methods")]
2084         public Tizen.NUI.PropertyMap Placeholder
2085         {
2086             get
2087             {
2088                 PropertyMap map = (PropertyMap)GetValue(PlaceholderProperty);
2089                 string defalutText = "";
2090
2091                 if (TextMapHelper.IsValue(map, 0))
2092                     map.Add("text", TextMapHelper.GetStringFromMap(map, 0, defalutText));
2093
2094                 if (TextMapHelper.IsValue(map, 1))
2095                     map.Add("textFocused", TextMapHelper.GetStringFromMap(map, 1, defalutText));
2096
2097                 if (TextMapHelper.IsValue(map, 2))
2098                 {
2099                     using (var color = TextMapHelper.GetColorFromMap(map, 2))
2100                     {
2101                         map.Add("color", color);
2102                     }
2103                 }
2104
2105                 if (TextMapHelper.IsValue(map, 3))
2106                     map.Add("fontFamily", TextMapHelper.GetStringFromMap(map, 3, defalutText));
2107
2108                 if (TextMapHelper.IsValue(map, 4))
2109                 {
2110                     using (var properyValue = map.Find(4))
2111                     using (var fontStyle = new PropertyMap())
2112                     {
2113                         properyValue.Get(fontStyle);
2114                         using (var fontStyleValue = new PropertyValue(fontStyle))
2115                         {
2116                             map.Add("fontStyle", fontStyleValue);
2117                         }
2118                     }
2119                 }
2120
2121                 if (TextMapHelper.IsValue(map, 5))
2122                     map.Add("pointSize", TextMapHelper.GetNullableFloatFromMap(map, 5));
2123
2124                 if (TextMapHelper.IsValue(map, 6))
2125                     map.Add("pixelSize", TextMapHelper.GetNullableFloatFromMap(map, 6));
2126
2127                 if (TextMapHelper.IsValue(map, 7))
2128                     map.Add("ellipsis", TextMapHelper.GetBoolFromMap(map, 7, false));
2129
2130                 return map;
2131             }
2132             set
2133             {
2134                 SetValue(PlaceholderProperty, value);
2135                 NotifyPropertyChanged();
2136             }
2137         }
2138
2139         /// <summary>
2140         /// Set Placeholder to TextField. <br />
2141         /// </summary>
2142         /// <param name="placeholder">The Placeholder</param>
2143         /// <remarks>
2144         /// SetPlaceholder specifies the attributes of the placeholder property through <see cref="Tizen.NUI.Text.Placeholder"/>. <br />
2145         /// </remarks>
2146         /// <example>
2147         /// The following example demonstrates how to use the SetPlaceholder method.
2148         /// <code>
2149         /// var placeholder = new Tizen.NUI.Text.Placeholder();
2150         /// placeholder.Text = "placeholder text";
2151         /// placeholder.TextFocused = "placeholder textFocused";
2152         /// placeholder.Color = new Color("#45B39D");
2153         /// placeholder.FontFamily = "BreezeSans";
2154         /// placeholder.FontStyle = new Tizen.NUI.Text.FontStyle()
2155         /// {
2156         ///     Width = FontWidthType.Expanded,
2157         ///     Weight = FontWeightType.ExtraLight,
2158         ///     Slant = FontSlantType.Italic,
2159         /// };
2160         /// placeholder.PointSize = 25.0f;
2161         /// //placeholder.PixelSize = 50.0f;
2162         /// placeholder.Ellipsis = true;
2163         /// field.SetPlaceholder(placeholder);
2164         /// </code>
2165         /// </example>
2166         [EditorBrowsable(EditorBrowsableState.Never)]
2167         public void SetPlaceholder(Placeholder placeholder)
2168         {
2169             using (var placeholderMap = TextMapHelper.GetPlaceholderMap(placeholder))
2170             {
2171                 SetValue(PlaceholderProperty, placeholderMap);
2172             }
2173         }
2174
2175         /// <summary>
2176         /// Get Placeholder from TextField. <br />
2177         /// </summary>
2178         /// <returns>The Placeholder</returns>
2179         /// <remarks>
2180         /// <see cref="Tizen.NUI.Text.Placeholder"/>
2181         /// </remarks>
2182         [EditorBrowsable(EditorBrowsableState.Never)]
2183         public Placeholder GetPlaceholder()
2184         {
2185             Placeholder placeholder;
2186             using (var placeholderMap = (PropertyMap)GetValue(PlaceholderProperty))
2187             {
2188                 placeholder = TextMapHelper.GetPlaceholderStruct(placeholderMap);
2189             }
2190             return placeholder;
2191         }
2192
2193         /// <summary>
2194         /// The Ellipsis property.<br />
2195         /// Enable or disable the ellipsis.<br />
2196         /// Placeholder PropertyMap is used to add ellipsis to placeholder text.
2197         /// </summary>
2198         /// <since_tizen> 4 </since_tizen>
2199         public bool Ellipsis
2200         {
2201             get
2202             {
2203                 return (bool)GetValue(EllipsisProperty);
2204             }
2205             set
2206             {
2207                 SetValue(EllipsisProperty, value);
2208                 NotifyPropertyChanged();
2209             }
2210         }
2211
2212         /// <summary>
2213         /// Enables selection of the text using the Shift key.
2214         /// </summary>
2215         /// This will be public opened in next release of tizen after ACR done. Before ACR, it is used as HiddenAPI (InhouseAPI).
2216         [EditorBrowsable(EditorBrowsableState.Never)]
2217         public bool EnableShiftSelection
2218         {
2219             get
2220             {
2221                 return (bool)GetValue(EnableShiftSelectionProperty);
2222             }
2223             set
2224             {
2225                 SetValue(EnableShiftSelectionProperty, value);
2226                 NotifyPropertyChanged();
2227             }
2228         }
2229
2230         /// <summary>
2231         /// The text alignment to match the direction of the system language.<br />
2232         /// The default value is true.<br />
2233         /// </summary>
2234         /// <since_tizen> 6 </since_tizen>
2235         public bool MatchSystemLanguageDirection
2236         {
2237             get
2238             {
2239                 return (bool)GetValue(MatchSystemLanguageDirectionProperty);
2240             }
2241             set
2242             {
2243                 SetValue(MatchSystemLanguageDirectionProperty, value);
2244                 NotifyPropertyChanged();
2245             }
2246         }
2247
2248         /// <summary>
2249         /// The FontSizeScale property. <br />
2250         /// The default value is 1.0. <br />
2251         /// The given font size scale value is used for multiplying the specified font size before querying fonts. <br />
2252         /// If FontSizeScale.UseSystemSetting, will use the SystemSettings.FontSize internally. <br />
2253         /// </summary>
2254         /// <since_tizen> 9 </since_tizen>
2255         public float FontSizeScale
2256         {
2257             get
2258             {
2259                 return fontSizeScale;
2260             }
2261             set
2262             {
2263                 float newFontSizeScale;
2264
2265                 if (fontSizeScale == value) return;
2266
2267                 fontSizeScale = value;
2268                 if (fontSizeScale == Tizen.NUI.FontSizeScale.UseSystemSetting)
2269                 {
2270                     SystemSettingsFontSize systemSettingsFontSize;
2271
2272                     try
2273                     {
2274                         systemSettingsFontSize = SystemSettings.FontSize;
2275                     }
2276                     catch (Exception e)
2277                     {
2278                         Console.WriteLine("{0} Exception caught.", e);
2279                         systemSettingsFontSize = SystemSettingsFontSize.Normal;
2280                     }
2281                     newFontSizeScale = TextUtils.GetFontSizeScale(systemSettingsFontSize);
2282                     addFontSizeChangedCallback();
2283                 }
2284                 else
2285                 {
2286                     newFontSizeScale = fontSizeScale;
2287                     removeFontSizeChangedCallback();
2288                 }
2289
2290                 SetValue(FontSizeScaleProperty, newFontSizeScale);
2291                 NotifyPropertyChanged();
2292             }
2293         }
2294
2295         /// <summary>
2296         /// The EnableFontSizeScale property.<br />
2297         /// Whether the font size scale is enabled. (The default value is true)
2298         /// </summary>
2299         [EditorBrowsable(EditorBrowsableState.Never)]
2300         public bool EnableFontSizeScale
2301         {
2302             get
2303             {
2304                 return (bool)GetValue(EnableFontSizeScaleProperty);
2305             }
2306             set
2307             {
2308                 SetValue(EnableFontSizeScaleProperty, value);
2309                 NotifyPropertyChanged();
2310             }
2311         }
2312
2313         /// <summary>
2314         /// Get the InputMethodContext instance.
2315         /// </summary>
2316         /// <returns>The InputMethodContext instance.</returns>
2317         /// <since_tizen> 5 </since_tizen>
2318         public InputMethodContext GetInputMethodContext()
2319         {
2320             if (inputMethodCotext == null)
2321             {
2322                 /*Avoid raising InputMethodContext reference count.*/
2323                 inputMethodCotext = new InputMethodContext(Interop.TextField.GetInputMethodContext(SwigCPtr), true);
2324                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
2325             }
2326             return inputMethodCotext;
2327         }
2328
2329         /// <summary>
2330         /// Select the whole text.
2331         /// </summary>
2332         /// <since_tizen> 9 </since_tizen>
2333         public void SelectWholeText()
2334         {
2335             Interop.TextField.SelectWholeText(SwigCPtr);
2336             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
2337         }
2338
2339         /// <summary>
2340         /// Select text from start to end index. <br />
2341         /// The index is valid when 0 or positive.
2342         /// </summary>
2343         /// <param name="start">The start index for selection.</param>
2344         /// <param name="end">The end index for selection.</param>
2345         /// <remarks>
2346         /// If the end index exceeds the maximum value, it is set to the length of the text.
2347         /// </remarks>
2348         /// <since_tizen> 9 </since_tizen>
2349         public void SelectText(int start, int end)
2350         {
2351             if (start < 0)
2352                 throw new global::System.ArgumentOutOfRangeException(nameof(start), "Value is less than zero");
2353             if (end < 0)
2354                 throw new global::System.ArgumentOutOfRangeException(nameof(end), "Value is less than zero");
2355
2356             Interop.TextField.SelectText(SwigCPtr, (uint)start, (uint)end);
2357             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
2358         }
2359
2360         /// <summary>
2361         /// Clear selection of the text. <br />
2362         /// Valid when selection is activate.
2363         /// </summary>
2364         /// <since_tizen> 9 </since_tizen>
2365         public void SelectNone()
2366         {
2367             _ = Interop.TextField.SelectNone(SwigCPtr);
2368             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
2369         }
2370
2371         internal SWIGTYPE_p_Dali__SignalT_void_fDali__Toolkit__TextField_Dali__Toolkit__TextField__InputStyle__MaskF_t InputStyleChangedSignal()
2372         {
2373             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));
2374             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
2375             return ret;
2376         }
2377
2378         /// <summary>
2379         /// Dispose.
2380         /// </summary>
2381         /// <since_tizen> 3 </since_tizen>
2382         protected override void Dispose(DisposeTypes type)
2383         {
2384             if (disposed)
2385             {
2386                 DisposeQueue.Instance.Add(this);
2387                 return;
2388             }
2389
2390             if (systemlangTextFlag)
2391             {
2392                 SystemSettings.LocaleLanguageChanged -= SystemSettings_LocaleLanguageChanged;
2393             }
2394
2395             removeFontSizeChangedCallback();
2396
2397             if (type == DisposeTypes.Explicit)
2398             {
2399                 //Called by User
2400                 //Release your own managed resources here.
2401                 //You should release all of your own disposable objects here.
2402             }
2403
2404             //Release your own unmanaged resources here.
2405             //You should not access any managed member here except static instance.
2406             //because the execution order of Finalizes is non-deterministic.
2407             if (this.HasBody())
2408             {
2409                 if (textFieldCursorPositionChangedCallbackDelegate != null)
2410                 {
2411                     this.CursorPositionChangedSignal().Disconnect(textFieldCursorPositionChangedCallbackDelegate);
2412                 }
2413
2414                 if (textFieldMaxLengthReachedCallbackDelegate != null)
2415                 {
2416                     this.MaxLengthReachedSignal().Disconnect(textFieldMaxLengthReachedCallbackDelegate);
2417                 }
2418
2419                 if (textFieldSelectionStartedCallbackDelegate != null)
2420                 {
2421                     this.SelectionStartedSignal().Disconnect(textFieldSelectionStartedCallbackDelegate);
2422                 }
2423
2424                 if (textFieldSelectionClearedCallbackDelegate != null)
2425                 {
2426                     this.SelectionClearedSignal().Disconnect(textFieldSelectionClearedCallbackDelegate);
2427                 }
2428
2429                 if (textFieldSelectionChangedCallbackDelegate != null)
2430                 {
2431                     this.SelectionChangedSignal().Disconnect(textFieldSelectionChangedCallbackDelegate);
2432                 }
2433
2434                 if (textFieldTextChangedCallbackDelegate != null)
2435                 {
2436                     TextChangedSignal().Disconnect(textFieldTextChangedCallbackDelegate);
2437                 }
2438             }
2439
2440             TextChanged -= TextFieldTextChanged;
2441
2442             base.Dispose(type);
2443         }
2444
2445         /// This will not be public opened.
2446         [EditorBrowsable(EditorBrowsableState.Never)]
2447         protected override void ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef swigCPtr)
2448         {
2449             // In order to speed up IME hide, temporarily add
2450             GetInputMethodContext()?.DestroyContext();
2451             Interop.TextField.DeleteTextField(swigCPtr);
2452         }
2453
2454         internal override LayoutItem CreateDefaultLayout()
2455         {
2456             return new TextFieldLayout();
2457         }
2458
2459         internal void SetTextWithoutTextChanged(string text)
2460         {
2461             invokeTextChanged = false;
2462             Tizen.NUI.Object.SetProperty((System.Runtime.InteropServices.HandleRef)SwigCPtr, TextField.Property.TEXT, new Tizen.NUI.PropertyValue(text));
2463             invokeTextChanged = true;
2464         }
2465
2466         private string SetTranslatable(string textFieldSid)
2467         {
2468             string translatableText = null;
2469             translatableText = NUIApplication.MultilingualResourceManager?.GetString(textFieldSid, new CultureInfo(SystemSettings.LocaleLanguage.Replace("_", "-")));
2470             if (translatableText != null)
2471             {
2472                 if (systemlangTextFlag == false)
2473                 {
2474                     SystemSettings.LocaleLanguageChanged += SystemSettings_LocaleLanguageChanged;
2475                     systemlangTextFlag = true;
2476                 }
2477                 return translatableText;
2478             }
2479             else
2480             {
2481                 translatableText = "";
2482                 return translatableText;
2483             }
2484         }
2485
2486         private void SystemSettings_LocaleLanguageChanged(object sender, LocaleLanguageChangedEventArgs e)
2487         {
2488             if (textFieldTextSid != null)
2489             {
2490                 Text = NUIApplication.MultilingualResourceManager?.GetString(textFieldTextSid, new CultureInfo(e.Value.Replace("_", "-")));
2491             }
2492             if (textFieldPlaceHolderTextSid != null)
2493             {
2494                 PlaceholderText = NUIApplication.MultilingualResourceManager?.GetString(textFieldPlaceHolderTextSid, new CultureInfo(e.Value.Replace("_", "-")));
2495             }
2496             if (textFieldPlaceHolderTextFocusedSid != null)
2497             {
2498                 PlaceholderTextFocused = NUIApplication.MultilingualResourceManager?.GetString(textFieldPlaceHolderTextFocusedSid, new CultureInfo(e.Value.Replace("_", "-")));
2499             }
2500         }
2501
2502         private void SystemSettingsFontSizeChanged(object sender, FontSizeChangedEventArgs e)
2503         {
2504             float newFontSizeScale = TextUtils.GetFontSizeScale(e.Value);
2505             SetValue(FontSizeScaleProperty, newFontSizeScale);
2506             NotifyPropertyChanged();
2507         }
2508
2509         private void addFontSizeChangedCallback()
2510         {
2511             if (hasFontSizeChangedCallback != true)
2512             {
2513                 try
2514                 {
2515                     SystemSettings.FontSizeChanged += SystemSettingsFontSizeChanged;
2516                     hasFontSizeChangedCallback = true;
2517                 }
2518                 catch (Exception e)
2519                 {
2520                     Console.WriteLine("{0} Exception caught.", e);
2521                     hasFontSizeChangedCallback = false;
2522                 }
2523             }
2524         }
2525
2526         private void removeFontSizeChangedCallback()
2527         {
2528             if (hasFontSizeChangedCallback == true)
2529             {
2530                 try
2531                 {
2532                     SystemSettings.FontSizeChanged -= SystemSettingsFontSizeChanged;
2533                     hasFontSizeChangedCallback = false;
2534                 }
2535                 catch (Exception e)
2536                 {
2537                     Console.WriteLine("{0} Exception caught.", e);
2538                     hasFontSizeChangedCallback = true;
2539                 }
2540             }
2541         }
2542
2543         private void TextFieldTextChanged(object sender, TextChangedEventArgs e)
2544         {
2545             if (!isSettingTextInCSharp)
2546             {
2547                 EnforceNotifyBindedInstance(TextProperty);
2548             }
2549         }
2550
2551         internal new class Property
2552         {
2553             internal static readonly int TEXT = Interop.TextField.TextGet();
2554             internal static readonly int PlaceholderText = Interop.TextField.PlaceholderTextGet();
2555             internal static readonly int PlaceholderTextFocused = Interop.TextField.PlaceholderTextFocusedGet();
2556             internal static readonly int FontFamily = Interop.TextField.FontFamilyGet();
2557             internal static readonly int FontStyle = Interop.TextField.FontStyleGet();
2558             internal static readonly int PointSize = Interop.TextField.PointSizeGet();
2559             internal static readonly int MaxLength = Interop.TextField.MaxLengthGet();
2560             internal static readonly int ExceedPolicy = Interop.TextField.ExceedPolicyGet();
2561             internal static readonly int HorizontalAlignment = Interop.TextField.HorizontalAlignmentGet();
2562             internal static readonly int VerticalAlignment = Interop.TextField.VerticalAlignmentGet();
2563             internal static readonly int TextColor = Interop.TextField.TextColorGet();
2564             internal static readonly int PlaceholderTextColor = Interop.TextField.PlaceholderTextColorGet();
2565             internal static readonly int PrimaryCursorColor = Interop.TextField.PrimaryCursorColorGet();
2566             internal static readonly int SecondaryCursorColor = Interop.TextField.SecondaryCursorColorGet();
2567             internal static readonly int EnableCursorBlink = Interop.TextField.EnableCursorBlinkGet();
2568             internal static readonly int CursorBlinkInterval = Interop.TextField.CursorBlinkIntervalGet();
2569             internal static readonly int CursorBlinkDuration = Interop.TextField.CursorBlinkDurationGet();
2570             internal static readonly int CursorWidth = Interop.TextField.CursorWidthGet();
2571             internal static readonly int GrabHandleImage = Interop.TextField.GrabHandleImageGet();
2572             internal static readonly int GrabHandlePressedImage = Interop.TextField.GrabHandlePressedImageGet();
2573             internal static readonly int ScrollThreshold = Interop.TextField.ScrollThresholdGet();
2574             internal static readonly int ScrollSpeed = Interop.TextField.ScrollSpeedGet();
2575             internal static readonly int SelectionHandleImageLeft = Interop.TextField.SelectionHandleImageLeftGet();
2576             internal static readonly int SelectionHandleImageRight = Interop.TextField.SelectionHandleImageRightGet();
2577             internal static readonly int SelectionHandlePressedImageLeft = Interop.TextField.SelectionHandlePressedImageLeftGet();
2578             internal static readonly int SelectionHandlePressedImageRight = Interop.TextField.SelectionHandlePressedImageRightGet();
2579             internal static readonly int SelectionHandleMarkerImageLeft = Interop.TextField.SelectionHandleMarkerImageLeftGet();
2580             internal static readonly int SelectionHandleMarkerImageRight = Interop.TextField.SelectionHandleMarkerImageRightGet();
2581             internal static readonly int SelectionHighlightColor = Interop.TextField.SelectionHighlightColorGet();
2582             internal static readonly int DecorationBoundingBox = Interop.TextField.DecorationBoundingBoxGet();
2583             internal static readonly int InputMethodSettings = Interop.TextField.InputMethodSettingsGet();
2584             internal static readonly int InputColor = Interop.TextField.InputColorGet();
2585             internal static readonly int EnableMarkup = Interop.TextField.EnableMarkupGet();
2586             internal static readonly int InputFontFamily = Interop.TextField.InputFontFamilyGet();
2587             internal static readonly int InputFontStyle = Interop.TextField.InputFontStyleGet();
2588             internal static readonly int InputPointSize = Interop.TextField.InputPointSizeGet();
2589             internal static readonly int UNDERLINE = Interop.TextField.UnderlineGet();
2590             internal static readonly int InputUnderline = Interop.TextField.InputUnderlineGet();
2591             internal static readonly int SHADOW = Interop.TextField.ShadowGet();
2592             internal static readonly int InputShadow = Interop.TextField.InputShadowGet();
2593             internal static readonly int EMBOSS = Interop.TextField.EmbossGet();
2594             internal static readonly int InputEmboss = Interop.TextField.InputEmbossGet();
2595             internal static readonly int OUTLINE = Interop.TextField.OutlineGet();
2596             internal static readonly int InputOutline = Interop.TextField.InputOutlineGet();
2597             internal static readonly int HiddenInputSettings = Interop.TextField.HiddenInputSettingsGet();
2598             internal static readonly int PixelSize = Interop.TextField.PixelSizeGet();
2599             internal static readonly int EnableSelection = Interop.TextField.EnableSelectionGet();
2600             internal static readonly int PLACEHOLDER = Interop.TextField.PlaceholderGet();
2601             internal static readonly int ELLIPSIS = Interop.TextField.EllipsisGet();
2602             internal static readonly int EnableShiftSelection = Interop.TextField.EnableShiftSelectionGet();
2603             internal static readonly int MatchSystemLanguageDirection = Interop.TextField.MatchSystemLanguageDirectionGet();
2604             internal static readonly int EnableGrabHandle = Interop.TextField.EnableGrabHandleGet();
2605             internal static readonly int EnableGrabHandlePopup = Interop.TextField.EnableGrabHandlePopupGet();
2606             internal static readonly int SelectedText = Interop.TextField.SelectedTextGet();
2607             internal static readonly int SelectedTextStart = Interop.TextField.SelectedTextStartGet();
2608             internal static readonly int SelectedTextEnd = Interop.TextField.SelectedTextEndGet();
2609             internal static readonly int EnableEditing = Interop.TextField.EnableEditingGet();
2610             internal static readonly int PrimaryCursorPosition = Interop.TextField.PrimaryCursorPositionGet();
2611             internal static readonly int FontSizeScale = Interop.TextField.FontSizeScaleGet();
2612             internal static readonly int EnableFontSizeScale = Interop.TextField.EnableFontSizeScaleGet();
2613             internal static readonly int GrabHandleColor = Interop.TextField.GrabHandleColorGet();
2614             internal static readonly int EllipsisPosition = Interop.TextField.EllipsisPositionGet();
2615             internal static readonly int InputFilter = Interop.TextField.InputFilterGet();
2616             internal static readonly int Strikethrough = Interop.TextField.StrikethroughGet();
2617             internal static readonly int CharacterSpacing = Interop.TextField.CharacterSpacingGet();
2618         }
2619
2620         internal class InputStyle
2621         {
2622             internal enum Mask
2623             {
2624                 None = 0x0000,
2625                 Color = 0x0001,
2626                 FontFamily = 0x0002,
2627                 PointSize = 0x0004,
2628                 FontStyle = 0x0008,
2629                 Underline = 0x0010,
2630                 Shadow = 0x0020,
2631                 Emboss = 0x0040,
2632                 Outline = 0x0080
2633             }
2634         }
2635
2636         private void OnDecorationBoundingBoxChanged(int x, int y, int width, int height)
2637         {
2638             DecorationBoundingBox = new Rectangle(x, y, width, height);
2639         }
2640         private void OnInputColorChanged(float x, float y, float z, float w)
2641         {
2642             InputColor = new Vector4(x, y, z, w);
2643         }
2644         private void OnPlaceholderTextColorChanged(float r, float g, float b, float a)
2645         {
2646             PlaceholderTextColor = new Vector4(r, g, b, a);
2647         }
2648         private void OnPrimaryCursorColorChanged(float x, float y, float z, float w)
2649         {
2650             PrimaryCursorColor = new Vector4(x, y, z, w);
2651         }
2652         private void OnSecondaryCursorColorChanged(float x, float y, float z, float w)
2653         {
2654             SecondaryCursorColor = new Vector4(x, y, z, w);
2655         }
2656         private void OnSelectionHighlightColorChanged(float x, float y, float z, float w)
2657         {
2658             SelectionHighlightColor = new Vector4(x, y, z, w);
2659         }
2660         private void OnShadowColorChanged(float x, float y, float z, float w)
2661         {
2662             ShadowColor = new Vector4(x, y, z, w);
2663         }
2664         private void OnShadowOffsetChanged(float x, float y)
2665         {
2666             ShadowOffset = new Vector2(x, y);
2667         }
2668         private void OnTextColorChanged(float r, float g, float b, float a)
2669         {
2670             TextColor = new Color(r, g, b, a);
2671         }
2672         private void OnGrabHandleColorChanged(float r, float g, float b, float a)
2673         {
2674             GrabHandleColor = new Color(r, g, b, a);
2675         }
2676
2677         private class TextFieldLayout : LayoutItem
2678         {
2679             protected override void OnMeasure(MeasureSpecification widthMeasureSpec, MeasureSpecification heightMeasureSpec)
2680             {
2681                 // Padding will be automatically applied by DALi TextField.
2682                 var totalWidth = widthMeasureSpec.Size.AsDecimal();
2683                 var totalHeight = heightMeasureSpec.Size.AsDecimal();
2684                 var minSize = Owner.MinimumSize;
2685                 var maxSize = Owner.MaximumSize;
2686                 var naturalSize = Owner.GetNaturalSize();
2687
2688                 if (((TextField)Owner).Text.Length == 0)
2689                 {
2690                     // Calculate height of TextField by setting Text with " ".
2691                     // By calling SetTextWithoutTextChanged, TextChanged callback is not called for this.
2692                     ((TextField)Owner).SetTextWithoutTextChanged(" ");
2693
2694                     // Store original WidthSpecification to restore it after setting ResizePolicy.
2695                     var widthSpecification = Owner.WidthSpecification;
2696
2697                     // In DALi's Size logic, if Width or Height is set to be 0, then
2698                     // ResizePolicy is not changed to Fixed.
2699                     // This causes Size changes after NUI Layout's OnMeasure is finished.
2700                     // e.g. TextField's Width fills to its parent although Text is null and
2701                     //      WidthSpecification is WrapContent.
2702                     // To prevent the Size changes, WidthResizePolicy is set to be Fixed
2703                     // in advance if Text is null.
2704                     Owner.WidthResizePolicy = ResizePolicyType.Fixed;
2705
2706                     // Restore WidthSpecification because ResizePolicy changes WidthSpecification.
2707                     Owner.WidthSpecification = widthSpecification;
2708
2709                     naturalSize = Owner.GetNaturalSize();
2710
2711                     // Restore TextField's Text after calculating height of TextField.
2712                     // By calling SetTextWithoutTextChanged, TextChanged callback is not called for this.
2713                     ((TextField)Owner).SetTextWithoutTextChanged("");
2714                 }
2715
2716                 if (widthMeasureSpec.Mode != MeasureSpecification.ModeType.Exactly)
2717                 {
2718                     totalWidth = Math.Min(Math.Max(naturalSize.Width, minSize.Width), maxSize.Width);
2719                 }
2720
2721                 if (heightMeasureSpec.Mode != MeasureSpecification.ModeType.Exactly)
2722                 {
2723                     totalHeight = Math.Min(Math.Max(naturalSize.Height, minSize.Height), maxSize.Height);
2724                 }
2725
2726                 widthMeasureSpec = new MeasureSpecification(new LayoutLength(totalWidth), MeasureSpecification.ModeType.Exactly);
2727                 heightMeasureSpec = new MeasureSpecification(new LayoutLength(totalHeight), MeasureSpecification.ModeType.Exactly);
2728
2729                 MeasuredSize.StateType childWidthState = MeasuredSize.StateType.MeasuredSizeOK;
2730                 MeasuredSize.StateType childHeightState = MeasuredSize.StateType.MeasuredSizeOK;
2731
2732                 SetMeasuredDimensions(ResolveSizeAndState(new LayoutLength(totalWidth), widthMeasureSpec, childWidthState),
2733                                       ResolveSizeAndState(new LayoutLength(totalHeight), heightMeasureSpec, childHeightState));
2734             }
2735         }
2736     }
2737 }