From 2efd383257db631ea6f5570c0b093cbefb2473e1 Mon Sep 17 00:00:00 2001 From: "minho.sun" Date: Mon, 14 Aug 2017 17:37:23 +0900 Subject: [PATCH] [Tizen] Add properties of TextLabel/Editor This reverts commit b621f76acb93540ec569d1694a346118f1967829. Conflicts: Tizen.NUI/src/public/BaseComponents/TextLabel.cs Change-Id: I7e8d1fb277c8a64015b216817f64088133975fe7 --- src/Tizen.NUI/src/internal/ManualPINVOKE.cs | 9 ++++ .../src/public/BaseComponents/TextEditor.cs | 45 +++++++++++++++++++- .../src/public/BaseComponents/TextLabel.cs | 48 ++++++++++++++++++++++ src/Tizen.NUI/src/public/NUIConstants.cs | 16 ++++++++ 4 files changed, 117 insertions(+), 1 deletion(-) diff --git a/src/Tizen.NUI/src/internal/ManualPINVOKE.cs b/src/Tizen.NUI/src/internal/ManualPINVOKE.cs index 51b2a07..9325cc6 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 616cd7f..9f3e819 100755 --- a/src/Tizen.NUI/src/public/BaseComponents/TextEditor.cs +++ b/src/Tizen.NUI/src/public/BaseComponents/TextEditor.cs @@ -284,7 +284,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 @@ -1251,6 +1251,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 20598db..a3088e9 100755 --- a/src/Tizen.NUI/src/public/BaseComponents/TextLabel.cs +++ b/src/Tizen.NUI/src/public/BaseComponents/TextLabel.cs @@ -101,8 +101,13 @@ 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(); +<<<<<<< HEAD internal static readonly int TEXT_COLOR_ANIMATABLE = NDalicPINVOKE.TextLabel_Property_TEXT_COLOR_ANIMATABLE_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(); +>>>>>>> parent of b621f76... Revert "[Tizen] Add properties of TextLabel/Editor" } /// @@ -740,5 +745,48 @@ namespace Tizen.NUI.BaseComponents return temp; } } + + /// + /// 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 1a581d1..704ea52 100755 --- a/src/Tizen.NUI/src/public/NUIConstants.cs +++ b/src/Tizen.NUI/src/public/NUIConstants.cs @@ -1533,4 +1533,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