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 public TextEditor TextEditor
108 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
109 private delegate void TextChangedCallbackDelegate(IntPtr textEditor);
110 private EventHandler<TextChangedEventArgs> _textEditorTextChangedEventHandler;
111 private TextChangedCallbackDelegate _textEditorTextChangedCallbackDelegate;
114 /// An event for the TextChanged signal which can be used to subscribe or unsubscribe the event handler
115 /// provided by the user. The TextChanged signal is emitted when the text changes.<br>
117 public event EventHandler<TextChangedEventArgs> TextChanged
121 if (_textEditorTextChangedEventHandler == null)
123 _textEditorTextChangedCallbackDelegate = (OnTextChanged);
124 TextChangedSignal().Connect(_textEditorTextChangedCallbackDelegate);
126 _textEditorTextChangedEventHandler += value;
130 _textEditorTextChangedEventHandler -= value;
131 if (_textEditorTextChangedEventHandler == null && TextChangedSignal().Empty() == false)
133 TextChangedSignal().Disconnect(_textEditorTextChangedCallbackDelegate);
138 private void OnTextChanged(IntPtr textEditor)
140 TextChangedEventArgs e = new TextChangedEventArgs();
142 // Populate all members of "e" (TextChangedEventArgs) with real data
143 e.TextEditor = Registry.GetManagedBaseHandleFromNativePtr(textEditor) as TextEditor;
145 if (_textEditorTextChangedEventHandler != null)
147 //here we send all data to user event handlers
148 _textEditorTextChangedEventHandler(this, e);
154 /// Event arguments that passed via the ScrollStateChanged signal.
156 public class ScrollStateChangedEventArgs : EventArgs
158 private TextEditor _textEditor;
159 private ScrollState _scrollState;
162 /// TextEditor - is the texteditor control which has the scroll state changed.
164 public TextEditor TextEditor
177 /// ScrollState - is the texteditor control scroll state.
179 public ScrollState ScrollState
187 _scrollState = value;
192 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
193 private delegate void ScrollStateChangedCallbackDelegate(IntPtr textEditor, ScrollState state);
194 private EventHandler<ScrollStateChangedEventArgs> _textEditorScrollStateChangedEventHandler;
195 private ScrollStateChangedCallbackDelegate _textEditorScrollStateChangedCallbackDelegate;
198 /// Event for the ScrollStateChanged signal which can be used to subscribe or unsubscribe the event handler
199 /// provided by the user. The ScrollStateChanged signal is emitted when the scroll state changes.<br>
201 public event EventHandler<ScrollStateChangedEventArgs> ScrollStateChanged
205 if (_textEditorScrollStateChangedEventHandler == null)
207 _textEditorScrollStateChangedCallbackDelegate = OnScrollStateChanged;
208 ScrollStateChangedSignal(this).Connect(_textEditorScrollStateChangedCallbackDelegate);
210 _textEditorScrollStateChangedEventHandler += value;
214 _textEditorScrollStateChangedEventHandler -= value;
215 if (_textEditorScrollStateChangedEventHandler == null && ScrollStateChangedSignal(this).Empty() == false)
217 ScrollStateChangedSignal(this).Disconnect(_textEditorScrollStateChangedCallbackDelegate);
222 private void OnScrollStateChanged(IntPtr textEditor, ScrollState state)
224 ScrollStateChangedEventArgs e = new ScrollStateChangedEventArgs();
226 if (textEditor != null)
228 // Populate all members of "e" (ScrollStateChangedEventArgs) with real data
229 e.TextEditor = Registry.GetManagedBaseHandleFromNativePtr(textEditor) as TextEditor;
230 e.ScrollState = state;
233 if (_textEditorScrollStateChangedEventHandler != null)
235 //here we send all data to user event handlers
236 _textEditorScrollStateChangedEventHandler(this, e);
240 internal new class Property
242 internal static readonly int RENDERING_BACKEND = NDalicPINVOKE.TextEditor_Property_RENDERING_BACKEND_get();
243 internal static readonly int TEXT = NDalicPINVOKE.TextEditor_Property_TEXT_get();
244 internal static readonly int TEXT_COLOR = NDalicPINVOKE.TextEditor_Property_TEXT_COLOR_get();
245 internal static readonly int FONT_FAMILY = NDalicPINVOKE.TextEditor_Property_FONT_FAMILY_get();
246 internal static readonly int FONT_STYLE = NDalicPINVOKE.TextEditor_Property_FONT_STYLE_get();
247 internal static readonly int POINT_SIZE = NDalicPINVOKE.TextEditor_Property_POINT_SIZE_get();
248 internal static readonly int HORIZONTAL_ALIGNMENT = NDalicPINVOKE.TextEditor_Property_HORIZONTAL_ALIGNMENT_get();
249 internal static readonly int SCROLL_THRESHOLD = NDalicPINVOKE.TextEditor_Property_SCROLL_THRESHOLD_get();
250 internal static readonly int SCROLL_SPEED = NDalicPINVOKE.TextEditor_Property_SCROLL_SPEED_get();
251 internal static readonly int PRIMARY_CURSOR_COLOR = NDalicPINVOKE.TextEditor_Property_PRIMARY_CURSOR_COLOR_get();
252 internal static readonly int SECONDARY_CURSOR_COLOR = NDalicPINVOKE.TextEditor_Property_SECONDARY_CURSOR_COLOR_get();
253 internal static readonly int ENABLE_CURSOR_BLINK = NDalicPINVOKE.TextEditor_Property_ENABLE_CURSOR_BLINK_get();
254 internal static readonly int CURSOR_BLINK_INTERVAL = NDalicPINVOKE.TextEditor_Property_CURSOR_BLINK_INTERVAL_get();
255 internal static readonly int CURSOR_BLINK_DURATION = NDalicPINVOKE.TextEditor_Property_CURSOR_BLINK_DURATION_get();
256 internal static readonly int CURSOR_WIDTH = NDalicPINVOKE.TextEditor_Property_CURSOR_WIDTH_get();
257 internal static readonly int GRAB_HANDLE_IMAGE = NDalicPINVOKE.TextEditor_Property_GRAB_HANDLE_IMAGE_get();
258 internal static readonly int GRAB_HANDLE_PRESSED_IMAGE = NDalicPINVOKE.TextEditor_Property_GRAB_HANDLE_PRESSED_IMAGE_get();
259 internal static readonly int SELECTION_HANDLE_IMAGE_LEFT = NDalicPINVOKE.TextEditor_Property_SELECTION_HANDLE_IMAGE_LEFT_get();
260 internal static readonly int SELECTION_HANDLE_IMAGE_RIGHT = NDalicPINVOKE.TextEditor_Property_SELECTION_HANDLE_IMAGE_RIGHT_get();
261 internal static readonly int SELECTION_HANDLE_PRESSED_IMAGE_LEFT = NDalicPINVOKE.TextEditor_Property_SELECTION_HANDLE_PRESSED_IMAGE_LEFT_get();
262 internal static readonly int SELECTION_HANDLE_PRESSED_IMAGE_RIGHT = NDalicPINVOKE.TextEditor_Property_SELECTION_HANDLE_PRESSED_IMAGE_RIGHT_get();
263 internal static readonly int SELECTION_HANDLE_MARKER_IMAGE_LEFT = NDalicPINVOKE.TextEditor_Property_SELECTION_HANDLE_MARKER_IMAGE_LEFT_get();
264 internal static readonly int SELECTION_HANDLE_MARKER_IMAGE_RIGHT = NDalicPINVOKE.TextEditor_Property_SELECTION_HANDLE_MARKER_IMAGE_RIGHT_get();
265 internal static readonly int SELECTION_HIGHLIGHT_COLOR = NDalicPINVOKE.TextEditor_Property_SELECTION_HIGHLIGHT_COLOR_get();
266 internal static readonly int DECORATION_BOUNDING_BOX = NDalicPINVOKE.TextEditor_Property_DECORATION_BOUNDING_BOX_get();
267 internal static readonly int ENABLE_MARKUP = NDalicPINVOKE.TextEditor_Property_ENABLE_MARKUP_get();
268 internal static readonly int INPUT_COLOR = NDalicPINVOKE.TextEditor_Property_INPUT_COLOR_get();
269 internal static readonly int INPUT_FONT_FAMILY = NDalicPINVOKE.TextEditor_Property_INPUT_FONT_FAMILY_get();
270 internal static readonly int INPUT_FONT_STYLE = NDalicPINVOKE.TextEditor_Property_INPUT_FONT_STYLE_get();
271 internal static readonly int INPUT_POINT_SIZE = NDalicPINVOKE.TextEditor_Property_INPUT_POINT_SIZE_get();
272 internal static readonly int LINE_SPACING = NDalicPINVOKE.TextEditor_Property_LINE_SPACING_get();
273 internal static readonly int INPUT_LINE_SPACING = NDalicPINVOKE.TextEditor_Property_INPUT_LINE_SPACING_get();
274 internal static readonly int UNDERLINE = NDalicPINVOKE.TextEditor_Property_UNDERLINE_get();
275 internal static readonly int INPUT_UNDERLINE = NDalicPINVOKE.TextEditor_Property_INPUT_UNDERLINE_get();
276 internal static readonly int SHADOW = NDalicPINVOKE.TextEditor_Property_SHADOW_get();
277 internal static readonly int INPUT_SHADOW = NDalicPINVOKE.TextEditor_Property_INPUT_SHADOW_get();
278 internal static readonly int EMBOSS = NDalicPINVOKE.TextEditor_Property_EMBOSS_get();
279 internal static readonly int INPUT_EMBOSS = NDalicPINVOKE.TextEditor_Property_INPUT_EMBOSS_get();
280 internal static readonly int OUTLINE = NDalicPINVOKE.TextEditor_Property_OUTLINE_get();
281 internal static readonly int INPUT_OUTLINE = NDalicPINVOKE.TextEditor_Property_INPUT_OUTLINE_get();
282 internal static readonly int SMOOTH_SCROLL = NDalicManualPINVOKE.TextEditor_Property_SMOOTH_SCROLL_get();
283 internal static readonly int SMOOTH_SCROLL_DURATION = NDalicManualPINVOKE.TextEditor_Property_SMOOTH_SCROLL_DURATION_get();
284 internal static readonly int ENABLE_SCROLL_BAR = NDalicManualPINVOKE.TextEditor_Property_ENABLE_SCROLL_BAR_get();
285 internal static readonly int SCROLL_BAR_SHOW_DURATION = NDalicManualPINVOKE.TextEditor_Property_SCROLL_BAR_SHOW_DURATION_get();
286 internal static readonly int SCROLL_BAR_FADE_DURATION = NDalicManualPINVOKE.TextEditor_Property_SCROLL_BAR_FADE_DURATION_get();
287 internal static readonly int PIXEL_SIZE = NDalicManualPINVOKE.TextEditor_Property_PIXEL_SIZE_get();
288 internal static readonly int LINE_COUNT = NDalicManualPINVOKE.TextEditor_Property_LINE_COUNT_get();
289 internal static readonly int PLACEHOLDER_TEXT = NDalicManualPINVOKE.TextEditor_Property_PLACEHOLDER_TEXT_get();
290 internal static readonly int PLACEHOLDER_TEXT_COLOR = NDalicManualPINVOKE.TextEditor_Property_PLACEHOLDER_TEXT_COLOR_get();
291 internal static readonly int ENABLE_SELECTION = NDalicManualPINVOKE.TextEditor_Property_ENABLE_SELECTION_get();
292 internal static readonly int PLACEHOLDER = NDalicManualPINVOKE.TextEditor_Property_PLACEHOLDER_get();
293 internal static readonly int LINE_WRAP_MODE = NDalicManualPINVOKE.TextEditor_Property_LINE_WRAP_MODE_get();
296 internal class InputStyle
305 LineSpacing = 0x0010,
314 /// Creates the TextEditor control.
316 public TextEditor() : this(NDalicPINVOKE.TextEditor_New(), true)
318 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
321 internal TextEditor(TextEditor handle) : this(NDalicPINVOKE.new_TextEditor__SWIG_1(TextEditor.getCPtr(handle)), true)
323 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
326 [Obsolete("Please do not use! this will be deprecated")]
327 public new static TextEditor DownCast(BaseHandle handle)
329 TextEditor ret = Registry.GetManagedBaseHandleFromNativePtr(handle) as TextEditor;
330 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
334 internal TextEditorSignal TextChangedSignal()
336 TextEditorSignal ret = new TextEditorSignal(NDalicPINVOKE.TextEditor_TextChangedSignal(swigCPtr), false);
337 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
341 internal ScrollStateChangedSignal ScrollStateChangedSignal(TextEditor textEditor)
343 ScrollStateChangedSignal ret = new ScrollStateChangedSignal(NDalicManualPINVOKE.TextEditor_ScrollStateChangedSignal(TextEditor.getCPtr(textEditor)), false);
344 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
348 internal SWIGTYPE_p_Dali__SignalT_void_fDali__Toolkit__TextEditor_Dali__Toolkit__TextEditor__InputStyle__MaskF_t InputStyleChangedSignal()
350 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);
351 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
356 /// The TranslatableText property.<br>
357 /// The text can set the SID value.<br>
359 /// <exception cref='ArgumentNullException'>
360 /// ResourceManager about multilingual is null.
362 public string TranslatableText
366 return textEditorTextSid;
370 if (NUIApplication.MultilingualResourceManager == null)
372 throw new ArgumentNullException("ResourceManager about multilingual is null");
374 textEditorTextSid = value;
375 Text = SetTranslatable(textEditorTextSid);
379 /// The TranslatablePlaceholderText property.<br>
380 /// The text can set the SID value.<br>
382 /// <exception cref='ArgumentNullException'>
383 /// ResourceManager about multilingual is null.
385 public string TranslatablePlaceholderText
389 return textEditorPlaceHolderTextSid;
393 if (NUIApplication.MultilingualResourceManager == null)
395 throw new ArgumentNullException("ResourceManager about multilingual is null");
397 textEditorPlaceHolderTextSid = value;
398 PlaceholderText = SetTranslatable(textEditorPlaceHolderTextSid);
401 private string SetTranslatable(string textEditorSid)
403 string translatableText = null;
404 translatableText = NUIApplication.MultilingualResourceManager?.GetString(textEditorSid, new CultureInfo(SystemSettings.LocaleLanguage.Replace("_", "-")));
405 if (translatableText != null)
407 if (systemlangTextFlag == false)
409 SystemSettings.LocaleLanguageChanged += new WeakEventHandler<LocaleLanguageChangedEventArgs>(SystemSettings_LocaleLanguageChanged).Handler;
410 systemlangTextFlag = true;
412 return translatableText;
416 translatableText = "";
417 return translatableText;
420 private void SystemSettings_LocaleLanguageChanged(object sender, LocaleLanguageChangedEventArgs e)
422 if (textEditorTextSid != null)
424 Text = NUIApplication.MultilingualResourceManager?.GetString(textEditorTextSid, new CultureInfo(e.Value.Replace("_", "-")));
426 if (textEditorPlaceHolderTextSid != null)
428 PlaceholderText = NUIApplication.MultilingualResourceManager?.GetString(textEditorPlaceHolderTextSid, new CultureInfo(e.Value.Replace("_", "-")));
431 /// The Text property.
438 GetProperty(TextEditor.Property.TEXT).Get(out temp);
443 SetProperty(TextEditor.Property.TEXT, new Tizen.NUI.PropertyValue(value));
448 /// The TextColor property.
450 public Vector4 TextColor
454 Vector4 temp = new Vector4(0.0f, 0.0f, 0.0f, 0.0f);
455 GetProperty(TextEditor.Property.TEXT_COLOR).Get(temp);
460 SetProperty(TextEditor.Property.TEXT_COLOR, new Tizen.NUI.PropertyValue(value));
465 /// The FontFamily property.
467 public string FontFamily
472 GetProperty(TextEditor.Property.FONT_FAMILY).Get(out temp);
477 SetProperty(TextEditor.Property.FONT_FAMILY, new Tizen.NUI.PropertyValue(value));
482 /// The FontStyle property.
484 public PropertyMap FontStyle
488 PropertyMap temp = new PropertyMap();
489 GetProperty(TextEditor.Property.FONT_STYLE).Get(temp);
494 SetProperty(TextEditor.Property.FONT_STYLE, new Tizen.NUI.PropertyValue(value));
499 /// The PointSize property.
501 public float PointSize
506 GetProperty(TextEditor.Property.POINT_SIZE).Get(out temp);
511 SetProperty(TextEditor.Property.POINT_SIZE, new Tizen.NUI.PropertyValue(value));
516 /// The HorizontalAlignment property.
518 public HorizontalAlignment HorizontalAlignment
523 if (GetProperty(TextEditor.Property.HORIZONTAL_ALIGNMENT).Get(out temp) == false)
525 NUILog.Error("HorizontalAlignment get error!");
531 return HorizontalAlignment.Begin;
533 return HorizontalAlignment.Center;
535 return HorizontalAlignment.End;
537 return HorizontalAlignment.Begin;
542 string valueToString = "";
545 case HorizontalAlignment.Begin:
547 valueToString = "BEGIN";
550 case HorizontalAlignment.Center:
552 valueToString = "CENTER";
555 case HorizontalAlignment.End:
557 valueToString = "END";
562 valueToString = "BEGIN";
566 SetProperty(TextEditor.Property.HORIZONTAL_ALIGNMENT, new Tizen.NUI.PropertyValue(valueToString));
571 /// The ScrollThreshold property.
573 public float ScrollThreshold
578 GetProperty(TextEditor.Property.SCROLL_THRESHOLD).Get(out temp);
583 SetProperty(TextEditor.Property.SCROLL_THRESHOLD, new Tizen.NUI.PropertyValue(value));
588 /// The ScrollSpeed property.
590 public float ScrollSpeed
595 GetProperty(TextEditor.Property.SCROLL_SPEED).Get(out temp);
600 SetProperty(TextEditor.Property.SCROLL_SPEED, new Tizen.NUI.PropertyValue(value));
605 /// The PrimaryCursorColor property.
607 public Vector4 PrimaryCursorColor
611 Vector4 temp = new Vector4(0.0f, 0.0f, 0.0f, 0.0f);
612 GetProperty(TextEditor.Property.PRIMARY_CURSOR_COLOR).Get(temp);
617 SetProperty(TextEditor.Property.PRIMARY_CURSOR_COLOR, new Tizen.NUI.PropertyValue(value));
622 /// The SecondaryCursorColor property.
624 public Vector4 SecondaryCursorColor
628 Vector4 temp = new Vector4(0.0f, 0.0f, 0.0f, 0.0f);
629 GetProperty(TextEditor.Property.SECONDARY_CURSOR_COLOR).Get(temp);
634 SetProperty(TextEditor.Property.SECONDARY_CURSOR_COLOR, new Tizen.NUI.PropertyValue(value));
639 /// The EnableCursorBlink property.
641 public bool EnableCursorBlink
646 GetProperty(TextEditor.Property.ENABLE_CURSOR_BLINK).Get(out temp);
651 SetProperty(TextEditor.Property.ENABLE_CURSOR_BLINK, new Tizen.NUI.PropertyValue(value));
656 /// The CursorBlinkInterval property.
658 public float CursorBlinkInterval
663 GetProperty(TextEditor.Property.CURSOR_BLINK_INTERVAL).Get(out temp);
668 SetProperty(TextEditor.Property.CURSOR_BLINK_INTERVAL, new Tizen.NUI.PropertyValue(value));
673 /// The CursorBlinkDuration property.
675 public float CursorBlinkDuration
680 GetProperty(TextEditor.Property.CURSOR_BLINK_DURATION).Get(out temp);
685 SetProperty(TextEditor.Property.CURSOR_BLINK_DURATION, new Tizen.NUI.PropertyValue(value));
690 /// The CursorWidth property.
692 public int CursorWidth
697 GetProperty(TextEditor.Property.CURSOR_WIDTH).Get(out temp);
702 SetProperty(TextEditor.Property.CURSOR_WIDTH, new Tizen.NUI.PropertyValue(value));
707 /// The GrabHandleImage property.
709 public string GrabHandleImage
714 GetProperty(TextEditor.Property.GRAB_HANDLE_IMAGE).Get(out temp);
719 SetProperty(TextEditor.Property.GRAB_HANDLE_IMAGE, new Tizen.NUI.PropertyValue(value));
724 /// The GrabHandlePressedImage property.
726 public string GrabHandlePressedImage
731 GetProperty(TextEditor.Property.GRAB_HANDLE_PRESSED_IMAGE).Get(out temp);
736 SetProperty(TextEditor.Property.GRAB_HANDLE_PRESSED_IMAGE, new Tizen.NUI.PropertyValue(value));
741 /// The SelectionHandleImageLeft property.
743 public PropertyMap SelectionHandleImageLeft
747 PropertyMap temp = new PropertyMap();
748 GetProperty(TextEditor.Property.SELECTION_HANDLE_IMAGE_LEFT).Get(temp);
753 SetProperty(TextEditor.Property.SELECTION_HANDLE_IMAGE_LEFT, new Tizen.NUI.PropertyValue(value));
758 /// The SelectionHandleImageRight property.
760 public PropertyMap SelectionHandleImageRight
764 PropertyMap temp = new PropertyMap();
765 GetProperty(TextEditor.Property.SELECTION_HANDLE_IMAGE_RIGHT).Get(temp);
770 SetProperty(TextEditor.Property.SELECTION_HANDLE_IMAGE_RIGHT, new Tizen.NUI.PropertyValue(value));
775 /// The SelectionHandlePressedImageLeft property.
777 public PropertyMap SelectionHandlePressedImageLeft
781 PropertyMap temp = new PropertyMap();
782 GetProperty(TextEditor.Property.SELECTION_HANDLE_PRESSED_IMAGE_LEFT).Get(temp);
787 SetProperty(TextEditor.Property.SELECTION_HANDLE_PRESSED_IMAGE_LEFT, new Tizen.NUI.PropertyValue(value));
792 /// The SelectionHandlePressedImageRight property.
794 public PropertyMap SelectionHandlePressedImageRight
798 PropertyMap temp = new PropertyMap();
799 GetProperty(TextEditor.Property.SELECTION_HANDLE_PRESSED_IMAGE_RIGHT).Get(temp);
804 SetProperty(TextEditor.Property.SELECTION_HANDLE_PRESSED_IMAGE_RIGHT, new Tizen.NUI.PropertyValue(value));
809 /// The SelectionHandleMarkerImageLeft property.
811 public PropertyMap SelectionHandleMarkerImageLeft
815 PropertyMap temp = new PropertyMap();
816 GetProperty(TextEditor.Property.SELECTION_HANDLE_MARKER_IMAGE_LEFT).Get(temp);
821 SetProperty(TextEditor.Property.SELECTION_HANDLE_MARKER_IMAGE_LEFT, new Tizen.NUI.PropertyValue(value));
826 /// The SelectionHandleMarkerImageRight property.
828 public PropertyMap SelectionHandleMarkerImageRight
832 PropertyMap temp = new PropertyMap();
833 GetProperty(TextEditor.Property.SELECTION_HANDLE_MARKER_IMAGE_RIGHT).Get(temp);
838 SetProperty(TextEditor.Property.SELECTION_HANDLE_MARKER_IMAGE_RIGHT, new Tizen.NUI.PropertyValue(value));
843 /// The SelectionHighlightColor property.
845 public Vector4 SelectionHighlightColor
849 Vector4 temp = new Vector4(0.0f, 0.0f, 0.0f, 0.0f);
850 GetProperty(TextEditor.Property.SELECTION_HIGHLIGHT_COLOR).Get(temp);
855 SetProperty(TextEditor.Property.SELECTION_HIGHLIGHT_COLOR, new Tizen.NUI.PropertyValue(value));
860 /// The DecorationBoundingBox property.
862 public Rectangle DecorationBoundingBox
866 Rectangle temp = new Rectangle(0, 0, 0, 0);
867 GetProperty(TextEditor.Property.DECORATION_BOUNDING_BOX).Get(temp);
872 SetProperty(TextEditor.Property.DECORATION_BOUNDING_BOX, new Tizen.NUI.PropertyValue(value));
877 /// The EnableMarkup property.
879 public bool EnableMarkup
884 GetProperty(TextEditor.Property.ENABLE_MARKUP).Get(out temp);
889 SetProperty(TextEditor.Property.ENABLE_MARKUP, new Tizen.NUI.PropertyValue(value));
894 /// The InputColor property.
896 public Vector4 InputColor
900 Vector4 temp = new Vector4(0.0f, 0.0f, 0.0f, 0.0f);
901 GetProperty(TextEditor.Property.INPUT_COLOR).Get(temp);
906 SetProperty(TextEditor.Property.INPUT_COLOR, new Tizen.NUI.PropertyValue(value));
911 /// The InputFontFamily property.
913 public string InputFontFamily
918 GetProperty(TextEditor.Property.INPUT_FONT_FAMILY).Get(out temp);
923 SetProperty(TextEditor.Property.INPUT_FONT_FAMILY, new Tizen.NUI.PropertyValue(value));
928 /// The InputFontStyle property.
930 public PropertyMap InputFontStyle
934 PropertyMap temp = new PropertyMap();
935 GetProperty(TextEditor.Property.INPUT_FONT_STYLE).Get(temp);
940 SetProperty(TextEditor.Property.INPUT_FONT_STYLE, new Tizen.NUI.PropertyValue(value));
945 /// The InputPointSize property.
947 public float InputPointSize
952 GetProperty(TextEditor.Property.INPUT_POINT_SIZE).Get(out temp);
957 SetProperty(TextEditor.Property.INPUT_POINT_SIZE, new Tizen.NUI.PropertyValue(value));
962 /// The LineSpacing property.
964 public float LineSpacing
969 GetProperty(TextEditor.Property.LINE_SPACING).Get(out temp);
974 SetProperty(TextEditor.Property.LINE_SPACING, new Tizen.NUI.PropertyValue(value));
979 /// The InputLineSpacing property.
981 public float InputLineSpacing
986 GetProperty(TextEditor.Property.INPUT_LINE_SPACING).Get(out temp);
991 SetProperty(TextEditor.Property.INPUT_LINE_SPACING, new Tizen.NUI.PropertyValue(value));
996 /// The Underline property.
998 public PropertyMap Underline
1002 PropertyMap temp = new PropertyMap();
1003 GetProperty(TextEditor.Property.UNDERLINE).Get(temp);
1008 SetProperty(TextEditor.Property.UNDERLINE, new Tizen.NUI.PropertyValue(value));
1013 /// The InputUnderline property.
1015 public string InputUnderline
1020 GetProperty(TextEditor.Property.INPUT_UNDERLINE).Get(out temp);
1025 SetProperty(TextEditor.Property.INPUT_UNDERLINE, new Tizen.NUI.PropertyValue(value));
1030 /// The Shadow property.
1032 public PropertyMap Shadow
1036 PropertyMap temp = new PropertyMap();
1037 GetProperty(TextEditor.Property.SHADOW).Get(temp);
1042 SetProperty(TextEditor.Property.SHADOW, new Tizen.NUI.PropertyValue(value));
1047 /// The InputShadow property.
1049 public string InputShadow
1054 GetProperty(TextEditor.Property.INPUT_SHADOW).Get(out temp);
1059 SetProperty(TextEditor.Property.INPUT_SHADOW, new Tizen.NUI.PropertyValue(value));
1064 /// The Emboss property.
1066 public string Emboss
1071 GetProperty(TextEditor.Property.EMBOSS).Get(out temp);
1076 SetProperty(TextEditor.Property.EMBOSS, new Tizen.NUI.PropertyValue(value));
1081 /// The InputEmboss property.
1083 public string InputEmboss
1088 GetProperty(TextEditor.Property.INPUT_EMBOSS).Get(out temp);
1093 SetProperty(TextEditor.Property.INPUT_EMBOSS, new Tizen.NUI.PropertyValue(value));
1098 /// The Outline property.
1100 public string Outline
1105 GetProperty(TextEditor.Property.OUTLINE).Get(out temp);
1110 SetProperty(TextEditor.Property.OUTLINE, new Tizen.NUI.PropertyValue(value));
1115 /// The InputOutline property.
1117 public string InputOutline
1122 GetProperty(TextEditor.Property.INPUT_OUTLINE).Get(out temp);
1127 SetProperty(TextEditor.Property.INPUT_OUTLINE, new Tizen.NUI.PropertyValue(value));
1132 /// The SmoothScroll property.
1134 public bool SmoothScroll
1139 GetProperty(TextEditor.Property.SMOOTH_SCROLL).Get(out temp);
1144 SetProperty(TextEditor.Property.SMOOTH_SCROLL, new Tizen.NUI.PropertyValue(value));
1149 /// The SmoothScrollDuration property.
1151 public float SmoothScrollDuration
1156 GetProperty(TextEditor.Property.SMOOTH_SCROLL_DURATION).Get(out temp);
1161 SetProperty(TextEditor.Property.SMOOTH_SCROLL_DURATION, new Tizen.NUI.PropertyValue(value));
1166 /// The EnableScrollBar property.
1168 public bool EnableScrollBar
1173 GetProperty(TextEditor.Property.ENABLE_SCROLL_BAR).Get(out temp);
1178 SetProperty(TextEditor.Property.ENABLE_SCROLL_BAR, new Tizen.NUI.PropertyValue(value));
1183 /// The ScrollBarShowDuration property.
1185 public float ScrollBarShowDuration
1190 GetProperty(TextEditor.Property.SCROLL_BAR_SHOW_DURATION).Get(out temp);
1195 SetProperty(TextEditor.Property.SCROLL_BAR_SHOW_DURATION, new Tizen.NUI.PropertyValue(value));
1200 /// The ScrollBarFadeDuration property.
1202 public float ScrollBarFadeDuration
1207 GetProperty(TextEditor.Property.SCROLL_BAR_FADE_DURATION).Get(out temp);
1212 SetProperty(TextEditor.Property.SCROLL_BAR_FADE_DURATION, new Tizen.NUI.PropertyValue(value));
1217 /// The PixelSize property.
1219 public float PixelSize
1224 GetProperty(TextEditor.Property.PIXEL_SIZE).Get(out temp);
1229 SetProperty(TextEditor.Property.PIXEL_SIZE, new Tizen.NUI.PropertyValue(value));
1234 /// The line count of the text.
1236 public int LineCount
1241 GetProperty(TextEditor.Property.LINE_COUNT).Get(out temp);
1247 /// The text to display when the TextEditor is empty and inactive.
1249 public string PlaceholderText
1254 GetProperty(TextEditor.Property.PLACEHOLDER_TEXT).Get(out temp);
1259 SetProperty(TextEditor.Property.PLACEHOLDER_TEXT, new Tizen.NUI.PropertyValue(value));
1264 /// The Placeholder text color.
1266 public Color PlaceholderTextColor
1270 Color temp = new Color(0.0f, 0.0f, 0.0f, 0.0f);
1271 GetProperty(TextEditor.Property.PLACEHOLDER_TEXT_COLOR).Get(temp);
1276 SetProperty(TextEditor.Property.PLACEHOLDER_TEXT_COLOR, new Tizen.NUI.PropertyValue(value));
1281 /// The EnableSelection property.
1283 public bool EnableSelection
1288 GetProperty(TextEditor.Property.ENABLE_SELECTION).Get(out temp);
1293 SetProperty(TextEditor.Property.ENABLE_SELECTION, new Tizen.NUI.PropertyValue(value));
1298 /// The Placeholder property.
1299 /// Gets or sets the placeholder: text, color, font family, font style, point size, and pixel size.
1302 /// The following example demonstrates how to set the placeholder property.
1304 /// PropertyMap propertyMap = new PropertyMap();
1305 /// propertyMap.Add("placeholderText", new PropertyValue("Setting Placeholder Text"));
1306 /// propertyMap.Add("placeholderTextFocused", new PropertyValue("Setting Placeholder Text Focused"));
1307 /// propertyMap.Add("placeholderColor", new PropertyValue(Color.Red));
1308 /// propertyMap.Add("placeholderFontFamily", new PropertyValue("Arial"));
1309 /// propertyMap.Add("placeholderPointSize", new PropertyValue(12.0f));
1311 /// PropertyMap fontStyleMap = new PropertyMap();
1312 /// fontStyleMap.Add("weight", new PropertyValue("bold"));
1313 /// fontStyleMap.Add("width", new PropertyValue("condensed"));
1314 /// fontStyleMap.Add("slant", new PropertyValue("italic"));
1315 /// propertyMap.Add("placeholderFontStyle", new PropertyValue(fontStyleMap));
1317 /// TextEditor editor = new TextEditor();
1318 /// editor.Placeholder = propertyMap;
1321 public Tizen.NUI.PropertyMap Placeholder
1325 Tizen.NUI.PropertyMap temp = new Tizen.NUI.PropertyMap();
1326 GetProperty(TextEditor.Property.PLACEHOLDER).Get(temp);
1331 SetProperty(TextEditor.Property.PLACEHOLDER, new Tizen.NUI.PropertyValue(value));
1336 /// The LineWrapMode property.<br>
1337 /// The line wrap mode when the text lines over the layout width.<br>
1339 public LineWrapMode LineWrapMode
1344 if(GetProperty(TextEditor.Property.LINE_WRAP_MODE).Get(out temp) == false)
1346 NUILog.Error("LineWrapMode get error!");
1350 case "WRAP_MODE_WORD":
1351 return LineWrapMode.Word;
1352 case "WRAP_MODE_CHARACTER":
1353 return LineWrapMode.Character;
1355 return LineWrapMode.Word;
1363 case LineWrapMode.Word:
1365 temp = "WRAP_MODE_WORD";
1368 case LineWrapMode.Character:
1370 temp = "WRAP_MODE_CHARACTER";
1374 SetProperty(TextEditor.Property.LINE_WRAP_MODE, new Tizen.NUI.PropertyValue(temp));