2 * Copyright(c) 2018 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 (this != null && _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 ENABLE_SELECTION = NDalicManualPINVOKE.TextEditor_Property_ENABLE_SELECTION_get();
301 internal static readonly int PLACEHOLDER = NDalicManualPINVOKE.TextEditor_Property_PLACEHOLDER_get();
302 internal static readonly int LINE_WRAP_MODE = NDalicManualPINVOKE.TextEditor_Property_LINE_WRAP_MODE_get();
303 internal static readonly int PLACEHOLDER_TEXT = NDalicManualPINVOKE.TextEditor_Property_PLACEHOLDER_TEXT_get();
304 internal static readonly int PLACEHOLDER_TEXT_COLOR = NDalicManualPINVOKE.TextEditor_Property_PLACEHOLDER_TEXT_COLOR_get();
305 internal static readonly int ENABLE_SHIFT_SELECTION = NDalicManualPINVOKE.TextEditor_Property_ENABLE_SHIFT_SELECTION_get();
308 internal class InputStyle
317 LineSpacing = 0x0010,
326 /// Creates the TextEditor control.
328 /// <since_tizen> 3 </since_tizen>
329 public TextEditor() : this(NDalicPINVOKE.TextEditor_New(), true)
331 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
334 internal TextEditor(TextEditor handle) : this(NDalicPINVOKE.new_TextEditor__SWIG_1(TextEditor.getCPtr(handle)), true)
336 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
340 /// Get the InputMethodContext instance.
342 /// <returns>The InputMethodContext instance.</returns>
343 public InputMethodContext GetInputMethodContext() {
344 InputMethodContext ret = new InputMethodContext(NDalicPINVOKE.TextEditor_GetInputMethodContext(swigCPtr), true);
345 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
349 internal TextEditorSignal TextChangedSignal()
351 TextEditorSignal ret = new TextEditorSignal(NDalicPINVOKE.TextEditor_TextChangedSignal(swigCPtr), false);
352 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
356 internal ScrollStateChangedSignal ScrollStateChangedSignal(TextEditor textEditor)
358 ScrollStateChangedSignal ret = new ScrollStateChangedSignal(NDalicManualPINVOKE.TextEditor_ScrollStateChangedSignal(TextEditor.getCPtr(textEditor)), false);
359 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
363 internal SWIGTYPE_p_Dali__SignalT_void_fDali__Toolkit__TextEditor_Dali__Toolkit__TextEditor__InputStyle__MaskF_t InputStyleChangedSignal()
365 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);
366 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
371 /// The TranslatableText property.<br />
372 /// The text can set the SID value.<br />
374 /// <exception cref='ArgumentNullException'>
375 /// ResourceManager about multilingual is null.
377 /// <since_tizen> 4 </since_tizen>
378 public string TranslatableText
382 return textEditorTextSid;
386 if (NUIApplication.MultilingualResourceManager == null)
388 throw new ArgumentNullException("ResourceManager about multilingual is null");
390 textEditorTextSid = value;
391 Text = SetTranslatable(textEditorTextSid);
392 NotifyPropertyChanged();
396 /// The TranslatablePlaceholderText property.<br />
397 /// The text can set the SID value.<br />
399 /// <exception cref='ArgumentNullException'>
400 /// ResourceManager about multilingual is null.
402 /// <since_tizen> 4 </since_tizen>
403 public string TranslatablePlaceholderText
407 return textEditorPlaceHolderTextSid;
411 if (NUIApplication.MultilingualResourceManager == null)
413 throw new ArgumentNullException("ResourceManager about multilingual is null");
415 textEditorPlaceHolderTextSid = value;
416 PlaceholderText = SetTranslatable(textEditorPlaceHolderTextSid);
417 NotifyPropertyChanged();
420 private string SetTranslatable(string textEditorSid)
422 string translatableText = null;
423 translatableText = NUIApplication.MultilingualResourceManager?.GetString(textEditorSid, new CultureInfo(SystemSettings.LocaleLanguage.Replace("_", "-")));
424 if (translatableText != null)
426 if (systemlangTextFlag == false)
428 SystemSettings.LocaleLanguageChanged += new WeakEventHandler<LocaleLanguageChangedEventArgs>(SystemSettings_LocaleLanguageChanged).Handler;
429 systemlangTextFlag = true;
431 return translatableText;
435 translatableText = "";
436 return translatableText;
439 private void SystemSettings_LocaleLanguageChanged(object sender, LocaleLanguageChangedEventArgs e)
441 if (textEditorTextSid != null)
443 Text = NUIApplication.MultilingualResourceManager?.GetString(textEditorTextSid, new CultureInfo(e.Value.Replace("_", "-")));
445 if (textEditorPlaceHolderTextSid != null)
447 PlaceholderText = NUIApplication.MultilingualResourceManager?.GetString(textEditorPlaceHolderTextSid, new CultureInfo(e.Value.Replace("_", "-")));
451 /// The Text property.
453 /// <since_tizen> 3 </since_tizen>
459 GetProperty(TextEditor.Property.TEXT).Get(out temp);
464 SetProperty(TextEditor.Property.TEXT, new Tizen.NUI.PropertyValue(value));
465 NotifyPropertyChanged();
470 /// The TextColor property.
472 /// <since_tizen> 3 </since_tizen>
473 public Vector4 TextColor
477 Vector4 temp = new Vector4(0.0f, 0.0f, 0.0f, 0.0f);
478 GetProperty(TextEditor.Property.TEXT_COLOR).Get(temp);
483 SetProperty(TextEditor.Property.TEXT_COLOR, new Tizen.NUI.PropertyValue(value));
484 NotifyPropertyChanged();
489 /// The FontFamily property.
491 /// <since_tizen> 3 </since_tizen>
492 public string FontFamily
497 GetProperty(TextEditor.Property.FONT_FAMILY).Get(out temp);
502 SetProperty(TextEditor.Property.FONT_FAMILY, new Tizen.NUI.PropertyValue(value));
503 NotifyPropertyChanged();
508 /// The FontStyle property.
510 /// <since_tizen> 3 </since_tizen>
511 public PropertyMap FontStyle
515 PropertyMap temp = new PropertyMap();
516 GetProperty(TextEditor.Property.FONT_STYLE).Get(temp);
521 SetProperty(TextEditor.Property.FONT_STYLE, new Tizen.NUI.PropertyValue(value));
522 NotifyPropertyChanged();
527 /// The PointSize property.
529 /// <since_tizen> 3 </since_tizen>
530 public float PointSize
535 GetProperty(TextEditor.Property.POINT_SIZE).Get(out temp);
540 SetProperty(TextEditor.Property.POINT_SIZE, new Tizen.NUI.PropertyValue(value));
541 NotifyPropertyChanged();
546 /// The HorizontalAlignment property.
548 /// <since_tizen> 3 </since_tizen>
549 public HorizontalAlignment HorizontalAlignment
554 if (GetProperty(TextEditor.Property.HORIZONTAL_ALIGNMENT).Get(out temp) == false)
556 NUILog.Error("HorizontalAlignment get error!");
562 return HorizontalAlignment.Begin;
564 return HorizontalAlignment.Center;
566 return HorizontalAlignment.End;
568 return HorizontalAlignment.Begin;
573 string valueToString = "";
576 case HorizontalAlignment.Begin:
578 valueToString = "BEGIN";
581 case HorizontalAlignment.Center:
583 valueToString = "CENTER";
586 case HorizontalAlignment.End:
588 valueToString = "END";
593 valueToString = "BEGIN";
597 SetProperty(TextEditor.Property.HORIZONTAL_ALIGNMENT, new Tizen.NUI.PropertyValue(valueToString));
598 NotifyPropertyChanged();
603 /// The ScrollThreshold property.
605 /// <since_tizen> 3 </since_tizen>
606 public float ScrollThreshold
611 GetProperty(TextEditor.Property.SCROLL_THRESHOLD).Get(out temp);
616 SetProperty(TextEditor.Property.SCROLL_THRESHOLD, new Tizen.NUI.PropertyValue(value));
617 NotifyPropertyChanged();
622 /// The ScrollSpeed property.
624 /// <since_tizen> 3 </since_tizen>
625 public float ScrollSpeed
630 GetProperty(TextEditor.Property.SCROLL_SPEED).Get(out temp);
635 SetProperty(TextEditor.Property.SCROLL_SPEED, new Tizen.NUI.PropertyValue(value));
636 NotifyPropertyChanged();
641 /// The PrimaryCursorColor property.
643 /// <since_tizen> 3 </since_tizen>
644 public Vector4 PrimaryCursorColor
648 Vector4 temp = new Vector4(0.0f, 0.0f, 0.0f, 0.0f);
649 GetProperty(TextEditor.Property.PRIMARY_CURSOR_COLOR).Get(temp);
654 SetProperty(TextEditor.Property.PRIMARY_CURSOR_COLOR, new Tizen.NUI.PropertyValue(value));
655 NotifyPropertyChanged();
660 /// The SecondaryCursorColor property.
662 /// <since_tizen> 3 </since_tizen>
663 public Vector4 SecondaryCursorColor
667 Vector4 temp = new Vector4(0.0f, 0.0f, 0.0f, 0.0f);
668 GetProperty(TextEditor.Property.SECONDARY_CURSOR_COLOR).Get(temp);
673 SetProperty(TextEditor.Property.SECONDARY_CURSOR_COLOR, new Tizen.NUI.PropertyValue(value));
674 NotifyPropertyChanged();
679 /// The EnableCursorBlink property.
681 /// <since_tizen> 3 </since_tizen>
682 public bool EnableCursorBlink
687 GetProperty(TextEditor.Property.ENABLE_CURSOR_BLINK).Get(out temp);
692 SetProperty(TextEditor.Property.ENABLE_CURSOR_BLINK, new Tizen.NUI.PropertyValue(value));
693 NotifyPropertyChanged();
698 /// The CursorBlinkInterval property.
700 /// <since_tizen> 3 </since_tizen>
701 public float CursorBlinkInterval
706 GetProperty(TextEditor.Property.CURSOR_BLINK_INTERVAL).Get(out temp);
711 SetProperty(TextEditor.Property.CURSOR_BLINK_INTERVAL, new Tizen.NUI.PropertyValue(value));
712 NotifyPropertyChanged();
717 /// The CursorBlinkDuration property.
719 /// <since_tizen> 3 </since_tizen>
720 public float CursorBlinkDuration
725 GetProperty(TextEditor.Property.CURSOR_BLINK_DURATION).Get(out temp);
730 SetProperty(TextEditor.Property.CURSOR_BLINK_DURATION, new Tizen.NUI.PropertyValue(value));
731 NotifyPropertyChanged();
736 /// The CursorWidth property.
738 /// <since_tizen> 3 </since_tizen>
739 public int CursorWidth
744 GetProperty(TextEditor.Property.CURSOR_WIDTH).Get(out temp);
749 SetProperty(TextEditor.Property.CURSOR_WIDTH, new Tizen.NUI.PropertyValue(value));
750 NotifyPropertyChanged();
755 /// The GrabHandleImage property.
757 /// <since_tizen> 3 </since_tizen>
758 public string GrabHandleImage
763 GetProperty(TextEditor.Property.GRAB_HANDLE_IMAGE).Get(out temp);
768 SetProperty(TextEditor.Property.GRAB_HANDLE_IMAGE, new Tizen.NUI.PropertyValue(value));
769 NotifyPropertyChanged();
774 /// The GrabHandlePressedImage property.
776 /// <since_tizen> 3 </since_tizen>
777 public string GrabHandlePressedImage
782 GetProperty(TextEditor.Property.GRAB_HANDLE_PRESSED_IMAGE).Get(out temp);
787 SetProperty(TextEditor.Property.GRAB_HANDLE_PRESSED_IMAGE, new Tizen.NUI.PropertyValue(value));
788 NotifyPropertyChanged();
793 /// The SelectionHandleImageLeft property.
795 /// <since_tizen> 3 </since_tizen>
796 public PropertyMap SelectionHandleImageLeft
800 PropertyMap temp = new PropertyMap();
801 GetProperty(TextEditor.Property.SELECTION_HANDLE_IMAGE_LEFT).Get(temp);
806 SetProperty(TextEditor.Property.SELECTION_HANDLE_IMAGE_LEFT, new Tizen.NUI.PropertyValue(value));
807 NotifyPropertyChanged();
812 /// The SelectionHandleImageRight property.
814 /// <since_tizen> 3 </since_tizen>
815 public PropertyMap SelectionHandleImageRight
819 PropertyMap temp = new PropertyMap();
820 GetProperty(TextEditor.Property.SELECTION_HANDLE_IMAGE_RIGHT).Get(temp);
825 SetProperty(TextEditor.Property.SELECTION_HANDLE_IMAGE_RIGHT, new Tizen.NUI.PropertyValue(value));
826 NotifyPropertyChanged();
831 /// The SelectionHandlePressedImageLeft property.
833 /// <since_tizen> 3 </since_tizen>
834 public PropertyMap SelectionHandlePressedImageLeft
838 PropertyMap temp = new PropertyMap();
839 GetProperty(TextEditor.Property.SELECTION_HANDLE_PRESSED_IMAGE_LEFT).Get(temp);
844 SetProperty(TextEditor.Property.SELECTION_HANDLE_PRESSED_IMAGE_LEFT, new Tizen.NUI.PropertyValue(value));
845 NotifyPropertyChanged();
850 /// The SelectionHandlePressedImageRight property.
852 /// <since_tizen> 3 </since_tizen>
853 public PropertyMap SelectionHandlePressedImageRight
857 PropertyMap temp = new PropertyMap();
858 GetProperty(TextEditor.Property.SELECTION_HANDLE_PRESSED_IMAGE_RIGHT).Get(temp);
863 SetProperty(TextEditor.Property.SELECTION_HANDLE_PRESSED_IMAGE_RIGHT, new Tizen.NUI.PropertyValue(value));
864 NotifyPropertyChanged();
869 /// The SelectionHandleMarkerImageLeft property.
871 /// <since_tizen> 3 </since_tizen>
872 public PropertyMap SelectionHandleMarkerImageLeft
876 PropertyMap temp = new PropertyMap();
877 GetProperty(TextEditor.Property.SELECTION_HANDLE_MARKER_IMAGE_LEFT).Get(temp);
882 SetProperty(TextEditor.Property.SELECTION_HANDLE_MARKER_IMAGE_LEFT, new Tizen.NUI.PropertyValue(value));
883 NotifyPropertyChanged();
888 /// The SelectionHandleMarkerImageRight property.
890 /// <since_tizen> 3 </since_tizen>
891 public PropertyMap SelectionHandleMarkerImageRight
895 PropertyMap temp = new PropertyMap();
896 GetProperty(TextEditor.Property.SELECTION_HANDLE_MARKER_IMAGE_RIGHT).Get(temp);
901 SetProperty(TextEditor.Property.SELECTION_HANDLE_MARKER_IMAGE_RIGHT, new Tizen.NUI.PropertyValue(value));
902 NotifyPropertyChanged();
907 /// The SelectionHighlightColor property.
909 /// <since_tizen> 3 </since_tizen>
910 public Vector4 SelectionHighlightColor
914 Vector4 temp = new Vector4(0.0f, 0.0f, 0.0f, 0.0f);
915 GetProperty(TextEditor.Property.SELECTION_HIGHLIGHT_COLOR).Get(temp);
920 SetProperty(TextEditor.Property.SELECTION_HIGHLIGHT_COLOR, new Tizen.NUI.PropertyValue(value));
921 NotifyPropertyChanged();
926 /// The DecorationBoundingBox property.
928 /// <since_tizen> 3 </since_tizen>
929 public Rectangle DecorationBoundingBox
933 Rectangle temp = new Rectangle(0, 0, 0, 0);
934 GetProperty(TextEditor.Property.DECORATION_BOUNDING_BOX).Get(temp);
939 SetProperty(TextEditor.Property.DECORATION_BOUNDING_BOX, new Tizen.NUI.PropertyValue(value));
940 NotifyPropertyChanged();
945 /// The EnableMarkup property.
947 /// <since_tizen> 3 </since_tizen>
948 public bool EnableMarkup
953 GetProperty(TextEditor.Property.ENABLE_MARKUP).Get(out temp);
958 SetProperty(TextEditor.Property.ENABLE_MARKUP, new Tizen.NUI.PropertyValue(value));
959 NotifyPropertyChanged();
964 /// The InputColor property.
966 /// <since_tizen> 3 </since_tizen>
967 public Vector4 InputColor
971 Vector4 temp = new Vector4(0.0f, 0.0f, 0.0f, 0.0f);
972 GetProperty(TextEditor.Property.INPUT_COLOR).Get(temp);
977 SetProperty(TextEditor.Property.INPUT_COLOR, new Tizen.NUI.PropertyValue(value));
978 NotifyPropertyChanged();
983 /// The InputFontFamily property.
985 /// <since_tizen> 3 </since_tizen>
986 public string InputFontFamily
991 GetProperty(TextEditor.Property.INPUT_FONT_FAMILY).Get(out temp);
996 SetProperty(TextEditor.Property.INPUT_FONT_FAMILY, new Tizen.NUI.PropertyValue(value));
997 NotifyPropertyChanged();
1002 /// The InputFontStyle property.
1004 /// <since_tizen> 3 </since_tizen>
1005 public PropertyMap InputFontStyle
1009 PropertyMap temp = new PropertyMap();
1010 GetProperty(TextEditor.Property.INPUT_FONT_STYLE).Get(temp);
1015 SetProperty(TextEditor.Property.INPUT_FONT_STYLE, new Tizen.NUI.PropertyValue(value));
1016 NotifyPropertyChanged();
1021 /// The InputPointSize property.
1023 /// <since_tizen> 3 </since_tizen>
1024 public float InputPointSize
1029 GetProperty(TextEditor.Property.INPUT_POINT_SIZE).Get(out temp);
1034 SetProperty(TextEditor.Property.INPUT_POINT_SIZE, new Tizen.NUI.PropertyValue(value));
1035 NotifyPropertyChanged();
1040 /// The LineSpacing property.
1042 /// <since_tizen> 3 </since_tizen>
1043 public float LineSpacing
1048 GetProperty(TextEditor.Property.LINE_SPACING).Get(out temp);
1053 SetProperty(TextEditor.Property.LINE_SPACING, new Tizen.NUI.PropertyValue(value));
1054 NotifyPropertyChanged();
1059 /// The InputLineSpacing property.
1061 /// <since_tizen> 3 </since_tizen>
1062 public float InputLineSpacing
1067 GetProperty(TextEditor.Property.INPUT_LINE_SPACING).Get(out temp);
1072 SetProperty(TextEditor.Property.INPUT_LINE_SPACING, new Tizen.NUI.PropertyValue(value));
1073 NotifyPropertyChanged();
1078 /// The Underline property.
1080 /// <since_tizen> 3 </since_tizen>
1081 public PropertyMap Underline
1085 PropertyMap temp = new PropertyMap();
1086 GetProperty(TextEditor.Property.UNDERLINE).Get(temp);
1091 SetProperty(TextEditor.Property.UNDERLINE, new Tizen.NUI.PropertyValue(value));
1092 NotifyPropertyChanged();
1097 /// The InputUnderline property.
1099 /// <since_tizen> 3 </since_tizen>
1100 public string InputUnderline
1105 GetProperty(TextEditor.Property.INPUT_UNDERLINE).Get(out temp);
1110 SetProperty(TextEditor.Property.INPUT_UNDERLINE, new Tizen.NUI.PropertyValue(value));
1111 NotifyPropertyChanged();
1116 /// The Shadow property.
1118 /// <since_tizen> 3 </since_tizen>
1119 public PropertyMap Shadow
1123 PropertyMap temp = new PropertyMap();
1124 GetProperty(TextEditor.Property.SHADOW).Get(temp);
1129 SetProperty(TextEditor.Property.SHADOW, new Tizen.NUI.PropertyValue(value));
1130 NotifyPropertyChanged();
1135 /// The InputShadow property.
1137 /// <since_tizen> 3 </since_tizen>
1138 public string InputShadow
1143 GetProperty(TextEditor.Property.INPUT_SHADOW).Get(out temp);
1148 SetProperty(TextEditor.Property.INPUT_SHADOW, new Tizen.NUI.PropertyValue(value));
1149 NotifyPropertyChanged();
1154 /// The Emboss property.
1156 /// <since_tizen> 3 </since_tizen>
1157 public string Emboss
1162 GetProperty(TextEditor.Property.EMBOSS).Get(out temp);
1167 SetProperty(TextEditor.Property.EMBOSS, new Tizen.NUI.PropertyValue(value));
1168 NotifyPropertyChanged();
1173 /// The InputEmboss property.
1175 /// <since_tizen> 3 </since_tizen>
1176 public string InputEmboss
1181 GetProperty(TextEditor.Property.INPUT_EMBOSS).Get(out temp);
1186 SetProperty(TextEditor.Property.INPUT_EMBOSS, new Tizen.NUI.PropertyValue(value));
1187 NotifyPropertyChanged();
1192 /// The Outline property.
1194 /// <since_tizen> 3 </since_tizen>
1195 public PropertyMap Outline
1199 PropertyMap temp = new PropertyMap();
1200 GetProperty(TextEditor.Property.OUTLINE).Get(temp);
1205 SetProperty(TextEditor.Property.OUTLINE, new Tizen.NUI.PropertyValue(value));
1206 NotifyPropertyChanged();
1211 /// The InputOutline property.
1213 /// <since_tizen> 3 </since_tizen>
1214 public string InputOutline
1219 GetProperty(TextEditor.Property.INPUT_OUTLINE).Get(out temp);
1224 SetProperty(TextEditor.Property.INPUT_OUTLINE, new Tizen.NUI.PropertyValue(value));
1225 NotifyPropertyChanged();
1230 /// The SmoothScroll property.
1232 /// <since_tizen> 3 </since_tizen>
1233 public bool SmoothScroll
1238 GetProperty(TextEditor.Property.SMOOTH_SCROLL).Get(out temp);
1243 SetProperty(TextEditor.Property.SMOOTH_SCROLL, new Tizen.NUI.PropertyValue(value));
1244 NotifyPropertyChanged();
1249 /// The SmoothScrollDuration property.
1251 /// <since_tizen> 3 </since_tizen>
1252 public float SmoothScrollDuration
1257 GetProperty(TextEditor.Property.SMOOTH_SCROLL_DURATION).Get(out temp);
1262 SetProperty(TextEditor.Property.SMOOTH_SCROLL_DURATION, new Tizen.NUI.PropertyValue(value));
1263 NotifyPropertyChanged();
1268 /// The EnableScrollBar property.
1270 /// <since_tizen> 3 </since_tizen>
1271 public bool EnableScrollBar
1276 GetProperty(TextEditor.Property.ENABLE_SCROLL_BAR).Get(out temp);
1281 SetProperty(TextEditor.Property.ENABLE_SCROLL_BAR, new Tizen.NUI.PropertyValue(value));
1282 NotifyPropertyChanged();
1287 /// The ScrollBarShowDuration property.
1289 /// <since_tizen> 3 </since_tizen>
1290 public float ScrollBarShowDuration
1295 GetProperty(TextEditor.Property.SCROLL_BAR_SHOW_DURATION).Get(out temp);
1300 SetProperty(TextEditor.Property.SCROLL_BAR_SHOW_DURATION, new Tizen.NUI.PropertyValue(value));
1301 NotifyPropertyChanged();
1306 /// The ScrollBarFadeDuration property.
1308 /// <since_tizen> 3 </since_tizen>
1309 public float ScrollBarFadeDuration
1314 GetProperty(TextEditor.Property.SCROLL_BAR_FADE_DURATION).Get(out temp);
1319 SetProperty(TextEditor.Property.SCROLL_BAR_FADE_DURATION, new Tizen.NUI.PropertyValue(value));
1320 NotifyPropertyChanged();
1325 /// The PixelSize property.
1327 /// <since_tizen> 3 </since_tizen>
1328 public float PixelSize
1333 GetProperty(TextEditor.Property.PIXEL_SIZE).Get(out temp);
1338 SetProperty(TextEditor.Property.PIXEL_SIZE, new Tizen.NUI.PropertyValue(value));
1339 NotifyPropertyChanged();
1344 /// The line count of the text.
1346 /// <since_tizen> 3 </since_tizen>
1347 public int LineCount
1352 GetProperty(TextEditor.Property.LINE_COUNT).Get(out temp);
1358 /// The text to display when the TextEditor is empty and inactive.
1360 /// <since_tizen> 3 </since_tizen>
1361 public string PlaceholderText
1366 GetProperty(TextEditor.Property.PLACEHOLDER_TEXT).Get(out temp);
1371 SetProperty(TextEditor.Property.PLACEHOLDER_TEXT, new Tizen.NUI.PropertyValue(value));
1372 NotifyPropertyChanged();
1377 /// The Placeholder text color.
1379 /// <since_tizen> 3 </since_tizen>
1380 public Color PlaceholderTextColor
1384 Color temp = new Color(0.0f, 0.0f, 0.0f, 0.0f);
1385 GetProperty(TextEditor.Property.PLACEHOLDER_TEXT_COLOR).Get(temp);
1390 SetProperty(TextEditor.Property.PLACEHOLDER_TEXT_COLOR, new Tizen.NUI.PropertyValue(value));
1391 NotifyPropertyChanged();
1396 /// The EnableSelection property.
1398 /// <since_tizen> 3 </since_tizen>
1399 public bool EnableSelection
1404 GetProperty(TextEditor.Property.ENABLE_SELECTION).Get(out temp);
1409 SetProperty(TextEditor.Property.ENABLE_SELECTION, new Tizen.NUI.PropertyValue(value));
1410 NotifyPropertyChanged();
1415 /// The Placeholder property.
1416 /// Gets or sets the placeholder: text, color, font family, font style, point size, and pixel size.
1419 /// The following example demonstrates how to set the placeholder property.
1421 /// PropertyMap propertyMap = new PropertyMap();
1422 /// propertyMap.Add("text", new PropertyValue("Setting Placeholder Text"));
1423 /// propertyMap.Add("textFocused", new PropertyValue("Setting Placeholder Text Focused"));
1424 /// propertyMap.Add("color", new PropertyValue(Color.Red));
1425 /// propertyMap.Add("fontFamily", new PropertyValue("Arial"));
1426 /// propertyMap.Add("pointSize", new PropertyValue(12.0f));
1428 /// PropertyMap fontStyleMap = new PropertyMap();
1429 /// fontStyleMap.Add("weight", new PropertyValue("bold"));
1430 /// fontStyleMap.Add("width", new PropertyValue("condensed"));
1431 /// fontStyleMap.Add("slant", new PropertyValue("italic"));
1432 /// propertyMap.Add("fontStyle", new PropertyValue(fontStyleMap));
1434 /// TextEditor editor = new TextEditor();
1435 /// editor.Placeholder = propertyMap;
1438 /// <since_tizen> 3 </since_tizen>
1439 public Tizen.NUI.PropertyMap Placeholder
1443 Tizen.NUI.PropertyMap temp = new Tizen.NUI.PropertyMap();
1444 GetProperty(TextEditor.Property.PLACEHOLDER).Get(temp);
1449 SetProperty(TextEditor.Property.PLACEHOLDER, new Tizen.NUI.PropertyValue(value));
1450 NotifyPropertyChanged();
1455 /// The LineWrapMode property.<br />
1456 /// The line wrap mode when the text lines over the layout width.<br />
1458 /// <since_tizen> 4 </since_tizen>
1459 public LineWrapMode LineWrapMode
1464 if(GetProperty(TextEditor.Property.LINE_WRAP_MODE).Get(out temp) == false)
1466 NUILog.Error("LineWrapMode get error!");
1468 return (LineWrapMode)temp;
1472 SetProperty(TextEditor.Property.LINE_WRAP_MODE, new Tizen.NUI.PropertyValue((int)value));
1473 NotifyPropertyChanged();
1478 /// Enables Text selection using Shift key.
1480 /// <since_tizen> 5 </since_tizen>
1481 public bool EnableShiftSelection
1485 // mShiftSelectionFlag( true )
1487 GetProperty(TextEditor.Property.ENABLE_SHIFT_SELECTION).Get(out temp);
1492 SetProperty(TextEditor.Property.ENABLE_SHIFT_SELECTION, new Tizen.NUI.PropertyValue(value));
1493 NotifyPropertyChanged();