cb8ac8520a4c4dc3fd7fa40709d87c366afa01d8
[platform/core/csapi/tizenfx.git] / src / Tizen.NUI / src / public / BaseComponents / TextField.cs
1 /*
2  * Copyright(c) 2019 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
25 namespace Tizen.NUI.BaseComponents
26 {
27     /// <summary>
28     /// A control which provides a single line editable text field.
29     /// </summary>
30     /// <since_tizen> 3 </since_tizen>
31     public partial class TextField : View
32     {
33         private string textFieldTextSid = null;
34         private string textFieldPlaceHolderTextSid = null;
35         private bool systemlangTextFlag = false;
36         private InputMethodContext inputMethodCotext = null;
37         private TextFieldSelectorData selectorData;
38         private float fontSizeScale = 1.0f;
39         private bool hasFontSizeChangedCallback = false;
40
41         static TextField() { }
42
43         /// <summary>
44         /// Creates the TextField control.
45         /// </summary>
46         /// <since_tizen> 3 </since_tizen>
47         public TextField() : this(Interop.TextField.New(), true)
48         {
49             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
50         }
51
52         /// <summary>
53         /// Creates the TextField with setting the status of shown or hidden.
54         /// </summary>
55         /// <param name="shown">false : Not displayed (hidden), true : displayed (shown)</param>
56         /// This will be public opened in next release of tizen after ACR done. Before ACR, it is used as HiddenAPI (InhouseAPI).
57         [EditorBrowsable(EditorBrowsableState.Never)]
58         public TextField(bool shown) : this(Interop.TextField.New(), true)
59         {
60             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
61             SetVisible(shown);
62         }
63
64         /// <summary>
65         /// Get attribues, it is abstract function and must be override.
66         /// </summary>
67         [EditorBrowsable(EditorBrowsableState.Never)]
68         protected override ViewStyle CreateViewStyle()
69         {
70             return new TextFieldStyle();
71         }
72
73         internal TextField(global::System.IntPtr cPtr, bool cMemoryOwn, ViewStyle viewStyle, bool shown = true) : base(Interop.TextField.Upcast(cPtr), cMemoryOwn, viewStyle)
74         {
75             if (!shown)
76             {
77                 SetVisible(false);
78             }
79         }
80
81         internal TextField(global::System.IntPtr cPtr, bool cMemoryOwn, bool shown = true) : base(Interop.TextField.Upcast(cPtr), cMemoryOwn, null)
82         {
83             if (!shown)
84             {
85                 SetVisible(false);
86             }
87         }
88
89         internal TextField(TextField handle, bool shown = true) : this(Interop.TextField.NewTextField(TextField.getCPtr(handle)), true)
90         {
91             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
92
93             if (!shown)
94             {
95                 SetVisible(false);
96             }
97         }
98
99         internal enum ExceedPolicyType
100         {
101             ExceedPolicyOriginal,
102             ExceedPolicyClip
103         }
104
105         /// <summary>
106         /// The TranslatableText property.<br />
107         /// The text can set the SID value.<br />
108         /// </summary>
109         /// <exception cref='ArgumentNullException'>
110         /// ResourceManager about multilingual is null.
111         /// </exception>
112         /// <since_tizen> 4 </since_tizen>
113         public string TranslatableText
114         {
115             get
116             {
117                 return (string)GetValue(TranslatableTextProperty);
118             }
119             set
120             {
121                 selectorData?.TranslatableText.UpdateIfNeeds(this, value);
122                 SetValue(TranslatableTextProperty, value);
123             }
124         }
125         private string translatableText
126         {
127             get
128             {
129                 return textFieldTextSid;
130             }
131             set
132             {
133                 if (NUIApplication.MultilingualResourceManager == null)
134                 {
135                     throw new ArgumentNullException(null, "ResourceManager about multilingual is null");
136                 }
137                 textFieldTextSid = value;
138                 Text = SetTranslatable(textFieldTextSid);
139                 NotifyPropertyChanged();
140             }
141         }
142
143         /// <summary>
144         /// The TranslatablePlaceholderText property.<br />
145         /// The text can set the SID value.<br />
146         /// </summary>
147         /// <exception cref='ArgumentNullException'>
148         /// ResourceManager about multilingual is null.
149         /// </exception>
150         /// <since_tizen> 4 </since_tizen>
151         public string TranslatablePlaceholderText
152         {
153             get
154             {
155                 return (string)GetValue(TranslatablePlaceholderTextProperty);
156             }
157             set
158             {
159                 SetValue(TranslatablePlaceholderTextProperty, value);
160                 selectorData?.TranslatablePlaceholderText.UpdateIfNeeds(this, value);
161             }
162         }
163         private string translatablePlaceholderText
164         {
165             get
166             {
167                 return textFieldPlaceHolderTextSid;
168             }
169             set
170             {
171                 if (NUIApplication.MultilingualResourceManager == null)
172                 {
173                     throw new ArgumentNullException(null, "ResourceManager about multilingual is null");
174                 }
175                 textFieldPlaceHolderTextSid = value;
176                 PlaceholderText = SetTranslatable(textFieldPlaceHolderTextSid);
177                 NotifyPropertyChanged();
178             }
179         }
180
181         /// <summary>
182         /// The Text property.
183         /// </summary>
184         /// <since_tizen> 3 </since_tizen>
185         public string Text
186         {
187             get
188             {
189                 return (string)GetValue(TextProperty);
190             }
191             set
192             {
193                 SetValueAndForceSendChangeSignal(TextProperty, value);
194                 selectorData?.Text.UpdateIfNeeds(this, value);
195                 NotifyPropertyChanged();
196             }
197         }
198
199         /// <summary>
200         /// The PlaceholderText property.
201         /// </summary>
202         /// <since_tizen> 3 </since_tizen>
203         public string PlaceholderText
204         {
205             get
206             {
207                 return (string)GetValue(PlaceholderTextProperty);
208             }
209             set
210             {
211                 SetValue(PlaceholderTextProperty, value);
212                 NotifyPropertyChanged();
213             }
214         }
215
216         /// <summary>
217         /// The PlaceholderTextFocused property.
218         /// </summary>
219         /// <since_tizen> 3 </since_tizen>
220         public string PlaceholderTextFocused
221         {
222             get
223             {
224                 return (string)GetValue(PlaceholderTextFocusedProperty);
225             }
226             set
227             {
228                 SetValue(PlaceholderTextFocusedProperty, value);
229                 NotifyPropertyChanged();
230             }
231         }
232
233         /// <summary>
234         /// The FontFamily property.
235         /// </summary>
236         /// <since_tizen> 3 </since_tizen>
237         public string FontFamily
238         {
239             get
240             {
241                 return (string)GetValue(FontFamilyProperty);
242             }
243             set
244             {
245                 SetValue(FontFamilyProperty, value);
246                 selectorData?.FontFamily.UpdateIfNeeds(this, value);
247                 NotifyPropertyChanged();
248             }
249         }
250
251         /// <summary>
252         /// The FontStyle property.
253         /// </summary>
254         /// <since_tizen> 3 </since_tizen>
255         public PropertyMap FontStyle
256         {
257             get
258             {
259                 return (PropertyMap)GetValue(FontStyleProperty);
260             }
261             set
262             {
263                 SetValue(FontStyleProperty, value);
264                 NotifyPropertyChanged();
265             }
266         }
267
268         /// <summary>
269         /// The PointSize property.
270         /// </summary>
271         /// <since_tizen> 3 </since_tizen>
272         public float PointSize
273         {
274             get
275             {
276                 return (float)GetValue(PointSizeProperty);
277             }
278             set
279             {
280                 SetValue(PointSizeProperty, value);
281                 selectorData?.PointSize.UpdateIfNeeds(this, value);
282                 NotifyPropertyChanged();
283             }
284         }
285
286         /// <summary>
287         /// The MaxLength property.
288         /// </summary>
289         /// <since_tizen> 3 </since_tizen>
290         public int MaxLength
291         {
292             get
293             {
294                 return (int)GetValue(MaxLengthProperty);
295             }
296             set
297             {
298                 SetValue(MaxLengthProperty, value);
299                 NotifyPropertyChanged();
300             }
301         }
302
303         /// <summary>
304         /// The ExceedPolicy property.
305         /// </summary>
306         /// <since_tizen> 3 </since_tizen>
307         public int ExceedPolicy
308         {
309             get
310             {
311                 return (int)GetValue(ExceedPolicyProperty);
312             }
313             set
314             {
315                 SetValue(ExceedPolicyProperty, value);
316                 NotifyPropertyChanged();
317             }
318         }
319
320         /// <summary>
321         /// The HorizontalAlignment property.
322         /// </summary>
323         /// <since_tizen> 3 </since_tizen>
324         public HorizontalAlignment HorizontalAlignment
325         {
326             get
327             {
328                 return (HorizontalAlignment)GetValue(HorizontalAlignmentProperty);
329             }
330             set
331             {
332                 SetValue(HorizontalAlignmentProperty, value);
333                 NotifyPropertyChanged();
334             }
335         }
336
337         /// <summary>
338         /// The VerticalAlignment property.
339         /// </summary>
340         /// <since_tizen> 3 </since_tizen>
341         public VerticalAlignment VerticalAlignment
342         {
343             get
344             {
345                 return (VerticalAlignment)GetValue(VerticalAlignmentProperty);
346             }
347             set
348             {
349                 SetValue(VerticalAlignmentProperty, value);
350                 NotifyPropertyChanged();
351                 NotifyPropertyChanged();
352             }
353         }
354
355         /// <summary>
356         /// The TextColor property.
357         /// </summary>
358         /// <remarks>
359         /// The property cascade chaining set is possible. For example, this (textField.TextColor.X = 0.1f;) is possible.
360         /// </remarks>
361         /// <since_tizen> 3 </since_tizen>
362         public Color TextColor
363         {
364             get
365             {
366                 Color temp = (Color)GetValue(TextColorProperty);
367                 return new Color(OnTextColorChanged, temp.R, temp.G, temp.B, temp.A);
368             }
369             set
370             {
371                 SetValue(TextColorProperty, value);
372                 selectorData?.TextColor.UpdateIfNeeds(this, value);
373                 NotifyPropertyChanged();
374             }
375         }
376
377         /// <summary>
378         /// The PlaceholderTextColor property.
379         /// </summary>
380         /// <remarks>
381         /// The property cascade chaining set is possible. For example, this (textField.PlaceholderTextColor.X = 0.1f;) is possible.
382         /// </remarks>
383         /// <since_tizen> 3 </since_tizen>
384         public Vector4 PlaceholderTextColor
385         {
386             get
387             {
388                 Vector4 temp = (Vector4)GetValue(PlaceholderTextColorProperty);
389                 return new Vector4(OnPlaceholderTextColorChanged, temp.X, temp.Y, temp.Z, temp.W);
390             }
391             set
392             {
393                 SetValue(PlaceholderTextColorProperty, value);
394                 selectorData?.PlaceholderTextColor.UpdateIfNeeds(this, value);
395                 NotifyPropertyChanged();
396             }
397         }
398
399         /// <summary>
400         /// The ShadowOffset property.
401         /// </summary>
402         /// <since_tizen> 3 </since_tizen>
403         /// <remarks>
404         /// Deprecated.(API Level 6) Use Shadow instead.
405         /// The property cascade chaining set is possible. For example, this (textField.ShadowOffset.X = 0.1f;) is possible.
406         /// </remarks>
407         [Obsolete("Please do not use this ShadowOffset(Deprecated). Please use Shadow instead.")]
408         public Vector2 ShadowOffset
409         {
410             get
411             {
412                 PropertyMap map = new PropertyMap();
413                 GetProperty(TextField.Property.SHADOW).Get(map);
414                 Vector2 shadowOffset = new Vector2();
415                 map.Find(TextField.Property.SHADOW, "offset")?.Get(shadowOffset);
416                 return new Vector2(OnShadowOffsetChanged, shadowOffset.X, shadowOffset.Y);
417             }
418             set
419             {
420                 PropertyMap temp = new PropertyMap();
421                 temp.Insert("offset", new PropertyValue(value));
422                 SetValue(ShadowProperty, temp);
423                 NotifyPropertyChanged();
424             }
425         }
426
427         /// <summary>
428         /// The ShadowColor property.
429         /// </summary>
430         /// <since_tizen> 3 </since_tizen>
431         /// <remarks>
432         /// Deprecated.(API Level 6) Use Shadow instead.
433         /// The property cascade chaining set is possible. For example, this (textField.ShadowColor.X = 0.1f;) is possible.
434         /// </remarks>
435         [Obsolete("Please do not use this ShadowColor(Deprecated). Please use Shadow instead.")]
436         public Vector4 ShadowColor
437         {
438             get
439             {
440                 PropertyMap map = new PropertyMap();
441                 GetProperty(TextField.Property.SHADOW).Get(map);
442                 Vector4 shadowColor = new Vector4();
443                 map.Find(TextField.Property.SHADOW, "color")?.Get(shadowColor);
444                 return new Vector4(OnShadowColorChanged, shadowColor.X, shadowColor.Y, shadowColor.Z, shadowColor.W);
445             }
446             set
447             {
448                 PropertyMap temp = new PropertyMap();
449                 temp.Insert("color", new PropertyValue(value));
450                 SetValue(ShadowProperty, temp);
451                 NotifyPropertyChanged();
452             }
453         }
454
455         /// <summary>
456         /// The PrimaryCursorColor property.
457         /// </summary>
458         /// <remarks>
459         /// The property cascade chaining set is possible. For example, this (textField.PrimaryCursorColor.X = 0.1f;) is possible.
460         /// </remarks>
461         /// <since_tizen> 3 </since_tizen>
462         public Vector4 PrimaryCursorColor
463         {
464             get
465             {
466                 Vector4 temp = (Vector4)GetValue(PrimaryCursorColorProperty);
467                 return new Vector4(OnPrimaryCursorColorChanged, temp.X, temp.Y, temp.Z, temp.W);
468             }
469             set
470             {
471                 SetValue(PrimaryCursorColorProperty, value);
472                 selectorData?.PrimaryCursorColor.UpdateIfNeeds(this, value);
473                 NotifyPropertyChanged();
474             }
475         }
476
477         /// <summary>
478         /// The SecondaryCursorColor property.
479         /// </summary>
480         /// <remarks>
481         /// The property cascade chaining set is possible. For example, this (textField.SecondaryCursorColor.X = 0.1f;) is possible.
482         /// </remarks>
483         /// <since_tizen> 3 </since_tizen>
484         public Vector4 SecondaryCursorColor
485         {
486             get
487             {
488                 Vector4 temp = (Vector4)GetValue(SecondaryCursorColorProperty);
489                 return new Vector4(OnSecondaryCursorColorChanged, temp.X, temp.Y, temp.Z, temp.W);
490             }
491             set
492             {
493                 SetValue(SecondaryCursorColorProperty, value);
494                 NotifyPropertyChanged();
495             }
496         }
497
498         /// <summary>
499         /// The EnableCursorBlink property.
500         /// </summary>
501         /// <since_tizen> 3 </since_tizen>
502         public bool EnableCursorBlink
503         {
504             get
505             {
506                 return (bool)GetValue(EnableCursorBlinkProperty);
507             }
508             set
509             {
510                 SetValue(EnableCursorBlinkProperty, value);
511                 NotifyPropertyChanged();
512             }
513         }
514
515         /// <summary>
516         /// The CursorBlinkInterval property.
517         /// </summary>
518         /// <since_tizen> 3 </since_tizen>
519         public float CursorBlinkInterval
520         {
521             get
522             {
523                 return (float)GetValue(CursorBlinkIntervalProperty);
524             }
525             set
526             {
527                 SetValue(CursorBlinkIntervalProperty, value);
528                 NotifyPropertyChanged();
529             }
530         }
531
532         /// <summary>
533         /// The CursorBlinkDuration property.
534         /// </summary>
535         /// <since_tizen> 3 </since_tizen>
536         public float CursorBlinkDuration
537         {
538             get
539             {
540                 return (float)GetValue(CursorBlinkDurationProperty);
541             }
542             set
543             {
544                 SetValue(CursorBlinkDurationProperty, value);
545                 NotifyPropertyChanged();
546             }
547         }
548
549         /// <summary>
550         /// The CursorWidth property.
551         /// </summary>
552         /// <since_tizen> 3 </since_tizen>
553         public int CursorWidth
554         {
555             get
556             {
557                 return (int)GetValue(CursorWidthProperty);
558             }
559             set
560             {
561                 SetValue(CursorWidthProperty, value);
562                 NotifyPropertyChanged();
563             }
564         }
565
566         /// <summary>
567         /// The GrabHandleImage property.
568         /// </summary>
569         /// <since_tizen> 3 </since_tizen>
570         public string GrabHandleImage
571         {
572             get
573             {
574                 return (string)GetValue(GrabHandleImageProperty);
575             }
576             set
577             {
578                 SetValue(GrabHandleImageProperty, value);
579                 NotifyPropertyChanged();
580             }
581         }
582
583         /// <summary>
584         /// The GrabHandlePressedImage property.
585         /// </summary>
586         /// <since_tizen> 3 </since_tizen>
587         public string GrabHandlePressedImage
588         {
589             get
590             {
591                 return (string)GetValue(GrabHandlePressedImageProperty);
592             }
593             set
594             {
595                 SetValue(GrabHandlePressedImageProperty, value);
596                 NotifyPropertyChanged();
597             }
598         }
599
600         /// <summary>
601         /// The ScrollThreshold property.
602         /// </summary>
603         /// <since_tizen> 3 </since_tizen>
604         public float ScrollThreshold
605         {
606             get
607             {
608                 return (float)GetValue(ScrollThresholdProperty);
609             }
610             set
611             {
612                 SetValue(ScrollThresholdProperty, value);
613                 NotifyPropertyChanged();
614             }
615         }
616
617         /// <summary>
618         /// The ScrollSpeed property.
619         /// </summary>
620         /// <since_tizen> 3 </since_tizen>
621         public float ScrollSpeed
622         {
623             get
624             {
625                 return (float)GetValue(ScrollSpeedProperty);
626             }
627             set
628             {
629                 SetValue(ScrollSpeedProperty, value);
630                 NotifyPropertyChanged();
631             }
632         }
633
634         /// <summary>
635         /// The SelectionHandleImageLeft property.
636         /// </summary>
637         /// <since_tizen> 3 </since_tizen>
638         public PropertyMap SelectionHandleImageLeft
639         {
640             get
641             {
642                 return (PropertyMap)GetValue(SelectionHandleImageLeftProperty);
643             }
644             set
645             {
646                 SetValue(SelectionHandleImageLeftProperty, value);
647                 NotifyPropertyChanged();
648             }
649         }
650
651         /// <summary>
652         /// The SelectionHandleImageRight property.
653         /// </summary>
654         /// <since_tizen> 3 </since_tizen>
655         public PropertyMap SelectionHandleImageRight
656         {
657             get
658             {
659                 return (PropertyMap)GetValue(SelectionHandleImageRightProperty);
660             }
661             set
662             {
663                 SetValue(SelectionHandleImageRightProperty, value);
664                 NotifyPropertyChanged();
665             }
666         }
667
668         /// <summary>
669         /// The SelectionHandlePressedImageLeft property.
670         /// </summary>
671         /// <since_tizen> 3 </since_tizen>
672         public PropertyMap SelectionHandlePressedImageLeft
673         {
674             get
675             {
676                 return (PropertyMap)GetValue(SelectionHandlePressedImageLeftProperty);
677             }
678             set
679             {
680                 SetValue(SelectionHandlePressedImageLeftProperty, value);
681                 NotifyPropertyChanged();
682             }
683         }
684
685         /// <summary>
686         /// The SelectionHandlePressedImageRight property.
687         /// </summary>
688         /// <since_tizen> 3 </since_tizen>
689         public PropertyMap SelectionHandlePressedImageRight
690         {
691             get
692             {
693                 return (PropertyMap)GetValue(SelectionHandlePressedImageRightProperty);
694             }
695             set
696             {
697                 SetValue(SelectionHandlePressedImageRightProperty, value);
698                 NotifyPropertyChanged();
699             }
700         }
701
702         /// <summary>
703         /// The SelectionHandleMarkerImageLeft property.
704         /// </summary>
705         /// <since_tizen> 3 </since_tizen>
706         public PropertyMap SelectionHandleMarkerImageLeft
707         {
708             get
709             {
710                 return (PropertyMap)GetValue(SelectionHandleMarkerImageLeftProperty);
711             }
712             set
713             {
714                 SetValue(SelectionHandleMarkerImageLeftProperty, value);
715                 NotifyPropertyChanged();
716             }
717         }
718
719         /// <summary>
720         /// The SelectionHandleMarkerImageRight property.
721         /// </summary>
722         /// <since_tizen> 3 </since_tizen>
723         public PropertyMap SelectionHandleMarkerImageRight
724         {
725             get
726             {
727                 return (PropertyMap)GetValue(SelectionHandleMarkerImageRightProperty);
728             }
729             set
730             {
731                 SetValue(SelectionHandleMarkerImageRightProperty, value);
732                 NotifyPropertyChanged();
733             }
734         }
735
736         /// <summary>
737         /// The SelectionHighlightColor property.
738         /// </summary>
739         /// <remarks>
740         /// The property cascade chaining set is possible. For example, this (textField.SelectionHighlightColor.X = 0.1f;) is possible.
741         /// </remarks>
742         /// <since_tizen> 3 </since_tizen>
743         public Vector4 SelectionHighlightColor
744         {
745             get
746             {
747                 Vector4 temp = (Vector4)GetValue(SelectionHighlightColorProperty);
748                 return new Vector4(OnSelectionHighlightColorChanged, temp.X, temp.Y, temp.Z, temp.W);
749             }
750             set
751             {
752                 SetValue(SelectionHighlightColorProperty, value);
753                 NotifyPropertyChanged();
754             }
755         }
756
757         /// <summary>
758         /// The DecorationBoundingBox property.
759         /// </summary>
760         /// <remarks>
761         /// The property cascade chaining set is possible. For example, this (textField.DecorationBoundingBox.X = 0.1f;) is possible.
762         /// </remarks>
763         /// <since_tizen> 3 </since_tizen>
764         public Rectangle DecorationBoundingBox
765         {
766             get
767             {
768                 Rectangle temp = (Rectangle)GetValue(DecorationBoundingBoxProperty);
769                 return new Rectangle(OnDecorationBoundingBoxChanged, temp.X, temp.Y, temp.Width, temp.Height);
770             }
771             set
772             {
773                 SetValue(DecorationBoundingBoxProperty, value);
774                 NotifyPropertyChanged();
775             }
776         }
777
778         /// <summary>
779         /// The InputMethodSettings property.
780         /// </summary>
781         /// <since_tizen> 3 </since_tizen>
782         public PropertyMap InputMethodSettings
783         {
784             get
785             {
786                 return (PropertyMap)GetValue(InputMethodSettingsProperty);
787             }
788             set
789             {
790                 SetValue(InputMethodSettingsProperty, value);
791                 NotifyPropertyChanged();
792             }
793         }
794
795         /// <summary>
796         /// The InputColor property.
797         /// </summary>
798         /// <remarks>
799         /// The property cascade chaining set is possible. For example, this (textField.InputColor.X = 0.1f;) is possible.
800         /// </remarks>
801         /// <since_tizen> 3 </since_tizen>
802         public Vector4 InputColor
803         {
804             get
805             {
806                 Vector4 temp = (Vector4)GetValue(InputColorProperty);
807                 return new Vector4(OnInputColorChanged, temp.X, temp.Y, temp.Z, temp.W);
808             }
809             set
810             {
811                 SetValue(InputColorProperty, value);
812                 NotifyPropertyChanged();
813             }
814         }
815
816         /// <summary>
817         /// The EnableMarkup property.
818         /// </summary>
819         /// <since_tizen> 3 </since_tizen>
820         public bool EnableMarkup
821         {
822             get
823             {
824                 return (bool)GetValue(EnableMarkupProperty);
825             }
826             set
827             {
828                 SetValue(EnableMarkupProperty, value);
829                 NotifyPropertyChanged();
830             }
831         }
832
833         /// <summary>
834         /// The InputFontFamily property.
835         /// </summary>
836         /// <since_tizen> 3 </since_tizen>
837         public string InputFontFamily
838         {
839             get
840             {
841                 return (string)GetValue(InputFontFamilyProperty);
842             }
843             set
844             {
845                 SetValue(InputFontFamilyProperty, value);
846                 NotifyPropertyChanged();
847             }
848         }
849
850         /// <summary>
851         /// The InputFontStyle property.
852         /// </summary>
853         /// <since_tizen> 3 </since_tizen>
854         public PropertyMap InputFontStyle
855         {
856             get
857             {
858                 return (PropertyMap)GetValue(InputFontStyleProperty);
859             }
860             set
861             {
862                 SetValue(InputFontStyleProperty, value);
863                 NotifyPropertyChanged();
864             }
865         }
866
867         /// <summary>
868         /// The InputPointSize property.
869         /// </summary>
870         /// <since_tizen> 3 </since_tizen>
871         public float InputPointSize
872         {
873             get
874             {
875                 return (float)GetValue(InputPointSizeProperty);
876             }
877             set
878             {
879                 SetValue(InputPointSizeProperty, value);
880                 NotifyPropertyChanged();
881             }
882         }
883
884         /// <summary>
885         /// The Underline property.
886         /// </summary>
887         /// <since_tizen> 3 </since_tizen>
888         public PropertyMap Underline
889         {
890             get
891             {
892                 return (PropertyMap)GetValue(UnderlineProperty);
893             }
894             set
895             {
896                 SetValue(UnderlineProperty, value);
897                 NotifyPropertyChanged();
898             }
899         }
900
901         /// <summary>
902         /// The InputUnderline property.
903         /// </summary>
904         /// <since_tizen> 3 </since_tizen>
905         public string InputUnderline
906         {
907             get
908             {
909                 return (string)GetValue(InputUnderlineProperty);
910             }
911             set
912             {
913                 SetValue(InputUnderlineProperty, value);
914                 NotifyPropertyChanged();
915             }
916         }
917
918         /// <summary>
919         /// The Shadow property.
920         /// </summary>
921         /// <since_tizen> 3 </since_tizen>
922         public PropertyMap Shadow
923         {
924             get
925             {
926                 return (PropertyMap)GetValue(ShadowProperty);
927             }
928             set
929             {
930                 SetValue(ShadowProperty, value);
931                 NotifyPropertyChanged();
932             }
933         }
934
935         /// <summary>
936         /// The InputShadow property.
937         /// </summary>
938         /// <since_tizen> 3 </since_tizen>
939         public string InputShadow
940         {
941             get
942             {
943                 return (string)GetValue(InputShadowProperty);
944             }
945             set
946             {
947                 SetValue(InputShadowProperty, value);
948                 NotifyPropertyChanged();
949             }
950         }
951
952         /// <summary>
953         /// The Emboss property.
954         /// </summary>
955         /// <since_tizen> 3 </since_tizen>
956         public string Emboss
957         {
958             get
959             {
960                 return (string)GetValue(EmbossProperty);
961             }
962             set
963             {
964                 SetValue(EmbossProperty, value);
965                 NotifyPropertyChanged();
966             }
967         }
968
969         /// <summary>
970         /// The InputEmboss property.
971         /// </summary>
972         /// <since_tizen> 3 </since_tizen>
973         public string InputEmboss
974         {
975             get
976             {
977                 return (string)GetValue(InputEmbossProperty);
978             }
979             set
980             {
981                 SetValue(InputEmbossProperty, value);
982                 NotifyPropertyChanged();
983             }
984         }
985
986         /// <summary>
987         /// The Outline property.
988         /// </summary>
989         /// <since_tizen> 3 </since_tizen>
990         public PropertyMap Outline
991         {
992             get
993             {
994                 return (PropertyMap)GetValue(OutlineProperty);
995             }
996             set
997             {
998                 SetValue(OutlineProperty, value);
999                 NotifyPropertyChanged();
1000             }
1001         }
1002
1003         /// <summary>
1004         /// The InputOutline property.
1005         /// </summary>
1006         /// <since_tizen> 3 </since_tizen>
1007         public string InputOutline
1008         {
1009             get
1010             {
1011                 return (string)GetValue(InputOutlineProperty);
1012             }
1013             set
1014             {
1015                 SetValue(InputOutlineProperty, value);
1016                 NotifyPropertyChanged();
1017             }
1018         }
1019
1020         /// <summary>
1021         /// The HiddenInputSettings property.
1022         /// </summary>
1023         /// <since_tizen> 3 </since_tizen>
1024         public Tizen.NUI.PropertyMap HiddenInputSettings
1025         {
1026             get
1027             {
1028                 return (PropertyMap)GetValue(HiddenInputSettingsProperty);
1029             }
1030             set
1031             {
1032                 SetValue(HiddenInputSettingsProperty, value);
1033                 NotifyPropertyChanged();
1034             }
1035         }
1036
1037         /// <summary>
1038         /// The PixelSize property.
1039         /// </summary>
1040         /// <since_tizen> 3 </since_tizen>
1041         public float PixelSize
1042         {
1043             get
1044             {
1045                 return (float)GetValue(PixelSizeProperty);
1046             }
1047             set
1048             {
1049                 SetValue(PixelSizeProperty, value);
1050                 selectorData?.PixelSize.UpdateIfNeeds(this, value);
1051                 NotifyPropertyChanged();
1052             }
1053         }
1054
1055         /// <summary>
1056         /// The Enable selection property.
1057         /// </summary>
1058         /// <since_tizen> 3 </since_tizen>
1059         public bool EnableSelection
1060         {
1061             get
1062             {
1063                 return (bool)GetValue(EnableSelectionProperty);
1064             }
1065             set
1066             {
1067                 SetValue(EnableSelectionProperty, value);
1068                 NotifyPropertyChanged();
1069             }
1070         }
1071
1072         /// <summary>
1073         /// The Enable selection property.
1074         /// </summary>
1075         /// <since_tizen> 6 </since_tizen>
1076         /// This will be released at Tizen.NET API Level 5, so currently this would be used as inhouse API.
1077         [EditorBrowsable(EditorBrowsableState.Never)]
1078         public bool EnableGrabHandle
1079         {
1080             get
1081             {
1082                 return (bool)GetValue(EnableGrabHandleProperty);
1083             }
1084             set
1085             {
1086                 SetValue(EnableGrabHandleProperty, value);
1087                 NotifyPropertyChanged();
1088             }
1089         }
1090
1091         /// <summary>
1092         /// The Enable selection property.
1093         /// </summary>
1094         /// <since_tizen> 6 </since_tizen>
1095         /// This will be released at Tizen.NET API Level 5, so currently this would be used as inhouse API.
1096         [EditorBrowsable(EditorBrowsableState.Never)]
1097         public bool EnableGrabHandlePopup
1098         {
1099             get
1100             {
1101                 return (bool)GetValue(EnableGrabHandlePopupProperty);
1102             }
1103             set
1104             {
1105                 SetValue(EnableGrabHandlePopupProperty, value);
1106                 NotifyPropertyChanged();
1107             }
1108         }
1109
1110         /// <summary>
1111         /// The Selected Text property.
1112         /// </summary>
1113         /// <since_tizen> 8 </since_tizen>
1114         /// This will be public opened in tizen_6.0 after ACR done, Before ACR, need to be hidden as inhouse API.
1115         [EditorBrowsable(EditorBrowsableState.Never)]
1116         public string SelectedText
1117         {
1118             get
1119             {
1120                 string temp;
1121                 GetProperty(TextField.Property.SelectedText).Get(out temp);
1122                 return temp;
1123             }
1124         }
1125
1126         /// <summary>
1127         /// The start index for selection.
1128         /// </summary>
1129         /// <since_tizen> 8 </since_tizen>
1130         /// This will be public opened in tizen_6.0 after ACR done, Before ACR, need to be hidden as inhouse API.
1131         [EditorBrowsable(EditorBrowsableState.Never)]
1132         public int SelectedTextStart
1133         {
1134             get
1135             {
1136                 int temp;
1137                 GetProperty(TextField.Property.SelectedTextStart).Get(out temp);
1138                 return temp;
1139             }
1140             set
1141             {
1142                 SetProperty(TextField.Property.SelectedTextStart, new PropertyValue(value));
1143                 NotifyPropertyChanged();
1144             }
1145         }
1146
1147         /// <summary>
1148         /// The end index for selection.
1149         /// </summary>
1150         /// <since_tizen> 8 </since_tizen>
1151         /// This will be public opened in tizen_6.0 after ACR done, Before ACR, need to be hidden as inhouse API.
1152         [EditorBrowsable(EditorBrowsableState.Never)]
1153         public int SelectedTextEnd
1154         {
1155             get
1156             {
1157                 int temp;
1158                 GetProperty(TextField.Property.SelectedTextEnd).Get(out temp);
1159                 return temp;
1160             }
1161             set
1162             {
1163                 SetProperty(TextField.Property.SelectedTextEnd, new PropertyValue(value));
1164                 NotifyPropertyChanged();
1165             }
1166         }
1167
1168         /// <summary>
1169         /// Enable editing in text control.
1170         /// </summary>
1171         /// <since_tizen> 8 </since_tizen>
1172         /// This will be public opened in tizen_6.0 after ACR done, Before ACR, need to be hidden as inhouse API.
1173         [EditorBrowsable(EditorBrowsableState.Never)]
1174         public bool EnableEditing
1175         {
1176             get
1177             {
1178                 bool temp;
1179                 GetProperty(TextField.Property.EnableEditing).Get(out temp);
1180                 return temp;
1181             }
1182             set
1183             {
1184                 SetProperty(TextField.Property.EnableEditing, new PropertyValue(value));
1185                 NotifyPropertyChanged();
1186             }
1187         }
1188
1189         /// <summary>
1190         /// Specify primary cursor (caret) position in text control.
1191         /// </summary>
1192         [EditorBrowsable(EditorBrowsableState.Never)]
1193         public int PrimaryCursorPosition
1194         {
1195             get
1196             {
1197                 int temp;
1198                 using (PropertyValue propertyValue = GetProperty(TextField.Property.PrimaryCursorPosition))
1199                 {
1200                     propertyValue.Get(out temp);
1201                 }
1202                 return temp;
1203             }
1204             set
1205             {
1206                 using (PropertyValue propertyValue = new PropertyValue(value))
1207                 {
1208                     SetProperty(TextField.Property.PrimaryCursorPosition, propertyValue);
1209                     NotifyPropertyChanged();
1210                 }
1211             }
1212         }
1213
1214         /// <summary>
1215         /// The Placeholder property.
1216         /// Gets or sets the placeholder: text, color, font family, font style, point size, and pixel size.
1217         /// </summary>
1218         /// <example>
1219         /// The following example demonstrates how to set the Placeholder property.
1220         /// <code>
1221         /// PropertyMap propertyMap = new PropertyMap();
1222         /// propertyMap.Add("text", new PropertyValue("Setting Placeholder Text"));
1223         /// propertyMap.Add("textFocused", new PropertyValue("Setting Placeholder Text Focused"));
1224         /// propertyMap.Add("color", new PropertyValue(Color.Red));
1225         /// propertyMap.Add("fontFamily", new PropertyValue("Arial"));
1226         /// propertyMap.Add("pointSize", new PropertyValue(12.0f));
1227         ///
1228         /// PropertyMap fontStyleMap = new PropertyMap();
1229         /// fontStyleMap.Add("weight", new PropertyValue("bold"));
1230         /// fontStyleMap.Add("width", new PropertyValue("condensed"));
1231         /// fontStyleMap.Add("slant", new PropertyValue("italic"));
1232         /// propertyMap.Add("fontStyle", new PropertyValue(fontStyleMap));
1233         ///
1234         /// TextField field = new TextField();
1235         /// field.Placeholder = propertyMap;
1236         /// </code>
1237         /// </example>
1238         /// <since_tizen> 3 </since_tizen>
1239         public Tizen.NUI.PropertyMap Placeholder
1240         {
1241             get
1242             {
1243                 return (PropertyMap)GetValue(PlaceholderProperty);
1244             }
1245             set
1246             {
1247                 SetValue(PlaceholderProperty, value);
1248                 NotifyPropertyChanged();
1249             }
1250         }
1251
1252         /// <summary>
1253         /// The Ellipsis property.<br />
1254         /// Enable or disable the ellipsis.<br />
1255         /// Placeholder PropertyMap is used to add ellipsis to placeholder text.
1256         /// </summary>
1257         /// <since_tizen> 4 </since_tizen>
1258         public bool Ellipsis
1259         {
1260             get
1261             {
1262                 return (bool)GetValue(EllipsisProperty);
1263             }
1264             set
1265             {
1266                 SetValue(EllipsisProperty, value);
1267                 NotifyPropertyChanged();
1268             }
1269         }
1270
1271         /// <summary>
1272         /// Enables selection of the text using the Shift key.
1273         /// </summary>
1274         /// <since_tizen> 5 </since_tizen>
1275         /// This will be released at Tizen.NET API Level 5, so currently this would be used as inhouse API.
1276         [EditorBrowsable(EditorBrowsableState.Never)]
1277         public bool EnableShiftSelection
1278         {
1279             get
1280             {
1281                 return (bool)GetValue(EnableShiftSelectionProperty);
1282             }
1283             set
1284             {
1285                 SetValue(EnableShiftSelectionProperty, value);
1286                 NotifyPropertyChanged();
1287             }
1288         }
1289
1290         /// <summary>
1291         /// The text alignment to match the direction of the system language.
1292         /// </summary>
1293         /// <since_tizen> 6 </since_tizen>
1294         public bool MatchSystemLanguageDirection
1295         {
1296             get
1297             {
1298                 return (bool)GetValue(MatchSystemLanguageDirectionProperty);
1299             }
1300             set
1301             {
1302                 SetValue(MatchSystemLanguageDirectionProperty, value);
1303                 NotifyPropertyChanged();
1304             }
1305         }
1306
1307         /// <summary>
1308         /// The FontSizeScale property. <br />
1309         /// The default value is 1.0. <br />
1310         /// If FontSizeScale.UseSystemSetting, will use the SystemSettings.FontSize internally. <br />
1311         /// </summary>
1312         /// <since_tizen> 9 </since_tizen>
1313         /// This will be public opened in tizen_6.5 after ACR done. Before ACR, need to be hidden as inhouse API.
1314         [EditorBrowsable(EditorBrowsableState.Never)]
1315         public float FontSizeScale
1316         {
1317             get
1318             {
1319                 return fontSizeScale;
1320             }
1321             set
1322             {
1323                 float newFontSizeScale;
1324
1325                 if (fontSizeScale == value) return;
1326
1327                 fontSizeScale = value;
1328                 if (fontSizeScale == Tizen.NUI.FontSizeScale.UseSystemSetting)
1329                 {
1330                     SystemSettingsFontSize systemSettingsFontSize;
1331
1332                     try
1333                     {
1334                         systemSettingsFontSize = SystemSettings.FontSize;
1335                     }
1336                     catch (Exception e)
1337                     {
1338                         Console.WriteLine("{0} Exception caught.", e);
1339                         systemSettingsFontSize = SystemSettingsFontSize.Normal;
1340                     }
1341                     newFontSizeScale = TextUtils.GetFontSizeScale(systemSettingsFontSize);
1342                     addFontSizeChangedCallback();
1343                 }
1344                 else
1345                 {
1346                     newFontSizeScale = fontSizeScale;
1347                     removeFontSizeChangedCallback();
1348                 }
1349
1350                 SetValue(FontSizeScaleProperty, newFontSizeScale);
1351                 NotifyPropertyChanged();
1352             }
1353         }
1354
1355         /// Only used by the IL of xaml, will never changed to not hidden.
1356         [EditorBrowsable(EditorBrowsableState.Never)]
1357         public override bool IsCreateByXaml
1358         {
1359             get
1360             {
1361                 return base.IsCreateByXaml;
1362             }
1363             set
1364             {
1365                 base.IsCreateByXaml = value;
1366
1367                 if (value == true)
1368                 {
1369                     this.TextChanged += (obj, e) =>
1370                     {
1371                         this.Text = e.TextField.Text;
1372                     };
1373                 }
1374             }
1375         }
1376
1377         private TextFieldSelectorData SelectorData
1378         {
1379             get
1380             {
1381                 if (selectorData == null)
1382                 {
1383                     selectorData = new TextFieldSelectorData();
1384                 }
1385                 return selectorData;
1386             }
1387         }
1388
1389         /// <summary>
1390         /// Get the InputMethodContext instance.
1391         /// </summary>
1392         /// <returns>The InputMethodContext instance.</returns>
1393         /// <since_tizen> 5 </since_tizen>
1394         public InputMethodContext GetInputMethodContext()
1395         {
1396             if (inputMethodCotext == null)
1397             {
1398                 /*Avoid raising InputMethodContext reference count.*/
1399                 inputMethodCotext = new InputMethodContext(Interop.TextField.GetInputMethodContext(SwigCPtr), true);
1400                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1401             }
1402             return inputMethodCotext;
1403         }
1404
1405         /// <summary>
1406         /// Select the whole text.
1407         /// </summary>
1408         /// <since_tizen> 6 </since_tizen>
1409         /// This will be released at Tizen.NET API Level 5.5, so currently this would be used as inhouse API.
1410         [EditorBrowsable(EditorBrowsableState.Never)]
1411         public void SelectWholeText()
1412         {
1413             Interop.TextField.SelectWholeText(SwigCPtr);
1414             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1415         }
1416
1417         /// <summary>
1418         /// Clear selection of the text.
1419         /// </summary>
1420         /// <since_tizen> 8 </since_tizen>
1421         /// This will be public opened in tizen_6.0 after ACR done, Before ACR, need to be hidden as inhouse API.
1422         [EditorBrowsable(EditorBrowsableState.Never)]
1423         public void SelectNone()
1424         {
1425             _ = Interop.TextField.SelectNone(SwigCPtr);
1426             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1427         }
1428
1429         internal static global::System.Runtime.InteropServices.HandleRef getCPtr(TextField obj)
1430         {
1431             return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.SwigCPtr;
1432         }
1433
1434         internal SWIGTYPE_p_Dali__SignalT_void_fDali__Toolkit__TextField_Dali__Toolkit__TextField__InputStyle__MaskF_t InputStyleChangedSignal()
1435         {
1436             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));
1437             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1438             return ret;
1439         }
1440
1441         /// <summary>
1442         /// Dispose.
1443         /// </summary>
1444         /// <since_tizen> 3 </since_tizen>
1445         protected override void Dispose(DisposeTypes type)
1446         {
1447             if (disposed)
1448             {
1449                 DisposeQueue.Instance.Add(this);
1450                 return;
1451             }
1452
1453             if (systemlangTextFlag)
1454             {
1455                 SystemSettings.LocaleLanguageChanged -= SystemSettings_LocaleLanguageChanged;
1456             }
1457
1458             removeFontSizeChangedCallback();
1459
1460             if (type == DisposeTypes.Explicit)
1461             {
1462                 //Called by User
1463                 //Release your own managed resources here.
1464                 //You should release all of your own disposable objects here.
1465                 selectorData?.Reset(this);
1466             }
1467
1468             //Release your own unmanaged resources here.
1469             //You should not access any managed member here except static instance.
1470             //because the execution order of Finalizes is non-deterministic.
1471             if (this.HasBody())
1472             {
1473                 if (_textFieldMaxLengthReachedCallbackDelegate != null)
1474                 {
1475                     this.MaxLengthReachedSignal().Disconnect(_textFieldMaxLengthReachedCallbackDelegate);
1476                 }
1477
1478                 if (_textFieldTextChangedCallbackDelegate != null)
1479                 {
1480                     TextChangedSignal().Disconnect(_textFieldTextChangedCallbackDelegate);
1481                 }
1482             }
1483
1484             base.Dispose(type);
1485         }
1486
1487         /// This will not be public opened.
1488         [EditorBrowsable(EditorBrowsableState.Never)]
1489         protected override void ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef swigCPtr)
1490         {
1491             // In order to speed up IME hide, temporarily add
1492             GetInputMethodContext()?.DestroyContext();
1493             Interop.TextField.DeleteTextField(swigCPtr);
1494         }
1495
1496         private string SetTranslatable(string textFieldSid)
1497         {
1498             string translatableText = null;
1499             translatableText = NUIApplication.MultilingualResourceManager?.GetString(textFieldSid, new CultureInfo(SystemSettings.LocaleLanguage.Replace("_", "-")));
1500             if (translatableText != null)
1501             {
1502                 if (systemlangTextFlag == false)
1503                 {
1504                     SystemSettings.LocaleLanguageChanged += SystemSettings_LocaleLanguageChanged;
1505                     systemlangTextFlag = true;
1506                 }
1507                 return translatableText;
1508             }
1509             else
1510             {
1511                 translatableText = "";
1512                 return translatableText;
1513             }
1514         }
1515
1516         private void SystemSettings_LocaleLanguageChanged(object sender, LocaleLanguageChangedEventArgs e)
1517         {
1518             if (textFieldTextSid != null)
1519             {
1520                 Text = NUIApplication.MultilingualResourceManager?.GetString(textFieldTextSid, new CultureInfo(e.Value.Replace("_", "-")));
1521             }
1522             if (textFieldPlaceHolderTextSid != null)
1523             {
1524                 PlaceholderText = NUIApplication.MultilingualResourceManager?.GetString(textFieldPlaceHolderTextSid, new CultureInfo(e.Value.Replace("_", "-")));
1525             }
1526         }
1527
1528         private void SystemSettingsFontSizeChanged(object sender, FontSizeChangedEventArgs e)
1529         {
1530             float newFontSizeScale = TextUtils.GetFontSizeScale(e.Value);
1531             SetValue(FontSizeScaleProperty, newFontSizeScale);
1532             NotifyPropertyChanged();
1533         }
1534
1535         private void addFontSizeChangedCallback()
1536         {
1537             if (hasFontSizeChangedCallback != true)
1538             {
1539                 try
1540                 {
1541                     SystemSettings.FontSizeChanged += SystemSettingsFontSizeChanged;
1542                     hasFontSizeChangedCallback = true;
1543                 }
1544                 catch (Exception e)
1545                 {
1546                     Console.WriteLine("{0} Exception caught.", e);
1547                     hasFontSizeChangedCallback = false;
1548                 }
1549             }
1550         }
1551
1552         private void removeFontSizeChangedCallback()
1553         {
1554             if (hasFontSizeChangedCallback == true)
1555             {
1556                 try
1557                 {
1558                     SystemSettings.FontSizeChanged -= SystemSettingsFontSizeChanged;
1559                     hasFontSizeChangedCallback = false;
1560                 }
1561                 catch (Exception e)
1562                 {
1563                     Console.WriteLine("{0} Exception caught.", e);
1564                     hasFontSizeChangedCallback = true;
1565                 }
1566             }
1567         }
1568
1569         internal new class Property
1570         {
1571             internal static readonly int TEXT = Interop.TextField.TextGet();
1572             internal static readonly int PlaceholderText = Interop.TextField.PlaceholderTextGet();
1573             internal static readonly int PlaceholderTextFocused = Interop.TextField.PlaceholderTextFocusedGet();
1574             internal static readonly int FontFamily = Interop.TextField.FontFamilyGet();
1575             internal static readonly int FontStyle = Interop.TextField.FontStyleGet();
1576             internal static readonly int PointSize = Interop.TextField.PointSizeGet();
1577             internal static readonly int MaxLength = Interop.TextField.MaxLengthGet();
1578             internal static readonly int ExceedPolicy = Interop.TextField.ExceedPolicyGet();
1579             internal static readonly int HorizontalAlignment = Interop.TextField.HorizontalAlignmentGet();
1580             internal static readonly int VerticalAlignment = Interop.TextField.VerticalAlignmentGet();
1581             internal static readonly int TextColor = Interop.TextField.TextColorGet();
1582             internal static readonly int PlaceholderTextColor = Interop.TextField.PlaceholderTextColorGet();
1583             internal static readonly int PrimaryCursorColor = Interop.TextField.PrimaryCursorColorGet();
1584             internal static readonly int SecondaryCursorColor = Interop.TextField.SecondaryCursorColorGet();
1585             internal static readonly int EnableCursorBlink = Interop.TextField.EnableCursorBlinkGet();
1586             internal static readonly int CursorBlinkInterval = Interop.TextField.CursorBlinkIntervalGet();
1587             internal static readonly int CursorBlinkDuration = Interop.TextField.CursorBlinkDurationGet();
1588             internal static readonly int CursorWidth = Interop.TextField.CursorWidthGet();
1589             internal static readonly int GrabHandleImage = Interop.TextField.GrabHandleImageGet();
1590             internal static readonly int GrabHandlePressedImage = Interop.TextField.GrabHandlePressedImageGet();
1591             internal static readonly int ScrollThreshold = Interop.TextField.ScrollThresholdGet();
1592             internal static readonly int ScrollSpeed = Interop.TextField.ScrollSpeedGet();
1593             internal static readonly int SelectionHandleImageLeft = Interop.TextField.SelectionHandleImageLeftGet();
1594             internal static readonly int SelectionHandleImageRight = Interop.TextField.SelectionHandleImageRightGet();
1595             internal static readonly int SelectionHandlePressedImageLeft = Interop.TextField.SelectionHandlePressedImageLeftGet();
1596             internal static readonly int SelectionHandlePressedImageRight = Interop.TextField.SelectionHandlePressedImageRightGet();
1597             internal static readonly int SelectionHandleMarkerImageLeft = Interop.TextField.SelectionHandleMarkerImageLeftGet();
1598             internal static readonly int SelectionHandleMarkerImageRight = Interop.TextField.SelectionHandleMarkerImageRightGet();
1599             internal static readonly int SelectionHighlightColor = Interop.TextField.SelectionHighlightColorGet();
1600             internal static readonly int DecorationBoundingBox = Interop.TextField.DecorationBoundingBoxGet();
1601             internal static readonly int InputMethodSettings = Interop.TextField.InputMethodSettingsGet();
1602             internal static readonly int InputColor = Interop.TextField.InputColorGet();
1603             internal static readonly int EnableMarkup = Interop.TextField.EnableMarkupGet();
1604             internal static readonly int InputFontFamily = Interop.TextField.InputFontFamilyGet();
1605             internal static readonly int InputFontStyle = Interop.TextField.InputFontStyleGet();
1606             internal static readonly int InputPointSize = Interop.TextField.InputPointSizeGet();
1607             internal static readonly int UNDERLINE = Interop.TextField.UnderlineGet();
1608             internal static readonly int InputUnderline = Interop.TextField.InputUnderlineGet();
1609             internal static readonly int SHADOW = Interop.TextField.ShadowGet();
1610             internal static readonly int InputShadow = Interop.TextField.InputShadowGet();
1611             internal static readonly int EMBOSS = Interop.TextField.EmbossGet();
1612             internal static readonly int InputEmboss = Interop.TextField.InputEmbossGet();
1613             internal static readonly int OUTLINE = Interop.TextField.OutlineGet();
1614             internal static readonly int InputOutline = Interop.TextField.InputOutlineGet();
1615             internal static readonly int HiddenInputSettings = Interop.TextField.HiddenInputSettingsGet();
1616             internal static readonly int PixelSize = Interop.TextField.PixelSizeGet();
1617             internal static readonly int EnableSelection = Interop.TextField.EnableSelectionGet();
1618             internal static readonly int PLACEHOLDER = Interop.TextField.PlaceholderGet();
1619             internal static readonly int ELLIPSIS = Interop.TextField.EllipsisGet();
1620             internal static readonly int EnableShiftSelection = Interop.TextField.EnableShiftSelectionGet();
1621             internal static readonly int MatchSystemLanguageDirection = Interop.TextField.MatchSystemLanguageDirectionGet();
1622             internal static readonly int EnableGrabHandle = Interop.TextField.EnableGrabHandleGet();
1623             internal static readonly int EnableGrabHandlePopup = Interop.TextField.EnableGrabHandlePopupGet();
1624             internal static readonly int SelectedText = Interop.TextField.SelectedTextGet();
1625             internal static readonly int SelectedTextStart = Interop.TextField.SelectedTextStartGet();
1626             internal static readonly int SelectedTextEnd = Interop.TextField.SelectedTextEndGet();
1627             internal static readonly int EnableEditing = Interop.TextField.EnableEditingGet();
1628             internal static readonly int PrimaryCursorPosition = Interop.TextField.PrimaryCursorPositionGet();
1629             internal static readonly int FontSizeScale = Interop.TextField.FontSizeScaleGet();
1630         }
1631
1632         internal class InputStyle
1633         {
1634             internal enum Mask
1635             {
1636                 None = 0x0000,
1637                 Color = 0x0001,
1638                 FontFamily = 0x0002,
1639                 PointSize = 0x0004,
1640                 FontStyle = 0x0008,
1641                 Underline = 0x0010,
1642                 Shadow = 0x0020,
1643                 Emboss = 0x0040,
1644                 Outline = 0x0080
1645             }
1646         }
1647
1648         private void OnDecorationBoundingBoxChanged(int x, int y, int width, int height)
1649         {
1650             DecorationBoundingBox = new Rectangle(x, y, width, height);
1651         }
1652         private void OnInputColorChanged(float x, float y, float z, float w)
1653         {
1654             InputColor = new Vector4(x, y, z, w);
1655         }
1656         private void OnPlaceholderTextColorChanged(float r, float g, float b, float a)
1657         {
1658             PlaceholderTextColor = new Vector4(r, g, b, a);
1659         }
1660         private void OnPrimaryCursorColorChanged(float x, float y, float z, float w)
1661         {
1662             PrimaryCursorColor = new Vector4(x, y, z, w);
1663         }
1664         private void OnSecondaryCursorColorChanged(float x, float y, float z, float w)
1665         {
1666             SecondaryCursorColor = new Vector4(x, y, z, w);
1667         }
1668         private void OnSelectionHighlightColorChanged(float x, float y, float z, float w)
1669         {
1670             SelectionHighlightColor = new Vector4(x, y, z, w);
1671         }
1672         private void OnShadowColorChanged(float x, float y, float z, float w)
1673         {
1674             ShadowColor = new Vector4(x, y, z, w);
1675         }
1676         private void OnShadowOffsetChanged(float x, float y)
1677         {
1678             ShadowOffset = new Vector2(x, y);
1679         }
1680         private void OnTextColorChanged(float r, float g, float b, float a)
1681         {
1682             TextColor = new Color(r, g, b, a);
1683         }
1684     }
1685 }