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;
20 namespace Tizen.NUI.BaseComponents
24 using System.Runtime.InteropServices;
25 using System.Globalization;
28 /// A control which provides a multi-line editable text editor.
30 public class TextEditor : View
32 private global::System.Runtime.InteropServices.HandleRef swigCPtr;
33 private string textEditorTextSid = null;
34 private string textEditorPlaceHolderTextSid = null;
35 private bool systemlangTextFlag = false;
37 internal TextEditor(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.TextEditor_SWIGUpcast(cPtr), cMemoryOwn)
39 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
42 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(TextEditor obj)
44 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
50 protected override void Dispose(DisposeTypes type)
57 if(type == DisposeTypes.Explicit)
60 //Release your own managed resources here.
61 //You should release all of your own disposable objects here.
64 //Release your own unmanaged resources here.
65 //You should not access any managed member here except static instance.
66 //because the execution order of Finalizes is non-deterministic.
68 if (_textEditorTextChangedCallbackDelegate != null)
70 TextChangedSignal().Disconnect(_textEditorTextChangedCallbackDelegate);
73 if (swigCPtr.Handle != global::System.IntPtr.Zero)
78 NDalicPINVOKE.delete_TextEditor(swigCPtr);
80 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
87 /// Event arguments that passed via the TextChanged signal.
89 public class TextChangedEventArgs : EventArgs
91 private TextEditor _textEditor;
94 /// TextEditor - is the texteditor control which has the text contents changed.
96 /// <since_tizen> 3 </since_tizen>
97 public TextEditor TextEditor
110 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
111 private delegate void TextChangedCallbackDelegate(IntPtr textEditor);
112 private EventHandler<TextChangedEventArgs> _textEditorTextChangedEventHandler;
113 private TextChangedCallbackDelegate _textEditorTextChangedCallbackDelegate;
116 /// An event for the TextChanged signal which can be used to subscribe or unsubscribe the event handler
117 /// provided by the user. The TextChanged signal is emitted when the text changes.<br />
119 /// <since_tizen> 3 </since_tizen>
120 public event EventHandler<TextChangedEventArgs> TextChanged
124 if (_textEditorTextChangedEventHandler == null)
126 _textEditorTextChangedCallbackDelegate = (OnTextChanged);
127 TextChangedSignal().Connect(_textEditorTextChangedCallbackDelegate);
129 _textEditorTextChangedEventHandler += value;
133 _textEditorTextChangedEventHandler -= value;
134 if (_textEditorTextChangedEventHandler == null && TextChangedSignal().Empty() == false)
136 TextChangedSignal().Disconnect(_textEditorTextChangedCallbackDelegate);
141 private void OnTextChanged(IntPtr textEditor)
143 TextChangedEventArgs e = new TextChangedEventArgs();
145 // Populate all members of "e" (TextChangedEventArgs) with real data
146 e.TextEditor = Registry.GetManagedBaseHandleFromNativePtr(textEditor) as TextEditor;
148 if (_textEditorTextChangedEventHandler != null)
150 //here we send all data to user event handlers
151 _textEditorTextChangedEventHandler(this, e);
157 /// Event arguments that passed via the ScrollStateChanged signal.
159 public class ScrollStateChangedEventArgs : EventArgs
161 private TextEditor _textEditor;
162 private ScrollState _scrollState;
165 /// TextEditor - is the texteditor control which has the scroll state changed.
167 /// <since_tizen> 3 </since_tizen>
168 public TextEditor TextEditor
181 /// ScrollState - is the texteditor control scroll state.
183 /// <since_tizen> 3 </since_tizen>
184 public ScrollState ScrollState
192 _scrollState = value;
197 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
198 private delegate void ScrollStateChangedCallbackDelegate(IntPtr textEditor, ScrollState state);
199 private EventHandler<ScrollStateChangedEventArgs> _textEditorScrollStateChangedEventHandler;
200 private ScrollStateChangedCallbackDelegate _textEditorScrollStateChangedCallbackDelegate;
203 /// Event for the ScrollStateChanged signal which can be used to subscribe or unsubscribe the event handler
204 /// provided by the user. The ScrollStateChanged signal is emitted when the scroll state changes.<br />
206 /// <since_tizen> 3 </since_tizen>
207 public event EventHandler<ScrollStateChangedEventArgs> ScrollStateChanged
211 if (_textEditorScrollStateChangedEventHandler == null)
213 _textEditorScrollStateChangedCallbackDelegate = OnScrollStateChanged;
214 ScrollStateChangedSignal(this).Connect(_textEditorScrollStateChangedCallbackDelegate);
216 _textEditorScrollStateChangedEventHandler += value;
220 _textEditorScrollStateChangedEventHandler -= value;
221 if (_textEditorScrollStateChangedEventHandler == null && ScrollStateChangedSignal(this).Empty() == false)
223 ScrollStateChangedSignal(this).Disconnect(_textEditorScrollStateChangedCallbackDelegate);
228 private void OnScrollStateChanged(IntPtr textEditor, ScrollState state)
230 ScrollStateChangedEventArgs e = new ScrollStateChangedEventArgs();
232 if (textEditor != null)
234 // Populate all members of "e" (ScrollStateChangedEventArgs) with real data
235 e.TextEditor = Registry.GetManagedBaseHandleFromNativePtr(textEditor) as TextEditor;
236 e.ScrollState = state;
239 if (_textEditorScrollStateChangedEventHandler != null)
241 //here we send all data to user event handlers
242 _textEditorScrollStateChangedEventHandler(this, e);
246 internal new class Property
248 internal static readonly int RENDERING_BACKEND = NDalicPINVOKE.TextEditor_Property_RENDERING_BACKEND_get();
249 internal static readonly int TEXT = NDalicPINVOKE.TextEditor_Property_TEXT_get();
250 internal static readonly int TEXT_COLOR = NDalicPINVOKE.TextEditor_Property_TEXT_COLOR_get();
251 internal static readonly int FONT_FAMILY = NDalicPINVOKE.TextEditor_Property_FONT_FAMILY_get();
252 internal static readonly int FONT_STYLE = NDalicPINVOKE.TextEditor_Property_FONT_STYLE_get();
253 internal static readonly int POINT_SIZE = NDalicPINVOKE.TextEditor_Property_POINT_SIZE_get();
254 internal static readonly int HORIZONTAL_ALIGNMENT = NDalicPINVOKE.TextEditor_Property_HORIZONTAL_ALIGNMENT_get();
255 internal static readonly int SCROLL_THRESHOLD = NDalicPINVOKE.TextEditor_Property_SCROLL_THRESHOLD_get();
256 internal static readonly int SCROLL_SPEED = NDalicPINVOKE.TextEditor_Property_SCROLL_SPEED_get();
257 internal static readonly int PRIMARY_CURSOR_COLOR = NDalicPINVOKE.TextEditor_Property_PRIMARY_CURSOR_COLOR_get();
258 internal static readonly int SECONDARY_CURSOR_COLOR = NDalicPINVOKE.TextEditor_Property_SECONDARY_CURSOR_COLOR_get();
259 internal static readonly int ENABLE_CURSOR_BLINK = NDalicPINVOKE.TextEditor_Property_ENABLE_CURSOR_BLINK_get();
260 internal static readonly int CURSOR_BLINK_INTERVAL = NDalicPINVOKE.TextEditor_Property_CURSOR_BLINK_INTERVAL_get();
261 internal static readonly int CURSOR_BLINK_DURATION = NDalicPINVOKE.TextEditor_Property_CURSOR_BLINK_DURATION_get();
262 internal static readonly int CURSOR_WIDTH = NDalicPINVOKE.TextEditor_Property_CURSOR_WIDTH_get();
263 internal static readonly int GRAB_HANDLE_IMAGE = NDalicPINVOKE.TextEditor_Property_GRAB_HANDLE_IMAGE_get();
264 internal static readonly int GRAB_HANDLE_PRESSED_IMAGE = NDalicPINVOKE.TextEditor_Property_GRAB_HANDLE_PRESSED_IMAGE_get();
265 internal static readonly int SELECTION_HANDLE_IMAGE_LEFT = NDalicPINVOKE.TextEditor_Property_SELECTION_HANDLE_IMAGE_LEFT_get();
266 internal static readonly int SELECTION_HANDLE_IMAGE_RIGHT = NDalicPINVOKE.TextEditor_Property_SELECTION_HANDLE_IMAGE_RIGHT_get();
267 internal static readonly int SELECTION_HANDLE_PRESSED_IMAGE_LEFT = NDalicPINVOKE.TextEditor_Property_SELECTION_HANDLE_PRESSED_IMAGE_LEFT_get();
268 internal static readonly int SELECTION_HANDLE_PRESSED_IMAGE_RIGHT = NDalicPINVOKE.TextEditor_Property_SELECTION_HANDLE_PRESSED_IMAGE_RIGHT_get();
269 internal static readonly int SELECTION_HANDLE_MARKER_IMAGE_LEFT = NDalicPINVOKE.TextEditor_Property_SELECTION_HANDLE_MARKER_IMAGE_LEFT_get();
270 internal static readonly int SELECTION_HANDLE_MARKER_IMAGE_RIGHT = NDalicPINVOKE.TextEditor_Property_SELECTION_HANDLE_MARKER_IMAGE_RIGHT_get();
271 internal static readonly int SELECTION_HIGHLIGHT_COLOR = NDalicPINVOKE.TextEditor_Property_SELECTION_HIGHLIGHT_COLOR_get();
272 internal static readonly int DECORATION_BOUNDING_BOX = NDalicPINVOKE.TextEditor_Property_DECORATION_BOUNDING_BOX_get();
273 internal static readonly int ENABLE_MARKUP = NDalicPINVOKE.TextEditor_Property_ENABLE_MARKUP_get();
274 internal static readonly int INPUT_COLOR = NDalicPINVOKE.TextEditor_Property_INPUT_COLOR_get();
275 internal static readonly int INPUT_FONT_FAMILY = NDalicPINVOKE.TextEditor_Property_INPUT_FONT_FAMILY_get();
276 internal static readonly int INPUT_FONT_STYLE = NDalicPINVOKE.TextEditor_Property_INPUT_FONT_STYLE_get();
277 internal static readonly int INPUT_POINT_SIZE = NDalicPINVOKE.TextEditor_Property_INPUT_POINT_SIZE_get();
278 internal static readonly int LINE_SPACING = NDalicPINVOKE.TextEditor_Property_LINE_SPACING_get();
279 internal static readonly int INPUT_LINE_SPACING = NDalicPINVOKE.TextEditor_Property_INPUT_LINE_SPACING_get();
280 internal static readonly int UNDERLINE = NDalicPINVOKE.TextEditor_Property_UNDERLINE_get();
281 internal static readonly int INPUT_UNDERLINE = NDalicPINVOKE.TextEditor_Property_INPUT_UNDERLINE_get();
282 internal static readonly int SHADOW = NDalicPINVOKE.TextEditor_Property_SHADOW_get();
283 internal static readonly int INPUT_SHADOW = NDalicPINVOKE.TextEditor_Property_INPUT_SHADOW_get();
284 internal static readonly int EMBOSS = NDalicPINVOKE.TextEditor_Property_EMBOSS_get();
285 internal static readonly int INPUT_EMBOSS = NDalicPINVOKE.TextEditor_Property_INPUT_EMBOSS_get();
286 internal static readonly int OUTLINE = NDalicPINVOKE.TextEditor_Property_OUTLINE_get();
287 internal static readonly int INPUT_OUTLINE = NDalicPINVOKE.TextEditor_Property_INPUT_OUTLINE_get();
288 internal static readonly int SMOOTH_SCROLL = NDalicManualPINVOKE.TextEditor_Property_SMOOTH_SCROLL_get();
289 internal static readonly int SMOOTH_SCROLL_DURATION = NDalicManualPINVOKE.TextEditor_Property_SMOOTH_SCROLL_DURATION_get();
290 internal static readonly int ENABLE_SCROLL_BAR = NDalicManualPINVOKE.TextEditor_Property_ENABLE_SCROLL_BAR_get();
291 internal static readonly int SCROLL_BAR_SHOW_DURATION = NDalicManualPINVOKE.TextEditor_Property_SCROLL_BAR_SHOW_DURATION_get();
292 internal static readonly int SCROLL_BAR_FADE_DURATION = NDalicManualPINVOKE.TextEditor_Property_SCROLL_BAR_FADE_DURATION_get();
293 internal static readonly int PIXEL_SIZE = NDalicManualPINVOKE.TextEditor_Property_PIXEL_SIZE_get();
294 internal static readonly int LINE_COUNT = NDalicManualPINVOKE.TextEditor_Property_LINE_COUNT_get();
295 internal static readonly int PLACEHOLDER_TEXT = NDalicManualPINVOKE.TextEditor_Property_PLACEHOLDER_TEXT_get();
296 internal static readonly int PLACEHOLDER_TEXT_COLOR = NDalicManualPINVOKE.TextEditor_Property_PLACEHOLDER_TEXT_COLOR_get();
297 internal static readonly int ENABLE_SELECTION = NDalicManualPINVOKE.TextEditor_Property_ENABLE_SELECTION_get();
298 internal static readonly int PLACEHOLDER = NDalicManualPINVOKE.TextEditor_Property_PLACEHOLDER_get();
299 internal static readonly int LINE_WRAP_MODE = NDalicManualPINVOKE.TextEditor_Property_LINE_WRAP_MODE_get();
302 internal class InputStyle
311 LineSpacing = 0x0010,
320 /// Creates the TextEditor control.
322 /// <since_tizen> 3 </since_tizen>
323 public TextEditor() : this(NDalicPINVOKE.TextEditor_New(), true)
325 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
328 internal TextEditor(TextEditor handle) : this(NDalicPINVOKE.new_TextEditor__SWIG_1(TextEditor.getCPtr(handle)), true)
330 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
334 /// [Obsolete("Please do not use! this will be deprecated")]
336 /// <param name="handle"></param>
337 /// <returns></returns>
338 /// <since_tizen> 3 </since_tizen>
339 [Obsolete("Please do not use! this will be deprecated")]
340 public new static TextEditor DownCast(BaseHandle handle)
342 TextEditor ret = Registry.GetManagedBaseHandleFromNativePtr(handle) as TextEditor;
343 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
347 internal TextEditorSignal TextChangedSignal()
349 TextEditorSignal ret = new TextEditorSignal(NDalicPINVOKE.TextEditor_TextChangedSignal(swigCPtr), false);
350 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
354 internal ScrollStateChangedSignal ScrollStateChangedSignal(TextEditor textEditor)
356 ScrollStateChangedSignal ret = new ScrollStateChangedSignal(NDalicManualPINVOKE.TextEditor_ScrollStateChangedSignal(TextEditor.getCPtr(textEditor)), false);
357 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
361 internal SWIGTYPE_p_Dali__SignalT_void_fDali__Toolkit__TextEditor_Dali__Toolkit__TextEditor__InputStyle__MaskF_t InputStyleChangedSignal()
363 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);
364 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
369 /// The TranslatableText property.<br />
370 /// The text can set the SID value.<br />
372 /// <exception cref='ArgumentNullException'>
373 /// ResourceManager about multilingual is null.
375 /// <since_tizen> 4 </since_tizen>
376 public string TranslatableText
380 return textEditorTextSid;
384 if (NUIApplication.MultilingualResourceManager == null)
386 throw new ArgumentNullException("ResourceManager about multilingual is null");
388 textEditorTextSid = value;
389 Text = SetTranslatable(textEditorTextSid);
393 /// The TranslatablePlaceholderText property.<br />
394 /// The text can set the SID value.<br />
396 /// <exception cref='ArgumentNullException'>
397 /// ResourceManager about multilingual is null.
399 /// <since_tizen> 4 </since_tizen>
400 public string TranslatablePlaceholderText
404 return textEditorPlaceHolderTextSid;
408 if (NUIApplication.MultilingualResourceManager == null)
410 throw new ArgumentNullException("ResourceManager about multilingual is null");
412 textEditorPlaceHolderTextSid = value;
413 PlaceholderText = SetTranslatable(textEditorPlaceHolderTextSid);
416 private string SetTranslatable(string textEditorSid)
418 string translatableText = null;
419 translatableText = NUIApplication.MultilingualResourceManager?.GetString(textEditorSid, new CultureInfo(SystemSettings.LocaleLanguage.Replace("_", "-")));
420 if (translatableText != null)
422 if (systemlangTextFlag == false)
424 SystemSettings.LocaleLanguageChanged += new WeakEventHandler<LocaleLanguageChangedEventArgs>(SystemSettings_LocaleLanguageChanged).Handler;
425 systemlangTextFlag = true;
427 return translatableText;
431 translatableText = "";
432 return translatableText;
435 private void SystemSettings_LocaleLanguageChanged(object sender, LocaleLanguageChangedEventArgs e)
437 if (textEditorTextSid != null)
439 Text = NUIApplication.MultilingualResourceManager?.GetString(textEditorTextSid, new CultureInfo(e.Value.Replace("_", "-")));
441 if (textEditorPlaceHolderTextSid != null)
443 PlaceholderText = NUIApplication.MultilingualResourceManager?.GetString(textEditorPlaceHolderTextSid, new CultureInfo(e.Value.Replace("_", "-")));
447 /// The Text property.
449 /// <since_tizen> 3 </since_tizen>
455 GetProperty(TextEditor.Property.TEXT).Get(out temp);
460 SetProperty(TextEditor.Property.TEXT, new Tizen.NUI.PropertyValue(value));
465 /// The TextColor property.
467 /// <since_tizen> 3 </since_tizen>
468 public Vector4 TextColor
472 Vector4 temp = new Vector4(0.0f, 0.0f, 0.0f, 0.0f);
473 GetProperty(TextEditor.Property.TEXT_COLOR).Get(temp);
478 SetProperty(TextEditor.Property.TEXT_COLOR, new Tizen.NUI.PropertyValue(value));
483 /// The FontFamily property.
485 /// <since_tizen> 3 </since_tizen>
486 public string FontFamily
491 GetProperty(TextEditor.Property.FONT_FAMILY).Get(out temp);
496 SetProperty(TextEditor.Property.FONT_FAMILY, new Tizen.NUI.PropertyValue(value));
501 /// The FontStyle property.
503 /// <since_tizen> 3 </since_tizen>
504 public PropertyMap FontStyle
508 PropertyMap temp = new PropertyMap();
509 GetProperty(TextEditor.Property.FONT_STYLE).Get(temp);
514 SetProperty(TextEditor.Property.FONT_STYLE, new Tizen.NUI.PropertyValue(value));
519 /// The PointSize property.
521 /// <since_tizen> 3 </since_tizen>
522 public float PointSize
527 GetProperty(TextEditor.Property.POINT_SIZE).Get(out temp);
532 SetProperty(TextEditor.Property.POINT_SIZE, new Tizen.NUI.PropertyValue(value));
537 /// The HorizontalAlignment property.
539 /// <since_tizen> 3 </since_tizen>
540 public HorizontalAlignment HorizontalAlignment
545 if (GetProperty(TextEditor.Property.HORIZONTAL_ALIGNMENT).Get(out temp) == false)
547 NUILog.Error("HorizontalAlignment get error!");
553 return HorizontalAlignment.Begin;
555 return HorizontalAlignment.Center;
557 return HorizontalAlignment.End;
559 return HorizontalAlignment.Begin;
564 string valueToString = "";
567 case HorizontalAlignment.Begin:
569 valueToString = "BEGIN";
572 case HorizontalAlignment.Center:
574 valueToString = "CENTER";
577 case HorizontalAlignment.End:
579 valueToString = "END";
584 valueToString = "BEGIN";
588 SetProperty(TextEditor.Property.HORIZONTAL_ALIGNMENT, new Tizen.NUI.PropertyValue(valueToString));
593 /// The ScrollThreshold property.
595 /// <since_tizen> 3 </since_tizen>
596 public float ScrollThreshold
601 GetProperty(TextEditor.Property.SCROLL_THRESHOLD).Get(out temp);
606 SetProperty(TextEditor.Property.SCROLL_THRESHOLD, new Tizen.NUI.PropertyValue(value));
611 /// The ScrollSpeed property.
613 /// <since_tizen> 3 </since_tizen>
614 public float ScrollSpeed
619 GetProperty(TextEditor.Property.SCROLL_SPEED).Get(out temp);
624 SetProperty(TextEditor.Property.SCROLL_SPEED, new Tizen.NUI.PropertyValue(value));
629 /// The PrimaryCursorColor property.
631 /// <since_tizen> 3 </since_tizen>
632 public Vector4 PrimaryCursorColor
636 Vector4 temp = new Vector4(0.0f, 0.0f, 0.0f, 0.0f);
637 GetProperty(TextEditor.Property.PRIMARY_CURSOR_COLOR).Get(temp);
642 SetProperty(TextEditor.Property.PRIMARY_CURSOR_COLOR, new Tizen.NUI.PropertyValue(value));
647 /// The SecondaryCursorColor property.
649 /// <since_tizen> 3 </since_tizen>
650 public Vector4 SecondaryCursorColor
654 Vector4 temp = new Vector4(0.0f, 0.0f, 0.0f, 0.0f);
655 GetProperty(TextEditor.Property.SECONDARY_CURSOR_COLOR).Get(temp);
660 SetProperty(TextEditor.Property.SECONDARY_CURSOR_COLOR, new Tizen.NUI.PropertyValue(value));
665 /// The EnableCursorBlink property.
667 /// <since_tizen> 3 </since_tizen>
668 public bool EnableCursorBlink
673 GetProperty(TextEditor.Property.ENABLE_CURSOR_BLINK).Get(out temp);
678 SetProperty(TextEditor.Property.ENABLE_CURSOR_BLINK, new Tizen.NUI.PropertyValue(value));
683 /// The CursorBlinkInterval property.
685 /// <since_tizen> 3 </since_tizen>
686 public float CursorBlinkInterval
691 GetProperty(TextEditor.Property.CURSOR_BLINK_INTERVAL).Get(out temp);
696 SetProperty(TextEditor.Property.CURSOR_BLINK_INTERVAL, new Tizen.NUI.PropertyValue(value));
701 /// The CursorBlinkDuration property.
703 /// <since_tizen> 3 </since_tizen>
704 public float CursorBlinkDuration
709 GetProperty(TextEditor.Property.CURSOR_BLINK_DURATION).Get(out temp);
714 SetProperty(TextEditor.Property.CURSOR_BLINK_DURATION, new Tizen.NUI.PropertyValue(value));
719 /// The CursorWidth property.
721 /// <since_tizen> 3 </since_tizen>
722 public int CursorWidth
727 GetProperty(TextEditor.Property.CURSOR_WIDTH).Get(out temp);
732 SetProperty(TextEditor.Property.CURSOR_WIDTH, new Tizen.NUI.PropertyValue(value));
737 /// The GrabHandleImage property.
739 /// <since_tizen> 3 </since_tizen>
740 public string GrabHandleImage
745 GetProperty(TextEditor.Property.GRAB_HANDLE_IMAGE).Get(out temp);
750 SetProperty(TextEditor.Property.GRAB_HANDLE_IMAGE, new Tizen.NUI.PropertyValue(value));
755 /// The GrabHandlePressedImage property.
757 /// <since_tizen> 3 </since_tizen>
758 public string GrabHandlePressedImage
763 GetProperty(TextEditor.Property.GRAB_HANDLE_PRESSED_IMAGE).Get(out temp);
768 SetProperty(TextEditor.Property.GRAB_HANDLE_PRESSED_IMAGE, new Tizen.NUI.PropertyValue(value));
773 /// The SelectionHandleImageLeft property.
775 /// <since_tizen> 3 </since_tizen>
776 public PropertyMap SelectionHandleImageLeft
780 PropertyMap temp = new PropertyMap();
781 GetProperty(TextEditor.Property.SELECTION_HANDLE_IMAGE_LEFT).Get(temp);
786 SetProperty(TextEditor.Property.SELECTION_HANDLE_IMAGE_LEFT, new Tizen.NUI.PropertyValue(value));
791 /// The SelectionHandleImageRight property.
793 /// <since_tizen> 3 </since_tizen>
794 public PropertyMap SelectionHandleImageRight
798 PropertyMap temp = new PropertyMap();
799 GetProperty(TextEditor.Property.SELECTION_HANDLE_IMAGE_RIGHT).Get(temp);
804 SetProperty(TextEditor.Property.SELECTION_HANDLE_IMAGE_RIGHT, new Tizen.NUI.PropertyValue(value));
809 /// The SelectionHandlePressedImageLeft property.
811 /// <since_tizen> 3 </since_tizen>
812 public PropertyMap SelectionHandlePressedImageLeft
816 PropertyMap temp = new PropertyMap();
817 GetProperty(TextEditor.Property.SELECTION_HANDLE_PRESSED_IMAGE_LEFT).Get(temp);
822 SetProperty(TextEditor.Property.SELECTION_HANDLE_PRESSED_IMAGE_LEFT, new Tizen.NUI.PropertyValue(value));
827 /// The SelectionHandlePressedImageRight property.
829 /// <since_tizen> 3 </since_tizen>
830 public PropertyMap SelectionHandlePressedImageRight
834 PropertyMap temp = new PropertyMap();
835 GetProperty(TextEditor.Property.SELECTION_HANDLE_PRESSED_IMAGE_RIGHT).Get(temp);
840 SetProperty(TextEditor.Property.SELECTION_HANDLE_PRESSED_IMAGE_RIGHT, new Tizen.NUI.PropertyValue(value));
845 /// The SelectionHandleMarkerImageLeft property.
847 /// <since_tizen> 3 </since_tizen>
848 public PropertyMap SelectionHandleMarkerImageLeft
852 PropertyMap temp = new PropertyMap();
853 GetProperty(TextEditor.Property.SELECTION_HANDLE_MARKER_IMAGE_LEFT).Get(temp);
858 SetProperty(TextEditor.Property.SELECTION_HANDLE_MARKER_IMAGE_LEFT, new Tizen.NUI.PropertyValue(value));
863 /// The SelectionHandleMarkerImageRight property.
865 /// <since_tizen> 3 </since_tizen>
866 public PropertyMap SelectionHandleMarkerImageRight
870 PropertyMap temp = new PropertyMap();
871 GetProperty(TextEditor.Property.SELECTION_HANDLE_MARKER_IMAGE_RIGHT).Get(temp);
876 SetProperty(TextEditor.Property.SELECTION_HANDLE_MARKER_IMAGE_RIGHT, new Tizen.NUI.PropertyValue(value));
881 /// The SelectionHighlightColor property.
883 /// <since_tizen> 3 </since_tizen>
884 public Vector4 SelectionHighlightColor
888 Vector4 temp = new Vector4(0.0f, 0.0f, 0.0f, 0.0f);
889 GetProperty(TextEditor.Property.SELECTION_HIGHLIGHT_COLOR).Get(temp);
894 SetProperty(TextEditor.Property.SELECTION_HIGHLIGHT_COLOR, new Tizen.NUI.PropertyValue(value));
899 /// The DecorationBoundingBox property.
901 /// <since_tizen> 3 </since_tizen>
902 public Rectangle DecorationBoundingBox
906 Rectangle temp = new Rectangle(0, 0, 0, 0);
907 GetProperty(TextEditor.Property.DECORATION_BOUNDING_BOX).Get(temp);
912 SetProperty(TextEditor.Property.DECORATION_BOUNDING_BOX, new Tizen.NUI.PropertyValue(value));
917 /// The EnableMarkup property.
919 /// <since_tizen> 3 </since_tizen>
920 public bool EnableMarkup
925 GetProperty(TextEditor.Property.ENABLE_MARKUP).Get(out temp);
930 SetProperty(TextEditor.Property.ENABLE_MARKUP, new Tizen.NUI.PropertyValue(value));
935 /// The InputColor property.
937 /// <since_tizen> 3 </since_tizen>
938 public Vector4 InputColor
942 Vector4 temp = new Vector4(0.0f, 0.0f, 0.0f, 0.0f);
943 GetProperty(TextEditor.Property.INPUT_COLOR).Get(temp);
948 SetProperty(TextEditor.Property.INPUT_COLOR, new Tizen.NUI.PropertyValue(value));
953 /// The InputFontFamily property.
955 /// <since_tizen> 3 </since_tizen>
956 public string InputFontFamily
961 GetProperty(TextEditor.Property.INPUT_FONT_FAMILY).Get(out temp);
966 SetProperty(TextEditor.Property.INPUT_FONT_FAMILY, new Tizen.NUI.PropertyValue(value));
971 /// The InputFontStyle property.
973 /// <since_tizen> 3 </since_tizen>
974 public PropertyMap InputFontStyle
978 PropertyMap temp = new PropertyMap();
979 GetProperty(TextEditor.Property.INPUT_FONT_STYLE).Get(temp);
984 SetProperty(TextEditor.Property.INPUT_FONT_STYLE, new Tizen.NUI.PropertyValue(value));
989 /// The InputPointSize property.
991 /// <since_tizen> 3 </since_tizen>
992 public float InputPointSize
997 GetProperty(TextEditor.Property.INPUT_POINT_SIZE).Get(out temp);
1002 SetProperty(TextEditor.Property.INPUT_POINT_SIZE, new Tizen.NUI.PropertyValue(value));
1007 /// The LineSpacing property.
1009 /// <since_tizen> 3 </since_tizen>
1010 public float LineSpacing
1015 GetProperty(TextEditor.Property.LINE_SPACING).Get(out temp);
1020 SetProperty(TextEditor.Property.LINE_SPACING, new Tizen.NUI.PropertyValue(value));
1025 /// The InputLineSpacing property.
1027 /// <since_tizen> 3 </since_tizen>
1028 public float InputLineSpacing
1033 GetProperty(TextEditor.Property.INPUT_LINE_SPACING).Get(out temp);
1038 SetProperty(TextEditor.Property.INPUT_LINE_SPACING, new Tizen.NUI.PropertyValue(value));
1043 /// The Underline property.
1045 /// <since_tizen> 3 </since_tizen>
1046 public PropertyMap Underline
1050 PropertyMap temp = new PropertyMap();
1051 GetProperty(TextEditor.Property.UNDERLINE).Get(temp);
1056 SetProperty(TextEditor.Property.UNDERLINE, new Tizen.NUI.PropertyValue(value));
1061 /// The InputUnderline property.
1063 /// <since_tizen> 3 </since_tizen>
1064 public string InputUnderline
1069 GetProperty(TextEditor.Property.INPUT_UNDERLINE).Get(out temp);
1074 SetProperty(TextEditor.Property.INPUT_UNDERLINE, new Tizen.NUI.PropertyValue(value));
1079 /// The Shadow property.
1081 /// <since_tizen> 3 </since_tizen>
1082 public PropertyMap Shadow
1086 PropertyMap temp = new PropertyMap();
1087 GetProperty(TextEditor.Property.SHADOW).Get(temp);
1092 SetProperty(TextEditor.Property.SHADOW, new Tizen.NUI.PropertyValue(value));
1097 /// The InputShadow property.
1099 /// <since_tizen> 3 </since_tizen>
1100 public string InputShadow
1105 GetProperty(TextEditor.Property.INPUT_SHADOW).Get(out temp);
1110 SetProperty(TextEditor.Property.INPUT_SHADOW, new Tizen.NUI.PropertyValue(value));
1115 /// The Emboss property.
1117 /// <since_tizen> 3 </since_tizen>
1118 public string Emboss
1123 GetProperty(TextEditor.Property.EMBOSS).Get(out temp);
1128 SetProperty(TextEditor.Property.EMBOSS, new Tizen.NUI.PropertyValue(value));
1133 /// The InputEmboss property.
1135 /// <since_tizen> 3 </since_tizen>
1136 public string InputEmboss
1141 GetProperty(TextEditor.Property.INPUT_EMBOSS).Get(out temp);
1146 SetProperty(TextEditor.Property.INPUT_EMBOSS, new Tizen.NUI.PropertyValue(value));
1151 /// The Outline property.
1153 /// <since_tizen> 3 </since_tizen>
1154 public PropertyMap Outline
1158 PropertyMap temp = new PropertyMap();
1159 GetProperty(TextEditor.Property.OUTLINE).Get(temp);
1164 SetProperty(TextEditor.Property.OUTLINE, new Tizen.NUI.PropertyValue(value));
1169 /// The InputOutline property.
1171 /// <since_tizen> 3 </since_tizen>
1172 public string InputOutline
1177 GetProperty(TextEditor.Property.INPUT_OUTLINE).Get(out temp);
1182 SetProperty(TextEditor.Property.INPUT_OUTLINE, new Tizen.NUI.PropertyValue(value));
1187 /// The SmoothScroll property.
1189 /// <since_tizen> 3 </since_tizen>
1190 public bool SmoothScroll
1195 GetProperty(TextEditor.Property.SMOOTH_SCROLL).Get(out temp);
1200 SetProperty(TextEditor.Property.SMOOTH_SCROLL, new Tizen.NUI.PropertyValue(value));
1205 /// The SmoothScrollDuration property.
1207 /// <since_tizen> 3 </since_tizen>
1208 public float SmoothScrollDuration
1213 GetProperty(TextEditor.Property.SMOOTH_SCROLL_DURATION).Get(out temp);
1218 SetProperty(TextEditor.Property.SMOOTH_SCROLL_DURATION, new Tizen.NUI.PropertyValue(value));
1223 /// The EnableScrollBar property.
1225 /// <since_tizen> 3 </since_tizen>
1226 public bool EnableScrollBar
1231 GetProperty(TextEditor.Property.ENABLE_SCROLL_BAR).Get(out temp);
1236 SetProperty(TextEditor.Property.ENABLE_SCROLL_BAR, new Tizen.NUI.PropertyValue(value));
1241 /// The ScrollBarShowDuration property.
1243 /// <since_tizen> 3 </since_tizen>
1244 public float ScrollBarShowDuration
1249 GetProperty(TextEditor.Property.SCROLL_BAR_SHOW_DURATION).Get(out temp);
1254 SetProperty(TextEditor.Property.SCROLL_BAR_SHOW_DURATION, new Tizen.NUI.PropertyValue(value));
1259 /// The ScrollBarFadeDuration property.
1261 /// <since_tizen> 3 </since_tizen>
1262 public float ScrollBarFadeDuration
1267 GetProperty(TextEditor.Property.SCROLL_BAR_FADE_DURATION).Get(out temp);
1272 SetProperty(TextEditor.Property.SCROLL_BAR_FADE_DURATION, new Tizen.NUI.PropertyValue(value));
1277 /// The PixelSize property.
1279 /// <since_tizen> 3 </since_tizen>
1280 public float PixelSize
1285 GetProperty(TextEditor.Property.PIXEL_SIZE).Get(out temp);
1290 SetProperty(TextEditor.Property.PIXEL_SIZE, new Tizen.NUI.PropertyValue(value));
1295 /// The line count of the text.
1297 /// <since_tizen> 3 </since_tizen>
1298 public int LineCount
1303 GetProperty(TextEditor.Property.LINE_COUNT).Get(out temp);
1309 /// The text to display when the TextEditor is empty and inactive.
1311 /// <since_tizen> 3 </since_tizen>
1312 public string PlaceholderText
1317 GetProperty(TextEditor.Property.PLACEHOLDER_TEXT).Get(out temp);
1322 SetProperty(TextEditor.Property.PLACEHOLDER_TEXT, new Tizen.NUI.PropertyValue(value));
1327 /// The Placeholder text color.
1329 /// <since_tizen> 3 </since_tizen>
1330 public Color PlaceholderTextColor
1334 Color temp = new Color(0.0f, 0.0f, 0.0f, 0.0f);
1335 GetProperty(TextEditor.Property.PLACEHOLDER_TEXT_COLOR).Get(temp);
1340 SetProperty(TextEditor.Property.PLACEHOLDER_TEXT_COLOR, new Tizen.NUI.PropertyValue(value));
1345 /// The EnableSelection property.
1347 /// <since_tizen> 4 </since_tizen>
1348 public bool EnableSelection
1353 GetProperty(TextEditor.Property.ENABLE_SELECTION).Get(out temp);
1358 SetProperty(TextEditor.Property.ENABLE_SELECTION, new Tizen.NUI.PropertyValue(value));
1363 /// The Placeholder property.
1364 /// Gets or sets the placeholder: text, color, font family, font style, point size, and pixel size.
1367 /// The following example demonstrates how to set the placeholder property.
1369 /// PropertyMap propertyMap = new PropertyMap();
1370 /// propertyMap.Add("text", new PropertyValue("Setting Placeholder Text"));
1371 /// propertyMap.Add("textFocused", new PropertyValue("Setting Placeholder Text Focused"));
1372 /// propertyMap.Add("color", new PropertyValue(Color.Red));
1373 /// propertyMap.Add("fontFamily", new PropertyValue("Arial"));
1374 /// propertyMap.Add("pointSize", new PropertyValue(12.0f));
1376 /// PropertyMap fontStyleMap = new PropertyMap();
1377 /// fontStyleMap.Add("weight", new PropertyValue("bold"));
1378 /// fontStyleMap.Add("width", new PropertyValue("condensed"));
1379 /// fontStyleMap.Add("slant", new PropertyValue("italic"));
1380 /// propertyMap.Add("fontStyle", new PropertyValue(fontStyleMap));
1382 /// TextEditor editor = new TextEditor();
1383 /// editor.Placeholder = propertyMap;
1386 /// <since_tizen> 4 </since_tizen>
1387 public Tizen.NUI.PropertyMap Placeholder
1391 Tizen.NUI.PropertyMap temp = new Tizen.NUI.PropertyMap();
1392 GetProperty(TextEditor.Property.PLACEHOLDER).Get(temp);
1397 SetProperty(TextEditor.Property.PLACEHOLDER, new Tizen.NUI.PropertyValue(value));
1402 /// The LineWrapMode property.<br />
1403 /// The line wrap mode when the text lines over the layout width.<br />
1405 /// <since_tizen> 4 </since_tizen>
1406 public LineWrapMode LineWrapMode
1411 if(GetProperty(TextEditor.Property.LINE_WRAP_MODE).Get(out temp) == false)
1413 NUILog.Error("LineWrapMode get error!");
1417 case "WRAP_MODE_WORD":
1418 return LineWrapMode.Word;
1419 case "WRAP_MODE_CHARACTER":
1420 return LineWrapMode.Character;
1422 return LineWrapMode.Word;
1430 case LineWrapMode.Word:
1432 temp = "WRAP_MODE_WORD";
1435 case LineWrapMode.Character:
1437 temp = "WRAP_MODE_CHARACTER";
1441 SetProperty(TextEditor.Property.LINE_WRAP_MODE, new Tizen.NUI.PropertyValue(temp));