diff options
author | Jinho, Lee <jeano.lee@samsung.com> | 2017-09-29 04:28:48 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@review.ap-northeast-2.compute.internal> | 2017-09-29 04:28:48 +0000 |
commit | 3c3668db694e87adc11258959b0b175cf068cc6a (patch) | |
tree | 5aad2fb32a0d6d715a9bd2b47f4bbfdaedbba6c5 | |
parent | 8e4abb29d95344815bf93602bb6b066ba5034b82 (diff) | |
parent | 4b36ae3d8ced363d486d9761f5d0636e9fde12ec (diff) | |
download | nui-3c3668db694e87adc11258959b0b175cf068cc6a.tar.gz nui-3c3668db694e87adc11258959b0b175cf068cc6a.tar.bz2 nui-3c3668db694e87adc11258959b0b175cf068cc6a.zip |
Merge "Add properties of TextLabel/Editor" into devel/master
-rwxr-xr-x | Tizen.NUI/src/internal/ManualPINVOKE.cs | 9 | ||||
-rwxr-xr-x | Tizen.NUI/src/public/BaseComponents/TextEditor.cs | 52 | ||||
-rwxr-xr-x | Tizen.NUI/src/public/BaseComponents/TextLabel.cs | 83 | ||||
-rwxr-xr-x | Tizen.NUI/src/public/NUIConstants.cs | 16 |
4 files changed, 154 insertions, 6 deletions
diff --git a/Tizen.NUI/src/internal/ManualPINVOKE.cs b/Tizen.NUI/src/internal/ManualPINVOKE.cs index f05d057..e9d938c 100755 --- a/Tizen.NUI/src/internal/ManualPINVOKE.cs +++ b/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/Tizen.NUI/src/public/BaseComponents/TextEditor.cs b/Tizen.NUI/src/public/BaseComponents/TextEditor.cs index 616cd7f..e2b00ad 100755 --- a/Tizen.NUI/src/public/BaseComponents/TextEditor.cs +++ b/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,56 @@ namespace Tizen.NUI.BaseComponents } } + /// <summary> + /// LineWrapMode property.<br> + /// line wrap mode when the text lines over layout width.<br> + /// </summary> + public LineWrapMode LineWrapMode + { + get + { + string temp; + if(GetProperty(TextLabel.Property.LINE_WRAP_MODE).Get(out temp) == false) + { + NUILog.Error("LineWrapMode get error!"); + } + LineWrapMode lineWrapMode; + switch (temp) + { + case "CHARACTER": + { + lineWrapMode = LineWrapMode.Character; + break; + } + case "WORD": + default: + { + lineWrapMode = LineWrapMode.Word; + break; + } + } + return lineWrapMode; + } + 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/Tizen.NUI/src/public/BaseComponents/TextLabel.cs b/Tizen.NUI/src/public/BaseComponents/TextLabel.cs index 0339ac0..f71b2e7 100755 --- a/Tizen.NUI/src/public/BaseComponents/TextLabel.cs +++ b/Tizen.NUI/src/public/BaseComponents/TextLabel.cs @@ -102,7 +102,8 @@ namespace Tizen.NUI.BaseComponents 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 TEXT_COLOR_ANIMATABLE = NDalicPINVOKE.TextLabel_Property_TEXT_COLOR_ANIMATABLE_get(); - + 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(); } /// <summary> @@ -693,15 +694,23 @@ namespace Tizen.NUI.BaseComponents { NUILog.Error("AutoScrollStopMode get error!"); } + AutoScrollStopMode autoScrollStopMode; switch (temp) { - case "FINISH_LOOP": - return AutoScrollStopMode.FinishLoop; + case "IMMEDIATE": - return AutoScrollStopMode.Immediate; + { + autoScrollStopMode = AutoScrollStopMode.Immediate; + break; + } + case "FINISH_LOOP": default: - return AutoScrollStopMode.FinishLoop; + { + autoScrollStopMode = AutoScrollStopMode.FinishLoop; + break; + } } + return autoScrollStopMode; } set { @@ -728,5 +737,69 @@ namespace Tizen.NUI.BaseComponents SetProperty(TextLabel.Property.TEXT_COLOR_ANIMATABLE, new Tizen.NUI.PropertyValue(value)); } } + + /// <summary> + /// The line count of text. + /// </summary> + public int LineCount + { + get + { + int temp = 0; + GetProperty(TextLabel.Property.LINE_COUNT).Get(out temp); + return temp; + } + } + + /// <summary> + /// LineWrapMode property.<br> + /// line wrap mode when the text lines over layout width.<br> + /// </summary> + public LineWrapMode LineWrapMode + { + get + { + string temp; + if(GetProperty(TextLabel.Property.LINE_WRAP_MODE).Get(out temp) == false) + { + NUILog.Error("LineWrapMode get error!"); + } + LineWrapMode lineWrapMode; + switch (temp) + { + case "CHARACTER": + { + lineWrapMode = LineWrapMode.Character; + break; + } + default: + case "WORD": + { + lineWrapMode = LineWrapMode.Word; + break; + } + } + return lineWrapMode; + } + 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/Tizen.NUI/src/public/NUIConstants.cs b/Tizen.NUI/src/public/NUIConstants.cs index 1a581d1..704ea52 100755 --- a/Tizen.NUI/src/public/NUIConstants.cs +++ b/Tizen.NUI/src/public/NUIConstants.cs @@ -1533,4 +1533,20 @@ namespace Tizen.NUI Finished } + /// <summary> + /// An enum of line wrap mode of text controls. + /// </summary> + public enum LineWrapMode + { + /// <summary> + /// Word mode will move word to next line + /// </summary> + Word, + + /// <summary> + /// character will move character by character to next line + /// </summary> + Character + } + } |