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