[NUI] Support Ellipsis location, END, START and MIDDLE in TextLabel, TextField and...
authorShrouq Sabah <s.sabah@samsung.com>
Wed, 30 Jun 2021 00:10:55 +0000 (03:10 +0300)
committerdongsug-song <35130733+dongsug-song@users.noreply.github.com>
Tue, 3 Aug 2021 01:50:50 +0000 (10:50 +0900)
src/Tizen.NUI/src/internal/Interop/Interop.TextEditor.cs
src/Tizen.NUI/src/internal/Interop/Interop.TextField.cs
src/Tizen.NUI/src/internal/Interop/Interop.TextLabel.cs
src/Tizen.NUI/src/public/BaseComponents/Style/TextEditorStyle.cs
src/Tizen.NUI/src/public/BaseComponents/Style/TextLabelStyle.cs
src/Tizen.NUI/src/public/BaseComponents/TextEditor.cs
src/Tizen.NUI/src/public/BaseComponents/TextEditorBindableProperty.cs
src/Tizen.NUI/src/public/BaseComponents/TextFieldBindableProperty.cs
src/Tizen.NUI/src/public/BaseComponents/TextLabel.cs
src/Tizen.NUI/src/public/BaseComponents/TextLabelBindableProperty.cs
src/Tizen.NUI/src/public/Common/NUIConstants.cs

index 4e7f556aadf8a9af67ddb094cf4f6e649eb92fd3..e545ff9141d798b129b8217951ef71668894f201 100755 (executable)
@@ -301,6 +301,12 @@ namespace Tizen.NUI
 
             [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_TextEditor_Property_INPUT_METHOD_SETTINGS_get")]
             public static extern int InputMethodSettingsGet();
+
+            [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_TextEditor_Property_ELLIPSIS_get")]
+            public static extern int EllipsisGet();
+
+            [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_TextEditor_Property_ELLIPSIS_LOCATION_get")]
+            public static extern int EllipsisLocationGet();
         }
     }
 }
index 3fe1152d2dbb3188ee6b0d6206e28093b94432fe..e0edf58c7c490e94572a587b12d93d950d14f4a3 100755 (executable)
@@ -244,6 +244,9 @@ namespace Tizen.NUI
             [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_TextField_Property_ELLIPSIS_get")]
             public static extern int EllipsisGet();
 
+            [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_TextField_Property_ELLIPSIS_LOCATION_get")]
+            public static extern int EllipsisLocationGet();
+
             [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_TextField_SelectWholeText")]
             public static extern void SelectWholeText(global::System.Runtime.InteropServices.HandleRef jarg1);
 
index 893ed95102899b13e47bf0ecde55b06f374aeb05..099b289337bea07d970200b5024ebecca0445053 100755 (executable)
@@ -108,6 +108,9 @@ namespace Tizen.NUI
             [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_TextLabel_Property_ELLIPSIS_get")]
             public static extern int EllipsisGet();
 
+            [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_TextLabel_Property_ELLIPSIS_LOCATION_get")]
+            public static extern int EllipsisLocationGet();
+
             [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_TextLabel_Property_LINE_COUNT_get")]
             public static extern int LineCountGet();
 
index d2fefa1118485e88326577040bb0f487b36350b2..a25fe0530a900e8ab67e85bac3aadf8b2d92b485 100755 (executable)
@@ -38,7 +38,7 @@ namespace Tizen.NUI.BaseComponents
         internal static readonly BindableProperty PointSizeProperty = BindableProperty.Create(nameof(PointSize), typeof(float?), typeof(TextEditorStyle), null,
             propertyChanged: (bindable, oldValue, newValue) => ((TextEditorStyle)bindable).pointSize = (float?)newValue,
             defaultValueCreator: (bindable) => ((TextEditorStyle)bindable).pointSize);
-        
+
         /// <summary> The bindable property of PixelSize. </summary>
         [EditorBrowsable(EditorBrowsableState.Never)]
         internal static readonly BindableProperty PixelSizeProperty = BindableProperty.Create(nameof(PixelSize), typeof(float?), typeof(TextEditorStyle), null,
@@ -218,6 +218,19 @@ namespace Tizen.NUI.BaseComponents
             propertyChanged: (bindable, oldValue, newValue) => ((TextEditorStyle)bindable).fontStyle = (PropertyMap)newValue,
             defaultValueCreator: (bindable) => ((TextEditorStyle)bindable).fontStyle);
 
+        /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public static readonly BindableProperty EllipsisProperty = BindableProperty.Create(nameof(Ellipsis), typeof(bool?), typeof(TextEditorStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
+        {
+            var textEditorStyle = (TextEditorStyle)bindable;
+            textEditorStyle.ellipsis = (bool?)newValue;
+        },
+        defaultValueCreator: (bindable) =>
+        {
+            var textEditorStyle = (TextEditorStyle)bindable;
+            return textEditorStyle.ellipsis;
+        });
+
         private HorizontalAlignment? horizontalAlignment;
         private Vector4 secondaryCursorColor;
         private bool? enableCursorBlink;
@@ -250,6 +263,7 @@ namespace Tizen.NUI.BaseComponents
         private Color placeholderTextColor;
         private Vector4 primaryCursorColor;
         private PropertyMap fontStyle;
+        private bool? ellipsis;
 
         static TextEditorStyle() { }
 
@@ -587,5 +601,13 @@ namespace Tizen.NUI.BaseComponents
             get => (PropertyMap)GetValue(FontStyleProperty);
             set => SetValue(FontStyleProperty, value);
         }
+
+        /// This will be public opened in tizen_6.5 after ACR done. Before ACR, need to be hidden as inhouse API.
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public bool? Ellipsis
+        {
+            get => (bool?)GetValue(EllipsisProperty);
+            set => SetValue(EllipsisProperty, value);
+        }
     }
 }
index 3bd0ccbd3d9310381717d3f3bf8cf1f3893af089..00759caab8422e65954bbecac07d939edc6c1c91 100755 (executable)
@@ -267,6 +267,18 @@ namespace Tizen.NUI.BaseComponents
             var textLabelStyle = (TextLabelStyle)bindable;
             return textLabelStyle.verticalLineAlignment;
         });
+        /// This will be public opened in tizen_6.5 after ACR done. Before ACR, need to be hidden as inhouse API.
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public static readonly BindableProperty EllipsisLocationProperty = BindableProperty.Create(nameof(EllipsisLocation), typeof(EllipsisLocation?), typeof(TextLabelStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
+        {
+            var textLabelStyle = (TextLabelStyle)bindable;
+            textLabelStyle.ellipsisLocation = (EllipsisLocation?)newValue;
+        },
+        defaultValueCreator: (bindable) =>
+        {
+            var textLabelStyle = (TextLabelStyle)bindable;
+            return textLabelStyle.ellipsisLocation;
+        });
         /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
         [EditorBrowsable(EditorBrowsableState.Never)]
         public static readonly BindableProperty MatchSystemLanguageDirectionProperty = BindableProperty.Create(nameof(MatchSystemLanguageDirection), typeof(bool?), typeof(TextLabelStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
@@ -318,6 +330,7 @@ namespace Tizen.NUI.BaseComponents
         private AutoScrollStopMode? autoScrollStopMode;
         private LineWrapMode? lineWrapMode;
         private VerticalLineAlignment? verticalLineAlignment;
+        private EllipsisLocation? ellipsisLocation;
         private bool? matchSystemLanguageDirection;
         private Selector<string> translatableTextSelector;
         private Selector<string> fontFamilySelector;
@@ -489,6 +502,14 @@ namespace Tizen.NUI.BaseComponents
             set => SetValue(VerticalLineAlignmentProperty, value);
         }
 
+        /// This will be public opened in tizen_6.5 after ACR done. Before ACR, need to be hidden as inhouse API.
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public EllipsisLocation? EllipsisLocation
+        {
+            get => (EllipsisLocation?)GetValue(EllipsisLocationProperty);
+            set => SetValue(EllipsisLocationProperty, value);
+        }
+
         /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
         [EditorBrowsable(EditorBrowsableState.Never)]
         public bool? MatchSystemLanguageDirection
index 77ddb52b90d7b58843578cc541d3774d5888539b..638b082e1af02cbacdf04b4b9faa0013fbfba637 100755 (executable)
@@ -1338,6 +1338,47 @@ namespace Tizen.NUI.BaseComponents
             }
         }
 
+        /// <summary>
+        /// The Ellipsis property.<br />
+        /// Enable or disable the ellipsis.<br />
+        /// </summary>
+        /// <since_tizen> 6.5 </since_tizen>
+        /// This will be released at Tizen.NET API Level 6.5, so currently this would be used as inhouse API.
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public bool Ellipsis
+        {
+            get
+            {
+                return (bool)GetValue(EllipsisProperty);
+            }
+            set
+            {
+                SetValue(EllipsisProperty, value);
+                NotifyPropertyChanged();
+            }
+        }
+
+        /// <summary>
+        /// The ellipsis location of the text.
+        /// The ellipsis location type when the text size over the layout size.<br />
+        /// The ellipsis location: End, Start or Middle.<br />
+        /// </summary>
+        /// <since_tizen> 6.5 </since_tizen>
+        /// This will be released at Tizen.NET API Level 6.5, so currently this would be used as inhouse API.
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public EllipsisLocation EllipsisLocation
+        {
+            get
+            {
+                return (EllipsisLocation)GetValue(EllipsisLocationProperty);
+            }
+            set
+            {
+                SetValue(EllipsisLocationProperty, value);
+                NotifyPropertyChanged();
+            }
+        }
+
         /// <summary>
         /// The LineWrapMode property.<br />
         /// The line wrap mode when the text lines over the layout width.<br />
@@ -1790,6 +1831,8 @@ namespace Tizen.NUI.BaseComponents
             internal static readonly int EnableGrabHandle = Interop.TextEditor.EnableGrabHandleGet();
             internal static readonly int EnableGrabHandlePopup = Interop.TextEditor.EnableGrabHandlePopupGet();
             internal static readonly int InputMethodSettings = Interop.TextEditor.InputMethodSettingsGet();
+            internal static readonly int ELLIPSIS = Interop.TextEditor.EllipsisGet();
+            internal static readonly int EllipsisLocation = Interop.TextEditor.EllipsisLocationGet();
         }
 
         internal class InputStyle
index 718e79e35015e6a9463e9f6961052adde320496f..b780f72bc44eccab48cb845a4342d2f1bc298915 100755 (executable)
@@ -1024,5 +1024,39 @@ namespace Tizen.NUI.BaseComponents
             Tizen.NUI.Object.GetProperty((System.Runtime.InteropServices.HandleRef)textEditor.SwigCPtr, TextEditor.Property.InputMethodSettings).Get(temp);
             return temp;
         }));
+        /// This will be public opened in tizen_6.5 after ACR done. Before ACR, need to be hidden as inhouse API.
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public static readonly BindableProperty EllipsisProperty = BindableProperty.Create(nameof(TextEditor.Ellipsis), typeof(bool), typeof(TextEditor), false, propertyChanged: (BindableProperty.BindingPropertyChangedDelegate)((bindable, oldValue, newValue) =>
+        {
+            var textEditor = (TextEditor)bindable;
+            if (newValue != null)
+            {
+                Tizen.NUI.Object.SetProperty((System.Runtime.InteropServices.HandleRef)textEditor.SwigCPtr, TextEditor.Property.ELLIPSIS, new Tizen.NUI.PropertyValue((bool)newValue));
+            }
+        }),
+        defaultValueCreator: (BindableProperty.CreateDefaultValueDelegate)((bindable) =>
+        {
+            var textEditor = (TextEditor)bindable;
+            bool temp = false;
+            Tizen.NUI.Object.GetProperty((System.Runtime.InteropServices.HandleRef)textEditor.SwigCPtr, TextEditor.Property.ELLIPSIS).Get(out temp);
+            return temp;
+        }));
+        /// This will be public opened in tizen_6.5 after ACR done. Before ACR, need to be hidden as inhouse API.
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public static readonly BindableProperty EllipsisLocationProperty = BindableProperty.Create(nameof(EllipsisLocation), typeof(EllipsisLocation), typeof(TextEditor), EllipsisLocation.End, propertyChanged: (BindableProperty.BindingPropertyChangedDelegate)((bindable, oldValue, newValue) =>
+        {
+            var textEditor = (TextEditor)bindable;
+            if (newValue != null)
+            {
+                Tizen.NUI.Object.SetProperty((System.Runtime.InteropServices.HandleRef)textEditor.SwigCPtr, TextEditor.Property.EllipsisLocation, new Tizen.NUI.PropertyValue((int)newValue));
+            }
+        }),
+        defaultValueCreator: (BindableProperty.CreateDefaultValueDelegate)((bindable) =>
+        {
+            var textEditor = (TextEditor)bindable;
+            int temp = 0;
+            Tizen.NUI.Object.GetProperty((System.Runtime.InteropServices.HandleRef)textEditor.SwigCPtr, TextEditor.Property.EllipsisLocation).Get(out temp);
+            return (EllipsisLocation)temp;
+        }));
     }
 }
index b332ed7d4957f519069db5d9bf86159b283ecdce..5d96c1762eee431dbbad1019a467a506714d4e76 100755 (executable)
@@ -952,6 +952,23 @@ namespace Tizen.NUI.BaseComponents
             Tizen.NUI.Object.GetProperty((System.Runtime.InteropServices.HandleRef)textField.SwigCPtr, TextField.Property.ELLIPSIS).Get(out temp);
             return temp;
         }));
+        /// This will be public opened in tizen_6.5 after ACR done. Before ACR, need to be hidden as inhouse API.
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public static readonly BindableProperty EllipsisLocationProperty = BindableProperty.Create(nameof(EllipsisLocation), typeof(EllipsisLocation), typeof(TextField), EllipsisLocation.End, propertyChanged: (BindableProperty.BindingPropertyChangedDelegate)((bindable, oldValue, newValue) =>
+        {
+            var textField = (TextField)bindable;
+            if (newValue != null)
+            {
+                Tizen.NUI.Object.SetProperty((System.Runtime.InteropServices.HandleRef)textField.SwigCPtr, TextField.Property.EllipsisLocation, new Tizen.NUI.PropertyValue((int)newValue));
+            }
+        }),
+        defaultValueCreator: (BindableProperty.CreateDefaultValueDelegate)((bindable) =>
+        {
+            var textField = (TextField)bindable;
+            int temp = 0;
+            Tizen.NUI.Object.GetProperty((System.Runtime.InteropServices.HandleRef)textField.SwigCPtr, TextField.Property.EllipsisLocation).Get(out temp);
+            return (EllipsisLocation)temp;
+        }));
         /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
         [EditorBrowsable(EditorBrowsableState.Never)]
         public static readonly BindableProperty EnableShiftSelectionProperty = BindableProperty.Create(nameof(TextField.EnableShiftSelection), typeof(bool), typeof(TextField), false, propertyChanged: (BindableProperty.BindingPropertyChangedDelegate)((bindable, oldValue, newValue) =>
index d3a36b97f7600624b9c8228c0531c1fd7f9bd91e..2e73c7ad24407d83bd1e8bae2a6cfac1319f2152 100755 (executable)
@@ -781,6 +781,27 @@ namespace Tizen.NUI.BaseComponents
             }
         }
 
+        /// <summary>
+        /// The ellipsis location of the text.
+        /// The ellipsis location type when the text size over the layout size.<br />
+        /// The ellipsis location: End, Start or Middle.<br />
+        /// </summary>
+        /// <since_tizen> 6.5 </since_tizen>
+        /// This will be released at Tizen.NET API Level 6.5, so currently this would be used as inhouse API.
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public EllipsisLocation EllipsisLocation
+        {
+            get
+            {
+                return (EllipsisLocation)GetValue(EllipsisLocationProperty);
+            }
+            set
+            {
+                SetValue(EllipsisLocationProperty, value);
+                NotifyPropertyChanged();
+            }
+        }
+
         /// <summary>
         /// The AutoScrollLoopDelay property.<br />
         /// Do something.<br />
@@ -1156,6 +1177,7 @@ namespace Tizen.NUI.BaseComponents
             internal static readonly int TextFit = Interop.TextLabel.TextFitGet();
             internal static readonly int MinLineSize = Interop.TextLabel.MinLineSizeGet();
             internal static readonly int FontSizeScale = Interop.TextLabel.FontSizeScaleGet();
+            internal static readonly int EllipsisLocation = Interop.TextLabel.EllipsisLocationGet();
         }
 
         private void OnShadowColorChanged(float x, float y, float z, float w)
index a77a2d4e7a1af9f1cb7e7c386ef064bbf76147b0..a2e06f111b138e966134ac17194fead91fa7d93f 100755 (executable)
@@ -459,6 +459,23 @@ namespace Tizen.NUI.BaseComponents
             Tizen.NUI.Object.GetProperty((System.Runtime.InteropServices.HandleRef)textLabel.SwigCPtr, TextLabel.Property.ELLIPSIS).Get(out temp);
             return temp;
         }));
+        /// This will be public opened in tizen_6.5 after ACR done. Before ACR, need to be hidden as inhouse API.
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public static readonly BindableProperty EllipsisLocationProperty = BindableProperty.Create(nameof(EllipsisLocation), typeof(EllipsisLocation), typeof(TextLabel), EllipsisLocation.End, propertyChanged: (BindableProperty.BindingPropertyChangedDelegate)((bindable, oldValue, newValue) =>
+        {
+            var textLabel = (TextLabel)bindable;
+            if (newValue != null)
+            {
+                Tizen.NUI.Object.SetProperty((System.Runtime.InteropServices.HandleRef)textLabel.SwigCPtr, TextLabel.Property.EllipsisLocation, new Tizen.NUI.PropertyValue((int)newValue));
+            }
+        }),
+        defaultValueCreator: (BindableProperty.CreateDefaultValueDelegate)((bindable) =>
+        {
+            var textLabel = (TextLabel)bindable;
+            int temp = 0;
+            Tizen.NUI.Object.GetProperty((System.Runtime.InteropServices.HandleRef)textLabel.SwigCPtr, TextLabel.Property.EllipsisLocation).Get(out temp);
+            return (EllipsisLocation)temp;
+        }));
         /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
         [EditorBrowsable(EditorBrowsableState.Never)]
         public static readonly BindableProperty AutoScrollLoopDelayProperty = BindableProperty.Create(nameof(AutoScrollLoopDelay), typeof(float), typeof(TextLabel), default(float), propertyChanged: (BindableProperty.BindingPropertyChangedDelegate)((bindable, oldValue, newValue) =>
index 606ea7ca5cb2a04546f4f2a4eca03b593024dc88..d4874b2bd6c965ea2ff3cabbedd05d5479fed139 100755 (executable)
@@ -883,6 +883,31 @@ namespace Tizen.NUI
         Bottom
     }
 
+    /// <summary>
+    /// An enum of ellipsis location.
+    /// </summary>
+    /// <since_tizen> 6 </since_tizen>
+    public enum EllipsisLocation
+    {
+        /// <summary>
+        /// ellipsis location at end.
+        /// </summary>
+        /// <since_tizen> 6 </since_tizen>
+        End,
+
+        /// <summary>
+        /// ellipsis location at start.
+        /// </summary>
+        /// <since_tizen> 6 </since_tizen>
+        Start,
+
+        /// <summary>
+        /// ellipsis location in middle.
+        /// </summary>
+        /// <since_tizen> 6 </since_tizen>
+        Middle
+    }
+
     /// <summary>
     /// Enumeration type for the font's slant.
     /// </summary>