1 /** Copyright (c) 2017 Samsung Electronics Co., Ltd.
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
7 * http://www.apache.org/licenses/LICENSE-2.0
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.
17 extern alias TizenSystemSettings;
18 using TizenSystemSettings.Tizen.System;
19 namespace Tizen.NUI.BaseComponents
23 using System.Runtime.InteropServices;
24 using System.Globalization;
27 /// A control which provides a multi-line editable text editor.
29 public class TextEditor : View
31 private global::System.Runtime.InteropServices.HandleRef swigCPtr;
32 private string textEditorTextSid = null;
33 private string textEditorPlaceHolderTextSid = null;
34 private bool systemlangTextFlag = false;
36 internal TextEditor(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.TextEditor_SWIGUpcast(cPtr), cMemoryOwn)
38 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
41 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(TextEditor obj)
43 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
49 protected override void Dispose(DisposeTypes type)
56 if(type == DisposeTypes.Explicit)
59 //Release your own managed resources here.
60 //You should release all of your own disposable objects here.
63 //Release your own unmanaged resources here.
64 //You should not access any managed member here except static instance.
65 //because the execution order of Finalizes is non-deterministic.
67 if (_textEditorTextChangedCallbackDelegate != null)
69 TextChangedSignal().Disconnect(_textEditorTextChangedCallbackDelegate);
72 if (swigCPtr.Handle != global::System.IntPtr.Zero)
77 NDalicPINVOKE.delete_TextEditor(swigCPtr);
79 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
86 /// Event arguments that passed via the TextChanged signal.
88 public class TextChangedEventArgs : EventArgs
90 private TextEditor _textEditor;
93 /// TextEditor - is the texteditor control which has the text contents changed.
95 /// <since_tizen> 3 </since_tizen>
96 public TextEditor TextEditor
109 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
110 private delegate void TextChangedCallbackDelegate(IntPtr textEditor);
111 private EventHandler<TextChangedEventArgs> _textEditorTextChangedEventHandler;
112 private TextChangedCallbackDelegate _textEditorTextChangedCallbackDelegate;
115 /// An event for the TextChanged signal which can be used to subscribe or unsubscribe the event handler
116 /// provided by the user. The TextChanged signal is emitted when the text changes.<br>
118 /// <since_tizen> 3 </since_tizen>
119 public event EventHandler<TextChangedEventArgs> TextChanged
123 if (_textEditorTextChangedEventHandler == null)
125 _textEditorTextChangedCallbackDelegate = (OnTextChanged);
126 TextChangedSignal().Connect(_textEditorTextChangedCallbackDelegate);
128 _textEditorTextChangedEventHandler += value;
132 _textEditorTextChangedEventHandler -= value;
133 if (_textEditorTextChangedEventHandler == null && TextChangedSignal().Empty() == false)
135 TextChangedSignal().Disconnect(_textEditorTextChangedCallbackDelegate);
140 private void OnTextChanged(IntPtr textEditor)
142 TextChangedEventArgs e = new TextChangedEventArgs();
144 // Populate all members of "e" (TextChangedEventArgs) with real data
145 e.TextEditor = Registry.GetManagedBaseHandleFromNativePtr(textEditor) as TextEditor;
147 if (_textEditorTextChangedEventHandler != null)
149 //here we send all data to user event handlers
150 _textEditorTextChangedEventHandler(this, e);
156 /// Event arguments that passed via the ScrollStateChanged signal.
158 public class ScrollStateChangedEventArgs : EventArgs
160 private TextEditor _textEditor;
161 private ScrollState _scrollState;
164 /// TextEditor - is the texteditor control which has the scroll state changed.
166 /// <since_tizen> 3 </since_tizen>
167 public TextEditor TextEditor
180 /// ScrollState - is the texteditor control scroll state.
182 /// <since_tizen> 3 </since_tizen>
183 public ScrollState ScrollState
191 _scrollState = value;
196 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
197 private delegate void ScrollStateChangedCallbackDelegate(IntPtr textEditor, ScrollState state);
198 private EventHandler<ScrollStateChangedEventArgs> _textEditorScrollStateChangedEventHandler;
199 private ScrollStateChangedCallbackDelegate _textEditorScrollStateChangedCallbackDelegate;
202 /// Event for the ScrollStateChanged signal which can be used to subscribe or unsubscribe the event handler
203 /// provided by the user. The ScrollStateChanged signal is emitted when the scroll state changes.<br>
205 /// <since_tizen> 3 </since_tizen>
206 public event EventHandler<ScrollStateChangedEventArgs> ScrollStateChanged
210 if (_textEditorScrollStateChangedEventHandler == null)
212 _textEditorScrollStateChangedCallbackDelegate = OnScrollStateChanged;
213 ScrollStateChangedSignal(this).Connect(_textEditorScrollStateChangedCallbackDelegate);
215 _textEditorScrollStateChangedEventHandler += value;
219 _textEditorScrollStateChangedEventHandler -= value;
220 if (_textEditorScrollStateChangedEventHandler == null && ScrollStateChangedSignal(this).Empty() == false)
222 ScrollStateChangedSignal(this).Disconnect(_textEditorScrollStateChangedCallbackDelegate);
227 private void OnScrollStateChanged(IntPtr textEditor, ScrollState state)
229 ScrollStateChangedEventArgs e = new ScrollStateChangedEventArgs();
231 if (textEditor != null)
233 // Populate all members of "e" (ScrollStateChangedEventArgs) with real data
234 e.TextEditor = Registry.GetManagedBaseHandleFromNativePtr(textEditor) as TextEditor;
235 e.ScrollState = state;
238 if (_textEditorScrollStateChangedEventHandler != null)
240 //here we send all data to user event handlers
241 _textEditorScrollStateChangedEventHandler(this, e);
245 internal new class Property
247 internal static readonly int RENDERING_BACKEND = NDalicPINVOKE.TextEditor_Property_RENDERING_BACKEND_get();
248 internal static readonly int TEXT = NDalicPINVOKE.TextEditor_Property_TEXT_get();
249 internal static readonly int TEXT_COLOR = NDalicPINVOKE.TextEditor_Property_TEXT_COLOR_get();
250 internal static readonly int FONT_FAMILY = NDalicPINVOKE.TextEditor_Property_FONT_FAMILY_get();
251 internal static readonly int FONT_STYLE = NDalicPINVOKE.TextEditor_Property_FONT_STYLE_get();
252 internal static readonly int POINT_SIZE = NDalicPINVOKE.TextEditor_Property_POINT_SIZE_get();
253 internal static readonly int HORIZONTAL_ALIGNMENT = NDalicPINVOKE.TextEditor_Property_HORIZONTAL_ALIGNMENT_get();
254 internal static readonly int SCROLL_THRESHOLD = NDalicPINVOKE.TextEditor_Property_SCROLL_THRESHOLD_get();
255 internal static readonly int SCROLL_SPEED = NDalicPINVOKE.TextEditor_Property_SCROLL_SPEED_get();
256 internal static readonly int PRIMARY_CURSOR_COLOR = NDalicPINVOKE.TextEditor_Property_PRIMARY_CURSOR_COLOR_get();
257 internal static readonly int SECONDARY_CURSOR_COLOR = NDalicPINVOKE.TextEditor_Property_SECONDARY_CURSOR_COLOR_get();
258 internal static readonly int ENABLE_CURSOR_BLINK = NDalicPINVOKE.TextEditor_Property_ENABLE_CURSOR_BLINK_get();
259 internal static readonly int CURSOR_BLINK_INTERVAL = NDalicPINVOKE.TextEditor_Property_CURSOR_BLINK_INTERVAL_get();
260 internal static readonly int CURSOR_BLINK_DURATION = NDalicPINVOKE.TextEditor_Property_CURSOR_BLINK_DURATION_get();
261 internal static readonly int CURSOR_WIDTH = NDalicPINVOKE.TextEditor_Property_CURSOR_WIDTH_get();
262 internal static readonly int GRAB_HANDLE_IMAGE = NDalicPINVOKE.TextEditor_Property_GRAB_HANDLE_IMAGE_get();
263 internal static readonly int GRAB_HANDLE_PRESSED_IMAGE = NDalicPINVOKE.TextEditor_Property_GRAB_HANDLE_PRESSED_IMAGE_get();
264 internal static readonly int SELECTION_HANDLE_IMAGE_LEFT = NDalicPINVOKE.TextEditor_Property_SELECTION_HANDLE_IMAGE_LEFT_get();
265 internal static readonly int SELECTION_HANDLE_IMAGE_RIGHT = NDalicPINVOKE.TextEditor_Property_SELECTION_HANDLE_IMAGE_RIGHT_get();
266 internal static readonly int SELECTION_HANDLE_PRESSED_IMAGE_LEFT = NDalicPINVOKE.TextEditor_Property_SELECTION_HANDLE_PRESSED_IMAGE_LEFT_get();
267 internal static readonly int SELECTION_HANDLE_PRESSED_IMAGE_RIGHT = NDalicPINVOKE.TextEditor_Property_SELECTION_HANDLE_PRESSED_IMAGE_RIGHT_get();
268 internal static readonly int SELECTION_HANDLE_MARKER_IMAGE_LEFT = NDalicPINVOKE.TextEditor_Property_SELECTION_HANDLE_MARKER_IMAGE_LEFT_get();
269 internal static readonly int SELECTION_HANDLE_MARKER_IMAGE_RIGHT = NDalicPINVOKE.TextEditor_Property_SELECTION_HANDLE_MARKER_IMAGE_RIGHT_get();
270 internal static readonly int SELECTION_HIGHLIGHT_COLOR = NDalicPINVOKE.TextEditor_Property_SELECTION_HIGHLIGHT_COLOR_get();
271 internal static readonly int DECORATION_BOUNDING_BOX = NDalicPINVOKE.TextEditor_Property_DECORATION_BOUNDING_BOX_get();
272 internal static readonly int ENABLE_MARKUP = NDalicPINVOKE.TextEditor_Property_ENABLE_MARKUP_get();
273 internal static readonly int INPUT_COLOR = NDalicPINVOKE.TextEditor_Property_INPUT_COLOR_get();
274 internal static readonly int INPUT_FONT_FAMILY = NDalicPINVOKE.TextEditor_Property_INPUT_FONT_FAMILY_get();
275 internal static readonly int INPUT_FONT_STYLE = NDalicPINVOKE.TextEditor_Property_INPUT_FONT_STYLE_get();
276 internal static readonly int INPUT_POINT_SIZE = NDalicPINVOKE.TextEditor_Property_INPUT_POINT_SIZE_get();
277 internal static readonly int LINE_SPACING = NDalicPINVOKE.TextEditor_Property_LINE_SPACING_get();
278 internal static readonly int INPUT_LINE_SPACING = NDalicPINVOKE.TextEditor_Property_INPUT_LINE_SPACING_get();
279 internal static readonly int UNDERLINE = NDalicPINVOKE.TextEditor_Property_UNDERLINE_get();
280 internal static readonly int INPUT_UNDERLINE = NDalicPINVOKE.TextEditor_Property_INPUT_UNDERLINE_get();
281 internal static readonly int SHADOW = NDalicPINVOKE.TextEditor_Property_SHADOW_get();
282 internal static readonly int INPUT_SHADOW = NDalicPINVOKE.TextEditor_Property_INPUT_SHADOW_get();
283 internal static readonly int EMBOSS = NDalicPINVOKE.TextEditor_Property_EMBOSS_get();
284 internal static readonly int INPUT_EMBOSS = NDalicPINVOKE.TextEditor_Property_INPUT_EMBOSS_get();
285 internal static readonly int OUTLINE = NDalicPINVOKE.TextEditor_Property_OUTLINE_get();
286 internal static readonly int INPUT_OUTLINE = NDalicPINVOKE.TextEditor_Property_INPUT_OUTLINE_get();
287 internal static readonly int SMOOTH_SCROLL = NDalicManualPINVOKE.TextEditor_Property_SMOOTH_SCROLL_get();
288 internal static readonly int SMOOTH_SCROLL_DURATION = NDalicManualPINVOKE.TextEditor_Property_SMOOTH_SCROLL_DURATION_get();
289 internal static readonly int ENABLE_SCROLL_BAR = NDalicManualPINVOKE.TextEditor_Property_ENABLE_SCROLL_BAR_get();
290 internal static readonly int SCROLL_BAR_SHOW_DURATION = NDalicManualPINVOKE.TextEditor_Property_SCROLL_BAR_SHOW_DURATION_get();
291 internal static readonly int SCROLL_BAR_FADE_DURATION = NDalicManualPINVOKE.TextEditor_Property_SCROLL_BAR_FADE_DURATION_get();
292 internal static readonly int PIXEL_SIZE = NDalicManualPINVOKE.TextEditor_Property_PIXEL_SIZE_get();
293 internal static readonly int LINE_COUNT = NDalicManualPINVOKE.TextEditor_Property_LINE_COUNT_get();
294 internal static readonly int PLACEHOLDER_TEXT = NDalicManualPINVOKE.TextEditor_Property_PLACEHOLDER_TEXT_get();
295 internal static readonly int PLACEHOLDER_TEXT_COLOR = NDalicManualPINVOKE.TextEditor_Property_PLACEHOLDER_TEXT_COLOR_get();
296 internal static readonly int ENABLE_SELECTION = NDalicManualPINVOKE.TextEditor_Property_ENABLE_SELECTION_get();
297 internal static readonly int PLACEHOLDER = NDalicManualPINVOKE.TextEditor_Property_PLACEHOLDER_get();
298 internal static readonly int LINE_WRAP_MODE = NDalicManualPINVOKE.TextEditor_Property_LINE_WRAP_MODE_get();
301 internal class InputStyle
310 LineSpacing = 0x0010,
319 /// Creates the TextEditor control.
321 /// <since_tizen> 3 </since_tizen>
322 public TextEditor() : this(NDalicPINVOKE.TextEditor_New(), true)
324 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
327 internal TextEditor(TextEditor handle) : this(NDalicPINVOKE.new_TextEditor__SWIG_1(TextEditor.getCPtr(handle)), true)
329 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
332 [Obsolete("Please do not use! this will be deprecated")]
333 public new static TextEditor DownCast(BaseHandle handle)
335 TextEditor ret = Registry.GetManagedBaseHandleFromNativePtr(handle) as TextEditor;
336 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
340 internal TextEditorSignal TextChangedSignal()
342 TextEditorSignal ret = new TextEditorSignal(NDalicPINVOKE.TextEditor_TextChangedSignal(swigCPtr), false);
343 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
347 internal ScrollStateChangedSignal ScrollStateChangedSignal(TextEditor textEditor)
349 ScrollStateChangedSignal ret = new ScrollStateChangedSignal(NDalicManualPINVOKE.TextEditor_ScrollStateChangedSignal(TextEditor.getCPtr(textEditor)), false);
350 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
354 internal SWIGTYPE_p_Dali__SignalT_void_fDali__Toolkit__TextEditor_Dali__Toolkit__TextEditor__InputStyle__MaskF_t InputStyleChangedSignal()
356 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);
357 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
362 /// The TranslatableText property.<br>
363 /// The text can set the SID value.<br>
365 /// <exception cref='ArgumentNullException'>
366 /// ResourceManager about multilingual is null.
368 /// <since_tizen> 4 </since_tizen>
369 public string TranslatableText
373 return textEditorTextSid;
377 if (NUIApplication.MultilingualResourceManager == null)
379 throw new ArgumentNullException("ResourceManager about multilingual is null");
381 textEditorTextSid = value;
382 Text = SetTranslatable(textEditorTextSid);
386 /// The TranslatablePlaceholderText property.<br>
387 /// The text can set the SID value.<br>
389 /// <exception cref='ArgumentNullException'>
390 /// ResourceManager about multilingual is null.
392 /// <since_tizen> 4 </since_tizen>
393 public string TranslatablePlaceholderText
397 return textEditorPlaceHolderTextSid;
401 if (NUIApplication.MultilingualResourceManager == null)
403 throw new ArgumentNullException("ResourceManager about multilingual is null");
405 textEditorPlaceHolderTextSid = value;
406 PlaceholderText = SetTranslatable(textEditorPlaceHolderTextSid);
409 private string SetTranslatable(string textEditorSid)
411 string translatableText = null;
412 translatableText = NUIApplication.MultilingualResourceManager?.GetString(textEditorSid, new CultureInfo(SystemSettings.LocaleLanguage.Replace("_", "-")));
413 if (translatableText != null)
415 if (systemlangTextFlag == false)
417 SystemSettings.LocaleLanguageChanged += new WeakEventHandler<LocaleLanguageChangedEventArgs>(SystemSettings_LocaleLanguageChanged).Handler;
418 systemlangTextFlag = true;
420 return translatableText;
424 translatableText = "";
425 return translatableText;
428 private void SystemSettings_LocaleLanguageChanged(object sender, LocaleLanguageChangedEventArgs e)
430 if (textEditorTextSid != null)
432 Text = NUIApplication.MultilingualResourceManager?.GetString(textEditorTextSid, new CultureInfo(e.Value.Replace("_", "-")));
434 if (textEditorPlaceHolderTextSid != null)
436 PlaceholderText = NUIApplication.MultilingualResourceManager?.GetString(textEditorPlaceHolderTextSid, new CultureInfo(e.Value.Replace("_", "-")));
439 /// The Text property.
441 /// <since_tizen> 3 </since_tizen>
447 GetProperty(TextEditor.Property.TEXT).Get(out temp);
452 SetProperty(TextEditor.Property.TEXT, new Tizen.NUI.PropertyValue(value));
457 /// The TextColor property.
459 /// <since_tizen> 3 </since_tizen>
460 public Vector4 TextColor
464 Vector4 temp = new Vector4(0.0f, 0.0f, 0.0f, 0.0f);
465 GetProperty(TextEditor.Property.TEXT_COLOR).Get(temp);
470 SetProperty(TextEditor.Property.TEXT_COLOR, new Tizen.NUI.PropertyValue(value));
475 /// The FontFamily property.
477 /// <since_tizen> 3 </since_tizen>
478 public string FontFamily
483 GetProperty(TextEditor.Property.FONT_FAMILY).Get(out temp);
488 SetProperty(TextEditor.Property.FONT_FAMILY, new Tizen.NUI.PropertyValue(value));
493 /// The FontStyle property.
495 /// <since_tizen> 3 </since_tizen>
496 public PropertyMap FontStyle
500 PropertyMap temp = new PropertyMap();
501 GetProperty(TextEditor.Property.FONT_STYLE).Get(temp);
506 SetProperty(TextEditor.Property.FONT_STYLE, new Tizen.NUI.PropertyValue(value));
511 /// The PointSize property.
513 /// <since_tizen> 3 </since_tizen>
514 public float PointSize
519 GetProperty(TextEditor.Property.POINT_SIZE).Get(out temp);
524 SetProperty(TextEditor.Property.POINT_SIZE, new Tizen.NUI.PropertyValue(value));
529 /// The HorizontalAlignment property.
531 /// <since_tizen> 3 </since_tizen>
532 public HorizontalAlignment HorizontalAlignment
537 if (GetProperty(TextEditor.Property.HORIZONTAL_ALIGNMENT).Get(out temp) == false)
539 NUILog.Error("HorizontalAlignment get error!");
545 return HorizontalAlignment.Begin;
547 return HorizontalAlignment.Center;
549 return HorizontalAlignment.End;
551 return HorizontalAlignment.Begin;
556 string valueToString = "";
559 case HorizontalAlignment.Begin:
561 valueToString = "BEGIN";
564 case HorizontalAlignment.Center:
566 valueToString = "CENTER";
569 case HorizontalAlignment.End:
571 valueToString = "END";
576 valueToString = "BEGIN";
580 SetProperty(TextEditor.Property.HORIZONTAL_ALIGNMENT, new Tizen.NUI.PropertyValue(valueToString));
585 /// The ScrollThreshold property.
587 /// <since_tizen> 3 </since_tizen>
588 public float ScrollThreshold
593 GetProperty(TextEditor.Property.SCROLL_THRESHOLD).Get(out temp);
598 SetProperty(TextEditor.Property.SCROLL_THRESHOLD, new Tizen.NUI.PropertyValue(value));
603 /// The ScrollSpeed property.
605 /// <since_tizen> 3 </since_tizen>
606 public float ScrollSpeed
611 GetProperty(TextEditor.Property.SCROLL_SPEED).Get(out temp);
616 SetProperty(TextEditor.Property.SCROLL_SPEED, new Tizen.NUI.PropertyValue(value));
621 /// The PrimaryCursorColor property.
623 /// <since_tizen> 3 </since_tizen>
624 public Vector4 PrimaryCursorColor
628 Vector4 temp = new Vector4(0.0f, 0.0f, 0.0f, 0.0f);
629 GetProperty(TextEditor.Property.PRIMARY_CURSOR_COLOR).Get(temp);
634 SetProperty(TextEditor.Property.PRIMARY_CURSOR_COLOR, new Tizen.NUI.PropertyValue(value));
639 /// The SecondaryCursorColor property.
641 /// <since_tizen> 3 </since_tizen>
642 public Vector4 SecondaryCursorColor
646 Vector4 temp = new Vector4(0.0f, 0.0f, 0.0f, 0.0f);
647 GetProperty(TextEditor.Property.SECONDARY_CURSOR_COLOR).Get(temp);
652 SetProperty(TextEditor.Property.SECONDARY_CURSOR_COLOR, new Tizen.NUI.PropertyValue(value));
657 /// The EnableCursorBlink property.
659 /// <since_tizen> 3 </since_tizen>
660 public bool EnableCursorBlink
665 GetProperty(TextEditor.Property.ENABLE_CURSOR_BLINK).Get(out temp);
670 SetProperty(TextEditor.Property.ENABLE_CURSOR_BLINK, new Tizen.NUI.PropertyValue(value));
675 /// The CursorBlinkInterval property.
677 /// <since_tizen> 3 </since_tizen>
678 public float CursorBlinkInterval
683 GetProperty(TextEditor.Property.CURSOR_BLINK_INTERVAL).Get(out temp);
688 SetProperty(TextEditor.Property.CURSOR_BLINK_INTERVAL, new Tizen.NUI.PropertyValue(value));
693 /// The CursorBlinkDuration property.
695 /// <since_tizen> 3 </since_tizen>
696 public float CursorBlinkDuration
701 GetProperty(TextEditor.Property.CURSOR_BLINK_DURATION).Get(out temp);
706 SetProperty(TextEditor.Property.CURSOR_BLINK_DURATION, new Tizen.NUI.PropertyValue(value));
711 /// The CursorWidth property.
713 /// <since_tizen> 3 </since_tizen>
714 public int CursorWidth
719 GetProperty(TextEditor.Property.CURSOR_WIDTH).Get(out temp);
724 SetProperty(TextEditor.Property.CURSOR_WIDTH, new Tizen.NUI.PropertyValue(value));
729 /// The GrabHandleImage property.
731 /// <since_tizen> 3 </since_tizen>
732 public string GrabHandleImage
737 GetProperty(TextEditor.Property.GRAB_HANDLE_IMAGE).Get(out temp);
742 SetProperty(TextEditor.Property.GRAB_HANDLE_IMAGE, new Tizen.NUI.PropertyValue(value));
747 /// The GrabHandlePressedImage property.
749 /// <since_tizen> 3 </since_tizen>
750 public string GrabHandlePressedImage
755 GetProperty(TextEditor.Property.GRAB_HANDLE_PRESSED_IMAGE).Get(out temp);
760 SetProperty(TextEditor.Property.GRAB_HANDLE_PRESSED_IMAGE, new Tizen.NUI.PropertyValue(value));
765 /// The SelectionHandleImageLeft property.
767 /// <since_tizen> 3 </since_tizen>
768 public PropertyMap SelectionHandleImageLeft
772 PropertyMap temp = new PropertyMap();
773 GetProperty(TextEditor.Property.SELECTION_HANDLE_IMAGE_LEFT).Get(temp);
778 SetProperty(TextEditor.Property.SELECTION_HANDLE_IMAGE_LEFT, new Tizen.NUI.PropertyValue(value));
783 /// The SelectionHandleImageRight property.
785 /// <since_tizen> 3 </since_tizen>
786 public PropertyMap SelectionHandleImageRight
790 PropertyMap temp = new PropertyMap();
791 GetProperty(TextEditor.Property.SELECTION_HANDLE_IMAGE_RIGHT).Get(temp);
796 SetProperty(TextEditor.Property.SELECTION_HANDLE_IMAGE_RIGHT, new Tizen.NUI.PropertyValue(value));
801 /// The SelectionHandlePressedImageLeft property.
803 /// <since_tizen> 3 </since_tizen>
804 public PropertyMap SelectionHandlePressedImageLeft
808 PropertyMap temp = new PropertyMap();
809 GetProperty(TextEditor.Property.SELECTION_HANDLE_PRESSED_IMAGE_LEFT).Get(temp);
814 SetProperty(TextEditor.Property.SELECTION_HANDLE_PRESSED_IMAGE_LEFT, new Tizen.NUI.PropertyValue(value));
819 /// The SelectionHandlePressedImageRight property.
821 /// <since_tizen> 3 </since_tizen>
822 public PropertyMap SelectionHandlePressedImageRight
826 PropertyMap temp = new PropertyMap();
827 GetProperty(TextEditor.Property.SELECTION_HANDLE_PRESSED_IMAGE_RIGHT).Get(temp);
832 SetProperty(TextEditor.Property.SELECTION_HANDLE_PRESSED_IMAGE_RIGHT, new Tizen.NUI.PropertyValue(value));
837 /// The SelectionHandleMarkerImageLeft property.
839 /// <since_tizen> 3 </since_tizen>
840 public PropertyMap SelectionHandleMarkerImageLeft
844 PropertyMap temp = new PropertyMap();
845 GetProperty(TextEditor.Property.SELECTION_HANDLE_MARKER_IMAGE_LEFT).Get(temp);
850 SetProperty(TextEditor.Property.SELECTION_HANDLE_MARKER_IMAGE_LEFT, new Tizen.NUI.PropertyValue(value));
855 /// The SelectionHandleMarkerImageRight property.
857 /// <since_tizen> 3 </since_tizen>
858 public PropertyMap SelectionHandleMarkerImageRight
862 PropertyMap temp = new PropertyMap();
863 GetProperty(TextEditor.Property.SELECTION_HANDLE_MARKER_IMAGE_RIGHT).Get(temp);
868 SetProperty(TextEditor.Property.SELECTION_HANDLE_MARKER_IMAGE_RIGHT, new Tizen.NUI.PropertyValue(value));
873 /// The SelectionHighlightColor property.
875 /// <since_tizen> 3 </since_tizen>
876 public Vector4 SelectionHighlightColor
880 Vector4 temp = new Vector4(0.0f, 0.0f, 0.0f, 0.0f);
881 GetProperty(TextEditor.Property.SELECTION_HIGHLIGHT_COLOR).Get(temp);
886 SetProperty(TextEditor.Property.SELECTION_HIGHLIGHT_COLOR, new Tizen.NUI.PropertyValue(value));
891 /// The DecorationBoundingBox property.
893 /// <since_tizen> 3 </since_tizen>
894 public Rectangle DecorationBoundingBox
898 Rectangle temp = new Rectangle(0, 0, 0, 0);
899 GetProperty(TextEditor.Property.DECORATION_BOUNDING_BOX).Get(temp);
904 SetProperty(TextEditor.Property.DECORATION_BOUNDING_BOX, new Tizen.NUI.PropertyValue(value));
909 /// The EnableMarkup property.
911 /// <since_tizen> 3 </since_tizen>
912 public bool EnableMarkup
917 GetProperty(TextEditor.Property.ENABLE_MARKUP).Get(out temp);
922 SetProperty(TextEditor.Property.ENABLE_MARKUP, new Tizen.NUI.PropertyValue(value));
927 /// The InputColor property.
929 /// <since_tizen> 3 </since_tizen>
930 public Vector4 InputColor
934 Vector4 temp = new Vector4(0.0f, 0.0f, 0.0f, 0.0f);
935 GetProperty(TextEditor.Property.INPUT_COLOR).Get(temp);
940 SetProperty(TextEditor.Property.INPUT_COLOR, new Tizen.NUI.PropertyValue(value));
945 /// The InputFontFamily property.
947 /// <since_tizen> 3 </since_tizen>
948 public string InputFontFamily
953 GetProperty(TextEditor.Property.INPUT_FONT_FAMILY).Get(out temp);
958 SetProperty(TextEditor.Property.INPUT_FONT_FAMILY, new Tizen.NUI.PropertyValue(value));
963 /// The InputFontStyle property.
965 /// <since_tizen> 3 </since_tizen>
966 public PropertyMap InputFontStyle
970 PropertyMap temp = new PropertyMap();
971 GetProperty(TextEditor.Property.INPUT_FONT_STYLE).Get(temp);
976 SetProperty(TextEditor.Property.INPUT_FONT_STYLE, new Tizen.NUI.PropertyValue(value));
981 /// The InputPointSize property.
983 /// <since_tizen> 3 </since_tizen>
984 public float InputPointSize
989 GetProperty(TextEditor.Property.INPUT_POINT_SIZE).Get(out temp);
994 SetProperty(TextEditor.Property.INPUT_POINT_SIZE, new Tizen.NUI.PropertyValue(value));
999 /// The LineSpacing property.
1001 /// <since_tizen> 3 </since_tizen>
1002 public float LineSpacing
1007 GetProperty(TextEditor.Property.LINE_SPACING).Get(out temp);
1012 SetProperty(TextEditor.Property.LINE_SPACING, new Tizen.NUI.PropertyValue(value));
1017 /// The InputLineSpacing property.
1019 /// <since_tizen> 3 </since_tizen>
1020 public float InputLineSpacing
1025 GetProperty(TextEditor.Property.INPUT_LINE_SPACING).Get(out temp);
1030 SetProperty(TextEditor.Property.INPUT_LINE_SPACING, new Tizen.NUI.PropertyValue(value));
1035 /// The Underline property.
1037 /// <since_tizen> 3 </since_tizen>
1038 public PropertyMap Underline
1042 PropertyMap temp = new PropertyMap();
1043 GetProperty(TextEditor.Property.UNDERLINE).Get(temp);
1048 SetProperty(TextEditor.Property.UNDERLINE, new Tizen.NUI.PropertyValue(value));
1053 /// The InputUnderline property.
1055 /// <since_tizen> 3 </since_tizen>
1056 public string InputUnderline
1061 GetProperty(TextEditor.Property.INPUT_UNDERLINE).Get(out temp);
1066 SetProperty(TextEditor.Property.INPUT_UNDERLINE, new Tizen.NUI.PropertyValue(value));
1071 /// The Shadow property.
1073 /// <since_tizen> 3 </since_tizen>
1074 public PropertyMap Shadow
1078 PropertyMap temp = new PropertyMap();
1079 GetProperty(TextEditor.Property.SHADOW).Get(temp);
1084 SetProperty(TextEditor.Property.SHADOW, new Tizen.NUI.PropertyValue(value));
1089 /// The InputShadow property.
1091 /// <since_tizen> 3 </since_tizen>
1092 public string InputShadow
1097 GetProperty(TextEditor.Property.INPUT_SHADOW).Get(out temp);
1102 SetProperty(TextEditor.Property.INPUT_SHADOW, new Tizen.NUI.PropertyValue(value));
1107 /// The Emboss property.
1109 /// <since_tizen> 3 </since_tizen>
1110 public string Emboss
1115 GetProperty(TextEditor.Property.EMBOSS).Get(out temp);
1120 SetProperty(TextEditor.Property.EMBOSS, new Tizen.NUI.PropertyValue(value));
1125 /// The InputEmboss property.
1127 /// <since_tizen> 3 </since_tizen>
1128 public string InputEmboss
1133 GetProperty(TextEditor.Property.INPUT_EMBOSS).Get(out temp);
1138 SetProperty(TextEditor.Property.INPUT_EMBOSS, new Tizen.NUI.PropertyValue(value));
1143 /// The Outline property.
1145 /// <since_tizen> 3 </since_tizen>
1146 public string Outline
1151 GetProperty(TextEditor.Property.OUTLINE).Get(out temp);
1156 SetProperty(TextEditor.Property.OUTLINE, new Tizen.NUI.PropertyValue(value));
1161 /// The InputOutline property.
1163 /// <since_tizen> 3 </since_tizen>
1164 public string InputOutline
1169 GetProperty(TextEditor.Property.INPUT_OUTLINE).Get(out temp);
1174 SetProperty(TextEditor.Property.INPUT_OUTLINE, new Tizen.NUI.PropertyValue(value));
1179 /// The SmoothScroll property.
1181 /// <since_tizen> 3 </since_tizen>
1182 public bool SmoothScroll
1187 GetProperty(TextEditor.Property.SMOOTH_SCROLL).Get(out temp);
1192 SetProperty(TextEditor.Property.SMOOTH_SCROLL, new Tizen.NUI.PropertyValue(value));
1197 /// The SmoothScrollDuration property.
1199 /// <since_tizen> 3 </since_tizen>
1200 public float SmoothScrollDuration
1205 GetProperty(TextEditor.Property.SMOOTH_SCROLL_DURATION).Get(out temp);
1210 SetProperty(TextEditor.Property.SMOOTH_SCROLL_DURATION, new Tizen.NUI.PropertyValue(value));
1215 /// The EnableScrollBar property.
1217 /// <since_tizen> 3 </since_tizen>
1218 public bool EnableScrollBar
1223 GetProperty(TextEditor.Property.ENABLE_SCROLL_BAR).Get(out temp);
1228 SetProperty(TextEditor.Property.ENABLE_SCROLL_BAR, new Tizen.NUI.PropertyValue(value));
1233 /// The ScrollBarShowDuration property.
1235 /// <since_tizen> 3 </since_tizen>
1236 public float ScrollBarShowDuration
1241 GetProperty(TextEditor.Property.SCROLL_BAR_SHOW_DURATION).Get(out temp);
1246 SetProperty(TextEditor.Property.SCROLL_BAR_SHOW_DURATION, new Tizen.NUI.PropertyValue(value));
1251 /// The ScrollBarFadeDuration property.
1253 /// <since_tizen> 3 </since_tizen>
1254 public float ScrollBarFadeDuration
1259 GetProperty(TextEditor.Property.SCROLL_BAR_FADE_DURATION).Get(out temp);
1264 SetProperty(TextEditor.Property.SCROLL_BAR_FADE_DURATION, new Tizen.NUI.PropertyValue(value));
1269 /// The PixelSize property.
1271 /// <since_tizen> 3 </since_tizen>
1272 public float PixelSize
1277 GetProperty(TextEditor.Property.PIXEL_SIZE).Get(out temp);
1282 SetProperty(TextEditor.Property.PIXEL_SIZE, new Tizen.NUI.PropertyValue(value));
1287 /// The line count of the text.
1289 /// <since_tizen> 3 </since_tizen>
1290 public int LineCount
1295 GetProperty(TextEditor.Property.LINE_COUNT).Get(out temp);
1301 /// The text to display when the TextEditor is empty and inactive.
1303 /// <since_tizen> 3 </since_tizen>
1304 public string PlaceholderText
1309 GetProperty(TextEditor.Property.PLACEHOLDER_TEXT).Get(out temp);
1314 SetProperty(TextEditor.Property.PLACEHOLDER_TEXT, new Tizen.NUI.PropertyValue(value));
1319 /// The Placeholder text color.
1321 /// <since_tizen> 3 </since_tizen>
1322 public Color PlaceholderTextColor
1326 Color temp = new Color(0.0f, 0.0f, 0.0f, 0.0f);
1327 GetProperty(TextEditor.Property.PLACEHOLDER_TEXT_COLOR).Get(temp);
1332 SetProperty(TextEditor.Property.PLACEHOLDER_TEXT_COLOR, new Tizen.NUI.PropertyValue(value));
1337 /// The EnableSelection property.
1339 /// <since_tizen> 4 </since_tizen>
1340 public bool EnableSelection
1345 GetProperty(TextEditor.Property.ENABLE_SELECTION).Get(out temp);
1350 SetProperty(TextEditor.Property.ENABLE_SELECTION, new Tizen.NUI.PropertyValue(value));
1355 /// The Placeholder property.
1356 /// Gets or sets the placeholder: text, color, font family, font style, point size, and pixel size.
1359 /// The following example demonstrates how to set the placeholder property.
1361 /// PropertyMap propertyMap = new PropertyMap();
1362 /// propertyMap.Add("placeholderText", new PropertyValue("Setting Placeholder Text"));
1363 /// propertyMap.Add("placeholderTextFocused", new PropertyValue("Setting Placeholder Text Focused"));
1364 /// propertyMap.Add("placeholderColor", new PropertyValue(Color.Red));
1365 /// propertyMap.Add("placeholderFontFamily", new PropertyValue("Arial"));
1366 /// propertyMap.Add("placeholderPointSize", new PropertyValue(12.0f));
1368 /// PropertyMap fontStyleMap = new PropertyMap();
1369 /// fontStyleMap.Add("weight", new PropertyValue("bold"));
1370 /// fontStyleMap.Add("width", new PropertyValue("condensed"));
1371 /// fontStyleMap.Add("slant", new PropertyValue("italic"));
1372 /// propertyMap.Add("placeholderFontStyle", new PropertyValue(fontStyleMap));
1374 /// TextEditor editor = new TextEditor();
1375 /// editor.Placeholder = propertyMap;
1378 /// <since_tizen> 4 </since_tizen>
1379 public Tizen.NUI.PropertyMap Placeholder
1383 Tizen.NUI.PropertyMap temp = new Tizen.NUI.PropertyMap();
1384 GetProperty(TextEditor.Property.PLACEHOLDER).Get(temp);
1389 SetProperty(TextEditor.Property.PLACEHOLDER, new Tizen.NUI.PropertyValue(value));
1394 /// The LineWrapMode property.<br>
1395 /// The line wrap mode when the text lines over the layout width.<br>
1397 /// <since_tizen> 4 </since_tizen>
1398 public LineWrapMode LineWrapMode
1403 if(GetProperty(TextEditor.Property.LINE_WRAP_MODE).Get(out temp) == false)
1405 NUILog.Error("LineWrapMode get error!");
1409 case "WRAP_MODE_WORD":
1410 return LineWrapMode.Word;
1411 case "WRAP_MODE_CHARACTER":
1412 return LineWrapMode.Character;
1414 return LineWrapMode.Word;
1422 case LineWrapMode.Word:
1424 temp = "WRAP_MODE_WORD";
1427 case LineWrapMode.Character:
1429 temp = "WRAP_MODE_CHARACTER";
1433 SetProperty(TextEditor.Property.LINE_WRAP_MODE, new Tizen.NUI.PropertyValue(temp));