Merge "Add properties of TextLabel/Editor" into devel/master
authorJinho, Lee <jeano.lee@samsung.com>
Fri, 29 Sep 2017 04:28:48 +0000 (04:28 +0000)
committerGerrit Code Review <gerrit@review.ap-northeast-2.compute.internal>
Fri, 29 Sep 2017 04:28:48 +0000 (04:28 +0000)
Tizen.NUI/src/internal/ManualPINVOKE.cs
Tizen.NUI/src/public/BaseComponents/TextEditor.cs
Tizen.NUI/src/public/BaseComponents/TextLabel.cs
Tizen.NUI/src/public/NUIConstants.cs

index f05d057..e9d938c 100755 (executable)
@@ -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();
 
index 616cd7f..e2b00ad 100755 (executable)
@@ -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));
+            }
+        }
+
     }
 
 }
index 0339ac0..f71b2e7 100755 (executable)
@@ -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));
+            }
+        }
+
     }
 }
index 1a581d1..704ea52 100755 (executable)
@@ -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
+    }
+
 }