[Tizen] Add properties of TextLabel/Editor
authorminho.sun <minho.sun@samsung.com>
Tue, 1 Aug 2017 01:52:38 +0000 (10:52 +0900)
committerminho.sun <minho.sun@samsung.com>
Tue, 1 Aug 2017 01:53:04 +0000 (10:53 +0900)
This reverts commit f2cc59e07835537d10f655c5f8f488c11f14def4.

Change-Id: Ic7140a12b64bda007a2c91d11a46c68b3db63941

src/Tizen.NUI/src/internal/ManualPINVOKE.cs
src/Tizen.NUI/src/public/BaseComponents/TextEditor.cs
src/Tizen.NUI/src/public/BaseComponents/TextLabel.cs
src/Tizen.NUI/src/public/NUIConstants.cs

index 593eafe..dbc1d40 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 288a477..dfa79bd 100755 (executable)
@@ -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
             }
         }
 
+        /// <summary>
+        /// LineWrapMode property.<br>
+        /// line wrap mode when the text lines over layout width.<br>
+        /// </summary>
+        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));
+            }
+        }
+
     }
 
 }
index fe53cb7..ac37acf 100755 (executable)
@@ -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();
         }
 
         /// <summary>
@@ -721,5 +722,48 @@ 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!");
+                }
+                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));
+            }
+        }
+
     }
 }
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
+    }
+
 }