2 * Copyright(c) 2017 Samsung Electronics Co., Ltd.
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
18 extern alias TizenSystemSettings;
19 using TizenSystemSettings.Tizen.System;
22 using System.Runtime.InteropServices;
23 using System.Globalization;
24 using System.ComponentModel;
26 namespace Tizen.NUI.BaseComponents
29 /// A control which provides a multi-line editable text editor.
31 /// <since_tizen> 3 </since_tizen>
32 public class TextEditor : View
34 private global::System.Runtime.InteropServices.HandleRef swigCPtr;
35 private string textEditorTextSid = null;
36 private string textEditorPlaceHolderTextSid = null;
37 private bool systemlangTextFlag = false;
39 internal TextEditor(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.TextEditor_SWIGUpcast(cPtr), cMemoryOwn)
41 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
44 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(TextEditor obj)
46 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
52 /// <since_tizen> 3 </since_tizen>
53 protected override void Dispose(DisposeTypes type)
60 if(type == DisposeTypes.Explicit)
63 //Release your own managed resources here.
64 //You should release all of your own disposable objects here.
67 //Release your own unmanaged resources here.
68 //You should not access any managed member here except static instance.
69 //because the execution order of Finalizes is non-deterministic.
71 if (_textEditorTextChangedCallbackDelegate != null)
73 TextChangedSignal().Disconnect(_textEditorTextChangedCallbackDelegate);
76 if (swigCPtr.Handle != global::System.IntPtr.Zero)
81 NDalicPINVOKE.delete_TextEditor(swigCPtr);
83 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
90 /// Event arguments that passed via the TextChanged signal.
92 /// <since_tizen> 3 </since_tizen>
93 public class TextChangedEventArgs : EventArgs
95 private TextEditor _textEditor;
98 /// TextEditor - is the texteditor control which has the text contents changed.
100 /// <since_tizen> 3 </since_tizen>
101 public TextEditor TextEditor
114 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
115 private delegate void TextChangedCallbackDelegate(IntPtr textEditor);
116 private EventHandler<TextChangedEventArgs> _textEditorTextChangedEventHandler;
117 private TextChangedCallbackDelegate _textEditorTextChangedCallbackDelegate;
120 /// An event for the TextChanged signal which can be used to subscribe or unsubscribe the event handler
121 /// provided by the user. The TextChanged signal is emitted when the text changes.<br />
123 /// <since_tizen> 3 </since_tizen>
124 public event EventHandler<TextChangedEventArgs> TextChanged
128 if (_textEditorTextChangedEventHandler == null)
130 _textEditorTextChangedCallbackDelegate = (OnTextChanged);
131 TextChangedSignal().Connect(_textEditorTextChangedCallbackDelegate);
133 _textEditorTextChangedEventHandler += value;
137 _textEditorTextChangedEventHandler -= value;
138 if (_textEditorTextChangedEventHandler == null && TextChangedSignal().Empty() == false)
140 TextChangedSignal().Disconnect(_textEditorTextChangedCallbackDelegate);
145 private void OnTextChanged(IntPtr textEditor)
147 TextChangedEventArgs e = new TextChangedEventArgs();
149 // Populate all members of "e" (TextChangedEventArgs) with real data
150 e.TextEditor = Registry.GetManagedBaseHandleFromNativePtr(textEditor) as TextEditor;
152 if (_textEditorTextChangedEventHandler != null)
154 //here we send all data to user event handlers
155 _textEditorTextChangedEventHandler(this, e);
161 /// Event arguments that passed via the ScrollStateChanged signal.
163 /// <since_tizen> 3 </since_tizen>
164 public class ScrollStateChangedEventArgs : EventArgs
166 private TextEditor _textEditor;
167 private ScrollState _scrollState;
170 /// TextEditor - is the texteditor control which has the scroll state changed.
172 /// <since_tizen> 3 </since_tizen>
173 public TextEditor TextEditor
186 /// ScrollState - is the texteditor control scroll state.
188 /// <since_tizen> 3 </since_tizen>
189 public ScrollState ScrollState
197 _scrollState = value;
202 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
203 private delegate void ScrollStateChangedCallbackDelegate(IntPtr textEditor, ScrollState state);
204 private EventHandler<ScrollStateChangedEventArgs> _textEditorScrollStateChangedEventHandler;
205 private ScrollStateChangedCallbackDelegate _textEditorScrollStateChangedCallbackDelegate;
208 /// Event for the ScrollStateChanged signal which can be used to subscribe or unsubscribe the event handler
209 /// provided by the user. The ScrollStateChanged signal is emitted when the scroll state changes.<br />
211 /// <since_tizen> 3 </since_tizen>
212 public event EventHandler<ScrollStateChangedEventArgs> ScrollStateChanged
216 if (_textEditorScrollStateChangedEventHandler == null)
218 _textEditorScrollStateChangedCallbackDelegate = OnScrollStateChanged;
219 ScrollStateChangedSignal(this).Connect(_textEditorScrollStateChangedCallbackDelegate);
221 _textEditorScrollStateChangedEventHandler += value;
225 _textEditorScrollStateChangedEventHandler -= value;
226 if (_textEditorScrollStateChangedEventHandler == null && ScrollStateChangedSignal(this).Empty() == false)
228 ScrollStateChangedSignal(this).Disconnect(_textEditorScrollStateChangedCallbackDelegate);
233 private void OnScrollStateChanged(IntPtr textEditor, ScrollState state)
235 ScrollStateChangedEventArgs e = new ScrollStateChangedEventArgs();
237 if (textEditor != null)
239 // Populate all members of "e" (ScrollStateChangedEventArgs) with real data
240 e.TextEditor = Registry.GetManagedBaseHandleFromNativePtr(textEditor) as TextEditor;
241 e.ScrollState = state;
244 if (_textEditorScrollStateChangedEventHandler != null)
246 //here we send all data to user event handlers
247 _textEditorScrollStateChangedEventHandler(this, e);
251 internal new class Property
253 internal static readonly int RENDERING_BACKEND = NDalicPINVOKE.TextEditor_Property_RENDERING_BACKEND_get();
254 internal static readonly int TEXT = NDalicPINVOKE.TextEditor_Property_TEXT_get();
255 internal static readonly int TEXT_COLOR = NDalicPINVOKE.TextEditor_Property_TEXT_COLOR_get();
256 internal static readonly int FONT_FAMILY = NDalicPINVOKE.TextEditor_Property_FONT_FAMILY_get();
257 internal static readonly int FONT_STYLE = NDalicPINVOKE.TextEditor_Property_FONT_STYLE_get();
258 internal static readonly int POINT_SIZE = NDalicPINVOKE.TextEditor_Property_POINT_SIZE_get();
259 internal static readonly int HORIZONTAL_ALIGNMENT = NDalicPINVOKE.TextEditor_Property_HORIZONTAL_ALIGNMENT_get();
260 internal static readonly int SCROLL_THRESHOLD = NDalicPINVOKE.TextEditor_Property_SCROLL_THRESHOLD_get();
261 internal static readonly int SCROLL_SPEED = NDalicPINVOKE.TextEditor_Property_SCROLL_SPEED_get();
262 internal static readonly int PRIMARY_CURSOR_COLOR = NDalicPINVOKE.TextEditor_Property_PRIMARY_CURSOR_COLOR_get();
263 internal static readonly int SECONDARY_CURSOR_COLOR = NDalicPINVOKE.TextEditor_Property_SECONDARY_CURSOR_COLOR_get();
264 internal static readonly int ENABLE_CURSOR_BLINK = NDalicPINVOKE.TextEditor_Property_ENABLE_CURSOR_BLINK_get();
265 internal static readonly int CURSOR_BLINK_INTERVAL = NDalicPINVOKE.TextEditor_Property_CURSOR_BLINK_INTERVAL_get();
266 internal static readonly int CURSOR_BLINK_DURATION = NDalicPINVOKE.TextEditor_Property_CURSOR_BLINK_DURATION_get();
267 internal static readonly int CURSOR_WIDTH = NDalicPINVOKE.TextEditor_Property_CURSOR_WIDTH_get();
268 internal static readonly int GRAB_HANDLE_IMAGE = NDalicPINVOKE.TextEditor_Property_GRAB_HANDLE_IMAGE_get();
269 internal static readonly int GRAB_HANDLE_PRESSED_IMAGE = NDalicPINVOKE.TextEditor_Property_GRAB_HANDLE_PRESSED_IMAGE_get();
270 internal static readonly int SELECTION_HANDLE_IMAGE_LEFT = NDalicPINVOKE.TextEditor_Property_SELECTION_HANDLE_IMAGE_LEFT_get();
271 internal static readonly int SELECTION_HANDLE_IMAGE_RIGHT = NDalicPINVOKE.TextEditor_Property_SELECTION_HANDLE_IMAGE_RIGHT_get();
272 internal static readonly int SELECTION_HANDLE_PRESSED_IMAGE_LEFT = NDalicPINVOKE.TextEditor_Property_SELECTION_HANDLE_PRESSED_IMAGE_LEFT_get();
273 internal static readonly int SELECTION_HANDLE_PRESSED_IMAGE_RIGHT = NDalicPINVOKE.TextEditor_Property_SELECTION_HANDLE_PRESSED_IMAGE_RIGHT_get();
274 internal static readonly int SELECTION_HANDLE_MARKER_IMAGE_LEFT = NDalicPINVOKE.TextEditor_Property_SELECTION_HANDLE_MARKER_IMAGE_LEFT_get();
275 internal static readonly int SELECTION_HANDLE_MARKER_IMAGE_RIGHT = NDalicPINVOKE.TextEditor_Property_SELECTION_HANDLE_MARKER_IMAGE_RIGHT_get();
276 internal static readonly int SELECTION_HIGHLIGHT_COLOR = NDalicPINVOKE.TextEditor_Property_SELECTION_HIGHLIGHT_COLOR_get();
277 internal static readonly int DECORATION_BOUNDING_BOX = NDalicPINVOKE.TextEditor_Property_DECORATION_BOUNDING_BOX_get();
278 internal static readonly int ENABLE_MARKUP = NDalicPINVOKE.TextEditor_Property_ENABLE_MARKUP_get();
279 internal static readonly int INPUT_COLOR = NDalicPINVOKE.TextEditor_Property_INPUT_COLOR_get();
280 internal static readonly int INPUT_FONT_FAMILY = NDalicPINVOKE.TextEditor_Property_INPUT_FONT_FAMILY_get();
281 internal static readonly int INPUT_FONT_STYLE = NDalicPINVOKE.TextEditor_Property_INPUT_FONT_STYLE_get();
282 internal static readonly int INPUT_POINT_SIZE = NDalicPINVOKE.TextEditor_Property_INPUT_POINT_SIZE_get();
283 internal static readonly int LINE_SPACING = NDalicPINVOKE.TextEditor_Property_LINE_SPACING_get();
284 internal static readonly int INPUT_LINE_SPACING = NDalicPINVOKE.TextEditor_Property_INPUT_LINE_SPACING_get();
285 internal static readonly int UNDERLINE = NDalicPINVOKE.TextEditor_Property_UNDERLINE_get();
286 internal static readonly int INPUT_UNDERLINE = NDalicPINVOKE.TextEditor_Property_INPUT_UNDERLINE_get();
287 internal static readonly int SHADOW = NDalicPINVOKE.TextEditor_Property_SHADOW_get();
288 internal static readonly int INPUT_SHADOW = NDalicPINVOKE.TextEditor_Property_INPUT_SHADOW_get();
289 internal static readonly int EMBOSS = NDalicPINVOKE.TextEditor_Property_EMBOSS_get();
290 internal static readonly int INPUT_EMBOSS = NDalicPINVOKE.TextEditor_Property_INPUT_EMBOSS_get();
291 internal static readonly int OUTLINE = NDalicPINVOKE.TextEditor_Property_OUTLINE_get();
292 internal static readonly int INPUT_OUTLINE = NDalicPINVOKE.TextEditor_Property_INPUT_OUTLINE_get();
293 internal static readonly int SMOOTH_SCROLL = NDalicManualPINVOKE.TextEditor_Property_SMOOTH_SCROLL_get();
294 internal static readonly int SMOOTH_SCROLL_DURATION = NDalicManualPINVOKE.TextEditor_Property_SMOOTH_SCROLL_DURATION_get();
295 internal static readonly int ENABLE_SCROLL_BAR = NDalicManualPINVOKE.TextEditor_Property_ENABLE_SCROLL_BAR_get();
296 internal static readonly int SCROLL_BAR_SHOW_DURATION = NDalicManualPINVOKE.TextEditor_Property_SCROLL_BAR_SHOW_DURATION_get();
297 internal static readonly int SCROLL_BAR_FADE_DURATION = NDalicManualPINVOKE.TextEditor_Property_SCROLL_BAR_FADE_DURATION_get();
298 internal static readonly int PIXEL_SIZE = NDalicManualPINVOKE.TextEditor_Property_PIXEL_SIZE_get();
299 internal static readonly int LINE_COUNT = NDalicManualPINVOKE.TextEditor_Property_LINE_COUNT_get();
300 internal static readonly int PLACEHOLDER_TEXT = NDalicManualPINVOKE.TextEditor_Property_PLACEHOLDER_TEXT_get();
301 internal static readonly int PLACEHOLDER_TEXT_COLOR = NDalicManualPINVOKE.TextEditor_Property_PLACEHOLDER_TEXT_COLOR_get();
302 internal static readonly int ENABLE_SELECTION = NDalicManualPINVOKE.TextEditor_Property_ENABLE_SELECTION_get();
303 internal static readonly int PLACEHOLDER = NDalicManualPINVOKE.TextEditor_Property_PLACEHOLDER_get();
304 internal static readonly int LINE_WRAP_MODE = NDalicManualPINVOKE.TextEditor_Property_LINE_WRAP_MODE_get();
307 internal class InputStyle
316 LineSpacing = 0x0010,
325 /// Creates the TextEditor control.
327 /// <since_tizen> 3 </since_tizen>
328 public TextEditor() : this(NDalicPINVOKE.TextEditor_New(), true)
330 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
333 internal TextEditor(TextEditor handle) : this(NDalicPINVOKE.new_TextEditor__SWIG_1(TextEditor.getCPtr(handle)), true)
335 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
339 /// Downcasts a handle to textEditor handle.
341 /// <param name="handle"></param>
342 /// <returns></returns>
343 /// <since_tizen> 3 </since_tizen>
344 /// Please do not use! this will be deprecated!
345 /// Instead please use as keyword.
346 [Obsolete("Please do not use! This will be deprecated! Please use as keyword instead!")]
347 [EditorBrowsable(EditorBrowsableState.Never)]
348 public new static TextEditor DownCast(BaseHandle handle)
350 TextEditor ret = Registry.GetManagedBaseHandleFromNativePtr(handle) as TextEditor;
351 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
355 internal TextEditorSignal TextChangedSignal()
357 TextEditorSignal ret = new TextEditorSignal(NDalicPINVOKE.TextEditor_TextChangedSignal(swigCPtr), false);
358 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
362 internal ScrollStateChangedSignal ScrollStateChangedSignal(TextEditor textEditor)
364 ScrollStateChangedSignal ret = new ScrollStateChangedSignal(NDalicManualPINVOKE.TextEditor_ScrollStateChangedSignal(TextEditor.getCPtr(textEditor)), false);
365 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
369 internal SWIGTYPE_p_Dali__SignalT_void_fDali__Toolkit__TextEditor_Dali__Toolkit__TextEditor__InputStyle__MaskF_t InputStyleChangedSignal()
371 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);
372 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
377 /// The TranslatableText property.<br />
378 /// The text can set the SID value.<br />
380 /// <exception cref='ArgumentNullException'>
381 /// ResourceManager about multilingual is null.
383 /// <since_tizen> 4 </since_tizen>
384 public string TranslatableText
388 return textEditorTextSid;
392 if (NUIApplication.MultilingualResourceManager == null)
394 throw new ArgumentNullException("ResourceManager about multilingual is null");
396 textEditorTextSid = value;
397 Text = SetTranslatable(textEditorTextSid);
401 /// The TranslatablePlaceholderText property.<br />
402 /// The text can set the SID value.<br />
404 /// <exception cref='ArgumentNullException'>
405 /// ResourceManager about multilingual is null.
407 /// <since_tizen> 4 </since_tizen>
408 public string TranslatablePlaceholderText
412 return textEditorPlaceHolderTextSid;
416 if (NUIApplication.MultilingualResourceManager == null)
418 throw new ArgumentNullException("ResourceManager about multilingual is null");
420 textEditorPlaceHolderTextSid = value;
421 PlaceholderText = SetTranslatable(textEditorPlaceHolderTextSid);
424 private string SetTranslatable(string textEditorSid)
426 string translatableText = null;
427 translatableText = NUIApplication.MultilingualResourceManager?.GetString(textEditorSid, new CultureInfo(SystemSettings.LocaleLanguage.Replace("_", "-")));
428 if (translatableText != null)
430 if (systemlangTextFlag == false)
432 SystemSettings.LocaleLanguageChanged += new WeakEventHandler<LocaleLanguageChangedEventArgs>(SystemSettings_LocaleLanguageChanged).Handler;
433 systemlangTextFlag = true;
435 return translatableText;
439 translatableText = "";
440 return translatableText;
443 private void SystemSettings_LocaleLanguageChanged(object sender, LocaleLanguageChangedEventArgs e)
445 if (textEditorTextSid != null)
447 Text = NUIApplication.MultilingualResourceManager?.GetString(textEditorTextSid, new CultureInfo(e.Value.Replace("_", "-")));
449 if (textEditorPlaceHolderTextSid != null)
451 PlaceholderText = NUIApplication.MultilingualResourceManager?.GetString(textEditorPlaceHolderTextSid, new CultureInfo(e.Value.Replace("_", "-")));
455 /// The Text property.
457 /// <since_tizen> 3 </since_tizen>
463 GetProperty(TextEditor.Property.TEXT).Get(out temp);
468 SetProperty(TextEditor.Property.TEXT, new Tizen.NUI.PropertyValue(value));
473 /// The TextColor property.
475 /// <since_tizen> 3 </since_tizen>
476 public Vector4 TextColor
480 Vector4 temp = new Vector4(0.0f, 0.0f, 0.0f, 0.0f);
481 GetProperty(TextEditor.Property.TEXT_COLOR).Get(temp);
486 SetProperty(TextEditor.Property.TEXT_COLOR, new Tizen.NUI.PropertyValue(value));
491 /// The FontFamily property.
493 /// <since_tizen> 3 </since_tizen>
494 public string FontFamily
499 GetProperty(TextEditor.Property.FONT_FAMILY).Get(out temp);
504 SetProperty(TextEditor.Property.FONT_FAMILY, new Tizen.NUI.PropertyValue(value));
509 /// The FontStyle property.
511 /// <since_tizen> 3 </since_tizen>
512 public PropertyMap FontStyle
516 PropertyMap temp = new PropertyMap();
517 GetProperty(TextEditor.Property.FONT_STYLE).Get(temp);
522 SetProperty(TextEditor.Property.FONT_STYLE, new Tizen.NUI.PropertyValue(value));
527 /// The PointSize property.
529 /// <since_tizen> 3 </since_tizen>
530 public float PointSize
535 GetProperty(TextEditor.Property.POINT_SIZE).Get(out temp);
540 SetProperty(TextEditor.Property.POINT_SIZE, new Tizen.NUI.PropertyValue(value));
545 /// The HorizontalAlignment property.
547 /// <since_tizen> 3 </since_tizen>
548 public HorizontalAlignment HorizontalAlignment
553 if (GetProperty(TextEditor.Property.HORIZONTAL_ALIGNMENT).Get(out temp) == false)
555 NUILog.Error("HorizontalAlignment get error!");
561 return HorizontalAlignment.Begin;
563 return HorizontalAlignment.Center;
565 return HorizontalAlignment.End;
567 return HorizontalAlignment.Begin;
572 string valueToString = "";
575 case HorizontalAlignment.Begin:
577 valueToString = "BEGIN";
580 case HorizontalAlignment.Center:
582 valueToString = "CENTER";
585 case HorizontalAlignment.End:
587 valueToString = "END";
592 valueToString = "BEGIN";
596 SetProperty(TextEditor.Property.HORIZONTAL_ALIGNMENT, new Tizen.NUI.PropertyValue(valueToString));
601 /// The ScrollThreshold property.
603 /// <since_tizen> 3 </since_tizen>
604 public float ScrollThreshold
609 GetProperty(TextEditor.Property.SCROLL_THRESHOLD).Get(out temp);
614 SetProperty(TextEditor.Property.SCROLL_THRESHOLD, new Tizen.NUI.PropertyValue(value));
619 /// The ScrollSpeed property.
621 /// <since_tizen> 3 </since_tizen>
622 public float ScrollSpeed
627 GetProperty(TextEditor.Property.SCROLL_SPEED).Get(out temp);
632 SetProperty(TextEditor.Property.SCROLL_SPEED, new Tizen.NUI.PropertyValue(value));
637 /// The PrimaryCursorColor property.
639 /// <since_tizen> 3 </since_tizen>
640 public Vector4 PrimaryCursorColor
644 Vector4 temp = new Vector4(0.0f, 0.0f, 0.0f, 0.0f);
645 GetProperty(TextEditor.Property.PRIMARY_CURSOR_COLOR).Get(temp);
650 SetProperty(TextEditor.Property.PRIMARY_CURSOR_COLOR, new Tizen.NUI.PropertyValue(value));
655 /// The SecondaryCursorColor property.
657 /// <since_tizen> 3 </since_tizen>
658 public Vector4 SecondaryCursorColor
662 Vector4 temp = new Vector4(0.0f, 0.0f, 0.0f, 0.0f);
663 GetProperty(TextEditor.Property.SECONDARY_CURSOR_COLOR).Get(temp);
668 SetProperty(TextEditor.Property.SECONDARY_CURSOR_COLOR, new Tizen.NUI.PropertyValue(value));
673 /// The EnableCursorBlink property.
675 /// <since_tizen> 3 </since_tizen>
676 public bool EnableCursorBlink
681 GetProperty(TextEditor.Property.ENABLE_CURSOR_BLINK).Get(out temp);
686 SetProperty(TextEditor.Property.ENABLE_CURSOR_BLINK, new Tizen.NUI.PropertyValue(value));
691 /// The CursorBlinkInterval property.
693 /// <since_tizen> 3 </since_tizen>
694 public float CursorBlinkInterval
699 GetProperty(TextEditor.Property.CURSOR_BLINK_INTERVAL).Get(out temp);
704 SetProperty(TextEditor.Property.CURSOR_BLINK_INTERVAL, new Tizen.NUI.PropertyValue(value));
709 /// The CursorBlinkDuration property.
711 /// <since_tizen> 3 </since_tizen>
712 public float CursorBlinkDuration
717 GetProperty(TextEditor.Property.CURSOR_BLINK_DURATION).Get(out temp);
722 SetProperty(TextEditor.Property.CURSOR_BLINK_DURATION, new Tizen.NUI.PropertyValue(value));
727 /// The CursorWidth property.
729 /// <since_tizen> 3 </since_tizen>
730 public int CursorWidth
735 GetProperty(TextEditor.Property.CURSOR_WIDTH).Get(out temp);
740 SetProperty(TextEditor.Property.CURSOR_WIDTH, new Tizen.NUI.PropertyValue(value));
745 /// The GrabHandleImage property.
747 /// <since_tizen> 3 </since_tizen>
748 public string GrabHandleImage
753 GetProperty(TextEditor.Property.GRAB_HANDLE_IMAGE).Get(out temp);
758 SetProperty(TextEditor.Property.GRAB_HANDLE_IMAGE, new Tizen.NUI.PropertyValue(value));
763 /// The GrabHandlePressedImage property.
765 /// <since_tizen> 3 </since_tizen>
766 public string GrabHandlePressedImage
771 GetProperty(TextEditor.Property.GRAB_HANDLE_PRESSED_IMAGE).Get(out temp);
776 SetProperty(TextEditor.Property.GRAB_HANDLE_PRESSED_IMAGE, new Tizen.NUI.PropertyValue(value));
781 /// The SelectionHandleImageLeft property.
783 /// <since_tizen> 3 </since_tizen>
784 public PropertyMap SelectionHandleImageLeft
788 PropertyMap temp = new PropertyMap();
789 GetProperty(TextEditor.Property.SELECTION_HANDLE_IMAGE_LEFT).Get(temp);
794 SetProperty(TextEditor.Property.SELECTION_HANDLE_IMAGE_LEFT, new Tizen.NUI.PropertyValue(value));
799 /// The SelectionHandleImageRight property.
801 /// <since_tizen> 3 </since_tizen>
802 public PropertyMap SelectionHandleImageRight
806 PropertyMap temp = new PropertyMap();
807 GetProperty(TextEditor.Property.SELECTION_HANDLE_IMAGE_RIGHT).Get(temp);
812 SetProperty(TextEditor.Property.SELECTION_HANDLE_IMAGE_RIGHT, new Tizen.NUI.PropertyValue(value));
817 /// The SelectionHandlePressedImageLeft property.
819 /// <since_tizen> 3 </since_tizen>
820 public PropertyMap SelectionHandlePressedImageLeft
824 PropertyMap temp = new PropertyMap();
825 GetProperty(TextEditor.Property.SELECTION_HANDLE_PRESSED_IMAGE_LEFT).Get(temp);
830 SetProperty(TextEditor.Property.SELECTION_HANDLE_PRESSED_IMAGE_LEFT, new Tizen.NUI.PropertyValue(value));
835 /// The SelectionHandlePressedImageRight property.
837 /// <since_tizen> 3 </since_tizen>
838 public PropertyMap SelectionHandlePressedImageRight
842 PropertyMap temp = new PropertyMap();
843 GetProperty(TextEditor.Property.SELECTION_HANDLE_PRESSED_IMAGE_RIGHT).Get(temp);
848 SetProperty(TextEditor.Property.SELECTION_HANDLE_PRESSED_IMAGE_RIGHT, new Tizen.NUI.PropertyValue(value));
853 /// The SelectionHandleMarkerImageLeft property.
855 /// <since_tizen> 3 </since_tizen>
856 public PropertyMap SelectionHandleMarkerImageLeft
860 PropertyMap temp = new PropertyMap();
861 GetProperty(TextEditor.Property.SELECTION_HANDLE_MARKER_IMAGE_LEFT).Get(temp);
866 SetProperty(TextEditor.Property.SELECTION_HANDLE_MARKER_IMAGE_LEFT, new Tizen.NUI.PropertyValue(value));
871 /// The SelectionHandleMarkerImageRight property.
873 /// <since_tizen> 3 </since_tizen>
874 public PropertyMap SelectionHandleMarkerImageRight
878 PropertyMap temp = new PropertyMap();
879 GetProperty(TextEditor.Property.SELECTION_HANDLE_MARKER_IMAGE_RIGHT).Get(temp);
884 SetProperty(TextEditor.Property.SELECTION_HANDLE_MARKER_IMAGE_RIGHT, new Tizen.NUI.PropertyValue(value));
889 /// The SelectionHighlightColor property.
891 /// <since_tizen> 3 </since_tizen>
892 public Vector4 SelectionHighlightColor
896 Vector4 temp = new Vector4(0.0f, 0.0f, 0.0f, 0.0f);
897 GetProperty(TextEditor.Property.SELECTION_HIGHLIGHT_COLOR).Get(temp);
902 SetProperty(TextEditor.Property.SELECTION_HIGHLIGHT_COLOR, new Tizen.NUI.PropertyValue(value));
907 /// The DecorationBoundingBox property.
909 /// <since_tizen> 3 </since_tizen>
910 public Rectangle DecorationBoundingBox
914 Rectangle temp = new Rectangle(0, 0, 0, 0);
915 GetProperty(TextEditor.Property.DECORATION_BOUNDING_BOX).Get(temp);
920 SetProperty(TextEditor.Property.DECORATION_BOUNDING_BOX, new Tizen.NUI.PropertyValue(value));
925 /// The EnableMarkup property.
927 /// <since_tizen> 3 </since_tizen>
928 public bool EnableMarkup
933 GetProperty(TextEditor.Property.ENABLE_MARKUP).Get(out temp);
938 SetProperty(TextEditor.Property.ENABLE_MARKUP, new Tizen.NUI.PropertyValue(value));
943 /// The InputColor property.
945 /// <since_tizen> 3 </since_tizen>
946 public Vector4 InputColor
950 Vector4 temp = new Vector4(0.0f, 0.0f, 0.0f, 0.0f);
951 GetProperty(TextEditor.Property.INPUT_COLOR).Get(temp);
956 SetProperty(TextEditor.Property.INPUT_COLOR, new Tizen.NUI.PropertyValue(value));
961 /// The InputFontFamily property.
963 /// <since_tizen> 3 </since_tizen>
964 public string InputFontFamily
969 GetProperty(TextEditor.Property.INPUT_FONT_FAMILY).Get(out temp);
974 SetProperty(TextEditor.Property.INPUT_FONT_FAMILY, new Tizen.NUI.PropertyValue(value));
979 /// The InputFontStyle property.
981 /// <since_tizen> 3 </since_tizen>
982 public PropertyMap InputFontStyle
986 PropertyMap temp = new PropertyMap();
987 GetProperty(TextEditor.Property.INPUT_FONT_STYLE).Get(temp);
992 SetProperty(TextEditor.Property.INPUT_FONT_STYLE, new Tizen.NUI.PropertyValue(value));
997 /// The InputPointSize property.
999 /// <since_tizen> 3 </since_tizen>
1000 public float InputPointSize
1005 GetProperty(TextEditor.Property.INPUT_POINT_SIZE).Get(out temp);
1010 SetProperty(TextEditor.Property.INPUT_POINT_SIZE, new Tizen.NUI.PropertyValue(value));
1015 /// The LineSpacing property.
1017 /// <since_tizen> 3 </since_tizen>
1018 public float LineSpacing
1023 GetProperty(TextEditor.Property.LINE_SPACING).Get(out temp);
1028 SetProperty(TextEditor.Property.LINE_SPACING, new Tizen.NUI.PropertyValue(value));
1033 /// The InputLineSpacing property.
1035 /// <since_tizen> 3 </since_tizen>
1036 public float InputLineSpacing
1041 GetProperty(TextEditor.Property.INPUT_LINE_SPACING).Get(out temp);
1046 SetProperty(TextEditor.Property.INPUT_LINE_SPACING, new Tizen.NUI.PropertyValue(value));
1051 /// The Underline property.
1053 /// <since_tizen> 3 </since_tizen>
1054 public PropertyMap Underline
1058 PropertyMap temp = new PropertyMap();
1059 GetProperty(TextEditor.Property.UNDERLINE).Get(temp);
1064 SetProperty(TextEditor.Property.UNDERLINE, new Tizen.NUI.PropertyValue(value));
1069 /// The InputUnderline property.
1071 /// <since_tizen> 3 </since_tizen>
1072 public string InputUnderline
1077 GetProperty(TextEditor.Property.INPUT_UNDERLINE).Get(out temp);
1082 SetProperty(TextEditor.Property.INPUT_UNDERLINE, new Tizen.NUI.PropertyValue(value));
1087 /// The Shadow property.
1089 /// <since_tizen> 3 </since_tizen>
1090 public PropertyMap Shadow
1094 PropertyMap temp = new PropertyMap();
1095 GetProperty(TextEditor.Property.SHADOW).Get(temp);
1100 SetProperty(TextEditor.Property.SHADOW, new Tizen.NUI.PropertyValue(value));
1105 /// The InputShadow property.
1107 /// <since_tizen> 3 </since_tizen>
1108 public string InputShadow
1113 GetProperty(TextEditor.Property.INPUT_SHADOW).Get(out temp);
1118 SetProperty(TextEditor.Property.INPUT_SHADOW, new Tizen.NUI.PropertyValue(value));
1123 /// The Emboss property.
1125 /// <since_tizen> 3 </since_tizen>
1126 public string Emboss
1131 GetProperty(TextEditor.Property.EMBOSS).Get(out temp);
1136 SetProperty(TextEditor.Property.EMBOSS, new Tizen.NUI.PropertyValue(value));
1141 /// The InputEmboss property.
1143 /// <since_tizen> 3 </since_tizen>
1144 public string InputEmboss
1149 GetProperty(TextEditor.Property.INPUT_EMBOSS).Get(out temp);
1154 SetProperty(TextEditor.Property.INPUT_EMBOSS, new Tizen.NUI.PropertyValue(value));
1159 /// The Outline property.
1161 /// <since_tizen> 3 </since_tizen>
1162 public PropertyMap Outline
1166 PropertyMap temp = new PropertyMap();
1167 GetProperty(TextEditor.Property.OUTLINE).Get(temp);
1172 SetProperty(TextEditor.Property.OUTLINE, new Tizen.NUI.PropertyValue(value));
1177 /// The InputOutline property.
1179 /// <since_tizen> 3 </since_tizen>
1180 public string InputOutline
1185 GetProperty(TextEditor.Property.INPUT_OUTLINE).Get(out temp);
1190 SetProperty(TextEditor.Property.INPUT_OUTLINE, new Tizen.NUI.PropertyValue(value));
1195 /// The SmoothScroll property.
1197 /// <since_tizen> 3 </since_tizen>
1198 public bool SmoothScroll
1203 GetProperty(TextEditor.Property.SMOOTH_SCROLL).Get(out temp);
1208 SetProperty(TextEditor.Property.SMOOTH_SCROLL, new Tizen.NUI.PropertyValue(value));
1213 /// The SmoothScrollDuration property.
1215 /// <since_tizen> 3 </since_tizen>
1216 public float SmoothScrollDuration
1221 GetProperty(TextEditor.Property.SMOOTH_SCROLL_DURATION).Get(out temp);
1226 SetProperty(TextEditor.Property.SMOOTH_SCROLL_DURATION, new Tizen.NUI.PropertyValue(value));
1231 /// The EnableScrollBar property.
1233 /// <since_tizen> 3 </since_tizen>
1234 public bool EnableScrollBar
1239 GetProperty(TextEditor.Property.ENABLE_SCROLL_BAR).Get(out temp);
1244 SetProperty(TextEditor.Property.ENABLE_SCROLL_BAR, new Tizen.NUI.PropertyValue(value));
1249 /// The ScrollBarShowDuration property.
1251 /// <since_tizen> 3 </since_tizen>
1252 public float ScrollBarShowDuration
1257 GetProperty(TextEditor.Property.SCROLL_BAR_SHOW_DURATION).Get(out temp);
1262 SetProperty(TextEditor.Property.SCROLL_BAR_SHOW_DURATION, new Tizen.NUI.PropertyValue(value));
1267 /// The ScrollBarFadeDuration property.
1269 /// <since_tizen> 3 </since_tizen>
1270 public float ScrollBarFadeDuration
1275 GetProperty(TextEditor.Property.SCROLL_BAR_FADE_DURATION).Get(out temp);
1280 SetProperty(TextEditor.Property.SCROLL_BAR_FADE_DURATION, new Tizen.NUI.PropertyValue(value));
1285 /// The PixelSize property.
1287 /// <since_tizen> 3 </since_tizen>
1288 public float PixelSize
1293 GetProperty(TextEditor.Property.PIXEL_SIZE).Get(out temp);
1298 SetProperty(TextEditor.Property.PIXEL_SIZE, new Tizen.NUI.PropertyValue(value));
1303 /// The line count of the text.
1305 /// <since_tizen> 3 </since_tizen>
1306 public int LineCount
1311 GetProperty(TextEditor.Property.LINE_COUNT).Get(out temp);
1317 /// The text to display when the TextEditor is empty and inactive.
1319 /// <since_tizen> 3 </since_tizen>
1320 public string PlaceholderText
1325 GetProperty(TextEditor.Property.PLACEHOLDER_TEXT).Get(out temp);
1330 SetProperty(TextEditor.Property.PLACEHOLDER_TEXT, new Tizen.NUI.PropertyValue(value));
1335 /// The Placeholder text color.
1337 /// <since_tizen> 3 </since_tizen>
1338 public Color PlaceholderTextColor
1342 Color temp = new Color(0.0f, 0.0f, 0.0f, 0.0f);
1343 GetProperty(TextEditor.Property.PLACEHOLDER_TEXT_COLOR).Get(temp);
1348 SetProperty(TextEditor.Property.PLACEHOLDER_TEXT_COLOR, new Tizen.NUI.PropertyValue(value));
1353 /// The EnableSelection property.
1355 /// <since_tizen> 3 </since_tizen>
1356 public bool EnableSelection
1361 GetProperty(TextEditor.Property.ENABLE_SELECTION).Get(out temp);
1366 SetProperty(TextEditor.Property.ENABLE_SELECTION, new Tizen.NUI.PropertyValue(value));
1371 /// The Placeholder property.
1372 /// Gets or sets the placeholder: text, color, font family, font style, point size, and pixel size.
1375 /// The following example demonstrates how to set the placeholder property.
1377 /// PropertyMap propertyMap = new PropertyMap();
1378 /// propertyMap.Add("text", new PropertyValue("Setting Placeholder Text"));
1379 /// propertyMap.Add("textFocused", new PropertyValue("Setting Placeholder Text Focused"));
1380 /// propertyMap.Add("color", new PropertyValue(Color.Red));
1381 /// propertyMap.Add("fontFamily", new PropertyValue("Arial"));
1382 /// propertyMap.Add("pointSize", new PropertyValue(12.0f));
1384 /// PropertyMap fontStyleMap = new PropertyMap();
1385 /// fontStyleMap.Add("weight", new PropertyValue("bold"));
1386 /// fontStyleMap.Add("width", new PropertyValue("condensed"));
1387 /// fontStyleMap.Add("slant", new PropertyValue("italic"));
1388 /// propertyMap.Add("fontStyle", new PropertyValue(fontStyleMap));
1390 /// TextEditor editor = new TextEditor();
1391 /// editor.Placeholder = propertyMap;
1394 /// <since_tizen> 3 </since_tizen>
1395 public Tizen.NUI.PropertyMap Placeholder
1399 Tizen.NUI.PropertyMap temp = new Tizen.NUI.PropertyMap();
1400 GetProperty(TextEditor.Property.PLACEHOLDER).Get(temp);
1405 SetProperty(TextEditor.Property.PLACEHOLDER, new Tizen.NUI.PropertyValue(value));
1410 /// The LineWrapMode property.<br />
1411 /// The line wrap mode when the text lines over the layout width.<br />
1413 /// <since_tizen> 4 </since_tizen>
1414 public LineWrapMode LineWrapMode
1419 if(GetProperty(TextEditor.Property.LINE_WRAP_MODE).Get(out temp) == false)
1421 NUILog.Error("LineWrapMode get error!");
1423 return (LineWrapMode)temp;
1427 SetProperty(TextEditor.Property.LINE_WRAP_MODE, new Tizen.NUI.PropertyValue((int)value));