-/** Copyright (c) 2017 Samsung Electronics Co., Ltd.
-*
-* Licensed under the Apache License, Version 2.0 (the "License");
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*
-*/
+/*
+ * Copyright(c) 2017 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
extern alias TizenSystemSettings;
using TizenSystemSettings.Tizen.System;
-namespace Tizen.NUI.BaseComponents
-{
- using System;
- using System.Runtime.InteropServices;
- using System.Globalization;
+using System;
+using System.Runtime.InteropServices;
+using System.Globalization;
+using System.ComponentModel;
+namespace Tizen.NUI.BaseComponents
+{
/// <summary>
/// A control which provides a multi-line editable text editor.
/// </summary>
+ /// <since_tizen> 3 </since_tizen>
public class TextEditor : View
{
private global::System.Runtime.InteropServices.HandleRef swigCPtr;
/// <summary>
/// Dispose.
/// </summary>
+ /// <since_tizen> 3 </since_tizen>
protected override void Dispose(DisposeTypes type)
{
if (disposed)
//You should not access any managed member here except static instance.
//because the execution order of Finalizes is non-deterministic.
+ if (_textEditorTextChangedCallbackDelegate != null)
+ {
+ TextChangedSignal().Disconnect(_textEditorTextChangedCallbackDelegate);
+ }
+
if (swigCPtr.Handle != global::System.IntPtr.Zero)
{
if (swigCMemOwn)
}
/// <summary>
- /// Event arguments that passed via TextChanged signal.
+ /// Event arguments that passed via the TextChanged signal.
/// </summary>
+ /// <since_tizen> 3 </since_tizen>
public class TextChangedEventArgs : EventArgs
{
private TextEditor _textEditor;
/// <summary>
/// TextEditor - is the texteditor control which has the text contents changed.
/// </summary>
+ /// <since_tizen> 3 </since_tizen>
public TextEditor TextEditor
{
get
private TextChangedCallbackDelegate _textEditorTextChangedCallbackDelegate;
/// <summary>
- /// Event for TextChanged signal which can be used to subscribe/unsubscribe the event handler
- /// provided by the user. TextChanged signal is emitted when the text changes.<br>
+ /// An event for the TextChanged signal which can be used to subscribe or unsubscribe the event handler
+ /// provided by the user. The TextChanged signal is emitted when the text changes.<br />
/// </summary>
+ /// <since_tizen> 3 </since_tizen>
public event EventHandler<TextChangedEventArgs> TextChanged
{
add
}
/// <summary>
- /// Event arguments that passed via ScrollStateChanged signal.
+ /// Event arguments that passed via the ScrollStateChanged signal.
/// </summary>
+ /// <since_tizen> 3 </since_tizen>
public class ScrollStateChangedEventArgs : EventArgs
{
private TextEditor _textEditor;
/// <summary>
/// TextEditor - is the texteditor control which has the scroll state changed.
/// </summary>
+ /// <since_tizen> 3 </since_tizen>
public TextEditor TextEditor
{
get
/// <summary>
/// ScrollState - is the texteditor control scroll state.
/// </summary>
+ /// <since_tizen> 3 </since_tizen>
public ScrollState ScrollState
{
get
private ScrollStateChangedCallbackDelegate _textEditorScrollStateChangedCallbackDelegate;
/// <summary>
- /// Event for ScrollStateChanged signal which can be used to subscribe/unsubscribe the event handler
- /// provided by the user. ScrollStateChanged signal is emitted when the scroll state changes.<br>
+ /// Event for the ScrollStateChanged signal which can be used to subscribe or unsubscribe the event handler
+ /// provided by the user. The ScrollStateChanged signal is emitted when the scroll state changes.<br />
/// </summary>
+ /// <since_tizen> 3 </since_tizen>
public event EventHandler<ScrollStateChangedEventArgs> ScrollStateChanged
{
add
}
}
- internal class Property
+ internal new class Property
{
internal static readonly int RENDERING_BACKEND = NDalicPINVOKE.TextEditor_Property_RENDERING_BACKEND_get();
internal static readonly int TEXT = NDalicPINVOKE.TextEditor_Property_TEXT_get();
/// <summary>
/// Creates the TextEditor control.
/// </summary>
+ /// <since_tizen> 3 </since_tizen>
public TextEditor() : this(NDalicPINVOKE.TextEditor_New(), true)
{
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
- [Obsolete("Please do not use! this will be deprecated")]
+ /// <summary>
+ /// Downcasts a handle to textEditor handle.
+ /// </summary>
+ /// <param name="handle"></param>
+ /// <returns></returns>
+ /// <since_tizen> 3 </since_tizen>
+ /// Please do not use! this will be deprecated!
+ /// Instead please use as keyword.
+ [Obsolete("Please DO NOT use! This will be deprecated, instead please USE as keyword.")]
+ [EditorBrowsable(EditorBrowsableState.Never)]
public new static TextEditor DownCast(BaseHandle handle)
{
TextEditor ret = Registry.GetManagedBaseHandleFromNativePtr(handle) as TextEditor;
}
/// <summary>
- /// TranslatableText property.<br>
- /// The text can be set SID value.<br>
+ /// The TranslatableText property.<br />
+ /// The text can set the SID value.<br />
/// </summary>
/// <exception cref='ArgumentNullException'>
- /// ResourceManager about multilingual is null
+ /// ResourceManager about multilingual is null.
/// </exception>
+ /// <since_tizen> 4 </since_tizen>
public string TranslatableText
{
get
}
}
/// <summary>
- /// TranslatablePlaceholderText property.<br>
- /// The text can be set SID value.<br>
+ /// The TranslatablePlaceholderText property.<br />
+ /// The text can set the SID value.<br />
/// </summary>
/// <exception cref='ArgumentNullException'>
- /// ResourceManager about multilingual is null
+ /// ResourceManager about multilingual is null.
/// </exception>
+ /// <since_tizen> 4 </since_tizen>
public string TranslatablePlaceholderText
{
get
PlaceholderText = NUIApplication.MultilingualResourceManager?.GetString(textEditorPlaceHolderTextSid, new CultureInfo(e.Value.Replace("_", "-")));
}
}
- /// Text property.
+ /// <summary>
+ /// The Text property.
/// </summary>
+ /// <since_tizen> 3 </since_tizen>
public string Text
{
get
}
/// <summary>
- /// Text color property.
+ /// The TextColor property.
/// </summary>
+ /// <since_tizen> 3 </since_tizen>
public Vector4 TextColor
{
get
}
/// <summary>
- /// Font family property.
+ /// The FontFamily property.
/// </summary>
+ /// <since_tizen> 3 </since_tizen>
public string FontFamily
{
get
}
/// <summary>
- /// Font style property.
+ /// The FontStyle property.
/// </summary>
+ /// <since_tizen> 3 </since_tizen>
public PropertyMap FontStyle
{
get
}
/// <summary>
- /// Point size property.
+ /// The PointSize property.
/// </summary>
+ /// <since_tizen> 3 </since_tizen>
public float PointSize
{
get
}
/// <summary>
- /// Horizontal alignment property.
+ /// The HorizontalAlignment property.
/// </summary>
+ /// <since_tizen> 3 </since_tizen>
public HorizontalAlignment HorizontalAlignment
{
get
}
/// <summary>
- /// Scroll threshold property.
+ /// The ScrollThreshold property.
/// </summary>
+ /// <since_tizen> 3 </since_tizen>
public float ScrollThreshold
{
get
}
/// <summary>
- /// Scroll speed property.
+ /// The ScrollSpeed property.
/// </summary>
+ /// <since_tizen> 3 </since_tizen>
public float ScrollSpeed
{
get
}
/// <summary>
- /// Primary cursor color property.
+ /// The PrimaryCursorColor property.
/// </summary>
+ /// <since_tizen> 3 </since_tizen>
public Vector4 PrimaryCursorColor
{
get
}
/// <summary>
- /// SecondaryCursorColor property.
+ /// The SecondaryCursorColor property.
/// </summary>
+ /// <since_tizen> 3 </since_tizen>
public Vector4 SecondaryCursorColor
{
get
}
/// <summary>
- /// EnableCursorBlink property.
+ /// The EnableCursorBlink property.
/// </summary>
+ /// <since_tizen> 3 </since_tizen>
public bool EnableCursorBlink
{
get
}
/// <summary>
- /// CursorBlinkInterval property.
+ /// The CursorBlinkInterval property.
/// </summary>
+ /// <since_tizen> 3 </since_tizen>
public float CursorBlinkInterval
{
get
}
/// <summary>
- /// CursorBlinkDuration property.
+ /// The CursorBlinkDuration property.
/// </summary>
+ /// <since_tizen> 3 </since_tizen>
public float CursorBlinkDuration
{
get
}
/// <summary>
- /// CursorWidth property.
+ /// The CursorWidth property.
/// </summary>
+ /// <since_tizen> 3 </since_tizen>
public int CursorWidth
{
get
}
/// <summary>
- /// GrabHandleImage property.
+ /// The GrabHandleImage property.
/// </summary>
+ /// <since_tizen> 3 </since_tizen>
public string GrabHandleImage
{
get
}
/// <summary>
- /// GrabHandlePressedImage property.
+ /// The GrabHandlePressedImage property.
/// </summary>
+ /// <since_tizen> 3 </since_tizen>
public string GrabHandlePressedImage
{
get
}
/// <summary>
- /// SelectionHandleImageLeft property.
+ /// The SelectionHandleImageLeft property.
/// </summary>
+ /// <since_tizen> 3 </since_tizen>
public PropertyMap SelectionHandleImageLeft
{
get
}
/// <summary>
- /// SelectionHandleImageRight property.
+ /// The SelectionHandleImageRight property.
/// </summary>
+ /// <since_tizen> 3 </since_tizen>
public PropertyMap SelectionHandleImageRight
{
get
}
/// <summary>
- /// SelectionHandlePressedImageLeft property.
+ /// The SelectionHandlePressedImageLeft property.
/// </summary>
+ /// <since_tizen> 3 </since_tizen>
public PropertyMap SelectionHandlePressedImageLeft
{
get
}
/// <summary>
- /// SelectionHandlePressedImageRight property.
+ /// The SelectionHandlePressedImageRight property.
/// </summary>
+ /// <since_tizen> 3 </since_tizen>
public PropertyMap SelectionHandlePressedImageRight
{
get
}
/// <summary>
- /// SelectionHandleMarkerImageLeft property.
+ /// The SelectionHandleMarkerImageLeft property.
/// </summary>
+ /// <since_tizen> 3 </since_tizen>
public PropertyMap SelectionHandleMarkerImageLeft
{
get
}
/// <summary>
- /// SelectionHandleMarkerImageRight property.
+ /// The SelectionHandleMarkerImageRight property.
/// </summary>
+ /// <since_tizen> 3 </since_tizen>
public PropertyMap SelectionHandleMarkerImageRight
{
get
}
/// <summary>
- /// SelectionHighlightColor property.
+ /// The SelectionHighlightColor property.
/// </summary>
+ /// <since_tizen> 3 </since_tizen>
public Vector4 SelectionHighlightColor
{
get
}
/// <summary>
- /// DecorationBoundingBox property.
+ /// The DecorationBoundingBox property.
/// </summary>
+ /// <since_tizen> 3 </since_tizen>
public Rectangle DecorationBoundingBox
{
get
}
/// <summary>
- /// EnableMarkup property.
+ /// The EnableMarkup property.
/// </summary>
+ /// <since_tizen> 3 </since_tizen>
public bool EnableMarkup
{
get
}
/// <summary>
- /// InputColor property.
+ /// The InputColor property.
/// </summary>
+ /// <since_tizen> 3 </since_tizen>
public Vector4 InputColor
{
get
}
/// <summary>
- /// InputFontFamily property.
+ /// The InputFontFamily property.
/// </summary>
+ /// <since_tizen> 3 </since_tizen>
public string InputFontFamily
{
get
}
/// <summary>
- /// InputFontStyle property.
+ /// The InputFontStyle property.
/// </summary>
+ /// <since_tizen> 3 </since_tizen>
public PropertyMap InputFontStyle
{
get
}
/// <summary>
- /// InputPointSize property.
+ /// The InputPointSize property.
/// </summary>
+ /// <since_tizen> 3 </since_tizen>
public float InputPointSize
{
get
}
/// <summary>
- /// LineSpacing property.
+ /// The LineSpacing property.
/// </summary>
+ /// <since_tizen> 3 </since_tizen>
public float LineSpacing
{
get
}
/// <summary>
- /// InputLineSpacing property.
+ /// The InputLineSpacing property.
/// </summary>
+ /// <since_tizen> 3 </since_tizen>
public float InputLineSpacing
{
get
}
/// <summary>
- /// Underline property.
+ /// The Underline property.
/// </summary>
+ /// <since_tizen> 3 </since_tizen>
public PropertyMap Underline
{
get
}
/// <summary>
- /// InputUnderline property.
+ /// The InputUnderline property.
/// </summary>
+ /// <since_tizen> 3 </since_tizen>
public string InputUnderline
{
get
}
/// <summary>
- /// Shadow property.
+ /// The Shadow property.
/// </summary>
+ /// <since_tizen> 3 </since_tizen>
public PropertyMap Shadow
{
get
}
/// <summary>
- /// InputShadow property.
+ /// The InputShadow property.
/// </summary>
+ /// <since_tizen> 3 </since_tizen>
public string InputShadow
{
get
}
/// <summary>
- /// Emboss property.
+ /// The Emboss property.
/// </summary>
+ /// <since_tizen> 3 </since_tizen>
public string Emboss
{
get
}
/// <summary>
- /// InputEmboss property.
+ /// The InputEmboss property.
/// </summary>
+ /// <since_tizen> 3 </since_tizen>
public string InputEmboss
{
get
}
/// <summary>
- /// Outline property.
+ /// The Outline property.
/// </summary>
- public string Outline
+ /// <since_tizen> 3 </since_tizen>
+ public PropertyMap Outline
{
get
{
- string temp;
- GetProperty(TextEditor.Property.OUTLINE).Get(out temp);
+ PropertyMap temp = new PropertyMap();
+ GetProperty(TextEditor.Property.OUTLINE).Get(temp);
return temp;
}
set
}
/// <summary>
- /// InputOutline property.
+ /// The InputOutline property.
/// </summary>
+ /// <since_tizen> 3 </since_tizen>
public string InputOutline
{
get
}
/// <summary>
- /// SmoothScroll property.
+ /// The SmoothScroll property.
/// </summary>
+ /// <since_tizen> 3 </since_tizen>
public bool SmoothScroll
{
get
}
/// <summary>
- /// SmoothScrollDuration property.
+ /// The SmoothScrollDuration property.
/// </summary>
+ /// <since_tizen> 3 </since_tizen>
public float SmoothScrollDuration
{
get
}
/// <summary>
- /// EnableScrollBar property.
+ /// The EnableScrollBar property.
/// </summary>
+ /// <since_tizen> 3 </since_tizen>
public bool EnableScrollBar
{
get
}
/// <summary>
- /// ScrollBarShowDuration property.
+ /// The ScrollBarShowDuration property.
/// </summary>
+ /// <since_tizen> 3 </since_tizen>
public float ScrollBarShowDuration
{
get
}
/// <summary>
- /// ScrollBarFadeDuration property.
+ /// The ScrollBarFadeDuration property.
/// </summary>
+ /// <since_tizen> 3 </since_tizen>
public float ScrollBarFadeDuration
{
get
}
/// <summary>
- /// PixelSize property.
+ /// The PixelSize property.
/// </summary>
+ /// <since_tizen> 3 </since_tizen>
public float PixelSize
{
get
}
/// <summary>
- /// The line count of text.
+ /// The line count of the text.
/// </summary>
+ /// <since_tizen> 3 </since_tizen>
public int LineCount
{
get
/// <summary>
/// The text to display when the TextEditor is empty and inactive.
/// </summary>
+ /// <since_tizen> 3 </since_tizen>
public string PlaceholderText
{
get
}
/// <summary>
- /// The placeholder-text color.
+ /// The Placeholder text color.
/// </summary>
+ /// <since_tizen> 3 </since_tizen>
public Color PlaceholderTextColor
{
get
}
/// <summary>
- /// Enable selection property.
+ /// The EnableSelection property.
/// </summary>
+ /// <since_tizen> 3 </since_tizen>
public bool EnableSelection
{
get
}
/// <summary>
- /// Placeholder property.
- /// Gets/Sets the placeholder : text, color, font family, font style, point size, and pixel size.
+ /// The Placeholder property.
+ /// Gets or sets the placeholder: text, color, font family, font style, point size, and pixel size.
/// </summary>
/// <example>
/// The following example demonstrates how to set the placeholder property.
/// <code>
/// PropertyMap propertyMap = new PropertyMap();
- /// propertyMap.Add("placeholderText", new PropertyValue("Setting Placeholder Text"));
- /// propertyMap.Add("placeholderTextFocused", new PropertyValue("Setting Placeholder Text Focused"));
- /// propertyMap.Add("placeholderColor", new PropertyValue(Color.Red));
- /// propertyMap.Add("placeholderFontFamily", new PropertyValue("Arial"));
- /// propertyMap.Add("placeholderPointSize", new PropertyValue(12.0f));
+ /// propertyMap.Add("text", new PropertyValue("Setting Placeholder Text"));
+ /// propertyMap.Add("textFocused", new PropertyValue("Setting Placeholder Text Focused"));
+ /// propertyMap.Add("color", new PropertyValue(Color.Red));
+ /// propertyMap.Add("fontFamily", new PropertyValue("Arial"));
+ /// propertyMap.Add("pointSize", new PropertyValue(12.0f));
///
/// PropertyMap fontStyleMap = new PropertyMap();
/// fontStyleMap.Add("weight", new PropertyValue("bold"));
/// fontStyleMap.Add("width", new PropertyValue("condensed"));
/// fontStyleMap.Add("slant", new PropertyValue("italic"));
- /// propertyMap.Add("placeholderFontStyle", new PropertyValue(fontStyleMap));
+ /// propertyMap.Add("fontStyle", new PropertyValue(fontStyleMap));
///
/// TextEditor editor = new TextEditor();
/// editor.Placeholder = propertyMap;
/// </code>
/// </example>
+ /// <since_tizen> 3 </since_tizen>
public Tizen.NUI.PropertyMap Placeholder
{
get
}
/// <summary>
- /// LineWrapMode property.<br>
- /// line wrap mode when the text lines over layout width.<br>
+ /// The LineWrapMode property.<br />
+ /// The line wrap mode when the text lines over the layout width.<br />
/// </summary>
+ /// <since_tizen> 4 </since_tizen>
public LineWrapMode LineWrapMode
{
get
{
- string temp;
+ int temp;
if(GetProperty(TextEditor.Property.LINE_WRAP_MODE).Get(out temp) == false)
{
NUILog.Error("LineWrapMode get error!");
}
- switch (temp)
- {
- case "WORD":
- return LineWrapMode.Word;
- case "CHARACTER":
- return LineWrapMode.Character;
- default:
- return LineWrapMode.Word;
- }
+ return (LineWrapMode)temp;
}
set
{
- string temp = "";
- switch (value)
- {
- case LineWrapMode.Word:
- {
- temp = "WORD";
- break;
- }
- case LineWrapMode.Character:
- {
- temp = "CHARACTER";
- break;
- }
- }
- SetProperty(TextEditor.Property.LINE_WRAP_MODE, new Tizen.NUI.PropertyValue(temp));
+ SetProperty(TextEditor.Property.LINE_WRAP_MODE, new Tizen.NUI.PropertyValue((int)value));
}
}