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