[Tizen] Add properties of TextLabel/Editor
[platform/core/csapi/tizenfx.git] / src / Tizen.NUI / src / public / BaseComponents / TextEditor.cs
1 /** Copyright (c) 2017 Samsung Electronics Co., Ltd.
2 *
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at
6 *
7 * http://www.apache.org/licenses/LICENSE-2.0
8 *
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
14 *
15 */
16
17 namespace Tizen.NUI.BaseComponents
18 {
19
20     using System;
21     using System.Runtime.InteropServices;
22
23     /// <summary>
24     /// A control which provides a multi-line editable text editor.
25     /// </summary>
26     public class TextEditor : View
27     {
28         private global::System.Runtime.InteropServices.HandleRef swigCPtr;
29
30         internal TextEditor(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.TextEditor_SWIGUpcast(cPtr), cMemoryOwn)
31         {
32             swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
33         }
34
35         internal static global::System.Runtime.InteropServices.HandleRef getCPtr(TextEditor obj)
36         {
37             return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
38         }
39
40         /// <summary>
41         /// Dispose.
42         /// </summary>
43         protected override void Dispose(DisposeTypes type)
44         {
45             if (disposed)
46             {
47                 return;
48             }
49
50             if(type == DisposeTypes.Explicit)
51             {
52                 //Called by User
53                 //Release your own managed resources here.
54                 //You should release all of your own disposable objects here.
55             }
56
57             //Release your own unmanaged resources here.
58             //You should not access any managed member here except static instance.
59             //because the execution order of Finalizes is non-deterministic.
60
61             if (_textEditorTextChangedCallbackDelegate != null)
62             {
63                 TextChangedSignal().Disconnect(_textEditorTextChangedCallbackDelegate);
64             }
65
66             if (swigCPtr.Handle != global::System.IntPtr.Zero)
67             {
68                 if (swigCMemOwn)
69                 {
70                     swigCMemOwn = false;
71                     NDalicPINVOKE.delete_TextEditor(swigCPtr);
72                 }
73                 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
74             }
75
76             base.Dispose(type);
77         }
78
79         /// <summary>
80         /// Event arguments that passed via TextChanged signal.
81         /// </summary>
82         public class TextChangedEventArgs : EventArgs
83         {
84             private TextEditor _textEditor;
85
86             /// <summary>
87             /// TextEditor - is the texteditor control which has the text contents changed.
88             /// </summary>
89             public TextEditor TextEditor
90             {
91                 get
92                 {
93                     return _textEditor;
94                 }
95                 set
96                 {
97                     _textEditor = value;
98                 }
99             }
100         }
101
102         [UnmanagedFunctionPointer(CallingConvention.StdCall)]
103         private delegate void TextChangedCallbackDelegate(IntPtr textEditor);
104         private EventHandler<TextChangedEventArgs> _textEditorTextChangedEventHandler;
105         private TextChangedCallbackDelegate _textEditorTextChangedCallbackDelegate;
106
107         /// <summary>
108         /// Event for TextChanged signal which can be used to subscribe/unsubscribe the event handler
109         /// provided by the user. TextChanged signal is emitted when the text changes.<br>
110         /// </summary>
111         public event EventHandler<TextChangedEventArgs> TextChanged
112         {
113             add
114             {
115                 if (_textEditorTextChangedEventHandler == null)
116                 {
117                     _textEditorTextChangedCallbackDelegate = (OnTextChanged);
118                     TextChangedSignal().Connect(_textEditorTextChangedCallbackDelegate);
119                 }
120                 _textEditorTextChangedEventHandler += value;
121             }
122             remove
123             {
124                 _textEditorTextChangedEventHandler -= value;
125                 if (_textEditorTextChangedEventHandler == null && TextChangedSignal().Empty() == false)
126                 {
127                     TextChangedSignal().Disconnect(_textEditorTextChangedCallbackDelegate);
128                 }
129             }
130         }
131
132         private void OnTextChanged(IntPtr textEditor)
133         {
134             TextChangedEventArgs e = new TextChangedEventArgs();
135
136             // Populate all members of "e" (TextChangedEventArgs) with real data
137             e.TextEditor = Registry.GetManagedBaseHandleFromNativePtr(textEditor) as TextEditor;
138
139             if (_textEditorTextChangedEventHandler != null)
140             {
141                 //here we send all data to user event handlers
142                 _textEditorTextChangedEventHandler(this, e);
143             }
144
145         }
146
147         /// <summary>
148         /// Event arguments that passed via ScrollStateChanged signal.
149         /// </summary>
150         public class ScrollStateChangedEventArgs : EventArgs
151         {
152             private TextEditor _textEditor;
153             private ScrollState _scrollState;
154
155             /// <summary>
156             /// TextEditor - is the texteditor control which has the scroll state changed.
157             /// </summary>
158             public TextEditor TextEditor
159             {
160                 get
161                 {
162                     return _textEditor;
163                 }
164                 set
165                 {
166                     _textEditor = value;
167                 }
168             }
169
170             /// <summary>
171             /// ScrollState - is the texteditor control scroll state.
172             /// </summary>
173             public ScrollState ScrollState
174             {
175                 get
176                 {
177                     return _scrollState;
178                 }
179                 set
180                 {
181                     _scrollState = value;
182                 }
183             }
184         }
185
186         [UnmanagedFunctionPointer(CallingConvention.StdCall)]
187         private delegate void ScrollStateChangedCallbackDelegate(IntPtr textEditor, ScrollState state);
188         private EventHandler<ScrollStateChangedEventArgs> _textEditorScrollStateChangedEventHandler;
189         private ScrollStateChangedCallbackDelegate _textEditorScrollStateChangedCallbackDelegate;
190
191         /// <summary>
192         /// Event for ScrollStateChanged signal which can be used to subscribe/unsubscribe the event handler
193         /// provided by the user. ScrollStateChanged signal is emitted when the scroll state changes.<br>
194         /// </summary>
195         public event EventHandler<ScrollStateChangedEventArgs> ScrollStateChanged
196         {
197             add
198             {
199                 if (_textEditorScrollStateChangedEventHandler == null)
200                 {
201                     _textEditorScrollStateChangedCallbackDelegate = OnScrollStateChanged;
202                     ScrollStateChangedSignal(this).Connect(_textEditorScrollStateChangedCallbackDelegate);
203                 }
204                 _textEditorScrollStateChangedEventHandler += value;
205             }
206             remove
207             {
208                 _textEditorScrollStateChangedEventHandler -= value;
209                 if (_textEditorScrollStateChangedEventHandler == null && ScrollStateChangedSignal(this).Empty() == false)
210                 {
211                     ScrollStateChangedSignal(this).Disconnect(_textEditorScrollStateChangedCallbackDelegate);
212                 }
213             }
214         }
215
216         private void OnScrollStateChanged(IntPtr textEditor, ScrollState state)
217         {
218             ScrollStateChangedEventArgs e = new ScrollStateChangedEventArgs();
219
220             if (textEditor != null)
221             {
222                 // Populate all members of "e" (ScrollStateChangedEventArgs) with real data
223                 e.TextEditor = Registry.GetManagedBaseHandleFromNativePtr(textEditor) as TextEditor;
224                 e.ScrollState = state;
225             }
226
227             if (_textEditorScrollStateChangedEventHandler != null)
228             {
229                 //here we send all data to user event handlers
230                 _textEditorScrollStateChangedEventHandler(this, e);
231             }
232         }
233
234         internal class Property
235         {
236             internal static readonly int RENDERING_BACKEND = NDalicPINVOKE.TextEditor_Property_RENDERING_BACKEND_get();
237             internal static readonly int TEXT = NDalicPINVOKE.TextEditor_Property_TEXT_get();
238             internal static readonly int TEXT_COLOR = NDalicPINVOKE.TextEditor_Property_TEXT_COLOR_get();
239             internal static readonly int FONT_FAMILY = NDalicPINVOKE.TextEditor_Property_FONT_FAMILY_get();
240             internal static readonly int FONT_STYLE = NDalicPINVOKE.TextEditor_Property_FONT_STYLE_get();
241             internal static readonly int POINT_SIZE = NDalicPINVOKE.TextEditor_Property_POINT_SIZE_get();
242             internal static readonly int HORIZONTAL_ALIGNMENT = NDalicPINVOKE.TextEditor_Property_HORIZONTAL_ALIGNMENT_get();
243             internal static readonly int SCROLL_THRESHOLD = NDalicPINVOKE.TextEditor_Property_SCROLL_THRESHOLD_get();
244             internal static readonly int SCROLL_SPEED = NDalicPINVOKE.TextEditor_Property_SCROLL_SPEED_get();
245             internal static readonly int PRIMARY_CURSOR_COLOR = NDalicPINVOKE.TextEditor_Property_PRIMARY_CURSOR_COLOR_get();
246             internal static readonly int SECONDARY_CURSOR_COLOR = NDalicPINVOKE.TextEditor_Property_SECONDARY_CURSOR_COLOR_get();
247             internal static readonly int ENABLE_CURSOR_BLINK = NDalicPINVOKE.TextEditor_Property_ENABLE_CURSOR_BLINK_get();
248             internal static readonly int CURSOR_BLINK_INTERVAL = NDalicPINVOKE.TextEditor_Property_CURSOR_BLINK_INTERVAL_get();
249             internal static readonly int CURSOR_BLINK_DURATION = NDalicPINVOKE.TextEditor_Property_CURSOR_BLINK_DURATION_get();
250             internal static readonly int CURSOR_WIDTH = NDalicPINVOKE.TextEditor_Property_CURSOR_WIDTH_get();
251             internal static readonly int GRAB_HANDLE_IMAGE = NDalicPINVOKE.TextEditor_Property_GRAB_HANDLE_IMAGE_get();
252             internal static readonly int GRAB_HANDLE_PRESSED_IMAGE = NDalicPINVOKE.TextEditor_Property_GRAB_HANDLE_PRESSED_IMAGE_get();
253             internal static readonly int SELECTION_HANDLE_IMAGE_LEFT = NDalicPINVOKE.TextEditor_Property_SELECTION_HANDLE_IMAGE_LEFT_get();
254             internal static readonly int SELECTION_HANDLE_IMAGE_RIGHT = NDalicPINVOKE.TextEditor_Property_SELECTION_HANDLE_IMAGE_RIGHT_get();
255             internal static readonly int SELECTION_HANDLE_PRESSED_IMAGE_LEFT = NDalicPINVOKE.TextEditor_Property_SELECTION_HANDLE_PRESSED_IMAGE_LEFT_get();
256             internal static readonly int SELECTION_HANDLE_PRESSED_IMAGE_RIGHT = NDalicPINVOKE.TextEditor_Property_SELECTION_HANDLE_PRESSED_IMAGE_RIGHT_get();
257             internal static readonly int SELECTION_HANDLE_MARKER_IMAGE_LEFT = NDalicPINVOKE.TextEditor_Property_SELECTION_HANDLE_MARKER_IMAGE_LEFT_get();
258             internal static readonly int SELECTION_HANDLE_MARKER_IMAGE_RIGHT = NDalicPINVOKE.TextEditor_Property_SELECTION_HANDLE_MARKER_IMAGE_RIGHT_get();
259             internal static readonly int SELECTION_HIGHLIGHT_COLOR = NDalicPINVOKE.TextEditor_Property_SELECTION_HIGHLIGHT_COLOR_get();
260             internal static readonly int DECORATION_BOUNDING_BOX = NDalicPINVOKE.TextEditor_Property_DECORATION_BOUNDING_BOX_get();
261             internal static readonly int ENABLE_MARKUP = NDalicPINVOKE.TextEditor_Property_ENABLE_MARKUP_get();
262             internal static readonly int INPUT_COLOR = NDalicPINVOKE.TextEditor_Property_INPUT_COLOR_get();
263             internal static readonly int INPUT_FONT_FAMILY = NDalicPINVOKE.TextEditor_Property_INPUT_FONT_FAMILY_get();
264             internal static readonly int INPUT_FONT_STYLE = NDalicPINVOKE.TextEditor_Property_INPUT_FONT_STYLE_get();
265             internal static readonly int INPUT_POINT_SIZE = NDalicPINVOKE.TextEditor_Property_INPUT_POINT_SIZE_get();
266             internal static readonly int LINE_SPACING = NDalicPINVOKE.TextEditor_Property_LINE_SPACING_get();
267             internal static readonly int INPUT_LINE_SPACING = NDalicPINVOKE.TextEditor_Property_INPUT_LINE_SPACING_get();
268             internal static readonly int UNDERLINE = NDalicPINVOKE.TextEditor_Property_UNDERLINE_get();
269             internal static readonly int INPUT_UNDERLINE = NDalicPINVOKE.TextEditor_Property_INPUT_UNDERLINE_get();
270             internal static readonly int SHADOW = NDalicPINVOKE.TextEditor_Property_SHADOW_get();
271             internal static readonly int INPUT_SHADOW = NDalicPINVOKE.TextEditor_Property_INPUT_SHADOW_get();
272             internal static readonly int EMBOSS = NDalicPINVOKE.TextEditor_Property_EMBOSS_get();
273             internal static readonly int INPUT_EMBOSS = NDalicPINVOKE.TextEditor_Property_INPUT_EMBOSS_get();
274             internal static readonly int OUTLINE = NDalicPINVOKE.TextEditor_Property_OUTLINE_get();
275             internal static readonly int INPUT_OUTLINE = NDalicPINVOKE.TextEditor_Property_INPUT_OUTLINE_get();
276             internal static readonly int SMOOTH_SCROLL = NDalicManualPINVOKE.TextEditor_Property_SMOOTH_SCROLL_get();
277             internal static readonly int SMOOTH_SCROLL_DURATION = NDalicManualPINVOKE.TextEditor_Property_SMOOTH_SCROLL_DURATION_get();
278             internal static readonly int ENABLE_SCROLL_BAR = NDalicManualPINVOKE.TextEditor_Property_ENABLE_SCROLL_BAR_get();
279             internal static readonly int SCROLL_BAR_SHOW_DURATION = NDalicManualPINVOKE.TextEditor_Property_SCROLL_BAR_SHOW_DURATION_get();
280             internal static readonly int SCROLL_BAR_FADE_DURATION = NDalicManualPINVOKE.TextEditor_Property_SCROLL_BAR_FADE_DURATION_get();
281             internal static readonly int PIXEL_SIZE = NDalicManualPINVOKE.TextEditor_Property_PIXEL_SIZE_get();
282             internal static readonly int LINE_COUNT = NDalicManualPINVOKE.TextEditor_Property_LINE_COUNT_get();
283             internal static readonly int PLACEHOLDER_TEXT = NDalicManualPINVOKE.TextEditor_Property_PLACEHOLDER_TEXT_get();
284             internal static readonly int PLACEHOLDER_TEXT_COLOR = NDalicManualPINVOKE.TextEditor_Property_PLACEHOLDER_TEXT_COLOR_get();
285             internal static readonly int ENABLE_SELECTION = NDalicManualPINVOKE.TextEditor_Property_ENABLE_SELECTION_get();
286             internal static readonly int PLACEHOLDER = NDalicManualPINVOKE.TextEditor_Property_PLACEHOLDER_get();
287             internal static readonly int LINE_WRAP_MODE = NDalicManualPINVOKE.TextEditor_Property_LINE_WRAP_MODE_get();
288         }
289
290         internal class InputStyle
291         {
292             internal enum Mask
293             {
294                 None = 0x0000,
295                 Color = 0x0001,
296                 FontFamily = 0x0002,
297                 PointSize = 0x0004,
298                 FontStyle = 0x0008,
299                 LineSpacing = 0x0010,
300                 Underline = 0x0020,
301                 Shadow = 0x0040,
302                 Emboss = 0x0080,
303                 Outline = 0x0100
304             }
305         }
306
307         /// <summary>
308         /// Creates the TextEditor control.
309         /// </summary>
310         public TextEditor() : this(NDalicPINVOKE.TextEditor_New(), true)
311         {
312             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
313
314         }
315         internal TextEditor(TextEditor handle) : this(NDalicPINVOKE.new_TextEditor__SWIG_1(TextEditor.getCPtr(handle)), true)
316         {
317             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
318         }
319
320         [Obsolete("Please do not use! this will be deprecated")]
321         public new static TextEditor DownCast(BaseHandle handle)
322         {
323             TextEditor ret =  Registry.GetManagedBaseHandleFromNativePtr(handle) as TextEditor;
324             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
325             return ret;
326         }
327
328         internal TextEditorSignal TextChangedSignal()
329         {
330             TextEditorSignal ret = new TextEditorSignal(NDalicPINVOKE.TextEditor_TextChangedSignal(swigCPtr), false);
331             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
332             return ret;
333         }
334
335         internal ScrollStateChangedSignal ScrollStateChangedSignal(TextEditor textEditor)
336         {
337             ScrollStateChangedSignal ret = new ScrollStateChangedSignal(NDalicManualPINVOKE.TextEditor_ScrollStateChangedSignal(TextEditor.getCPtr(textEditor)), false);
338             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
339             return ret;
340         }
341
342         internal SWIGTYPE_p_Dali__SignalT_void_fDali__Toolkit__TextEditor_Dali__Toolkit__TextEditor__InputStyle__MaskF_t InputStyleChangedSignal()
343         {
344             SWIGTYPE_p_Dali__SignalT_void_fDali__Toolkit__TextEditor_Dali__Toolkit__TextEditor__InputStyle__MaskF_t ret = new SWIGTYPE_p_Dali__SignalT_void_fDali__Toolkit__TextEditor_Dali__Toolkit__TextEditor__InputStyle__MaskF_t(NDalicPINVOKE.TextEditor_InputStyleChangedSignal(swigCPtr), false);
345             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
346             return ret;
347         }
348
349         /// <summary>
350         /// Text property.
351         /// </summary>
352         public string Text
353         {
354             get
355             {
356                 string temp;
357                 GetProperty(TextEditor.Property.TEXT).Get(out temp);
358                 return temp;
359             }
360             set
361             {
362                 SetProperty(TextEditor.Property.TEXT, new Tizen.NUI.PropertyValue(value));
363             }
364         }
365
366         /// <summary>
367         /// Text color property.
368         /// </summary>
369         public Vector4 TextColor
370         {
371             get
372             {
373                 Vector4 temp = new Vector4(0.0f, 0.0f, 0.0f, 0.0f);
374                 GetProperty(TextEditor.Property.TEXT_COLOR).Get(temp);
375                 return temp;
376             }
377             set
378             {
379                 SetProperty(TextEditor.Property.TEXT_COLOR, new Tizen.NUI.PropertyValue(value));
380             }
381         }
382
383         /// <summary>
384         /// Font family property.
385         /// </summary>
386         public string FontFamily
387         {
388             get
389             {
390                 string temp;
391                 GetProperty(TextEditor.Property.FONT_FAMILY).Get(out temp);
392                 return temp;
393             }
394             set
395             {
396                 SetProperty(TextEditor.Property.FONT_FAMILY, new Tizen.NUI.PropertyValue(value));
397             }
398         }
399
400         /// <summary>
401         /// Font style property.
402         /// </summary>
403         public PropertyMap FontStyle
404         {
405             get
406             {
407                 PropertyMap temp = new PropertyMap();
408                 GetProperty(TextEditor.Property.FONT_STYLE).Get(temp);
409                 return temp;
410             }
411             set
412             {
413                 SetProperty(TextEditor.Property.FONT_STYLE, new Tizen.NUI.PropertyValue(value));
414             }
415         }
416
417         /// <summary>
418         /// Point size property.
419         /// </summary>
420         public float PointSize
421         {
422             get
423             {
424                 float temp = 0.0f;
425                 GetProperty(TextEditor.Property.POINT_SIZE).Get(out temp);
426                 return temp;
427             }
428             set
429             {
430                 SetProperty(TextEditor.Property.POINT_SIZE, new Tizen.NUI.PropertyValue(value));
431             }
432         }
433
434         /// <summary>
435         /// Horizontal alignment property.
436         /// </summary>
437         public HorizontalAlignment HorizontalAlignment
438         {
439             get
440             {
441                 string temp;
442                 if (GetProperty(TextEditor.Property.HORIZONTAL_ALIGNMENT).Get(out temp) == false)
443                 {
444                     NUILog.Error("HorizontalAlignment get error!");
445                 }
446
447                 switch (temp)
448                 {
449                     case "BEGIN":
450                         return HorizontalAlignment.Begin;
451                     case "CENTER":
452                         return HorizontalAlignment.Center;
453                     case "END":
454                         return HorizontalAlignment.End;
455                     default:
456                         return HorizontalAlignment.Begin;
457                 }
458             }
459             set
460             {
461                 string valueToString = "";
462                 switch (value)
463                 {
464                     case HorizontalAlignment.Begin:
465                     {
466                         valueToString = "BEGIN";
467                         break;
468                     }
469                     case HorizontalAlignment.Center:
470                     {
471                         valueToString = "CENTER";
472                         break;
473                     }
474                     case HorizontalAlignment.End:
475                     {
476                         valueToString = "END";
477                         break;
478                     }
479                     default:
480                     {
481                         valueToString = "BEGIN";
482                         break;
483                     }
484                 }
485                 SetProperty(TextEditor.Property.HORIZONTAL_ALIGNMENT, new Tizen.NUI.PropertyValue(valueToString));
486             }
487         }
488
489         /// <summary>
490         /// Scroll threshold property.
491         /// </summary>
492         public float ScrollThreshold
493         {
494             get
495             {
496                 float temp = 0.0f;
497                 GetProperty(TextEditor.Property.SCROLL_THRESHOLD).Get(out temp);
498                 return temp;
499             }
500             set
501             {
502                 SetProperty(TextEditor.Property.SCROLL_THRESHOLD, new Tizen.NUI.PropertyValue(value));
503             }
504         }
505
506         /// <summary>
507         /// Scroll speed property.
508         /// </summary>
509         public float ScrollSpeed
510         {
511             get
512             {
513                 float temp = 0.0f;
514                 GetProperty(TextEditor.Property.SCROLL_SPEED).Get(out temp);
515                 return temp;
516             }
517             set
518             {
519                 SetProperty(TextEditor.Property.SCROLL_SPEED, new Tizen.NUI.PropertyValue(value));
520             }
521         }
522
523         /// <summary>
524         /// Primary cursor color property.
525         /// </summary>
526         public Vector4 PrimaryCursorColor
527         {
528             get
529             {
530                 Vector4 temp = new Vector4(0.0f, 0.0f, 0.0f, 0.0f);
531                 GetProperty(TextEditor.Property.PRIMARY_CURSOR_COLOR).Get(temp);
532                 return temp;
533             }
534             set
535             {
536                 SetProperty(TextEditor.Property.PRIMARY_CURSOR_COLOR, new Tizen.NUI.PropertyValue(value));
537             }
538         }
539
540         /// <summary>
541         /// SecondaryCursorColor property.
542         /// </summary>
543         public Vector4 SecondaryCursorColor
544         {
545             get
546             {
547                 Vector4 temp = new Vector4(0.0f, 0.0f, 0.0f, 0.0f);
548                 GetProperty(TextEditor.Property.SECONDARY_CURSOR_COLOR).Get(temp);
549                 return temp;
550             }
551             set
552             {
553                 SetProperty(TextEditor.Property.SECONDARY_CURSOR_COLOR, new Tizen.NUI.PropertyValue(value));
554             }
555         }
556
557         /// <summary>
558         /// EnableCursorBlink property.
559         /// </summary>
560         public bool EnableCursorBlink
561         {
562             get
563             {
564                 bool temp = false;
565                 GetProperty(TextEditor.Property.ENABLE_CURSOR_BLINK).Get(out temp);
566                 return temp;
567             }
568             set
569             {
570                 SetProperty(TextEditor.Property.ENABLE_CURSOR_BLINK, new Tizen.NUI.PropertyValue(value));
571             }
572         }
573
574         /// <summary>
575         /// CursorBlinkInterval property.
576         /// </summary>
577         public float CursorBlinkInterval
578         {
579             get
580             {
581                 float temp = 0.0f;
582                 GetProperty(TextEditor.Property.CURSOR_BLINK_INTERVAL).Get(out temp);
583                 return temp;
584             }
585             set
586             {
587                 SetProperty(TextEditor.Property.CURSOR_BLINK_INTERVAL, new Tizen.NUI.PropertyValue(value));
588             }
589         }
590
591         /// <summary>
592         /// CursorBlinkDuration property.
593         /// </summary>
594         public float CursorBlinkDuration
595         {
596             get
597             {
598                 float temp = 0.0f;
599                 GetProperty(TextEditor.Property.CURSOR_BLINK_DURATION).Get(out temp);
600                 return temp;
601             }
602             set
603             {
604                 SetProperty(TextEditor.Property.CURSOR_BLINK_DURATION, new Tizen.NUI.PropertyValue(value));
605             }
606         }
607
608         /// <summary>
609         /// CursorWidth property.
610         /// </summary>
611         public int CursorWidth
612         {
613             get
614             {
615                 int temp = 0;
616                 GetProperty(TextEditor.Property.CURSOR_WIDTH).Get(out temp);
617                 return temp;
618             }
619             set
620             {
621                 SetProperty(TextEditor.Property.CURSOR_WIDTH, new Tizen.NUI.PropertyValue(value));
622             }
623         }
624
625         /// <summary>
626         /// GrabHandleImage property.
627         /// </summary>
628         public string GrabHandleImage
629         {
630             get
631             {
632                 string temp;
633                 GetProperty(TextEditor.Property.GRAB_HANDLE_IMAGE).Get(out temp);
634                 return temp;
635             }
636             set
637             {
638                 SetProperty(TextEditor.Property.GRAB_HANDLE_IMAGE, new Tizen.NUI.PropertyValue(value));
639             }
640         }
641
642         /// <summary>
643         /// GrabHandlePressedImage property.
644         /// </summary>
645         public string GrabHandlePressedImage
646         {
647             get
648             {
649                 string temp;
650                 GetProperty(TextEditor.Property.GRAB_HANDLE_PRESSED_IMAGE).Get(out temp);
651                 return temp;
652             }
653             set
654             {
655                 SetProperty(TextEditor.Property.GRAB_HANDLE_PRESSED_IMAGE, new Tizen.NUI.PropertyValue(value));
656             }
657         }
658
659         /// <summary>
660         /// SelectionHandleImageLeft property.
661         /// </summary>
662         public PropertyMap SelectionHandleImageLeft
663         {
664             get
665             {
666                 PropertyMap temp = new PropertyMap();
667                 GetProperty(TextEditor.Property.SELECTION_HANDLE_IMAGE_LEFT).Get(temp);
668                 return temp;
669             }
670             set
671             {
672                 SetProperty(TextEditor.Property.SELECTION_HANDLE_IMAGE_LEFT, new Tizen.NUI.PropertyValue(value));
673             }
674         }
675
676         /// <summary>
677         /// SelectionHandleImageRight property.
678         /// </summary>
679         public PropertyMap SelectionHandleImageRight
680         {
681             get
682             {
683                 PropertyMap temp = new PropertyMap();
684                 GetProperty(TextEditor.Property.SELECTION_HANDLE_IMAGE_RIGHT).Get(temp);
685                 return temp;
686             }
687             set
688             {
689                 SetProperty(TextEditor.Property.SELECTION_HANDLE_IMAGE_RIGHT, new Tizen.NUI.PropertyValue(value));
690             }
691         }
692
693         /// <summary>
694         /// SelectionHandlePressedImageLeft property.
695         /// </summary>
696         public PropertyMap SelectionHandlePressedImageLeft
697         {
698             get
699             {
700                 PropertyMap temp = new PropertyMap();
701                 GetProperty(TextEditor.Property.SELECTION_HANDLE_PRESSED_IMAGE_LEFT).Get(temp);
702                 return temp;
703             }
704             set
705             {
706                 SetProperty(TextEditor.Property.SELECTION_HANDLE_PRESSED_IMAGE_LEFT, new Tizen.NUI.PropertyValue(value));
707             }
708         }
709
710         /// <summary>
711         /// SelectionHandlePressedImageRight property.
712         /// </summary>
713         public PropertyMap SelectionHandlePressedImageRight
714         {
715             get
716             {
717                 PropertyMap temp = new PropertyMap();
718                 GetProperty(TextEditor.Property.SELECTION_HANDLE_PRESSED_IMAGE_RIGHT).Get(temp);
719                 return temp;
720             }
721             set
722             {
723                 SetProperty(TextEditor.Property.SELECTION_HANDLE_PRESSED_IMAGE_RIGHT, new Tizen.NUI.PropertyValue(value));
724             }
725         }
726
727         /// <summary>
728         /// SelectionHandleMarkerImageLeft property.
729         /// </summary>
730         public PropertyMap SelectionHandleMarkerImageLeft
731         {
732             get
733             {
734                 PropertyMap temp = new PropertyMap();
735                 GetProperty(TextEditor.Property.SELECTION_HANDLE_MARKER_IMAGE_LEFT).Get(temp);
736                 return temp;
737             }
738             set
739             {
740                 SetProperty(TextEditor.Property.SELECTION_HANDLE_MARKER_IMAGE_LEFT, new Tizen.NUI.PropertyValue(value));
741             }
742         }
743
744         /// <summary>
745         /// SelectionHandleMarkerImageRight property.
746         /// </summary>
747         public PropertyMap SelectionHandleMarkerImageRight
748         {
749             get
750             {
751                 PropertyMap temp = new PropertyMap();
752                 GetProperty(TextEditor.Property.SELECTION_HANDLE_MARKER_IMAGE_RIGHT).Get(temp);
753                 return temp;
754             }
755             set
756             {
757                 SetProperty(TextEditor.Property.SELECTION_HANDLE_MARKER_IMAGE_RIGHT, new Tizen.NUI.PropertyValue(value));
758             }
759         }
760
761         /// <summary>
762         /// SelectionHighlightColor property.
763         /// </summary>
764         public Vector4 SelectionHighlightColor
765         {
766             get
767             {
768                 Vector4 temp = new Vector4(0.0f, 0.0f, 0.0f, 0.0f);
769                 GetProperty(TextEditor.Property.SELECTION_HIGHLIGHT_COLOR).Get(temp);
770                 return temp;
771             }
772             set
773             {
774                 SetProperty(TextEditor.Property.SELECTION_HIGHLIGHT_COLOR, new Tizen.NUI.PropertyValue(value));
775             }
776         }
777
778         /// <summary>
779         /// DecorationBoundingBox property.
780         /// </summary>
781         public Rectangle DecorationBoundingBox
782         {
783             get
784             {
785                 Rectangle temp = new Rectangle(0, 0, 0, 0);
786                 GetProperty(TextEditor.Property.DECORATION_BOUNDING_BOX).Get(temp);
787                 return temp;
788             }
789             set
790             {
791                 SetProperty(TextEditor.Property.DECORATION_BOUNDING_BOX, new Tizen.NUI.PropertyValue(value));
792             }
793         }
794
795         /// <summary>
796         /// EnableMarkup property.
797         /// </summary>
798         public bool EnableMarkup
799         {
800             get
801             {
802                 bool temp = false;
803                 GetProperty(TextEditor.Property.ENABLE_MARKUP).Get(out temp);
804                 return temp;
805             }
806             set
807             {
808                 SetProperty(TextEditor.Property.ENABLE_MARKUP, new Tizen.NUI.PropertyValue(value));
809             }
810         }
811
812         /// <summary>
813         /// InputColor property.
814         /// </summary>
815         public Vector4 InputColor
816         {
817             get
818             {
819                 Vector4 temp = new Vector4(0.0f, 0.0f, 0.0f, 0.0f);
820                 GetProperty(TextEditor.Property.INPUT_COLOR).Get(temp);
821                 return temp;
822             }
823             set
824             {
825                 SetProperty(TextEditor.Property.INPUT_COLOR, new Tizen.NUI.PropertyValue(value));
826             }
827         }
828
829         /// <summary>
830         /// InputFontFamily property.
831         /// </summary>
832         public string InputFontFamily
833         {
834             get
835             {
836                 string temp;
837                 GetProperty(TextEditor.Property.INPUT_FONT_FAMILY).Get(out temp);
838                 return temp;
839             }
840             set
841             {
842                 SetProperty(TextEditor.Property.INPUT_FONT_FAMILY, new Tizen.NUI.PropertyValue(value));
843             }
844         }
845
846         /// <summary>
847         /// InputFontStyle property.
848         /// </summary>
849         public PropertyMap InputFontStyle
850         {
851             get
852             {
853                 PropertyMap temp = new PropertyMap();
854                 GetProperty(TextEditor.Property.INPUT_FONT_STYLE).Get(temp);
855                 return temp;
856             }
857             set
858             {
859                 SetProperty(TextEditor.Property.INPUT_FONT_STYLE, new Tizen.NUI.PropertyValue(value));
860             }
861         }
862
863         /// <summary>
864         /// InputPointSize property.
865         /// </summary>
866         public float InputPointSize
867         {
868             get
869             {
870                 float temp = 0.0f;
871                 GetProperty(TextEditor.Property.INPUT_POINT_SIZE).Get(out temp);
872                 return temp;
873             }
874             set
875             {
876                 SetProperty(TextEditor.Property.INPUT_POINT_SIZE, new Tizen.NUI.PropertyValue(value));
877             }
878         }
879
880         /// <summary>
881         /// LineSpacing property.
882         /// </summary>
883         public float LineSpacing
884         {
885             get
886             {
887                 float temp = 0.0f;
888                 GetProperty(TextEditor.Property.LINE_SPACING).Get(out temp);
889                 return temp;
890             }
891             set
892             {
893                 SetProperty(TextEditor.Property.LINE_SPACING, new Tizen.NUI.PropertyValue(value));
894             }
895         }
896
897         /// <summary>
898         /// InputLineSpacing property.
899         /// </summary>
900         public float InputLineSpacing
901         {
902             get
903             {
904                 float temp = 0.0f;
905                 GetProperty(TextEditor.Property.INPUT_LINE_SPACING).Get(out temp);
906                 return temp;
907             }
908             set
909             {
910                 SetProperty(TextEditor.Property.INPUT_LINE_SPACING, new Tizen.NUI.PropertyValue(value));
911             }
912         }
913
914         /// <summary>
915         /// Underline property.
916         /// </summary>
917         public PropertyMap Underline
918         {
919             get
920             {
921                 PropertyMap temp = new PropertyMap();
922                 GetProperty(TextEditor.Property.UNDERLINE).Get(temp);
923                 return temp;
924             }
925             set
926             {
927                 SetProperty(TextEditor.Property.UNDERLINE, new Tizen.NUI.PropertyValue(value));
928             }
929         }
930
931         /// <summary>
932         /// InputUnderline property.
933         /// </summary>
934         public string InputUnderline
935         {
936             get
937             {
938                 string temp;
939                 GetProperty(TextEditor.Property.INPUT_UNDERLINE).Get(out temp);
940                 return temp;
941             }
942             set
943             {
944                 SetProperty(TextEditor.Property.INPUT_UNDERLINE, new Tizen.NUI.PropertyValue(value));
945             }
946         }
947
948         /// <summary>
949         /// Shadow property.
950         /// </summary>
951         public PropertyMap Shadow
952         {
953             get
954             {
955                 PropertyMap temp = new PropertyMap();
956                 GetProperty(TextEditor.Property.SHADOW).Get(temp);
957                 return temp;
958             }
959             set
960             {
961                 SetProperty(TextEditor.Property.SHADOW, new Tizen.NUI.PropertyValue(value));
962             }
963         }
964
965         /// <summary>
966         /// InputShadow property.
967         /// </summary>
968         public string InputShadow
969         {
970             get
971             {
972                 string temp;
973                 GetProperty(TextEditor.Property.INPUT_SHADOW).Get(out temp);
974                 return temp;
975             }
976             set
977             {
978                 SetProperty(TextEditor.Property.INPUT_SHADOW, new Tizen.NUI.PropertyValue(value));
979             }
980         }
981
982         /// <summary>
983         /// Emboss property.
984         /// </summary>
985         public string Emboss
986         {
987             get
988             {
989                 string temp;
990                 GetProperty(TextEditor.Property.EMBOSS).Get(out temp);
991                 return temp;
992             }
993             set
994             {
995                 SetProperty(TextEditor.Property.EMBOSS, new Tizen.NUI.PropertyValue(value));
996             }
997         }
998
999         /// <summary>
1000         /// InputEmboss property.
1001         /// </summary>
1002         public string InputEmboss
1003         {
1004             get
1005             {
1006                 string temp;
1007                 GetProperty(TextEditor.Property.INPUT_EMBOSS).Get(out temp);
1008                 return temp;
1009             }
1010             set
1011             {
1012                 SetProperty(TextEditor.Property.INPUT_EMBOSS, new Tizen.NUI.PropertyValue(value));
1013             }
1014         }
1015
1016         /// <summary>
1017         /// Outline property.
1018         /// </summary>
1019         public string Outline
1020         {
1021             get
1022             {
1023                 string temp;
1024                 GetProperty(TextEditor.Property.OUTLINE).Get(out temp);
1025                 return temp;
1026             }
1027             set
1028             {
1029                 SetProperty(TextEditor.Property.OUTLINE, new Tizen.NUI.PropertyValue(value));
1030             }
1031         }
1032
1033         /// <summary>
1034         /// InputOutline property.
1035         /// </summary>
1036         public string InputOutline
1037         {
1038             get
1039             {
1040                 string temp;
1041                 GetProperty(TextEditor.Property.INPUT_OUTLINE).Get(out temp);
1042                 return temp;
1043             }
1044             set
1045             {
1046                 SetProperty(TextEditor.Property.INPUT_OUTLINE, new Tizen.NUI.PropertyValue(value));
1047             }
1048         }
1049
1050         /// <summary>
1051         /// SmoothScroll property.
1052         /// </summary>
1053         public bool SmoothScroll
1054         {
1055             get
1056             {
1057                 bool temp = false;
1058                 GetProperty(TextEditor.Property.SMOOTH_SCROLL).Get(out temp);
1059                 return temp;
1060             }
1061             set
1062             {
1063                 SetProperty(TextEditor.Property.SMOOTH_SCROLL, new Tizen.NUI.PropertyValue(value));
1064             }
1065         }
1066
1067         /// <summary>
1068         /// SmoothScrollDuration property.
1069         /// </summary>
1070         public float SmoothScrollDuration
1071         {
1072             get
1073             {
1074                 float temp = 0.0f;
1075                 GetProperty(TextEditor.Property.SMOOTH_SCROLL_DURATION).Get(out temp);
1076                 return temp;
1077             }
1078             set
1079             {
1080                 SetProperty(TextEditor.Property.SMOOTH_SCROLL_DURATION, new Tizen.NUI.PropertyValue(value));
1081             }
1082         }
1083
1084         /// <summary>
1085         /// EnableScrollBar property.
1086         /// </summary>
1087         public bool EnableScrollBar
1088         {
1089             get
1090             {
1091                 bool temp = false;
1092                 GetProperty(TextEditor.Property.ENABLE_SCROLL_BAR).Get(out temp);
1093                 return temp;
1094             }
1095             set
1096             {
1097                 SetProperty(TextEditor.Property.ENABLE_SCROLL_BAR, new Tizen.NUI.PropertyValue(value));
1098             }
1099         }
1100
1101         /// <summary>
1102         /// ScrollBarShowDuration property.
1103         /// </summary>
1104         public float ScrollBarShowDuration
1105         {
1106             get
1107             {
1108                 float temp = 0.0f;
1109                 GetProperty(TextEditor.Property.SCROLL_BAR_SHOW_DURATION).Get(out temp);
1110                 return temp;
1111             }
1112             set
1113             {
1114                 SetProperty(TextEditor.Property.SCROLL_BAR_SHOW_DURATION, new Tizen.NUI.PropertyValue(value));
1115             }
1116         }
1117
1118         /// <summary>
1119         /// ScrollBarFadeDuration property.
1120         /// </summary>
1121         public float ScrollBarFadeDuration
1122         {
1123             get
1124             {
1125                 float temp = 0.0f;
1126                 GetProperty(TextEditor.Property.SCROLL_BAR_FADE_DURATION).Get(out temp);
1127                 return temp;
1128             }
1129             set
1130             {
1131                 SetProperty(TextEditor.Property.SCROLL_BAR_FADE_DURATION, new Tizen.NUI.PropertyValue(value));
1132             }
1133         }
1134
1135         /// <summary>
1136         /// PixelSize property.
1137         /// </summary>
1138         public float PixelSize
1139         {
1140             get
1141             {
1142                 float temp = 0.0f;
1143                 GetProperty(TextEditor.Property.PIXEL_SIZE).Get(out temp);
1144                 return temp;
1145             }
1146             set
1147             {
1148                 SetProperty(TextEditor.Property.PIXEL_SIZE, new Tizen.NUI.PropertyValue(value));
1149             }
1150         }
1151
1152         /// <summary>
1153         /// The line count of text.
1154         /// </summary>
1155         public int LineCount
1156         {
1157             get
1158             {
1159                 int temp = 0;
1160                 GetProperty(TextEditor.Property.LINE_COUNT).Get(out temp);
1161                 return temp;
1162             }
1163         }
1164
1165         /// <summary>
1166         /// The text to display when the TextEditor is empty and inactive.
1167         /// </summary>
1168         public string PlaceholderText
1169         {
1170             get
1171             {
1172                 string temp;
1173                 GetProperty(TextEditor.Property.PLACEHOLDER_TEXT).Get(out temp);
1174                 return temp;
1175             }
1176             set
1177             {
1178                 SetProperty(TextEditor.Property.PLACEHOLDER_TEXT, new Tizen.NUI.PropertyValue(value));
1179             }
1180         }
1181
1182         /// <summary>
1183         /// The placeholder-text color.
1184         /// </summary>
1185         public Color PlaceholderTextColor
1186         {
1187             get
1188             {
1189                 Color temp = new Color(0.0f, 0.0f, 0.0f, 0.0f);
1190                 GetProperty(TextEditor.Property.PLACEHOLDER_TEXT_COLOR).Get(temp);
1191                 return temp;
1192             }
1193             set
1194             {
1195                 SetProperty(TextEditor.Property.PLACEHOLDER_TEXT_COLOR, new Tizen.NUI.PropertyValue(value));
1196             }
1197         }
1198
1199         /// <summary>
1200         /// Enable selection property.
1201         /// </summary>
1202         public bool EnableSelection
1203         {
1204             get
1205             {
1206                 bool temp = false;
1207                 GetProperty(TextEditor.Property.ENABLE_SELECTION).Get(out temp);
1208                 return temp;
1209             }
1210             set
1211             {
1212                 SetProperty(TextEditor.Property.ENABLE_SELECTION, new Tizen.NUI.PropertyValue(value));
1213             }
1214         }
1215
1216         /// <summary>
1217         /// Placeholder property.
1218         /// Gets/Sets the placeholder : text, color, font family, font style, point size, and pixel size.
1219         /// </summary>
1220         /// <example>
1221         /// The following example demonstrates how to set the placeholder property.
1222         /// <code>
1223         /// PropertyMap propertyMap = new PropertyMap();
1224         /// propertyMap.Add("placeholderText", new PropertyValue("Setting Placeholder Text"));
1225         /// propertyMap.Add("placeholderTextFocused", new PropertyValue("Setting Placeholder Text Focused"));
1226         /// propertyMap.Add("placeholderColor", new PropertyValue(Color.Red));
1227         /// propertyMap.Add("placeholderFontFamily", new PropertyValue("Arial"));
1228         /// propertyMap.Add("placeholderPointSize", new PropertyValue(12.0f));
1229         ///
1230         /// PropertyMap fontStyleMap = new PropertyMap();
1231         /// fontStyleMap.Add("weight", new PropertyValue("bold"));
1232         /// fontStyleMap.Add("width", new PropertyValue("condensed"));
1233         /// fontStyleMap.Add("slant", new PropertyValue("italic"));
1234         /// propertyMap.Add("placeholderFontStyle", new PropertyValue(fontStyleMap));
1235         ///
1236         /// TextEditor editor = new TextEditor();
1237         /// editor.Placeholder = propertyMap;
1238         /// </code>
1239         /// </example>
1240         public Tizen.NUI.PropertyMap Placeholder
1241         {
1242             get
1243             {
1244                 Tizen.NUI.PropertyMap temp = new Tizen.NUI.PropertyMap();
1245                 GetProperty(TextEditor.Property.PLACEHOLDER).Get(temp);
1246                 return temp;
1247             }
1248             set
1249             {
1250                 SetProperty(TextEditor.Property.PLACEHOLDER, new Tizen.NUI.PropertyValue(value));
1251             }
1252         }
1253
1254         /// <summary>
1255         /// LineWrapMode property.<br>
1256         /// line wrap mode when the text lines over layout width.<br>
1257         /// </summary>
1258         public LineWrapMode LineWrapMode
1259         {
1260             get
1261             {
1262                 string temp;
1263                 if(GetProperty(TextEditor.Property.LINE_WRAP_MODE).Get(out temp) == false)
1264                 {
1265                     NUILog.Error("LineWrapMode get error!");
1266                 }
1267                 switch (temp)
1268                 {
1269                     case "WORD":
1270                     return LineWrapMode.Word;
1271                     case "CHARACTER":
1272                     return LineWrapMode.Character;
1273                     default:
1274                     return LineWrapMode.Word;
1275                 }
1276             }
1277             set
1278             {
1279                 string temp = "";
1280                 switch (value)
1281                 {
1282                     case LineWrapMode.Word:
1283                     {
1284                         temp = "WORD";
1285                         break;
1286                     }
1287                     case LineWrapMode.Character:
1288                     {
1289                         temp = "CHARACTER";
1290                         break;
1291                     }
1292                 }
1293                 SetProperty(TextEditor.Property.LINE_WRAP_MODE, new Tizen.NUI.PropertyValue(temp));
1294             }
1295         }
1296
1297     }
1298
1299 }