2 * Copyright(c) 2017 Samsung Electronics Co., Ltd.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
18 extern alias TizenSystemSettings;
19 using TizenSystemSettings.Tizen.System;
22 using System.Runtime.InteropServices;
23 using System.Globalization;
24 using System.ComponentModel;
26 namespace Tizen.NUI.BaseComponents
29 /// A control which provides a multi-line editable text editor.
31 /// <since_tizen> 3 </since_tizen>
32 public class TextEditor : View
34 private global::System.Runtime.InteropServices.HandleRef swigCPtr;
35 private string textEditorTextSid = null;
36 private string textEditorPlaceHolderTextSid = null;
37 private bool systemlangTextFlag = false;
39 internal TextEditor(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.TextEditor_SWIGUpcast(cPtr), cMemoryOwn)
41 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
44 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(TextEditor obj)
46 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
52 /// <since_tizen> 3 </since_tizen>
53 protected override void Dispose(DisposeTypes type)
60 if(type == DisposeTypes.Explicit)
63 //Release your own managed resources here.
64 //You should release all of your own disposable objects here.
67 //Release your own unmanaged resources here.
68 //You should not access any managed member here except static instance.
69 //because the execution order of Finalizes is non-deterministic.
71 if (_textEditorTextChangedCallbackDelegate != null)
73 TextChangedSignal().Disconnect(_textEditorTextChangedCallbackDelegate);
76 if (swigCPtr.Handle != global::System.IntPtr.Zero)
81 NDalicPINVOKE.delete_TextEditor(swigCPtr);
83 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
90 /// Event arguments that passed via the TextChanged signal.
92 /// <since_tizen> 3 </since_tizen>
93 public class TextChangedEventArgs : EventArgs
95 private TextEditor _textEditor;
98 /// TextEditor - is the texteditor control which has the text contents changed.
100 /// <since_tizen> 3 </since_tizen>
101 public TextEditor TextEditor
114 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
115 private delegate void TextChangedCallbackDelegate(IntPtr textEditor);
116 private EventHandler<TextChangedEventArgs> _textEditorTextChangedEventHandler;
117 private TextChangedCallbackDelegate _textEditorTextChangedCallbackDelegate;
120 /// An event for the TextChanged signal which can be used to subscribe or unsubscribe the event handler
121 /// provided by the user. The TextChanged signal is emitted when the text changes.<br />
123 /// <since_tizen> 3 </since_tizen>
124 public event EventHandler<TextChangedEventArgs> TextChanged
128 if (_textEditorTextChangedEventHandler == null)
130 _textEditorTextChangedCallbackDelegate = (OnTextChanged);
131 TextChangedSignal().Connect(_textEditorTextChangedCallbackDelegate);
133 _textEditorTextChangedEventHandler += value;
137 _textEditorTextChangedEventHandler -= value;
138 if (_textEditorTextChangedEventHandler == null && TextChangedSignal().Empty() == false)
140 TextChangedSignal().Disconnect(_textEditorTextChangedCallbackDelegate);
145 private void OnTextChanged(IntPtr textEditor)
147 TextChangedEventArgs e = new TextChangedEventArgs();
149 // Populate all members of "e" (TextChangedEventArgs) with real data
150 e.TextEditor = Registry.GetManagedBaseHandleFromNativePtr(textEditor) as TextEditor;
152 if (_textEditorTextChangedEventHandler != null)
154 //here we send all data to user event handlers
155 _textEditorTextChangedEventHandler(this, e);
161 /// Event arguments that passed via the ScrollStateChanged signal.
163 /// <since_tizen> 3 </since_tizen>
164 public class ScrollStateChangedEventArgs : EventArgs
166 private TextEditor _textEditor;
167 private ScrollState _scrollState;
170 /// TextEditor - is the texteditor control which has the scroll state changed.
172 /// <since_tizen> 3 </since_tizen>
173 public TextEditor TextEditor
186 /// ScrollState - is the texteditor control scroll state.
188 /// <since_tizen> 3 </since_tizen>
189 public ScrollState ScrollState
197 _scrollState = value;
202 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
203 private delegate void ScrollStateChangedCallbackDelegate(IntPtr textEditor, ScrollState state);
204 private EventHandler<ScrollStateChangedEventArgs> _textEditorScrollStateChangedEventHandler;
205 private ScrollStateChangedCallbackDelegate _textEditorScrollStateChangedCallbackDelegate;
208 /// Event for the ScrollStateChanged signal which can be used to subscribe or unsubscribe the event handler
209 /// provided by the user. The ScrollStateChanged signal is emitted when the scroll state changes.<br />
211 /// <since_tizen> 3 </since_tizen>
212 public event EventHandler<ScrollStateChangedEventArgs> ScrollStateChanged
216 if (_textEditorScrollStateChangedEventHandler == null)
218 _textEditorScrollStateChangedCallbackDelegate = OnScrollStateChanged;
219 ScrollStateChangedSignal(this).Connect(_textEditorScrollStateChangedCallbackDelegate);
221 _textEditorScrollStateChangedEventHandler += value;
225 _textEditorScrollStateChangedEventHandler -= value;
226 if (_textEditorScrollStateChangedEventHandler == null && ScrollStateChangedSignal(this).Empty() == false)
228 ScrollStateChangedSignal(this).Disconnect(_textEditorScrollStateChangedCallbackDelegate);
233 private void OnScrollStateChanged(IntPtr textEditor, ScrollState state)
235 ScrollStateChangedEventArgs e = new ScrollStateChangedEventArgs();
237 if (textEditor != null)
239 // Populate all members of "e" (ScrollStateChangedEventArgs) with real data
240 e.TextEditor = Registry.GetManagedBaseHandleFromNativePtr(textEditor) as TextEditor;
241 e.ScrollState = state;
244 if (_textEditorScrollStateChangedEventHandler != null)
246 //here we send all data to user event handlers
247 _textEditorScrollStateChangedEventHandler(this, e);
251 internal new class Property
253 internal static readonly int RENDERING_BACKEND = NDalicPINVOKE.TextEditor_Property_RENDERING_BACKEND_get();
254 internal static readonly int TEXT = NDalicPINVOKE.TextEditor_Property_TEXT_get();
255 internal static readonly int TEXT_COLOR = NDalicPINVOKE.TextEditor_Property_TEXT_COLOR_get();
256 internal static readonly int FONT_FAMILY = NDalicPINVOKE.TextEditor_Property_FONT_FAMILY_get();
257 internal static readonly int FONT_STYLE = NDalicPINVOKE.TextEditor_Property_FONT_STYLE_get();
258 internal static readonly int POINT_SIZE = NDalicPINVOKE.TextEditor_Property_POINT_SIZE_get();
259 internal static readonly int HORIZONTAL_ALIGNMENT = NDalicPINVOKE.TextEditor_Property_HORIZONTAL_ALIGNMENT_get();
260 internal static readonly int SCROLL_THRESHOLD = NDalicPINVOKE.TextEditor_Property_SCROLL_THRESHOLD_get();
261 internal static readonly int SCROLL_SPEED = NDalicPINVOKE.TextEditor_Property_SCROLL_SPEED_get();
262 internal static readonly int PRIMARY_CURSOR_COLOR = NDalicPINVOKE.TextEditor_Property_PRIMARY_CURSOR_COLOR_get();
263 internal static readonly int SECONDARY_CURSOR_COLOR = NDalicPINVOKE.TextEditor_Property_SECONDARY_CURSOR_COLOR_get();
264 internal static readonly int ENABLE_CURSOR_BLINK = NDalicPINVOKE.TextEditor_Property_ENABLE_CURSOR_BLINK_get();
265 internal static readonly int CURSOR_BLINK_INTERVAL = NDalicPINVOKE.TextEditor_Property_CURSOR_BLINK_INTERVAL_get();
266 internal static readonly int CURSOR_BLINK_DURATION = NDalicPINVOKE.TextEditor_Property_CURSOR_BLINK_DURATION_get();
267 internal static readonly int CURSOR_WIDTH = NDalicPINVOKE.TextEditor_Property_CURSOR_WIDTH_get();
268 internal static readonly int GRAB_HANDLE_IMAGE = NDalicPINVOKE.TextEditor_Property_GRAB_HANDLE_IMAGE_get();
269 internal static readonly int GRAB_HANDLE_PRESSED_IMAGE = NDalicPINVOKE.TextEditor_Property_GRAB_HANDLE_PRESSED_IMAGE_get();
270 internal static readonly int SELECTION_HANDLE_IMAGE_LEFT = NDalicPINVOKE.TextEditor_Property_SELECTION_HANDLE_IMAGE_LEFT_get();
271 internal static readonly int SELECTION_HANDLE_IMAGE_RIGHT = NDalicPINVOKE.TextEditor_Property_SELECTION_HANDLE_IMAGE_RIGHT_get();
272 internal static readonly int SELECTION_HANDLE_PRESSED_IMAGE_LEFT = NDalicPINVOKE.TextEditor_Property_SELECTION_HANDLE_PRESSED_IMAGE_LEFT_get();
273 internal static readonly int SELECTION_HANDLE_PRESSED_IMAGE_RIGHT = NDalicPINVOKE.TextEditor_Property_SELECTION_HANDLE_PRESSED_IMAGE_RIGHT_get();
274 internal static readonly int SELECTION_HANDLE_MARKER_IMAGE_LEFT = NDalicPINVOKE.TextEditor_Property_SELECTION_HANDLE_MARKER_IMAGE_LEFT_get();
275 internal static readonly int SELECTION_HANDLE_MARKER_IMAGE_RIGHT = NDalicPINVOKE.TextEditor_Property_SELECTION_HANDLE_MARKER_IMAGE_RIGHT_get();
276 internal static readonly int SELECTION_HIGHLIGHT_COLOR = NDalicPINVOKE.TextEditor_Property_SELECTION_HIGHLIGHT_COLOR_get();
277 internal static readonly int DECORATION_BOUNDING_BOX = NDalicPINVOKE.TextEditor_Property_DECORATION_BOUNDING_BOX_get();
278 internal static readonly int ENABLE_MARKUP = NDalicPINVOKE.TextEditor_Property_ENABLE_MARKUP_get();
279 internal static readonly int INPUT_COLOR = NDalicPINVOKE.TextEditor_Property_INPUT_COLOR_get();
280 internal static readonly int INPUT_FONT_FAMILY = NDalicPINVOKE.TextEditor_Property_INPUT_FONT_FAMILY_get();
281 internal static readonly int INPUT_FONT_STYLE = NDalicPINVOKE.TextEditor_Property_INPUT_FONT_STYLE_get();
282 internal static readonly int INPUT_POINT_SIZE = NDalicPINVOKE.TextEditor_Property_INPUT_POINT_SIZE_get();
283 internal static readonly int LINE_SPACING = NDalicPINVOKE.TextEditor_Property_LINE_SPACING_get();
284 internal static readonly int INPUT_LINE_SPACING = NDalicPINVOKE.TextEditor_Property_INPUT_LINE_SPACING_get();
285 internal static readonly int UNDERLINE = NDalicPINVOKE.TextEditor_Property_UNDERLINE_get();
286 internal static readonly int INPUT_UNDERLINE = NDalicPINVOKE.TextEditor_Property_INPUT_UNDERLINE_get();
287 internal static readonly int SHADOW = NDalicPINVOKE.TextEditor_Property_SHADOW_get();
288 internal static readonly int INPUT_SHADOW = NDalicPINVOKE.TextEditor_Property_INPUT_SHADOW_get();
289 internal static readonly int EMBOSS = NDalicPINVOKE.TextEditor_Property_EMBOSS_get();
290 internal static readonly int INPUT_EMBOSS = NDalicPINVOKE.TextEditor_Property_INPUT_EMBOSS_get();
291 internal static readonly int OUTLINE = NDalicPINVOKE.TextEditor_Property_OUTLINE_get();
292 internal static readonly int INPUT_OUTLINE = NDalicPINVOKE.TextEditor_Property_INPUT_OUTLINE_get();
293 internal static readonly int SMOOTH_SCROLL = NDalicManualPINVOKE.TextEditor_Property_SMOOTH_SCROLL_get();
294 internal static readonly int SMOOTH_SCROLL_DURATION = NDalicManualPINVOKE.TextEditor_Property_SMOOTH_SCROLL_DURATION_get();
295 internal static readonly int ENABLE_SCROLL_BAR = NDalicManualPINVOKE.TextEditor_Property_ENABLE_SCROLL_BAR_get();
296 internal static readonly int SCROLL_BAR_SHOW_DURATION = NDalicManualPINVOKE.TextEditor_Property_SCROLL_BAR_SHOW_DURATION_get();
297 internal static readonly int SCROLL_BAR_FADE_DURATION = NDalicManualPINVOKE.TextEditor_Property_SCROLL_BAR_FADE_DURATION_get();
298 internal static readonly int PIXEL_SIZE = NDalicManualPINVOKE.TextEditor_Property_PIXEL_SIZE_get();
299 internal static readonly int LINE_COUNT = NDalicManualPINVOKE.TextEditor_Property_LINE_COUNT_get();
300 internal static readonly int PLACEHOLDER_TEXT = NDalicManualPINVOKE.TextEditor_Property_PLACEHOLDER_TEXT_get();
301 internal static readonly int PLACEHOLDER_TEXT_COLOR = NDalicManualPINVOKE.TextEditor_Property_PLACEHOLDER_TEXT_COLOR_get();
302 internal static readonly int ENABLE_SELECTION = NDalicManualPINVOKE.TextEditor_Property_ENABLE_SELECTION_get();
303 internal static readonly int PLACEHOLDER = NDalicManualPINVOKE.TextEditor_Property_PLACEHOLDER_get();
304 internal static readonly int LINE_WRAP_MODE = NDalicManualPINVOKE.TextEditor_Property_LINE_WRAP_MODE_get();
307 internal class InputStyle
316 LineSpacing = 0x0010,
325 /// Creates the TextEditor control.
327 /// <since_tizen> 3 </since_tizen>
328 public TextEditor() : this(NDalicPINVOKE.TextEditor_New(), true)
330 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
333 internal TextEditor(TextEditor handle) : this(NDalicPINVOKE.new_TextEditor__SWIG_1(TextEditor.getCPtr(handle)), true)
335 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
338 internal TextEditorSignal TextChangedSignal()
340 TextEditorSignal ret = new TextEditorSignal(NDalicPINVOKE.TextEditor_TextChangedSignal(swigCPtr), false);
341 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
345 internal ScrollStateChangedSignal ScrollStateChangedSignal(TextEditor textEditor)
347 ScrollStateChangedSignal ret = new ScrollStateChangedSignal(NDalicManualPINVOKE.TextEditor_ScrollStateChangedSignal(TextEditor.getCPtr(textEditor)), false);
348 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
352 internal SWIGTYPE_p_Dali__SignalT_void_fDali__Toolkit__TextEditor_Dali__Toolkit__TextEditor__InputStyle__MaskF_t InputStyleChangedSignal()
354 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);
355 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
360 /// The TranslatableText property.<br />
361 /// The text can set the SID value.<br />
363 /// <exception cref='ArgumentNullException'>
364 /// ResourceManager about multilingual is null.
366 /// <since_tizen> 4 </since_tizen>
367 public string TranslatableText
371 return textEditorTextSid;
375 if (NUIApplication.MultilingualResourceManager == null)
377 throw new ArgumentNullException("ResourceManager about multilingual is null");
379 textEditorTextSid = value;
380 Text = SetTranslatable(textEditorTextSid);
384 /// The TranslatablePlaceholderText property.<br />
385 /// The text can set the SID value.<br />
387 /// <exception cref='ArgumentNullException'>
388 /// ResourceManager about multilingual is null.
390 /// <since_tizen> 4 </since_tizen>
391 public string TranslatablePlaceholderText
395 return textEditorPlaceHolderTextSid;
399 if (NUIApplication.MultilingualResourceManager == null)
401 throw new ArgumentNullException("ResourceManager about multilingual is null");
403 textEditorPlaceHolderTextSid = value;
404 PlaceholderText = SetTranslatable(textEditorPlaceHolderTextSid);
407 private string SetTranslatable(string textEditorSid)
409 string translatableText = null;
410 translatableText = NUIApplication.MultilingualResourceManager?.GetString(textEditorSid, new CultureInfo(SystemSettings.LocaleLanguage.Replace("_", "-")));
411 if (translatableText != null)
413 if (systemlangTextFlag == false)
415 SystemSettings.LocaleLanguageChanged += new WeakEventHandler<LocaleLanguageChangedEventArgs>(SystemSettings_LocaleLanguageChanged).Handler;
416 systemlangTextFlag = true;
418 return translatableText;
422 translatableText = "";
423 return translatableText;
426 private void SystemSettings_LocaleLanguageChanged(object sender, LocaleLanguageChangedEventArgs e)
428 if (textEditorTextSid != null)
430 Text = NUIApplication.MultilingualResourceManager?.GetString(textEditorTextSid, new CultureInfo(e.Value.Replace("_", "-")));
432 if (textEditorPlaceHolderTextSid != null)
434 PlaceholderText = NUIApplication.MultilingualResourceManager?.GetString(textEditorPlaceHolderTextSid, new CultureInfo(e.Value.Replace("_", "-")));
438 /// The Text property.
440 /// <since_tizen> 3 </since_tizen>
446 GetProperty(TextEditor.Property.TEXT).Get(out temp);
451 SetProperty(TextEditor.Property.TEXT, new Tizen.NUI.PropertyValue(value));
456 /// The TextColor property.
458 /// <since_tizen> 3 </since_tizen>
459 public Vector4 TextColor
463 Vector4 temp = new Vector4(0.0f, 0.0f, 0.0f, 0.0f);
464 GetProperty(TextEditor.Property.TEXT_COLOR).Get(temp);
469 SetProperty(TextEditor.Property.TEXT_COLOR, new Tizen.NUI.PropertyValue(value));
474 /// The FontFamily property.
476 /// <since_tizen> 3 </since_tizen>
477 public string FontFamily
482 GetProperty(TextEditor.Property.FONT_FAMILY).Get(out temp);
487 SetProperty(TextEditor.Property.FONT_FAMILY, new Tizen.NUI.PropertyValue(value));
492 /// The FontStyle property.
494 /// <since_tizen> 3 </since_tizen>
495 public PropertyMap FontStyle
499 PropertyMap temp = new PropertyMap();
500 GetProperty(TextEditor.Property.FONT_STYLE).Get(temp);
505 SetProperty(TextEditor.Property.FONT_STYLE, new Tizen.NUI.PropertyValue(value));
510 /// The PointSize property.
512 /// <since_tizen> 3 </since_tizen>
513 public float PointSize
518 GetProperty(TextEditor.Property.POINT_SIZE).Get(out temp);
523 SetProperty(TextEditor.Property.POINT_SIZE, new Tizen.NUI.PropertyValue(value));
528 /// The HorizontalAlignment property.
530 /// <since_tizen> 3 </since_tizen>
531 public HorizontalAlignment HorizontalAlignment
536 if (GetProperty(TextEditor.Property.HORIZONTAL_ALIGNMENT).Get(out temp) == false)
538 NUILog.Error("HorizontalAlignment get error!");
544 return HorizontalAlignment.Begin;
546 return HorizontalAlignment.Center;
548 return HorizontalAlignment.End;
550 return HorizontalAlignment.Begin;
555 string valueToString = "";
558 case HorizontalAlignment.Begin:
560 valueToString = "BEGIN";
563 case HorizontalAlignment.Center:
565 valueToString = "CENTER";
568 case HorizontalAlignment.End:
570 valueToString = "END";
575 valueToString = "BEGIN";
579 SetProperty(TextEditor.Property.HORIZONTAL_ALIGNMENT, new Tizen.NUI.PropertyValue(valueToString));
584 /// The ScrollThreshold property.
586 /// <since_tizen> 3 </since_tizen>
587 public float ScrollThreshold
592 GetProperty(TextEditor.Property.SCROLL_THRESHOLD).Get(out temp);
597 SetProperty(TextEditor.Property.SCROLL_THRESHOLD, new Tizen.NUI.PropertyValue(value));
602 /// The ScrollSpeed property.
604 /// <since_tizen> 3 </since_tizen>
605 public float ScrollSpeed
610 GetProperty(TextEditor.Property.SCROLL_SPEED).Get(out temp);
615 SetProperty(TextEditor.Property.SCROLL_SPEED, new Tizen.NUI.PropertyValue(value));
620 /// The PrimaryCursorColor property.
622 /// <since_tizen> 3 </since_tizen>
623 public Vector4 PrimaryCursorColor
627 Vector4 temp = new Vector4(0.0f, 0.0f, 0.0f, 0.0f);
628 GetProperty(TextEditor.Property.PRIMARY_CURSOR_COLOR).Get(temp);
633 SetProperty(TextEditor.Property.PRIMARY_CURSOR_COLOR, new Tizen.NUI.PropertyValue(value));
638 /// The SecondaryCursorColor property.
640 /// <since_tizen> 3 </since_tizen>
641 public Vector4 SecondaryCursorColor
645 Vector4 temp = new Vector4(0.0f, 0.0f, 0.0f, 0.0f);
646 GetProperty(TextEditor.Property.SECONDARY_CURSOR_COLOR).Get(temp);
651 SetProperty(TextEditor.Property.SECONDARY_CURSOR_COLOR, new Tizen.NUI.PropertyValue(value));
656 /// The EnableCursorBlink property.
658 /// <since_tizen> 3 </since_tizen>
659 public bool EnableCursorBlink
664 GetProperty(TextEditor.Property.ENABLE_CURSOR_BLINK).Get(out temp);
669 SetProperty(TextEditor.Property.ENABLE_CURSOR_BLINK, new Tizen.NUI.PropertyValue(value));
674 /// The CursorBlinkInterval property.
676 /// <since_tizen> 3 </since_tizen>
677 public float CursorBlinkInterval
682 GetProperty(TextEditor.Property.CURSOR_BLINK_INTERVAL).Get(out temp);
687 SetProperty(TextEditor.Property.CURSOR_BLINK_INTERVAL, new Tizen.NUI.PropertyValue(value));
692 /// The CursorBlinkDuration property.
694 /// <since_tizen> 3 </since_tizen>
695 public float CursorBlinkDuration
700 GetProperty(TextEditor.Property.CURSOR_BLINK_DURATION).Get(out temp);
705 SetProperty(TextEditor.Property.CURSOR_BLINK_DURATION, new Tizen.NUI.PropertyValue(value));
710 /// The CursorWidth property.
712 /// <since_tizen> 3 </since_tizen>
713 public int CursorWidth
718 GetProperty(TextEditor.Property.CURSOR_WIDTH).Get(out temp);
723 SetProperty(TextEditor.Property.CURSOR_WIDTH, new Tizen.NUI.PropertyValue(value));
728 /// The GrabHandleImage property.
730 /// <since_tizen> 3 </since_tizen>
731 public string GrabHandleImage
736 GetProperty(TextEditor.Property.GRAB_HANDLE_IMAGE).Get(out temp);
741 SetProperty(TextEditor.Property.GRAB_HANDLE_IMAGE, new Tizen.NUI.PropertyValue(value));
746 /// The GrabHandlePressedImage property.
748 /// <since_tizen> 3 </since_tizen>
749 public string GrabHandlePressedImage
754 GetProperty(TextEditor.Property.GRAB_HANDLE_PRESSED_IMAGE).Get(out temp);
759 SetProperty(TextEditor.Property.GRAB_HANDLE_PRESSED_IMAGE, new Tizen.NUI.PropertyValue(value));
764 /// The SelectionHandleImageLeft property.
766 /// <since_tizen> 3 </since_tizen>
767 public PropertyMap SelectionHandleImageLeft
771 PropertyMap temp = new PropertyMap();
772 GetProperty(TextEditor.Property.SELECTION_HANDLE_IMAGE_LEFT).Get(temp);
777 SetProperty(TextEditor.Property.SELECTION_HANDLE_IMAGE_LEFT, new Tizen.NUI.PropertyValue(value));
782 /// The SelectionHandleImageRight property.
784 /// <since_tizen> 3 </since_tizen>
785 public PropertyMap SelectionHandleImageRight
789 PropertyMap temp = new PropertyMap();
790 GetProperty(TextEditor.Property.SELECTION_HANDLE_IMAGE_RIGHT).Get(temp);
795 SetProperty(TextEditor.Property.SELECTION_HANDLE_IMAGE_RIGHT, new Tizen.NUI.PropertyValue(value));
800 /// The SelectionHandlePressedImageLeft property.
802 /// <since_tizen> 3 </since_tizen>
803 public PropertyMap SelectionHandlePressedImageLeft
807 PropertyMap temp = new PropertyMap();
808 GetProperty(TextEditor.Property.SELECTION_HANDLE_PRESSED_IMAGE_LEFT).Get(temp);
813 SetProperty(TextEditor.Property.SELECTION_HANDLE_PRESSED_IMAGE_LEFT, new Tizen.NUI.PropertyValue(value));
818 /// The SelectionHandlePressedImageRight property.
820 /// <since_tizen> 3 </since_tizen>
821 public PropertyMap SelectionHandlePressedImageRight
825 PropertyMap temp = new PropertyMap();
826 GetProperty(TextEditor.Property.SELECTION_HANDLE_PRESSED_IMAGE_RIGHT).Get(temp);
831 SetProperty(TextEditor.Property.SELECTION_HANDLE_PRESSED_IMAGE_RIGHT, new Tizen.NUI.PropertyValue(value));
836 /// The SelectionHandleMarkerImageLeft property.
838 /// <since_tizen> 3 </since_tizen>
839 public PropertyMap SelectionHandleMarkerImageLeft
843 PropertyMap temp = new PropertyMap();
844 GetProperty(TextEditor.Property.SELECTION_HANDLE_MARKER_IMAGE_LEFT).Get(temp);
849 SetProperty(TextEditor.Property.SELECTION_HANDLE_MARKER_IMAGE_LEFT, new Tizen.NUI.PropertyValue(value));
854 /// The SelectionHandleMarkerImageRight property.
856 /// <since_tizen> 3 </since_tizen>
857 public PropertyMap SelectionHandleMarkerImageRight
861 PropertyMap temp = new PropertyMap();
862 GetProperty(TextEditor.Property.SELECTION_HANDLE_MARKER_IMAGE_RIGHT).Get(temp);
867 SetProperty(TextEditor.Property.SELECTION_HANDLE_MARKER_IMAGE_RIGHT, new Tizen.NUI.PropertyValue(value));
872 /// The SelectionHighlightColor property.
874 /// <since_tizen> 3 </since_tizen>
875 public Vector4 SelectionHighlightColor
879 Vector4 temp = new Vector4(0.0f, 0.0f, 0.0f, 0.0f);
880 GetProperty(TextEditor.Property.SELECTION_HIGHLIGHT_COLOR).Get(temp);
885 SetProperty(TextEditor.Property.SELECTION_HIGHLIGHT_COLOR, new Tizen.NUI.PropertyValue(value));
890 /// The DecorationBoundingBox property.
892 /// <since_tizen> 3 </since_tizen>
893 public Rectangle DecorationBoundingBox
897 Rectangle temp = new Rectangle(0, 0, 0, 0);
898 GetProperty(TextEditor.Property.DECORATION_BOUNDING_BOX).Get(temp);
903 SetProperty(TextEditor.Property.DECORATION_BOUNDING_BOX, new Tizen.NUI.PropertyValue(value));
908 /// The EnableMarkup property.
910 /// <since_tizen> 3 </since_tizen>
911 public bool EnableMarkup
916 GetProperty(TextEditor.Property.ENABLE_MARKUP).Get(out temp);
921 SetProperty(TextEditor.Property.ENABLE_MARKUP, new Tizen.NUI.PropertyValue(value));
926 /// The InputColor property.
928 /// <since_tizen> 3 </since_tizen>
929 public Vector4 InputColor
933 Vector4 temp = new Vector4(0.0f, 0.0f, 0.0f, 0.0f);
934 GetProperty(TextEditor.Property.INPUT_COLOR).Get(temp);
939 SetProperty(TextEditor.Property.INPUT_COLOR, new Tizen.NUI.PropertyValue(value));
944 /// The InputFontFamily property.
946 /// <since_tizen> 3 </since_tizen>
947 public string InputFontFamily
952 GetProperty(TextEditor.Property.INPUT_FONT_FAMILY).Get(out temp);
957 SetProperty(TextEditor.Property.INPUT_FONT_FAMILY, new Tizen.NUI.PropertyValue(value));
962 /// The InputFontStyle property.
964 /// <since_tizen> 3 </since_tizen>
965 public PropertyMap InputFontStyle
969 PropertyMap temp = new PropertyMap();
970 GetProperty(TextEditor.Property.INPUT_FONT_STYLE).Get(temp);
975 SetProperty(TextEditor.Property.INPUT_FONT_STYLE, new Tizen.NUI.PropertyValue(value));
980 /// The InputPointSize property.
982 /// <since_tizen> 3 </since_tizen>
983 public float InputPointSize
988 GetProperty(TextEditor.Property.INPUT_POINT_SIZE).Get(out temp);
993 SetProperty(TextEditor.Property.INPUT_POINT_SIZE, new Tizen.NUI.PropertyValue(value));
998 /// The LineSpacing property.
1000 /// <since_tizen> 3 </since_tizen>
1001 public float LineSpacing
1006 GetProperty(TextEditor.Property.LINE_SPACING).Get(out temp);
1011 SetProperty(TextEditor.Property.LINE_SPACING, new Tizen.NUI.PropertyValue(value));
1016 /// The InputLineSpacing property.
1018 /// <since_tizen> 3 </since_tizen>
1019 public float InputLineSpacing
1024 GetProperty(TextEditor.Property.INPUT_LINE_SPACING).Get(out temp);
1029 SetProperty(TextEditor.Property.INPUT_LINE_SPACING, new Tizen.NUI.PropertyValue(value));
1034 /// The Underline property.
1036 /// <since_tizen> 3 </since_tizen>
1037 public PropertyMap Underline
1041 PropertyMap temp = new PropertyMap();
1042 GetProperty(TextEditor.Property.UNDERLINE).Get(temp);
1047 SetProperty(TextEditor.Property.UNDERLINE, new Tizen.NUI.PropertyValue(value));
1052 /// The InputUnderline property.
1054 /// <since_tizen> 3 </since_tizen>
1055 public string InputUnderline
1060 GetProperty(TextEditor.Property.INPUT_UNDERLINE).Get(out temp);
1065 SetProperty(TextEditor.Property.INPUT_UNDERLINE, new Tizen.NUI.PropertyValue(value));
1070 /// The Shadow property.
1072 /// <since_tizen> 3 </since_tizen>
1073 public PropertyMap Shadow
1077 PropertyMap temp = new PropertyMap();
1078 GetProperty(TextEditor.Property.SHADOW).Get(temp);
1083 SetProperty(TextEditor.Property.SHADOW, new Tizen.NUI.PropertyValue(value));
1088 /// The InputShadow property.
1090 /// <since_tizen> 3 </since_tizen>
1091 public string InputShadow
1096 GetProperty(TextEditor.Property.INPUT_SHADOW).Get(out temp);
1101 SetProperty(TextEditor.Property.INPUT_SHADOW, new Tizen.NUI.PropertyValue(value));
1106 /// The Emboss property.
1108 /// <since_tizen> 3 </since_tizen>
1109 public string Emboss
1114 GetProperty(TextEditor.Property.EMBOSS).Get(out temp);
1119 SetProperty(TextEditor.Property.EMBOSS, new Tizen.NUI.PropertyValue(value));
1124 /// The InputEmboss property.
1126 /// <since_tizen> 3 </since_tizen>
1127 public string InputEmboss
1132 GetProperty(TextEditor.Property.INPUT_EMBOSS).Get(out temp);
1137 SetProperty(TextEditor.Property.INPUT_EMBOSS, new Tizen.NUI.PropertyValue(value));
1142 /// The Outline property.
1144 /// <since_tizen> 3 </since_tizen>
1145 public PropertyMap Outline
1149 PropertyMap temp = new PropertyMap();
1150 GetProperty(TextEditor.Property.OUTLINE).Get(temp);
1155 SetProperty(TextEditor.Property.OUTLINE, new Tizen.NUI.PropertyValue(value));
1160 /// The InputOutline property.
1162 /// <since_tizen> 3 </since_tizen>
1163 public string InputOutline
1168 GetProperty(TextEditor.Property.INPUT_OUTLINE).Get(out temp);
1173 SetProperty(TextEditor.Property.INPUT_OUTLINE, new Tizen.NUI.PropertyValue(value));
1178 /// The SmoothScroll property.
1180 /// <since_tizen> 3 </since_tizen>
1181 public bool SmoothScroll
1186 GetProperty(TextEditor.Property.SMOOTH_SCROLL).Get(out temp);
1191 SetProperty(TextEditor.Property.SMOOTH_SCROLL, new Tizen.NUI.PropertyValue(value));
1196 /// The SmoothScrollDuration property.
1198 /// <since_tizen> 3 </since_tizen>
1199 public float SmoothScrollDuration
1204 GetProperty(TextEditor.Property.SMOOTH_SCROLL_DURATION).Get(out temp);
1209 SetProperty(TextEditor.Property.SMOOTH_SCROLL_DURATION, new Tizen.NUI.PropertyValue(value));
1214 /// The EnableScrollBar property.
1216 /// <since_tizen> 3 </since_tizen>
1217 public bool EnableScrollBar
1222 GetProperty(TextEditor.Property.ENABLE_SCROLL_BAR).Get(out temp);
1227 SetProperty(TextEditor.Property.ENABLE_SCROLL_BAR, new Tizen.NUI.PropertyValue(value));
1232 /// The ScrollBarShowDuration property.
1234 /// <since_tizen> 3 </since_tizen>
1235 public float ScrollBarShowDuration
1240 GetProperty(TextEditor.Property.SCROLL_BAR_SHOW_DURATION).Get(out temp);
1245 SetProperty(TextEditor.Property.SCROLL_BAR_SHOW_DURATION, new Tizen.NUI.PropertyValue(value));
1250 /// The ScrollBarFadeDuration property.
1252 /// <since_tizen> 3 </since_tizen>
1253 public float ScrollBarFadeDuration
1258 GetProperty(TextEditor.Property.SCROLL_BAR_FADE_DURATION).Get(out temp);
1263 SetProperty(TextEditor.Property.SCROLL_BAR_FADE_DURATION, new Tizen.NUI.PropertyValue(value));
1268 /// The PixelSize property.
1270 /// <since_tizen> 3 </since_tizen>
1271 public float PixelSize
1276 GetProperty(TextEditor.Property.PIXEL_SIZE).Get(out temp);
1281 SetProperty(TextEditor.Property.PIXEL_SIZE, new Tizen.NUI.PropertyValue(value));
1286 /// The line count of the text.
1288 /// <since_tizen> 3 </since_tizen>
1289 public int LineCount
1294 GetProperty(TextEditor.Property.LINE_COUNT).Get(out temp);
1300 /// The text to display when the TextEditor is empty and inactive.
1302 /// <since_tizen> 3 </since_tizen>
1303 public string PlaceholderText
1308 GetProperty(TextEditor.Property.PLACEHOLDER_TEXT).Get(out temp);
1313 SetProperty(TextEditor.Property.PLACEHOLDER_TEXT, new Tizen.NUI.PropertyValue(value));
1318 /// The Placeholder text color.
1320 /// <since_tizen> 3 </since_tizen>
1321 public Color PlaceholderTextColor
1325 Color temp = new Color(0.0f, 0.0f, 0.0f, 0.0f);
1326 GetProperty(TextEditor.Property.PLACEHOLDER_TEXT_COLOR).Get(temp);
1331 SetProperty(TextEditor.Property.PLACEHOLDER_TEXT_COLOR, new Tizen.NUI.PropertyValue(value));
1336 /// The EnableSelection property.
1338 /// <since_tizen> 3 </since_tizen>
1339 public bool EnableSelection
1344 GetProperty(TextEditor.Property.ENABLE_SELECTION).Get(out temp);
1349 SetProperty(TextEditor.Property.ENABLE_SELECTION, new Tizen.NUI.PropertyValue(value));
1354 /// The Placeholder property.
1355 /// Gets or sets the placeholder: text, color, font family, font style, point size, and pixel size.
1358 /// The following example demonstrates how to set the placeholder property.
1360 /// PropertyMap propertyMap = new PropertyMap();
1361 /// propertyMap.Add("text", new PropertyValue("Setting Placeholder Text"));
1362 /// propertyMap.Add("textFocused", new PropertyValue("Setting Placeholder Text Focused"));
1363 /// propertyMap.Add("color", new PropertyValue(Color.Red));
1364 /// propertyMap.Add("fontFamily", new PropertyValue("Arial"));
1365 /// propertyMap.Add("pointSize", new PropertyValue(12.0f));
1367 /// PropertyMap fontStyleMap = new PropertyMap();
1368 /// fontStyleMap.Add("weight", new PropertyValue("bold"));
1369 /// fontStyleMap.Add("width", new PropertyValue("condensed"));
1370 /// fontStyleMap.Add("slant", new PropertyValue("italic"));
1371 /// propertyMap.Add("fontStyle", new PropertyValue(fontStyleMap));
1373 /// TextEditor editor = new TextEditor();
1374 /// editor.Placeholder = propertyMap;
1377 /// <since_tizen> 3 </since_tizen>
1378 public Tizen.NUI.PropertyMap Placeholder
1382 Tizen.NUI.PropertyMap temp = new Tizen.NUI.PropertyMap();
1383 GetProperty(TextEditor.Property.PLACEHOLDER).Get(temp);
1388 SetProperty(TextEditor.Property.PLACEHOLDER, new Tizen.NUI.PropertyValue(value));
1393 /// The LineWrapMode property.<br />
1394 /// The line wrap mode when the text lines over the layout width.<br />
1396 /// <since_tizen> 4 </since_tizen>
1397 public LineWrapMode LineWrapMode
1402 if(GetProperty(TextEditor.Property.LINE_WRAP_MODE).Get(out temp) == false)
1404 NUILog.Error("LineWrapMode get error!");
1406 return (LineWrapMode)temp;
1410 SetProperty(TextEditor.Property.LINE_WRAP_MODE, new Tizen.NUI.PropertyValue((int)value));