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 public class TextEditor : View
33 private global::System.Runtime.InteropServices.HandleRef swigCPtr;
34 private string textEditorTextSid = null;
35 private string textEditorPlaceHolderTextSid = null;
36 private bool systemlangTextFlag = false;
38 internal TextEditor(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.TextEditor_SWIGUpcast(cPtr), cMemoryOwn)
40 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
43 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(TextEditor obj)
45 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
51 protected override void Dispose(DisposeTypes type)
58 if(type == DisposeTypes.Explicit)
61 //Release your own managed resources here.
62 //You should release all of your own disposable objects here.
65 //Release your own unmanaged resources here.
66 //You should not access any managed member here except static instance.
67 //because the execution order of Finalizes is non-deterministic.
69 if (_textEditorTextChangedCallbackDelegate != null)
71 TextChangedSignal().Disconnect(_textEditorTextChangedCallbackDelegate);
74 if (swigCPtr.Handle != global::System.IntPtr.Zero)
79 NDalicPINVOKE.delete_TextEditor(swigCPtr);
81 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
88 /// Event arguments that passed via the TextChanged signal.
90 public class TextChangedEventArgs : EventArgs
92 private TextEditor _textEditor;
95 /// TextEditor - is the texteditor control which has the text contents changed.
97 /// <since_tizen> 3 </since_tizen>
98 public TextEditor TextEditor
111 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
112 private delegate void TextChangedCallbackDelegate(IntPtr textEditor);
113 private EventHandler<TextChangedEventArgs> _textEditorTextChangedEventHandler;
114 private TextChangedCallbackDelegate _textEditorTextChangedCallbackDelegate;
117 /// An event for the TextChanged signal which can be used to subscribe or unsubscribe the event handler
118 /// provided by the user. The TextChanged signal is emitted when the text changes.<br />
120 /// <since_tizen> 3 </since_tizen>
121 public event EventHandler<TextChangedEventArgs> TextChanged
125 if (_textEditorTextChangedEventHandler == null)
127 _textEditorTextChangedCallbackDelegate = (OnTextChanged);
128 TextChangedSignal().Connect(_textEditorTextChangedCallbackDelegate);
130 _textEditorTextChangedEventHandler += value;
134 _textEditorTextChangedEventHandler -= value;
135 if (_textEditorTextChangedEventHandler == null && TextChangedSignal().Empty() == false)
137 TextChangedSignal().Disconnect(_textEditorTextChangedCallbackDelegate);
142 private void OnTextChanged(IntPtr textEditor)
144 TextChangedEventArgs e = new TextChangedEventArgs();
146 // Populate all members of "e" (TextChangedEventArgs) with real data
147 e.TextEditor = Registry.GetManagedBaseHandleFromNativePtr(textEditor) as TextEditor;
149 if (_textEditorTextChangedEventHandler != null)
151 //here we send all data to user event handlers
152 _textEditorTextChangedEventHandler(this, e);
158 /// Event arguments that passed via the ScrollStateChanged signal.
160 public class ScrollStateChangedEventArgs : EventArgs
162 private TextEditor _textEditor;
163 private ScrollState _scrollState;
166 /// TextEditor - is the texteditor control which has the scroll state changed.
168 /// <since_tizen> 3 </since_tizen>
169 public TextEditor TextEditor
182 /// ScrollState - is the texteditor control scroll state.
184 /// <since_tizen> 3 </since_tizen>
185 public ScrollState ScrollState
193 _scrollState = value;
198 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
199 private delegate void ScrollStateChangedCallbackDelegate(IntPtr textEditor, ScrollState state);
200 private EventHandler<ScrollStateChangedEventArgs> _textEditorScrollStateChangedEventHandler;
201 private ScrollStateChangedCallbackDelegate _textEditorScrollStateChangedCallbackDelegate;
204 /// Event for the ScrollStateChanged signal which can be used to subscribe or unsubscribe the event handler
205 /// provided by the user. The ScrollStateChanged signal is emitted when the scroll state changes.<br />
207 /// <since_tizen> 3 </since_tizen>
208 public event EventHandler<ScrollStateChangedEventArgs> ScrollStateChanged
212 if (_textEditorScrollStateChangedEventHandler == null)
214 _textEditorScrollStateChangedCallbackDelegate = OnScrollStateChanged;
215 ScrollStateChangedSignal(this).Connect(_textEditorScrollStateChangedCallbackDelegate);
217 _textEditorScrollStateChangedEventHandler += value;
221 _textEditorScrollStateChangedEventHandler -= value;
222 if (_textEditorScrollStateChangedEventHandler == null && ScrollStateChangedSignal(this).Empty() == false)
224 ScrollStateChangedSignal(this).Disconnect(_textEditorScrollStateChangedCallbackDelegate);
229 private void OnScrollStateChanged(IntPtr textEditor, ScrollState state)
231 ScrollStateChangedEventArgs e = new ScrollStateChangedEventArgs();
233 if (textEditor != null)
235 // Populate all members of "e" (ScrollStateChangedEventArgs) with real data
236 e.TextEditor = Registry.GetManagedBaseHandleFromNativePtr(textEditor) as TextEditor;
237 e.ScrollState = state;
240 if (_textEditorScrollStateChangedEventHandler != null)
242 //here we send all data to user event handlers
243 _textEditorScrollStateChangedEventHandler(this, e);
247 internal new class Property
249 internal static readonly int RENDERING_BACKEND = NDalicPINVOKE.TextEditor_Property_RENDERING_BACKEND_get();
250 internal static readonly int TEXT = NDalicPINVOKE.TextEditor_Property_TEXT_get();
251 internal static readonly int TEXT_COLOR = NDalicPINVOKE.TextEditor_Property_TEXT_COLOR_get();
252 internal static readonly int FONT_FAMILY = NDalicPINVOKE.TextEditor_Property_FONT_FAMILY_get();
253 internal static readonly int FONT_STYLE = NDalicPINVOKE.TextEditor_Property_FONT_STYLE_get();
254 internal static readonly int POINT_SIZE = NDalicPINVOKE.TextEditor_Property_POINT_SIZE_get();
255 internal static readonly int HORIZONTAL_ALIGNMENT = NDalicPINVOKE.TextEditor_Property_HORIZONTAL_ALIGNMENT_get();
256 internal static readonly int SCROLL_THRESHOLD = NDalicPINVOKE.TextEditor_Property_SCROLL_THRESHOLD_get();
257 internal static readonly int SCROLL_SPEED = NDalicPINVOKE.TextEditor_Property_SCROLL_SPEED_get();
258 internal static readonly int PRIMARY_CURSOR_COLOR = NDalicPINVOKE.TextEditor_Property_PRIMARY_CURSOR_COLOR_get();
259 internal static readonly int SECONDARY_CURSOR_COLOR = NDalicPINVOKE.TextEditor_Property_SECONDARY_CURSOR_COLOR_get();
260 internal static readonly int ENABLE_CURSOR_BLINK = NDalicPINVOKE.TextEditor_Property_ENABLE_CURSOR_BLINK_get();
261 internal static readonly int CURSOR_BLINK_INTERVAL = NDalicPINVOKE.TextEditor_Property_CURSOR_BLINK_INTERVAL_get();
262 internal static readonly int CURSOR_BLINK_DURATION = NDalicPINVOKE.TextEditor_Property_CURSOR_BLINK_DURATION_get();
263 internal static readonly int CURSOR_WIDTH = NDalicPINVOKE.TextEditor_Property_CURSOR_WIDTH_get();
264 internal static readonly int GRAB_HANDLE_IMAGE = NDalicPINVOKE.TextEditor_Property_GRAB_HANDLE_IMAGE_get();
265 internal static readonly int GRAB_HANDLE_PRESSED_IMAGE = NDalicPINVOKE.TextEditor_Property_GRAB_HANDLE_PRESSED_IMAGE_get();
266 internal static readonly int SELECTION_HANDLE_IMAGE_LEFT = NDalicPINVOKE.TextEditor_Property_SELECTION_HANDLE_IMAGE_LEFT_get();
267 internal static readonly int SELECTION_HANDLE_IMAGE_RIGHT = NDalicPINVOKE.TextEditor_Property_SELECTION_HANDLE_IMAGE_RIGHT_get();
268 internal static readonly int SELECTION_HANDLE_PRESSED_IMAGE_LEFT = NDalicPINVOKE.TextEditor_Property_SELECTION_HANDLE_PRESSED_IMAGE_LEFT_get();
269 internal static readonly int SELECTION_HANDLE_PRESSED_IMAGE_RIGHT = NDalicPINVOKE.TextEditor_Property_SELECTION_HANDLE_PRESSED_IMAGE_RIGHT_get();
270 internal static readonly int SELECTION_HANDLE_MARKER_IMAGE_LEFT = NDalicPINVOKE.TextEditor_Property_SELECTION_HANDLE_MARKER_IMAGE_LEFT_get();
271 internal static readonly int SELECTION_HANDLE_MARKER_IMAGE_RIGHT = NDalicPINVOKE.TextEditor_Property_SELECTION_HANDLE_MARKER_IMAGE_RIGHT_get();
272 internal static readonly int SELECTION_HIGHLIGHT_COLOR = NDalicPINVOKE.TextEditor_Property_SELECTION_HIGHLIGHT_COLOR_get();
273 internal static readonly int DECORATION_BOUNDING_BOX = NDalicPINVOKE.TextEditor_Property_DECORATION_BOUNDING_BOX_get();
274 internal static readonly int ENABLE_MARKUP = NDalicPINVOKE.TextEditor_Property_ENABLE_MARKUP_get();
275 internal static readonly int INPUT_COLOR = NDalicPINVOKE.TextEditor_Property_INPUT_COLOR_get();
276 internal static readonly int INPUT_FONT_FAMILY = NDalicPINVOKE.TextEditor_Property_INPUT_FONT_FAMILY_get();
277 internal static readonly int INPUT_FONT_STYLE = NDalicPINVOKE.TextEditor_Property_INPUT_FONT_STYLE_get();
278 internal static readonly int INPUT_POINT_SIZE = NDalicPINVOKE.TextEditor_Property_INPUT_POINT_SIZE_get();
279 internal static readonly int LINE_SPACING = NDalicPINVOKE.TextEditor_Property_LINE_SPACING_get();
280 internal static readonly int INPUT_LINE_SPACING = NDalicPINVOKE.TextEditor_Property_INPUT_LINE_SPACING_get();
281 internal static readonly int UNDERLINE = NDalicPINVOKE.TextEditor_Property_UNDERLINE_get();
282 internal static readonly int INPUT_UNDERLINE = NDalicPINVOKE.TextEditor_Property_INPUT_UNDERLINE_get();
283 internal static readonly int SHADOW = NDalicPINVOKE.TextEditor_Property_SHADOW_get();
284 internal static readonly int INPUT_SHADOW = NDalicPINVOKE.TextEditor_Property_INPUT_SHADOW_get();
285 internal static readonly int EMBOSS = NDalicPINVOKE.TextEditor_Property_EMBOSS_get();
286 internal static readonly int INPUT_EMBOSS = NDalicPINVOKE.TextEditor_Property_INPUT_EMBOSS_get();
287 internal static readonly int OUTLINE = NDalicPINVOKE.TextEditor_Property_OUTLINE_get();
288 internal static readonly int INPUT_OUTLINE = NDalicPINVOKE.TextEditor_Property_INPUT_OUTLINE_get();
289 internal static readonly int SMOOTH_SCROLL = NDalicManualPINVOKE.TextEditor_Property_SMOOTH_SCROLL_get();
290 internal static readonly int SMOOTH_SCROLL_DURATION = NDalicManualPINVOKE.TextEditor_Property_SMOOTH_SCROLL_DURATION_get();
291 internal static readonly int ENABLE_SCROLL_BAR = NDalicManualPINVOKE.TextEditor_Property_ENABLE_SCROLL_BAR_get();
292 internal static readonly int SCROLL_BAR_SHOW_DURATION = NDalicManualPINVOKE.TextEditor_Property_SCROLL_BAR_SHOW_DURATION_get();
293 internal static readonly int SCROLL_BAR_FADE_DURATION = NDalicManualPINVOKE.TextEditor_Property_SCROLL_BAR_FADE_DURATION_get();
294 internal static readonly int PIXEL_SIZE = NDalicManualPINVOKE.TextEditor_Property_PIXEL_SIZE_get();
295 internal static readonly int LINE_COUNT = NDalicManualPINVOKE.TextEditor_Property_LINE_COUNT_get();
296 internal static readonly int PLACEHOLDER_TEXT = NDalicManualPINVOKE.TextEditor_Property_PLACEHOLDER_TEXT_get();
297 internal static readonly int PLACEHOLDER_TEXT_COLOR = NDalicManualPINVOKE.TextEditor_Property_PLACEHOLDER_TEXT_COLOR_get();
298 internal static readonly int ENABLE_SELECTION = NDalicManualPINVOKE.TextEditor_Property_ENABLE_SELECTION_get();
299 internal static readonly int PLACEHOLDER = NDalicManualPINVOKE.TextEditor_Property_PLACEHOLDER_get();
300 internal static readonly int LINE_WRAP_MODE = NDalicManualPINVOKE.TextEditor_Property_LINE_WRAP_MODE_get();
303 internal class InputStyle
312 LineSpacing = 0x0010,
321 /// Creates the TextEditor control.
323 /// <since_tizen> 3 </since_tizen>
324 public TextEditor() : this(NDalicPINVOKE.TextEditor_New(), true)
326 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
329 internal TextEditor(TextEditor handle) : this(NDalicPINVOKE.new_TextEditor__SWIG_1(TextEditor.getCPtr(handle)), true)
331 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
335 /// Downcasts a handle to textEditor handle.
337 /// <param name="handle"></param>
338 /// <returns></returns>
339 /// <since_tizen> 3 </since_tizen>
340 /// Please do not use! this will be deprecated!
341 /// Instead please use as keyword.
342 [Obsolete("Please DO NOT use! This will be deprecated, instead please USE as keyword.")]
343 [EditorBrowsable(EditorBrowsableState.Never)]
344 public new static TextEditor DownCast(BaseHandle handle)
346 TextEditor ret = Registry.GetManagedBaseHandleFromNativePtr(handle) as TextEditor;
347 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
351 internal TextEditorSignal TextChangedSignal()
353 TextEditorSignal ret = new TextEditorSignal(NDalicPINVOKE.TextEditor_TextChangedSignal(swigCPtr), false);
354 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
358 internal ScrollStateChangedSignal ScrollStateChangedSignal(TextEditor textEditor)
360 ScrollStateChangedSignal ret = new ScrollStateChangedSignal(NDalicManualPINVOKE.TextEditor_ScrollStateChangedSignal(TextEditor.getCPtr(textEditor)), false);
361 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
365 internal SWIGTYPE_p_Dali__SignalT_void_fDali__Toolkit__TextEditor_Dali__Toolkit__TextEditor__InputStyle__MaskF_t InputStyleChangedSignal()
367 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);
368 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
373 /// The TranslatableText property.<br />
374 /// The text can set the SID value.<br />
376 /// <exception cref='ArgumentNullException'>
377 /// ResourceManager about multilingual is null.
379 /// <since_tizen> 4 </since_tizen>
380 public string TranslatableText
384 return textEditorTextSid;
388 if (NUIApplication.MultilingualResourceManager == null)
390 throw new ArgumentNullException("ResourceManager about multilingual is null");
392 textEditorTextSid = value;
393 Text = SetTranslatable(textEditorTextSid);
397 /// The TranslatablePlaceholderText property.<br />
398 /// The text can set the SID value.<br />
400 /// <exception cref='ArgumentNullException'>
401 /// ResourceManager about multilingual is null.
403 /// <since_tizen> 4 </since_tizen>
404 public string TranslatablePlaceholderText
408 return textEditorPlaceHolderTextSid;
412 if (NUIApplication.MultilingualResourceManager == null)
414 throw new ArgumentNullException("ResourceManager about multilingual is null");
416 textEditorPlaceHolderTextSid = value;
417 PlaceholderText = SetTranslatable(textEditorPlaceHolderTextSid);
420 private string SetTranslatable(string textEditorSid)
422 string translatableText = null;
423 translatableText = NUIApplication.MultilingualResourceManager?.GetString(textEditorSid, new CultureInfo(SystemSettings.LocaleLanguage.Replace("_", "-")));
424 if (translatableText != null)
426 if (systemlangTextFlag == false)
428 SystemSettings.LocaleLanguageChanged += new WeakEventHandler<LocaleLanguageChangedEventArgs>(SystemSettings_LocaleLanguageChanged).Handler;
429 systemlangTextFlag = true;
431 return translatableText;
435 translatableText = "";
436 return translatableText;
439 private void SystemSettings_LocaleLanguageChanged(object sender, LocaleLanguageChangedEventArgs e)
441 if (textEditorTextSid != null)
443 Text = NUIApplication.MultilingualResourceManager?.GetString(textEditorTextSid, new CultureInfo(e.Value.Replace("_", "-")));
445 if (textEditorPlaceHolderTextSid != null)
447 PlaceholderText = NUIApplication.MultilingualResourceManager?.GetString(textEditorPlaceHolderTextSid, new CultureInfo(e.Value.Replace("_", "-")));
451 /// The Text property.
453 /// <since_tizen> 3 </since_tizen>
459 GetProperty(TextEditor.Property.TEXT).Get(out temp);
464 SetProperty(TextEditor.Property.TEXT, new Tizen.NUI.PropertyValue(value));
469 /// The TextColor property.
471 /// <since_tizen> 3 </since_tizen>
472 public Vector4 TextColor
476 Vector4 temp = new Vector4(0.0f, 0.0f, 0.0f, 0.0f);
477 GetProperty(TextEditor.Property.TEXT_COLOR).Get(temp);
482 SetProperty(TextEditor.Property.TEXT_COLOR, new Tizen.NUI.PropertyValue(value));
487 /// The FontFamily property.
489 /// <since_tizen> 3 </since_tizen>
490 public string FontFamily
495 GetProperty(TextEditor.Property.FONT_FAMILY).Get(out temp);
500 SetProperty(TextEditor.Property.FONT_FAMILY, new Tizen.NUI.PropertyValue(value));
505 /// The FontStyle property.
507 /// <since_tizen> 3 </since_tizen>
508 public PropertyMap FontStyle
512 PropertyMap temp = new PropertyMap();
513 GetProperty(TextEditor.Property.FONT_STYLE).Get(temp);
518 SetProperty(TextEditor.Property.FONT_STYLE, new Tizen.NUI.PropertyValue(value));
523 /// The PointSize property.
525 /// <since_tizen> 3 </since_tizen>
526 public float PointSize
531 GetProperty(TextEditor.Property.POINT_SIZE).Get(out temp);
536 SetProperty(TextEditor.Property.POINT_SIZE, new Tizen.NUI.PropertyValue(value));
541 /// The HorizontalAlignment property.
543 /// <since_tizen> 3 </since_tizen>
544 public HorizontalAlignment HorizontalAlignment
549 if (GetProperty(TextEditor.Property.HORIZONTAL_ALIGNMENT).Get(out temp) == false)
551 NUILog.Error("HorizontalAlignment get error!");
557 return HorizontalAlignment.Begin;
559 return HorizontalAlignment.Center;
561 return HorizontalAlignment.End;
563 return HorizontalAlignment.Begin;
568 string valueToString = "";
571 case HorizontalAlignment.Begin:
573 valueToString = "BEGIN";
576 case HorizontalAlignment.Center:
578 valueToString = "CENTER";
581 case HorizontalAlignment.End:
583 valueToString = "END";
588 valueToString = "BEGIN";
592 SetProperty(TextEditor.Property.HORIZONTAL_ALIGNMENT, new Tizen.NUI.PropertyValue(valueToString));
597 /// The ScrollThreshold property.
599 /// <since_tizen> 3 </since_tizen>
600 public float ScrollThreshold
605 GetProperty(TextEditor.Property.SCROLL_THRESHOLD).Get(out temp);
610 SetProperty(TextEditor.Property.SCROLL_THRESHOLD, new Tizen.NUI.PropertyValue(value));
615 /// The ScrollSpeed property.
617 /// <since_tizen> 3 </since_tizen>
618 public float ScrollSpeed
623 GetProperty(TextEditor.Property.SCROLL_SPEED).Get(out temp);
628 SetProperty(TextEditor.Property.SCROLL_SPEED, new Tizen.NUI.PropertyValue(value));
633 /// The PrimaryCursorColor property.
635 /// <since_tizen> 3 </since_tizen>
636 public Vector4 PrimaryCursorColor
640 Vector4 temp = new Vector4(0.0f, 0.0f, 0.0f, 0.0f);
641 GetProperty(TextEditor.Property.PRIMARY_CURSOR_COLOR).Get(temp);
646 SetProperty(TextEditor.Property.PRIMARY_CURSOR_COLOR, new Tizen.NUI.PropertyValue(value));
651 /// The SecondaryCursorColor property.
653 /// <since_tizen> 3 </since_tizen>
654 public Vector4 SecondaryCursorColor
658 Vector4 temp = new Vector4(0.0f, 0.0f, 0.0f, 0.0f);
659 GetProperty(TextEditor.Property.SECONDARY_CURSOR_COLOR).Get(temp);
664 SetProperty(TextEditor.Property.SECONDARY_CURSOR_COLOR, new Tizen.NUI.PropertyValue(value));
669 /// The EnableCursorBlink property.
671 /// <since_tizen> 3 </since_tizen>
672 public bool EnableCursorBlink
677 GetProperty(TextEditor.Property.ENABLE_CURSOR_BLINK).Get(out temp);
682 SetProperty(TextEditor.Property.ENABLE_CURSOR_BLINK, new Tizen.NUI.PropertyValue(value));
687 /// The CursorBlinkInterval property.
689 /// <since_tizen> 3 </since_tizen>
690 public float CursorBlinkInterval
695 GetProperty(TextEditor.Property.CURSOR_BLINK_INTERVAL).Get(out temp);
700 SetProperty(TextEditor.Property.CURSOR_BLINK_INTERVAL, new Tizen.NUI.PropertyValue(value));
705 /// The CursorBlinkDuration property.
707 /// <since_tizen> 3 </since_tizen>
708 public float CursorBlinkDuration
713 GetProperty(TextEditor.Property.CURSOR_BLINK_DURATION).Get(out temp);
718 SetProperty(TextEditor.Property.CURSOR_BLINK_DURATION, new Tizen.NUI.PropertyValue(value));
723 /// The CursorWidth property.
725 /// <since_tizen> 3 </since_tizen>
726 public int CursorWidth
731 GetProperty(TextEditor.Property.CURSOR_WIDTH).Get(out temp);
736 SetProperty(TextEditor.Property.CURSOR_WIDTH, new Tizen.NUI.PropertyValue(value));
741 /// The GrabHandleImage property.
743 /// <since_tizen> 3 </since_tizen>
744 public string GrabHandleImage
749 GetProperty(TextEditor.Property.GRAB_HANDLE_IMAGE).Get(out temp);
754 SetProperty(TextEditor.Property.GRAB_HANDLE_IMAGE, new Tizen.NUI.PropertyValue(value));
759 /// The GrabHandlePressedImage property.
761 /// <since_tizen> 3 </since_tizen>
762 public string GrabHandlePressedImage
767 GetProperty(TextEditor.Property.GRAB_HANDLE_PRESSED_IMAGE).Get(out temp);
772 SetProperty(TextEditor.Property.GRAB_HANDLE_PRESSED_IMAGE, new Tizen.NUI.PropertyValue(value));
777 /// The SelectionHandleImageLeft property.
779 /// <since_tizen> 3 </since_tizen>
780 public PropertyMap SelectionHandleImageLeft
784 PropertyMap temp = new PropertyMap();
785 GetProperty(TextEditor.Property.SELECTION_HANDLE_IMAGE_LEFT).Get(temp);
790 SetProperty(TextEditor.Property.SELECTION_HANDLE_IMAGE_LEFT, new Tizen.NUI.PropertyValue(value));
795 /// The SelectionHandleImageRight property.
797 /// <since_tizen> 3 </since_tizen>
798 public PropertyMap SelectionHandleImageRight
802 PropertyMap temp = new PropertyMap();
803 GetProperty(TextEditor.Property.SELECTION_HANDLE_IMAGE_RIGHT).Get(temp);
808 SetProperty(TextEditor.Property.SELECTION_HANDLE_IMAGE_RIGHT, new Tizen.NUI.PropertyValue(value));
813 /// The SelectionHandlePressedImageLeft property.
815 /// <since_tizen> 3 </since_tizen>
816 public PropertyMap SelectionHandlePressedImageLeft
820 PropertyMap temp = new PropertyMap();
821 GetProperty(TextEditor.Property.SELECTION_HANDLE_PRESSED_IMAGE_LEFT).Get(temp);
826 SetProperty(TextEditor.Property.SELECTION_HANDLE_PRESSED_IMAGE_LEFT, new Tizen.NUI.PropertyValue(value));
831 /// The SelectionHandlePressedImageRight property.
833 /// <since_tizen> 3 </since_tizen>
834 public PropertyMap SelectionHandlePressedImageRight
838 PropertyMap temp = new PropertyMap();
839 GetProperty(TextEditor.Property.SELECTION_HANDLE_PRESSED_IMAGE_RIGHT).Get(temp);
844 SetProperty(TextEditor.Property.SELECTION_HANDLE_PRESSED_IMAGE_RIGHT, new Tizen.NUI.PropertyValue(value));
849 /// The SelectionHandleMarkerImageLeft property.
851 /// <since_tizen> 3 </since_tizen>
852 public PropertyMap SelectionHandleMarkerImageLeft
856 PropertyMap temp = new PropertyMap();
857 GetProperty(TextEditor.Property.SELECTION_HANDLE_MARKER_IMAGE_LEFT).Get(temp);
862 SetProperty(TextEditor.Property.SELECTION_HANDLE_MARKER_IMAGE_LEFT, new Tizen.NUI.PropertyValue(value));
867 /// The SelectionHandleMarkerImageRight property.
869 /// <since_tizen> 3 </since_tizen>
870 public PropertyMap SelectionHandleMarkerImageRight
874 PropertyMap temp = new PropertyMap();
875 GetProperty(TextEditor.Property.SELECTION_HANDLE_MARKER_IMAGE_RIGHT).Get(temp);
880 SetProperty(TextEditor.Property.SELECTION_HANDLE_MARKER_IMAGE_RIGHT, new Tizen.NUI.PropertyValue(value));
885 /// The SelectionHighlightColor property.
887 /// <since_tizen> 3 </since_tizen>
888 public Vector4 SelectionHighlightColor
892 Vector4 temp = new Vector4(0.0f, 0.0f, 0.0f, 0.0f);
893 GetProperty(TextEditor.Property.SELECTION_HIGHLIGHT_COLOR).Get(temp);
898 SetProperty(TextEditor.Property.SELECTION_HIGHLIGHT_COLOR, new Tizen.NUI.PropertyValue(value));
903 /// The DecorationBoundingBox property.
905 /// <since_tizen> 3 </since_tizen>
906 public Rectangle DecorationBoundingBox
910 Rectangle temp = new Rectangle(0, 0, 0, 0);
911 GetProperty(TextEditor.Property.DECORATION_BOUNDING_BOX).Get(temp);
916 SetProperty(TextEditor.Property.DECORATION_BOUNDING_BOX, new Tizen.NUI.PropertyValue(value));
921 /// The EnableMarkup property.
923 /// <since_tizen> 3 </since_tizen>
924 public bool EnableMarkup
929 GetProperty(TextEditor.Property.ENABLE_MARKUP).Get(out temp);
934 SetProperty(TextEditor.Property.ENABLE_MARKUP, new Tizen.NUI.PropertyValue(value));
939 /// The InputColor property.
941 /// <since_tizen> 3 </since_tizen>
942 public Vector4 InputColor
946 Vector4 temp = new Vector4(0.0f, 0.0f, 0.0f, 0.0f);
947 GetProperty(TextEditor.Property.INPUT_COLOR).Get(temp);
952 SetProperty(TextEditor.Property.INPUT_COLOR, new Tizen.NUI.PropertyValue(value));
957 /// The InputFontFamily property.
959 /// <since_tizen> 3 </since_tizen>
960 public string InputFontFamily
965 GetProperty(TextEditor.Property.INPUT_FONT_FAMILY).Get(out temp);
970 SetProperty(TextEditor.Property.INPUT_FONT_FAMILY, new Tizen.NUI.PropertyValue(value));
975 /// The InputFontStyle property.
977 /// <since_tizen> 3 </since_tizen>
978 public PropertyMap InputFontStyle
982 PropertyMap temp = new PropertyMap();
983 GetProperty(TextEditor.Property.INPUT_FONT_STYLE).Get(temp);
988 SetProperty(TextEditor.Property.INPUT_FONT_STYLE, new Tizen.NUI.PropertyValue(value));
993 /// The InputPointSize property.
995 /// <since_tizen> 3 </since_tizen>
996 public float InputPointSize
1001 GetProperty(TextEditor.Property.INPUT_POINT_SIZE).Get(out temp);
1006 SetProperty(TextEditor.Property.INPUT_POINT_SIZE, new Tizen.NUI.PropertyValue(value));
1011 /// The LineSpacing property.
1013 /// <since_tizen> 3 </since_tizen>
1014 public float LineSpacing
1019 GetProperty(TextEditor.Property.LINE_SPACING).Get(out temp);
1024 SetProperty(TextEditor.Property.LINE_SPACING, new Tizen.NUI.PropertyValue(value));
1029 /// The InputLineSpacing property.
1031 /// <since_tizen> 3 </since_tizen>
1032 public float InputLineSpacing
1037 GetProperty(TextEditor.Property.INPUT_LINE_SPACING).Get(out temp);
1042 SetProperty(TextEditor.Property.INPUT_LINE_SPACING, new Tizen.NUI.PropertyValue(value));
1047 /// The Underline property.
1049 /// <since_tizen> 3 </since_tizen>
1050 public PropertyMap Underline
1054 PropertyMap temp = new PropertyMap();
1055 GetProperty(TextEditor.Property.UNDERLINE).Get(temp);
1060 SetProperty(TextEditor.Property.UNDERLINE, new Tizen.NUI.PropertyValue(value));
1065 /// The InputUnderline property.
1067 /// <since_tizen> 3 </since_tizen>
1068 public string InputUnderline
1073 GetProperty(TextEditor.Property.INPUT_UNDERLINE).Get(out temp);
1078 SetProperty(TextEditor.Property.INPUT_UNDERLINE, new Tizen.NUI.PropertyValue(value));
1083 /// The Shadow property.
1085 /// <since_tizen> 3 </since_tizen>
1086 public PropertyMap Shadow
1090 PropertyMap temp = new PropertyMap();
1091 GetProperty(TextEditor.Property.SHADOW).Get(temp);
1096 SetProperty(TextEditor.Property.SHADOW, new Tizen.NUI.PropertyValue(value));
1101 /// The InputShadow property.
1103 /// <since_tizen> 3 </since_tizen>
1104 public string InputShadow
1109 GetProperty(TextEditor.Property.INPUT_SHADOW).Get(out temp);
1114 SetProperty(TextEditor.Property.INPUT_SHADOW, new Tizen.NUI.PropertyValue(value));
1119 /// The Emboss property.
1121 /// <since_tizen> 3 </since_tizen>
1122 public string Emboss
1127 GetProperty(TextEditor.Property.EMBOSS).Get(out temp);
1132 SetProperty(TextEditor.Property.EMBOSS, new Tizen.NUI.PropertyValue(value));
1137 /// The InputEmboss property.
1139 /// <since_tizen> 3 </since_tizen>
1140 public string InputEmboss
1145 GetProperty(TextEditor.Property.INPUT_EMBOSS).Get(out temp);
1150 SetProperty(TextEditor.Property.INPUT_EMBOSS, new Tizen.NUI.PropertyValue(value));
1155 /// The Outline property.
1157 /// <since_tizen> 3 </since_tizen>
1158 public PropertyMap Outline
1162 PropertyMap temp = new PropertyMap();
1163 GetProperty(TextEditor.Property.OUTLINE).Get(temp);
1168 SetProperty(TextEditor.Property.OUTLINE, new Tizen.NUI.PropertyValue(value));
1173 /// The InputOutline property.
1175 /// <since_tizen> 3 </since_tizen>
1176 public string InputOutline
1181 GetProperty(TextEditor.Property.INPUT_OUTLINE).Get(out temp);
1186 SetProperty(TextEditor.Property.INPUT_OUTLINE, new Tizen.NUI.PropertyValue(value));
1191 /// The SmoothScroll property.
1193 /// <since_tizen> 3 </since_tizen>
1194 public bool SmoothScroll
1199 GetProperty(TextEditor.Property.SMOOTH_SCROLL).Get(out temp);
1204 SetProperty(TextEditor.Property.SMOOTH_SCROLL, new Tizen.NUI.PropertyValue(value));
1209 /// The SmoothScrollDuration property.
1211 /// <since_tizen> 3 </since_tizen>
1212 public float SmoothScrollDuration
1217 GetProperty(TextEditor.Property.SMOOTH_SCROLL_DURATION).Get(out temp);
1222 SetProperty(TextEditor.Property.SMOOTH_SCROLL_DURATION, new Tizen.NUI.PropertyValue(value));
1227 /// The EnableScrollBar property.
1229 /// <since_tizen> 3 </since_tizen>
1230 public bool EnableScrollBar
1235 GetProperty(TextEditor.Property.ENABLE_SCROLL_BAR).Get(out temp);
1240 SetProperty(TextEditor.Property.ENABLE_SCROLL_BAR, new Tizen.NUI.PropertyValue(value));
1245 /// The ScrollBarShowDuration property.
1247 /// <since_tizen> 3 </since_tizen>
1248 public float ScrollBarShowDuration
1253 GetProperty(TextEditor.Property.SCROLL_BAR_SHOW_DURATION).Get(out temp);
1258 SetProperty(TextEditor.Property.SCROLL_BAR_SHOW_DURATION, new Tizen.NUI.PropertyValue(value));
1263 /// The ScrollBarFadeDuration property.
1265 /// <since_tizen> 3 </since_tizen>
1266 public float ScrollBarFadeDuration
1271 GetProperty(TextEditor.Property.SCROLL_BAR_FADE_DURATION).Get(out temp);
1276 SetProperty(TextEditor.Property.SCROLL_BAR_FADE_DURATION, new Tizen.NUI.PropertyValue(value));
1281 /// The PixelSize property.
1283 /// <since_tizen> 3 </since_tizen>
1284 public float PixelSize
1289 GetProperty(TextEditor.Property.PIXEL_SIZE).Get(out temp);
1294 SetProperty(TextEditor.Property.PIXEL_SIZE, new Tizen.NUI.PropertyValue(value));
1299 /// The line count of the text.
1301 /// <since_tizen> 3 </since_tizen>
1302 public int LineCount
1307 GetProperty(TextEditor.Property.LINE_COUNT).Get(out temp);
1313 /// The text to display when the TextEditor is empty and inactive.
1315 /// <since_tizen> 3 </since_tizen>
1316 public string PlaceholderText
1321 GetProperty(TextEditor.Property.PLACEHOLDER_TEXT).Get(out temp);
1326 SetProperty(TextEditor.Property.PLACEHOLDER_TEXT, new Tizen.NUI.PropertyValue(value));
1331 /// The Placeholder text color.
1333 /// <since_tizen> 3 </since_tizen>
1334 public Color PlaceholderTextColor
1338 Color temp = new Color(0.0f, 0.0f, 0.0f, 0.0f);
1339 GetProperty(TextEditor.Property.PLACEHOLDER_TEXT_COLOR).Get(temp);
1344 SetProperty(TextEditor.Property.PLACEHOLDER_TEXT_COLOR, new Tizen.NUI.PropertyValue(value));
1349 /// The EnableSelection property.
1351 /// <since_tizen> 4 </since_tizen>
1352 public bool EnableSelection
1357 GetProperty(TextEditor.Property.ENABLE_SELECTION).Get(out temp);
1362 SetProperty(TextEditor.Property.ENABLE_SELECTION, new Tizen.NUI.PropertyValue(value));
1367 /// The Placeholder property.
1368 /// Gets or sets the placeholder: text, color, font family, font style, point size, and pixel size.
1371 /// The following example demonstrates how to set the placeholder property.
1373 /// PropertyMap propertyMap = new PropertyMap();
1374 /// propertyMap.Add("text", new PropertyValue("Setting Placeholder Text"));
1375 /// propertyMap.Add("textFocused", new PropertyValue("Setting Placeholder Text Focused"));
1376 /// propertyMap.Add("color", new PropertyValue(Color.Red));
1377 /// propertyMap.Add("fontFamily", new PropertyValue("Arial"));
1378 /// propertyMap.Add("pointSize", new PropertyValue(12.0f));
1380 /// PropertyMap fontStyleMap = new PropertyMap();
1381 /// fontStyleMap.Add("weight", new PropertyValue("bold"));
1382 /// fontStyleMap.Add("width", new PropertyValue("condensed"));
1383 /// fontStyleMap.Add("slant", new PropertyValue("italic"));
1384 /// propertyMap.Add("fontStyle", new PropertyValue(fontStyleMap));
1386 /// TextEditor editor = new TextEditor();
1387 /// editor.Placeholder = propertyMap;
1390 /// <since_tizen> 4 </since_tizen>
1391 public Tizen.NUI.PropertyMap Placeholder
1395 Tizen.NUI.PropertyMap temp = new Tizen.NUI.PropertyMap();
1396 GetProperty(TextEditor.Property.PLACEHOLDER).Get(temp);
1401 SetProperty(TextEditor.Property.PLACEHOLDER, new Tizen.NUI.PropertyValue(value));
1406 /// The LineWrapMode property.<br />
1407 /// The line wrap mode when the text lines over the layout width.<br />
1409 /// <since_tizen> 4 </since_tizen>
1410 public LineWrapMode LineWrapMode
1415 if(GetProperty(TextEditor.Property.LINE_WRAP_MODE).Get(out temp) == false)
1417 NUILog.Error("LineWrapMode get error!");
1421 case "WRAP_MODE_WORD":
1422 return LineWrapMode.Word;
1423 case "WRAP_MODE_CHARACTER":
1424 return LineWrapMode.Character;
1426 return LineWrapMode.Word;
1434 case LineWrapMode.Word:
1436 temp = "WRAP_MODE_WORD";
1439 case LineWrapMode.Character:
1441 temp = "WRAP_MODE_CHARACTER";
1445 SetProperty(TextEditor.Property.LINE_WRAP_MODE, new Tizen.NUI.PropertyValue(temp));