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