[NUI] Add SelectionStarted event (#3912)
[platform/core/csapi/tizenfx.git] / src / Tizen.NUI / src / public / BaseComponents / TextField.cs
1 /*
2  * Copyright(c) 2021 Samsung Electronics Co., Ltd.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  *
16  */
17 extern alias TizenSystemSettings;
18 using TizenSystemSettings.Tizen.System;
19
20 using System;
21 using System.Globalization;
22 using System.ComponentModel;
23 using Tizen.NUI.Binding;
24 using Tizen.NUI.Text;
25
26 namespace Tizen.NUI.BaseComponents
27 {
28     /// <summary>
29     /// A control which provides a single line editable text field.
30     /// </summary>
31     /// <since_tizen> 3 </since_tizen>
32     public partial class TextField : View
33     {
34         private string textFieldTextSid = null;
35         private string textFieldPlaceHolderTextSid = null;
36         private string textFieldPlaceHolderTextFocusedSid = null;
37         private bool systemlangTextFlag = false;
38         private InputMethodContext inputMethodCotext = null;
39         private float fontSizeScale = 1.0f;
40         private bool hasFontSizeChangedCallback = false;
41
42         static TextField() { }
43
44         /// <summary>
45         /// Creates the TextField control.
46         /// </summary>
47         /// <since_tizen> 3 </since_tizen>
48         public TextField() : this(Interop.TextField.New(), true)
49         {
50             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
51         }
52
53         /// <summary>
54         /// Creates the TextField with setting the status of shown or hidden.
55         /// </summary>
56         /// <param name="shown">false : Not displayed (hidden), true : displayed (shown)</param>
57         /// This will be public opened in next release of tizen after ACR done. Before ACR, it is used as HiddenAPI (InhouseAPI).
58         [EditorBrowsable(EditorBrowsableState.Never)]
59         public TextField(bool shown) : this(Interop.TextField.New(), true)
60         {
61             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
62             SetVisible(shown);
63         }
64
65         /// <summary>
66         /// Get attributes, it is abstract function and must be override.
67         /// </summary>
68         [EditorBrowsable(EditorBrowsableState.Never)]
69         protected override ViewStyle CreateViewStyle()
70         {
71             return new TextFieldStyle();
72         }
73
74         internal TextField(global::System.IntPtr cPtr, bool cMemoryOwn, ViewStyle viewStyle, bool shown = true) : base(cPtr, cMemoryOwn, viewStyle)
75         {
76             if (!shown)
77             {
78                 SetVisible(false);
79             }
80         }
81
82         internal TextField(global::System.IntPtr cPtr, bool cMemoryOwn, bool shown = true) : base(cPtr, cMemoryOwn, null)
83         {
84             if (!shown)
85             {
86                 SetVisible(false);
87             }
88         }
89
90         internal TextField(TextField handle, bool shown = true) : this(Interop.TextField.NewTextField(TextField.getCPtr(handle)), true)
91         {
92             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
93
94             if (!shown)
95             {
96                 SetVisible(false);
97             }
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                 SetValueAndForceSendChangeSignal(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         public float PixelSize
1687         {
1688             get
1689             {
1690                 return (float)GetValue(PixelSizeProperty);
1691             }
1692             set
1693             {
1694                 SetValue(PixelSizeProperty, value);
1695                 NotifyPropertyChanged();
1696             }
1697         }
1698
1699         /// <summary>
1700         /// The Enable selection property.<br />
1701         /// Enables Text selection, such as the cursor, handle, clipboard, and highlight color.<br />
1702         /// </summary>
1703         /// <since_tizen> 3 </since_tizen>
1704         public bool EnableSelection
1705         {
1706             get
1707             {
1708                 return (bool)GetValue(EnableSelectionProperty);
1709             }
1710             set
1711             {
1712                 SetValue(EnableSelectionProperty, value);
1713                 NotifyPropertyChanged();
1714             }
1715         }
1716
1717         /// <summary>
1718         /// The Enable grab handle property.<br />
1719         /// Enables the grab handles for text selection.<br />
1720         /// The default value is true, which means the grab handles are enabled by default.<br />
1721         /// </summary>
1722         /// This will be public opened in next release of tizen after ACR done. Before ACR, it is used as HiddenAPI (InhouseAPI).
1723         [EditorBrowsable(EditorBrowsableState.Never)]
1724         public bool EnableGrabHandle
1725         {
1726             get
1727             {
1728                 return (bool)GetValue(EnableGrabHandleProperty);
1729             }
1730             set
1731             {
1732                 SetValue(EnableGrabHandleProperty, value);
1733                 NotifyPropertyChanged();
1734             }
1735         }
1736
1737         /// <summary>
1738         /// The Enable grab handle popup property.<br />
1739         /// Enables the grab handle popup for text selection.<br />
1740         /// The default value is true, which means the grab handle popup is enabled by default.<br />
1741         /// </summary>
1742         /// This will be public opened in next release of tizen after ACR done. Before ACR, it is used as HiddenAPI (InhouseAPI).
1743         [EditorBrowsable(EditorBrowsableState.Never)]
1744         public bool EnableGrabHandlePopup
1745         {
1746             get
1747             {
1748                 return (bool)GetValue(EnableGrabHandlePopupProperty);
1749             }
1750             set
1751             {
1752                 SetValue(EnableGrabHandlePopupProperty, value);
1753                 NotifyPropertyChanged();
1754             }
1755         }
1756
1757         /// <summary>
1758         /// The portion of the text that has been selected by the user.
1759         /// </summary>
1760         /// <remarks>
1761         /// Empty string when nothing is selected.
1762         /// </remarks>
1763         /// <since_tizen> 9 </since_tizen>
1764         public string SelectedText
1765         {
1766             get
1767             {
1768                 string selectedText;
1769                 using (var propertyValue = GetProperty(TextField.Property.SelectedText))
1770                 {
1771                     propertyValue.Get(out selectedText);
1772                 }
1773                 return selectedText;
1774             }
1775         }
1776
1777         /// <summary>
1778         /// The start index for selection.
1779         /// </summary>
1780         /// <remarks>
1781         /// When there is no selection, the index is current cursor position.
1782         /// </remarks>
1783         /// <since_tizen> 9 </since_tizen>
1784         public int SelectedTextStart
1785         {
1786             get
1787             {
1788                 int selectedTextStart;
1789                 using (var propertyValue = GetProperty(TextField.Property.SelectedTextStart))
1790                 {
1791                     propertyValue.Get(out selectedTextStart);
1792                 }
1793                 return selectedTextStart;
1794             }
1795         }
1796
1797         /// <summary>
1798         /// The end index for selection.
1799         /// </summary>
1800         /// <remarks>
1801         /// When there is no selection, the index is current cursor position.
1802         /// </remarks>
1803         /// <since_tizen> 9 </since_tizen>
1804         public int SelectedTextEnd
1805         {
1806             get
1807             {
1808                 int selectedTextEnd;
1809                 using (var propertyValue = GetProperty(TextField.Property.SelectedTextEnd))
1810                 {
1811                     propertyValue.Get(out selectedTextEnd);
1812                 }
1813                 return selectedTextEnd;
1814             }
1815         }
1816
1817         /// <summary>
1818         /// Enable editing in text control.
1819         /// </summary>
1820         /// This will be public opened in next release of tizen after ACR done. Before ACR, it is used as HiddenAPI (InhouseAPI).
1821         [EditorBrowsable(EditorBrowsableState.Never)]
1822         public bool EnableEditing
1823         {
1824             get
1825             {
1826                 return (bool)GetValue(EnableEditingProperty);
1827             }
1828             set
1829             {
1830                 SetValue(EnableEditingProperty, value);
1831             }
1832         }
1833
1834         private bool InternalEnableEditing
1835         {
1836             get
1837             {
1838                 bool enableEditing;
1839                 using (var propertyValue = GetProperty(TextField.Property.EnableEditing))
1840                 {
1841                     propertyValue.Get(out enableEditing);
1842                 }
1843                 return enableEditing;
1844             }
1845             set
1846             {
1847                 using (var propertyValue = new PropertyValue(value))
1848                 {
1849                     SetProperty(TextField.Property.EnableEditing, propertyValue);
1850                     NotifyPropertyChanged();
1851                 }
1852             }
1853         }
1854
1855         /// <summary>
1856         /// Specify primary cursor (caret) position in text control.
1857         /// </summary>
1858         [EditorBrowsable(EditorBrowsableState.Never)]
1859         public int PrimaryCursorPosition
1860         {
1861             get
1862             {
1863                 return (int)GetValue(PrimaryCursorPositionProperty);
1864             }
1865             set
1866             {
1867                 SetValue(PrimaryCursorPositionProperty, value);
1868             }
1869         }
1870
1871         private int InternalPrimaryCursorPosition
1872         {
1873             get
1874             {
1875                 int primaryCursorPosition;
1876                 using (var propertyValue = GetProperty(TextField.Property.PrimaryCursorPosition))
1877                 {
1878                     propertyValue.Get(out primaryCursorPosition);
1879                 }
1880                 return primaryCursorPosition;
1881             }
1882             set
1883             {
1884                 using (PropertyValue propertyValue = new PropertyValue(value))
1885                 {
1886                     SetProperty(TextField.Property.PrimaryCursorPosition, propertyValue);
1887                     NotifyPropertyChanged();
1888                 }
1889             }
1890         }
1891
1892         /// <summary>
1893         /// The GrabHandleColor property.
1894         /// </summary>
1895         /// <remarks>
1896         /// The property cascade chaining set is possible. For example, this (textField.GrabHandleColor.X = 0.1f;) is possible.
1897         /// </remarks>
1898         [EditorBrowsable(EditorBrowsableState.Never)]
1899         public Color GrabHandleColor
1900         {
1901             get
1902             {
1903                 Color temp = (Color)GetValue(GrabHandleColorProperty);
1904                 return new Color(OnGrabHandleColorChanged, temp.R, temp.G, temp.B, temp.A);
1905             }
1906             set
1907             {
1908                 SetValue(GrabHandleColorProperty, value);
1909                 NotifyPropertyChanged();
1910             }
1911         }
1912
1913         /// <summary>
1914         /// The ellipsis position of the text.
1915         /// Specifies which portion of the text should be replaced with an ellipsis when the text size exceeds the layout size.<br />
1916         /// </summary>
1917         /// <since_tizen> 9 </since_tizen>
1918         public EllipsisPosition EllipsisPosition
1919         {
1920             get
1921             {
1922                 return (EllipsisPosition)GetValue(EllipsisPositionProperty);
1923             }
1924             set
1925             {
1926                 SetValue(EllipsisPositionProperty, value);
1927                 NotifyPropertyChanged();
1928             }
1929         }
1930
1931         /// <summary>
1932         /// Set InputFilter to TextField.
1933         /// </summary>
1934         /// <param name="inputFilter">The InputFilter</param>
1935         /// <remarks>
1936         /// <see cref="Tizen.NUI.Text.InputFilter"/> filters input based on regular expressions. <br />
1937         /// InputFiltered signal is emitted when the input is filtered by InputFilter <br />
1938         /// See <see cref="InputFiltered"/>, <see cref="InputFilterType"/> and <see cref="InputFilteredEventArgs"/> for a detailed description.
1939         /// </remarks>
1940         /// <example>
1941         /// The following example demonstrates how to use the SetInputFilter method.
1942         /// <code>
1943         /// var inputFilter = new Tizen.NUI.Text.InputFilter();
1944         /// inputFilter.Accepted = @"[\d]"; // accept whole digits
1945         /// inputFilter.Rejected = "[0-3]"; // reject 0, 1, 2, 3
1946         /// field.SetInputFilter(inputFilter); // acceptable inputs are 4, 5, 6, 7, 8, 9
1947         /// </code>
1948         /// </example>
1949         /// <since_tizen> 9 </since_tizen>
1950         public void SetInputFilter(InputFilter inputFilter)
1951         {
1952             using (var map = TextMapHelper.GetInputFilterMap(inputFilter))
1953             using (var propertyValue = new PropertyValue(map))
1954             {
1955                 SetProperty(TextField.Property.InputFilter, propertyValue);
1956             }
1957         }
1958
1959         /// <summary>
1960         /// Get InputFilter from TextField.
1961         /// </summary>
1962         /// <returns>The InputFilter</returns>
1963         /// <remarks>
1964         /// <see cref="Tizen.NUI.Text.InputFilter"/>
1965         /// </remarks>
1966         /// <since_tizen> 9 </since_tizen>
1967         public InputFilter GetInputFilter()
1968         {
1969             InputFilter inputFilter;
1970             using (var propertyValue = GetProperty(TextField.Property.InputFilter))
1971             using (var map = new PropertyMap())
1972             {
1973                 propertyValue.Get(map);
1974                 inputFilter = TextMapHelper.GetInputFilterStruct(map);
1975             }
1976             return inputFilter;
1977         }
1978
1979         /// <summary>
1980         /// Set Strikethrough to TextField. <br />
1981         /// </summary>
1982         /// <param name="strikethrough">The Strikethrough</param>
1983         /// <remarks>
1984         /// SetStrikethrough specifies the strikethrough of the text through <see cref="Tizen.NUI.Text.Strikethrough"/>. <br />
1985         /// </remarks>
1986         /// <example>
1987         /// The following example demonstrates how to use the SetStrikethrough method.
1988         /// <code>
1989         /// var strikethrough = new Tizen.NUI.Text.Strikethrough();
1990         /// strikethrough.Enable = true;
1991         /// strikethrough.Color = new Color("#3498DB");
1992         /// strikethrough.Height = 2.0f;
1993         /// field.SetStrikethrough(strikethrough);
1994         /// </code>
1995         /// </example>
1996         [EditorBrowsable(EditorBrowsableState.Never)]
1997         public void SetStrikethrough(Strikethrough strikethrough)
1998         {
1999             using (var map = TextMapHelper.GetStrikethroughMap(strikethrough))
2000             using (var propertyValue = new PropertyValue(map))
2001             {
2002                 SetProperty(TextField.Property.Strikethrough, propertyValue);
2003             }
2004         }
2005
2006         /// <summary>
2007         /// Get Strikethrough from TextField. <br />
2008         /// </summary>
2009         /// <returns>The Strikethrough</returns>
2010         /// <remarks>
2011         /// <see cref="Tizen.NUI.Text.Strikethrough"/>
2012         /// </remarks>
2013         [EditorBrowsable(EditorBrowsableState.Never)]
2014         public Strikethrough GetStrikethrough()
2015         {
2016             Strikethrough strikethrough;
2017             using (var propertyValue = GetProperty(TextField.Property.Strikethrough))
2018             using (var map = new PropertyMap())
2019             {
2020                 propertyValue.Get(map);
2021                 strikethrough = TextMapHelper.GetStrikethroughStruct(map);
2022             }
2023             return strikethrough;
2024         }
2025
2026         /// <summary>
2027         /// The Placeholder property.
2028         /// The placeholder map contains the following keys :<br />
2029         /// <list type="table">
2030         /// <item><term>text (string)</term><description>The text to display when the TextField is empty and inactive</description></item>
2031         /// <item><term>textFocused (string)</term><description>The text to display when the placeholder has focus</description></item>
2032         /// <item><term>color (Color)</term><description>The color of the placeholder text</description></item>
2033         /// <item><term>fontFamily (string)</term><description>The fontFamily of the placeholder text</description></item>
2034         /// <item><term>fontStyle (PropertyMap)</term><description>The fontStyle of the placeholder text</description></item>
2035         /// <item><term>pointSize (float)</term><description>The pointSize of the placeholder text</description></item>
2036         /// <item><term>pixelSize (float)</term><description>The pixelSize of the placeholder text</description></item>
2037         /// <item><term>ellipsis (bool)</term><description>The ellipsis of the placeholder text</description></item>
2038         /// </list>
2039         /// </summary>
2040         /// <example>
2041         /// The following example demonstrates how to set the Placeholder property.
2042         /// <code>
2043         /// PropertyMap propertyMap = new PropertyMap();
2044         /// propertyMap.Add("text", new PropertyValue("Setting Placeholder Text"));
2045         /// propertyMap.Add("textFocused", new PropertyValue("Setting Placeholder Text Focused"));
2046         /// propertyMap.Add("color", new PropertyValue(Color.Red));
2047         /// propertyMap.Add("fontFamily", new PropertyValue("Arial"));
2048         /// propertyMap.Add("pointSize", new PropertyValue(12.0f));
2049         ///
2050         /// PropertyMap fontStyleMap = new PropertyMap();
2051         /// fontStyleMap.Add("weight", new PropertyValue("bold"));
2052         /// fontStyleMap.Add("width", new PropertyValue("condensed"));
2053         /// fontStyleMap.Add("slant", new PropertyValue("italic"));
2054         /// propertyMap.Add("fontStyle", new PropertyValue(fontStyleMap));
2055         ///
2056         /// TextField field = new TextField();
2057         /// field.Placeholder = propertyMap;
2058         /// </code>
2059         /// </example>
2060         /// <since_tizen> 3 </since_tizen>
2061         [System.Diagnostics.CodeAnalysis.SuppressMessage("Naming", "CA1721: Property names should not match get methods")]
2062         public Tizen.NUI.PropertyMap Placeholder
2063         {
2064             get
2065             {
2066                 PropertyMap map = (PropertyMap)GetValue(PlaceholderProperty);
2067                 string defalutText = "";
2068
2069                 if (TextMapHelper.IsValue(map, 0))
2070                     map.Add("text", TextMapHelper.GetStringFromMap(map, 0, defalutText));
2071
2072                 if (TextMapHelper.IsValue(map, 1))
2073                     map.Add("textFocused", TextMapHelper.GetStringFromMap(map, 1, defalutText));
2074
2075                 if (TextMapHelper.IsValue(map, 2))
2076                 {
2077                     using (var color = TextMapHelper.GetColorFromMap(map, 2))
2078                     {
2079                         map.Add("color", color);
2080                     }
2081                 }
2082
2083                 if (TextMapHelper.IsValue(map, 3))
2084                     map.Add("fontFamily", TextMapHelper.GetStringFromMap(map, 3, defalutText));
2085
2086                 if (TextMapHelper.IsValue(map, 4))
2087                 {
2088                     using (var properyValue = map.Find(4))
2089                     using (var fontStyle = new PropertyMap())
2090                     {
2091                         properyValue.Get(fontStyle);
2092                         using (var fontStyleValue = new PropertyValue(fontStyle))
2093                         {
2094                             map.Add("fontStyle", fontStyleValue);
2095                         }
2096                     }
2097                 }
2098
2099                 if (TextMapHelper.IsValue(map, 5))
2100                     map.Add("pointSize", TextMapHelper.GetNullableFloatFromMap(map, 5));
2101
2102                 if (TextMapHelper.IsValue(map, 6))
2103                     map.Add("pixelSize", TextMapHelper.GetNullableFloatFromMap(map, 6));
2104
2105                 if (TextMapHelper.IsValue(map, 7))
2106                     map.Add("ellipsis", TextMapHelper.GetBoolFromMap(map, 7, false));
2107
2108                 return map;
2109             }
2110             set
2111             {
2112                 SetValue(PlaceholderProperty, value);
2113                 NotifyPropertyChanged();
2114             }
2115         }
2116
2117         /// <summary>
2118         /// Set Placeholder to TextField. <br />
2119         /// </summary>
2120         /// <param name="placeholder">The Placeholder</param>
2121         /// <remarks>
2122         /// SetPlaceholder specifies the attributes of the placeholder property through <see cref="Tizen.NUI.Text.Placeholder"/>. <br />
2123         /// </remarks>
2124         /// <example>
2125         /// The following example demonstrates how to use the SetPlaceholder method.
2126         /// <code>
2127         /// var placeholder = new Tizen.NUI.Text.Placeholder();
2128         /// placeholder.Text = "placeholder text";
2129         /// placeholder.TextFocused = "placeholder textFocused";
2130         /// placeholder.Color = new Color("#45B39D");
2131         /// placeholder.FontFamily = "BreezeSans";
2132         /// placeholder.FontStyle = new Tizen.NUI.Text.FontStyle()
2133         /// {
2134         ///     Width = FontWidthType.Expanded,
2135         ///     Weight = FontWeightType.ExtraLight,
2136         ///     Slant = FontSlantType.Italic,
2137         /// };
2138         /// placeholder.PointSize = 25.0f;
2139         /// //placeholder.PixelSize = 50.0f;
2140         /// placeholder.Ellipsis = true;
2141         /// field.SetPlaceholder(placeholder);
2142         /// </code>
2143         /// </example>
2144         [EditorBrowsable(EditorBrowsableState.Never)]
2145         public void SetPlaceholder(Placeholder placeholder)
2146         {
2147             using (var placeholderMap = TextMapHelper.GetPlaceholderMap(placeholder))
2148             {
2149                 SetValue(PlaceholderProperty, placeholderMap);
2150             }
2151         }
2152
2153         /// <summary>
2154         /// Get Placeholder from TextField. <br />
2155         /// </summary>
2156         /// <returns>The Placeholder</returns>
2157         /// <remarks>
2158         /// <see cref="Tizen.NUI.Text.Placeholder"/>
2159         /// </remarks>
2160         [EditorBrowsable(EditorBrowsableState.Never)]
2161         public Placeholder GetPlaceholder()
2162         {
2163             Placeholder placeholder;
2164             using (var placeholderMap = (PropertyMap)GetValue(PlaceholderProperty))
2165             {
2166                 placeholder = TextMapHelper.GetPlaceholderStruct(placeholderMap);
2167             }
2168             return placeholder;
2169         }
2170
2171         /// <summary>
2172         /// The Ellipsis property.<br />
2173         /// Enable or disable the ellipsis.<br />
2174         /// Placeholder PropertyMap is used to add ellipsis to placeholder text.
2175         /// </summary>
2176         /// <since_tizen> 4 </since_tizen>
2177         public bool Ellipsis
2178         {
2179             get
2180             {
2181                 return (bool)GetValue(EllipsisProperty);
2182             }
2183             set
2184             {
2185                 SetValue(EllipsisProperty, value);
2186                 NotifyPropertyChanged();
2187             }
2188         }
2189
2190         /// <summary>
2191         /// Enables selection of the text using the Shift key.
2192         /// </summary>
2193         /// This will be public opened in next release of tizen after ACR done. Before ACR, it is used as HiddenAPI (InhouseAPI).
2194         [EditorBrowsable(EditorBrowsableState.Never)]
2195         public bool EnableShiftSelection
2196         {
2197             get
2198             {
2199                 return (bool)GetValue(EnableShiftSelectionProperty);
2200             }
2201             set
2202             {
2203                 SetValue(EnableShiftSelectionProperty, value);
2204                 NotifyPropertyChanged();
2205             }
2206         }
2207
2208         /// <summary>
2209         /// The text alignment to match the direction of the system language.<br />
2210         /// The default value is true.<br />
2211         /// </summary>
2212         /// <since_tizen> 6 </since_tizen>
2213         public bool MatchSystemLanguageDirection
2214         {
2215             get
2216             {
2217                 return (bool)GetValue(MatchSystemLanguageDirectionProperty);
2218             }
2219             set
2220             {
2221                 SetValue(MatchSystemLanguageDirectionProperty, value);
2222                 NotifyPropertyChanged();
2223             }
2224         }
2225
2226         /// <summary>
2227         /// The FontSizeScale property. <br />
2228         /// The default value is 1.0. <br />
2229         /// The given font size scale value is used for multiplying the specified font size before querying fonts. <br />
2230         /// If FontSizeScale.UseSystemSetting, will use the SystemSettings.FontSize internally. <br />
2231         /// </summary>
2232         /// <since_tizen> 9 </since_tizen>
2233         public float FontSizeScale
2234         {
2235             get
2236             {
2237                 return fontSizeScale;
2238             }
2239             set
2240             {
2241                 float newFontSizeScale;
2242
2243                 if (fontSizeScale == value) return;
2244
2245                 fontSizeScale = value;
2246                 if (fontSizeScale == Tizen.NUI.FontSizeScale.UseSystemSetting)
2247                 {
2248                     SystemSettingsFontSize systemSettingsFontSize;
2249
2250                     try
2251                     {
2252                         systemSettingsFontSize = SystemSettings.FontSize;
2253                     }
2254                     catch (Exception e)
2255                     {
2256                         Console.WriteLine("{0} Exception caught.", e);
2257                         systemSettingsFontSize = SystemSettingsFontSize.Normal;
2258                     }
2259                     newFontSizeScale = TextUtils.GetFontSizeScale(systemSettingsFontSize);
2260                     addFontSizeChangedCallback();
2261                 }
2262                 else
2263                 {
2264                     newFontSizeScale = fontSizeScale;
2265                     removeFontSizeChangedCallback();
2266                 }
2267
2268                 SetValue(FontSizeScaleProperty, newFontSizeScale);
2269                 NotifyPropertyChanged();
2270             }
2271         }
2272
2273         /// <summary>
2274         /// The EnableFontSizeScale property.<br />
2275         /// Whether the font size scale is enabled. (The default value is true)
2276         /// </summary>
2277         [EditorBrowsable(EditorBrowsableState.Never)]
2278         public bool EnableFontSizeScale
2279         {
2280             get
2281             {
2282                 return (bool)GetValue(EnableFontSizeScaleProperty);
2283             }
2284             set
2285             {
2286                 SetValue(EnableFontSizeScaleProperty, value);
2287                 NotifyPropertyChanged();
2288             }
2289         }
2290
2291         /// Only used by the IL of xaml, will never changed to not hidden.
2292         [EditorBrowsable(EditorBrowsableState.Never)]
2293         public override bool IsCreateByXaml
2294         {
2295             get
2296             {
2297                 return base.IsCreateByXaml;
2298             }
2299             set
2300             {
2301                 base.IsCreateByXaml = value;
2302
2303                 if (value == true)
2304                 {
2305                     this.TextChanged += (obj, e) =>
2306                     {
2307                         this.Text = e.TextField.Text;
2308                     };
2309                 }
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             base.Dispose(type);
2441         }
2442
2443         /// This will not be public opened.
2444         [EditorBrowsable(EditorBrowsableState.Never)]
2445         protected override void ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef swigCPtr)
2446         {
2447             // In order to speed up IME hide, temporarily add
2448             GetInputMethodContext()?.DestroyContext();
2449             Interop.TextField.DeleteTextField(swigCPtr);
2450         }
2451
2452         internal override LayoutItem CreateDefaultLayout()
2453         {
2454             return new TextFieldLayout();
2455         }
2456
2457         internal void SetTextWithoutTextChanged(string text)
2458         {
2459             invokeTextChanged = false;
2460             Tizen.NUI.Object.SetProperty((System.Runtime.InteropServices.HandleRef)SwigCPtr, TextField.Property.TEXT, new Tizen.NUI.PropertyValue(text));
2461             invokeTextChanged = true;
2462         }
2463
2464         private string SetTranslatable(string textFieldSid)
2465         {
2466             string translatableText = null;
2467             translatableText = NUIApplication.MultilingualResourceManager?.GetString(textFieldSid, new CultureInfo(SystemSettings.LocaleLanguage.Replace("_", "-")));
2468             if (translatableText != null)
2469             {
2470                 if (systemlangTextFlag == false)
2471                 {
2472                     SystemSettings.LocaleLanguageChanged += SystemSettings_LocaleLanguageChanged;
2473                     systemlangTextFlag = true;
2474                 }
2475                 return translatableText;
2476             }
2477             else
2478             {
2479                 translatableText = "";
2480                 return translatableText;
2481             }
2482         }
2483
2484         private void SystemSettings_LocaleLanguageChanged(object sender, LocaleLanguageChangedEventArgs e)
2485         {
2486             if (textFieldTextSid != null)
2487             {
2488                 Text = NUIApplication.MultilingualResourceManager?.GetString(textFieldTextSid, new CultureInfo(e.Value.Replace("_", "-")));
2489             }
2490             if (textFieldPlaceHolderTextSid != null)
2491             {
2492                 PlaceholderText = NUIApplication.MultilingualResourceManager?.GetString(textFieldPlaceHolderTextSid, new CultureInfo(e.Value.Replace("_", "-")));
2493             }
2494             if (textFieldPlaceHolderTextFocusedSid != null)
2495             {
2496                 PlaceholderTextFocused = NUIApplication.MultilingualResourceManager?.GetString(textFieldPlaceHolderTextFocusedSid, new CultureInfo(e.Value.Replace("_", "-")));
2497             }
2498         }
2499
2500         private void SystemSettingsFontSizeChanged(object sender, FontSizeChangedEventArgs e)
2501         {
2502             float newFontSizeScale = TextUtils.GetFontSizeScale(e.Value);
2503             SetValue(FontSizeScaleProperty, newFontSizeScale);
2504             NotifyPropertyChanged();
2505         }
2506
2507         private void addFontSizeChangedCallback()
2508         {
2509             if (hasFontSizeChangedCallback != true)
2510             {
2511                 try
2512                 {
2513                     SystemSettings.FontSizeChanged += SystemSettingsFontSizeChanged;
2514                     hasFontSizeChangedCallback = true;
2515                 }
2516                 catch (Exception e)
2517                 {
2518                     Console.WriteLine("{0} Exception caught.", e);
2519                     hasFontSizeChangedCallback = false;
2520                 }
2521             }
2522         }
2523
2524         private void removeFontSizeChangedCallback()
2525         {
2526             if (hasFontSizeChangedCallback == true)
2527             {
2528                 try
2529                 {
2530                     SystemSettings.FontSizeChanged -= SystemSettingsFontSizeChanged;
2531                     hasFontSizeChangedCallback = false;
2532                 }
2533                 catch (Exception e)
2534                 {
2535                     Console.WriteLine("{0} Exception caught.", e);
2536                     hasFontSizeChangedCallback = true;
2537                 }
2538             }
2539         }
2540
2541         internal new class Property
2542         {
2543             internal static readonly int TEXT = Interop.TextField.TextGet();
2544             internal static readonly int PlaceholderText = Interop.TextField.PlaceholderTextGet();
2545             internal static readonly int PlaceholderTextFocused = Interop.TextField.PlaceholderTextFocusedGet();
2546             internal static readonly int FontFamily = Interop.TextField.FontFamilyGet();
2547             internal static readonly int FontStyle = Interop.TextField.FontStyleGet();
2548             internal static readonly int PointSize = Interop.TextField.PointSizeGet();
2549             internal static readonly int MaxLength = Interop.TextField.MaxLengthGet();
2550             internal static readonly int ExceedPolicy = Interop.TextField.ExceedPolicyGet();
2551             internal static readonly int HorizontalAlignment = Interop.TextField.HorizontalAlignmentGet();
2552             internal static readonly int VerticalAlignment = Interop.TextField.VerticalAlignmentGet();
2553             internal static readonly int TextColor = Interop.TextField.TextColorGet();
2554             internal static readonly int PlaceholderTextColor = Interop.TextField.PlaceholderTextColorGet();
2555             internal static readonly int PrimaryCursorColor = Interop.TextField.PrimaryCursorColorGet();
2556             internal static readonly int SecondaryCursorColor = Interop.TextField.SecondaryCursorColorGet();
2557             internal static readonly int EnableCursorBlink = Interop.TextField.EnableCursorBlinkGet();
2558             internal static readonly int CursorBlinkInterval = Interop.TextField.CursorBlinkIntervalGet();
2559             internal static readonly int CursorBlinkDuration = Interop.TextField.CursorBlinkDurationGet();
2560             internal static readonly int CursorWidth = Interop.TextField.CursorWidthGet();
2561             internal static readonly int GrabHandleImage = Interop.TextField.GrabHandleImageGet();
2562             internal static readonly int GrabHandlePressedImage = Interop.TextField.GrabHandlePressedImageGet();
2563             internal static readonly int ScrollThreshold = Interop.TextField.ScrollThresholdGet();
2564             internal static readonly int ScrollSpeed = Interop.TextField.ScrollSpeedGet();
2565             internal static readonly int SelectionHandleImageLeft = Interop.TextField.SelectionHandleImageLeftGet();
2566             internal static readonly int SelectionHandleImageRight = Interop.TextField.SelectionHandleImageRightGet();
2567             internal static readonly int SelectionHandlePressedImageLeft = Interop.TextField.SelectionHandlePressedImageLeftGet();
2568             internal static readonly int SelectionHandlePressedImageRight = Interop.TextField.SelectionHandlePressedImageRightGet();
2569             internal static readonly int SelectionHandleMarkerImageLeft = Interop.TextField.SelectionHandleMarkerImageLeftGet();
2570             internal static readonly int SelectionHandleMarkerImageRight = Interop.TextField.SelectionHandleMarkerImageRightGet();
2571             internal static readonly int SelectionHighlightColor = Interop.TextField.SelectionHighlightColorGet();
2572             internal static readonly int DecorationBoundingBox = Interop.TextField.DecorationBoundingBoxGet();
2573             internal static readonly int InputMethodSettings = Interop.TextField.InputMethodSettingsGet();
2574             internal static readonly int InputColor = Interop.TextField.InputColorGet();
2575             internal static readonly int EnableMarkup = Interop.TextField.EnableMarkupGet();
2576             internal static readonly int InputFontFamily = Interop.TextField.InputFontFamilyGet();
2577             internal static readonly int InputFontStyle = Interop.TextField.InputFontStyleGet();
2578             internal static readonly int InputPointSize = Interop.TextField.InputPointSizeGet();
2579             internal static readonly int UNDERLINE = Interop.TextField.UnderlineGet();
2580             internal static readonly int InputUnderline = Interop.TextField.InputUnderlineGet();
2581             internal static readonly int SHADOW = Interop.TextField.ShadowGet();
2582             internal static readonly int InputShadow = Interop.TextField.InputShadowGet();
2583             internal static readonly int EMBOSS = Interop.TextField.EmbossGet();
2584             internal static readonly int InputEmboss = Interop.TextField.InputEmbossGet();
2585             internal static readonly int OUTLINE = Interop.TextField.OutlineGet();
2586             internal static readonly int InputOutline = Interop.TextField.InputOutlineGet();
2587             internal static readonly int HiddenInputSettings = Interop.TextField.HiddenInputSettingsGet();
2588             internal static readonly int PixelSize = Interop.TextField.PixelSizeGet();
2589             internal static readonly int EnableSelection = Interop.TextField.EnableSelectionGet();
2590             internal static readonly int PLACEHOLDER = Interop.TextField.PlaceholderGet();
2591             internal static readonly int ELLIPSIS = Interop.TextField.EllipsisGet();
2592             internal static readonly int EnableShiftSelection = Interop.TextField.EnableShiftSelectionGet();
2593             internal static readonly int MatchSystemLanguageDirection = Interop.TextField.MatchSystemLanguageDirectionGet();
2594             internal static readonly int EnableGrabHandle = Interop.TextField.EnableGrabHandleGet();
2595             internal static readonly int EnableGrabHandlePopup = Interop.TextField.EnableGrabHandlePopupGet();
2596             internal static readonly int SelectedText = Interop.TextField.SelectedTextGet();
2597             internal static readonly int SelectedTextStart = Interop.TextField.SelectedTextStartGet();
2598             internal static readonly int SelectedTextEnd = Interop.TextField.SelectedTextEndGet();
2599             internal static readonly int EnableEditing = Interop.TextField.EnableEditingGet();
2600             internal static readonly int PrimaryCursorPosition = Interop.TextField.PrimaryCursorPositionGet();
2601             internal static readonly int FontSizeScale = Interop.TextField.FontSizeScaleGet();
2602             internal static readonly int EnableFontSizeScale = Interop.TextField.EnableFontSizeScaleGet();
2603             internal static readonly int GrabHandleColor = Interop.TextField.GrabHandleColorGet();
2604             internal static readonly int EllipsisPosition = Interop.TextField.EllipsisPositionGet();
2605             internal static readonly int InputFilter = Interop.TextField.InputFilterGet();
2606             internal static readonly int Strikethrough = Interop.TextField.StrikethroughGet();
2607
2608         }
2609
2610         internal class InputStyle
2611         {
2612             internal enum Mask
2613             {
2614                 None = 0x0000,
2615                 Color = 0x0001,
2616                 FontFamily = 0x0002,
2617                 PointSize = 0x0004,
2618                 FontStyle = 0x0008,
2619                 Underline = 0x0010,
2620                 Shadow = 0x0020,
2621                 Emboss = 0x0040,
2622                 Outline = 0x0080
2623             }
2624         }
2625
2626         private void OnDecorationBoundingBoxChanged(int x, int y, int width, int height)
2627         {
2628             DecorationBoundingBox = new Rectangle(x, y, width, height);
2629         }
2630         private void OnInputColorChanged(float x, float y, float z, float w)
2631         {
2632             InputColor = new Vector4(x, y, z, w);
2633         }
2634         private void OnPlaceholderTextColorChanged(float r, float g, float b, float a)
2635         {
2636             PlaceholderTextColor = new Vector4(r, g, b, a);
2637         }
2638         private void OnPrimaryCursorColorChanged(float x, float y, float z, float w)
2639         {
2640             PrimaryCursorColor = new Vector4(x, y, z, w);
2641         }
2642         private void OnSecondaryCursorColorChanged(float x, float y, float z, float w)
2643         {
2644             SecondaryCursorColor = new Vector4(x, y, z, w);
2645         }
2646         private void OnSelectionHighlightColorChanged(float x, float y, float z, float w)
2647         {
2648             SelectionHighlightColor = new Vector4(x, y, z, w);
2649         }
2650         private void OnShadowColorChanged(float x, float y, float z, float w)
2651         {
2652             ShadowColor = new Vector4(x, y, z, w);
2653         }
2654         private void OnShadowOffsetChanged(float x, float y)
2655         {
2656             ShadowOffset = new Vector2(x, y);
2657         }
2658         private void OnTextColorChanged(float r, float g, float b, float a)
2659         {
2660             TextColor = new Color(r, g, b, a);
2661         }
2662         private void OnGrabHandleColorChanged(float r, float g, float b, float a)
2663         {
2664             GrabHandleColor = new Color(r, g, b, a);
2665         }
2666
2667         private class TextFieldLayout : LayoutItem
2668         {
2669             protected override void OnMeasure(MeasureSpecification widthMeasureSpec, MeasureSpecification heightMeasureSpec)
2670             {
2671                 // Padding will be automatically applied by DALi TextField.
2672                 var totalWidth = widthMeasureSpec.Size.AsDecimal();
2673                 var totalHeight = heightMeasureSpec.Size.AsDecimal();
2674                 var minSize = Owner.MinimumSize;
2675                 var maxSize = Owner.MaximumSize;
2676                 var naturalSize = Owner.GetNaturalSize();
2677
2678                 if (((TextField)Owner).Text.Length == 0)
2679                 {
2680                     // Calculate height of TextField by setting Text with " ".
2681                     // By calling SetTextWithoutTextChanged, TextChanged callback is not called for this.
2682                     ((TextField)Owner).SetTextWithoutTextChanged(" ");
2683
2684                     // Store original WidthSpecification to restore it after setting ResizePolicy.
2685                     var widthSpecification = Owner.WidthSpecification;
2686
2687                     // In DALi's Size logic, if Width or Height is set to be 0, then
2688                     // ResizePolicy is not changed to Fixed.
2689                     // This causes Size changes after NUI Layout's OnMeasure is finished.
2690                     // e.g. TextField's Width fills to its parent although Text is null and
2691                     //      WidthSpecification is WrapContent.
2692                     // To prevent the Size changes, WidthResizePolicy is set to be Fixed
2693                     // in advance if Text is null.
2694                     Owner.WidthResizePolicy = ResizePolicyType.Fixed;
2695
2696                     // Restore WidthSpecification because ResizePolicy changes WidthSpecification.
2697                     Owner.WidthSpecification = widthSpecification;
2698
2699                     naturalSize = Owner.GetNaturalSize();
2700
2701                     // Restore TextField's Text after calculating height of TextField.
2702                     // By calling SetTextWithoutTextChanged, TextChanged callback is not called for this.
2703                     ((TextField)Owner).SetTextWithoutTextChanged("");
2704                 }
2705
2706                 if (widthMeasureSpec.Mode != MeasureSpecification.ModeType.Exactly)
2707                 {
2708                     totalWidth = Math.Min(Math.Max(naturalSize.Width, minSize.Width), maxSize.Width);
2709                 }
2710
2711                 if (heightMeasureSpec.Mode != MeasureSpecification.ModeType.Exactly)
2712                 {
2713                     totalHeight = Math.Min(Math.Max(naturalSize.Height, minSize.Height), maxSize.Height);
2714                 }
2715
2716                 widthMeasureSpec = new MeasureSpecification(new LayoutLength(totalWidth), MeasureSpecification.ModeType.Exactly);
2717                 heightMeasureSpec = new MeasureSpecification(new LayoutLength(totalHeight), MeasureSpecification.ModeType.Exactly);
2718
2719                 MeasuredSize.StateType childWidthState = MeasuredSize.StateType.MeasuredSizeOK;
2720                 MeasuredSize.StateType childHeightState = MeasuredSize.StateType.MeasuredSizeOK;
2721
2722                 SetMeasuredDimensions(ResolveSizeAndState(new LayoutLength(totalWidth), widthMeasureSpec, childWidthState),
2723                                       ResolveSizeAndState(new LayoutLength(totalHeight), heightMeasureSpec, childHeightState));
2724             }
2725         }
2726     }
2727 }