From 230ad35281ec8c9dacf5d5972ab9ccf158f0a3d8 Mon Sep 17 00:00:00 2001 From: "Jinho, Lee" Date: Fri, 28 Jul 2017 18:56:12 +0900 Subject: [PATCH] [Tizen] Add properties of TextLabel/Editor TextEditor -LINE_WRAP_MODE TextLabel -LINE_WRAP_MODE -LINE_COUNT Change-Id: I26626afea204b9654d63eb10930bec1a27741ba9 --- src/Tizen.NUI/src/internal/ManualPINVOKE.cs | 9 +++++ .../src/public/BaseComponents/TextEditor.cs | 45 ++++++++++++++++++++- .../src/public/BaseComponents/TextLabel.cs | 46 +++++++++++++++++++++- src/Tizen.NUI/src/public/NUIConstants.cs | 16 ++++++++ 4 files changed, 114 insertions(+), 2 deletions(-) diff --git a/src/Tizen.NUI/src/internal/ManualPINVOKE.cs b/src/Tizen.NUI/src/internal/ManualPINVOKE.cs index 593eafe..dbc1d40 100755 --- a/src/Tizen.NUI/src/internal/ManualPINVOKE.cs +++ b/src/Tizen.NUI/src/internal/ManualPINVOKE.cs @@ -629,6 +629,9 @@ namespace Tizen.NUI [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_TextEditor_Property_PLACEHOLDER_get")] public static extern int TextEditor_Property_PLACEHOLDER_get(); + [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_TextEditor_Property_LINE_WRAP_MODE_get")] + public static extern int TextEditor_Property_LINE_WRAP_MODE_get(); + [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_TextField_Property_HIDDEN_INPUT_SETTINGS_get")] public static extern int TextField_Property_HIDDEN_INPUT_SETTINGS_get(); @@ -653,6 +656,12 @@ namespace Tizen.NUI [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint = "CSharp_TextLabel_Property_AUTO_SCROLL_LOOP_DELAY_get")] public static extern int TextLabel_Property_AUTO_SCROLL_LOOP_DELAY_get(); + [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_TextLabel_Property_LINE_COUNT_get")] + public static extern int TextLabel_Property_LINE_COUNT_get(); + + [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_TextLabel_Property_LINE_WRAP_MODE_get")] + public static extern int TextLabel_Property_LINE_WRAP_MODE_get(); + [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint = "CSharp_HIDDENINPUT_PROPERTY_MODE_get")] public static extern int HIDDENINPUT_PROPERTY_MODE_get(); diff --git a/src/Tizen.NUI/src/public/BaseComponents/TextEditor.cs b/src/Tizen.NUI/src/public/BaseComponents/TextEditor.cs index 288a477..dfa79bd 100755 --- a/src/Tizen.NUI/src/public/BaseComponents/TextEditor.cs +++ b/src/Tizen.NUI/src/public/BaseComponents/TextEditor.cs @@ -279,7 +279,7 @@ namespace Tizen.NUI.BaseComponents internal static readonly int PLACEHOLDER_TEXT_COLOR = NDalicManualPINVOKE.TextEditor_Property_PLACEHOLDER_TEXT_COLOR_get(); internal static readonly int ENABLE_SELECTION = NDalicManualPINVOKE.TextEditor_Property_ENABLE_SELECTION_get(); internal static readonly int PLACEHOLDER = NDalicManualPINVOKE.TextEditor_Property_PLACEHOLDER_get(); - + internal static readonly int LINE_WRAP_MODE = NDalicManualPINVOKE.TextEditor_Property_LINE_WRAP_MODE_get(); } internal class InputStyle @@ -1245,6 +1245,49 @@ namespace Tizen.NUI.BaseComponents } } + /// + /// LineWrapMode property.
+ /// line wrap mode when the text lines over layout width.
+ ///
+ public LineWrapMode LineWrapMode + { + get + { + string 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; + } + } + 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)); + } + } + } } diff --git a/src/Tizen.NUI/src/public/BaseComponents/TextLabel.cs b/src/Tizen.NUI/src/public/BaseComponents/TextLabel.cs index fe53cb7..ac37acf 100755 --- a/src/Tizen.NUI/src/public/BaseComponents/TextLabel.cs +++ b/src/Tizen.NUI/src/public/BaseComponents/TextLabel.cs @@ -101,7 +101,8 @@ namespace Tizen.NUI.BaseComponents internal static readonly int ELLIPSIS = NDalicManualPINVOKE.TextLabel_Property_ELLIPSIS_get(); internal static readonly int AUTO_SCROLL_STOP_MODE = NDalicManualPINVOKE.TextLabel_Property_AUTO_SCROLL_STOP_MODE_get(); internal static readonly int AUTO_SCROLL_LOOP_DELAY = NDalicManualPINVOKE.TextLabel_Property_AUTO_SCROLL_LOOP_DELAY_get(); - internal static readonly int LINE_COUNT = OUTLINE + 5; + internal static readonly int LINE_COUNT = NDalicManualPINVOKE.TextLabel_Property_LINE_COUNT_get(); + internal static readonly int LINE_WRAP_MODE = NDalicManualPINVOKE.TextLabel_Property_LINE_WRAP_MODE_get(); } /// @@ -721,5 +722,48 @@ namespace Tizen.NUI.BaseComponents } } + /// + /// LineWrapMode property.
+ /// line wrap mode when the text lines over layout width.
+ ///
+ public LineWrapMode LineWrapMode + { + get + { + string temp; + if(GetProperty(TextLabel.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; + } + } + set + { + string temp = ""; + switch (value) + { + case LineWrapMode.Word: + { + temp = "WORD"; + break; + } + case LineWrapMode.Character: + { + temp = "CHARACTER"; + break; + } + } + SetProperty(TextLabel.Property.LINE_WRAP_MODE, new Tizen.NUI.PropertyValue(temp)); + } + } + } } diff --git a/src/Tizen.NUI/src/public/NUIConstants.cs b/src/Tizen.NUI/src/public/NUIConstants.cs index e978872..748b8fa 100755 --- a/src/Tizen.NUI/src/public/NUIConstants.cs +++ b/src/Tizen.NUI/src/public/NUIConstants.cs @@ -1527,4 +1527,20 @@ namespace Tizen.NUI Finished } + /// + /// An enum of line wrap mode of text controls. + /// + public enum LineWrapMode + { + /// + /// Word mode will move word to next line + /// + Word, + + /// + /// character will move character by character to next line + /// + Character + } + } -- 2.7.4