X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=src%2FTizen.NUI%2Fsrc%2Fpublic%2FBaseComponents%2FTextLabel.cs;h=91e3659214067d0fc08d7426cb62d0cdeb0835b1;hb=4154ae280c05e5132e270ead3d7808ac9c6980f9;hp=84f19b81898739ebe94ddb8de9b874fc262ced29;hpb=ac1c95426e88d3dcbcb35e3ea11a4adf1678c748;p=platform%2Fcore%2Fcsapi%2Ftizenfx.git diff --git a/src/Tizen.NUI/src/public/BaseComponents/TextLabel.cs b/src/Tizen.NUI/src/public/BaseComponents/TextLabel.cs index 84f19b8..91e3659 100755 --- a/src/Tizen.NUI/src/public/BaseComponents/TextLabel.cs +++ b/src/Tizen.NUI/src/public/BaseComponents/TextLabel.cs @@ -1,5 +1,5 @@ /* - * Copyright(c) 2020 Samsung Electronics Co., Ltd. + * Copyright(c) 2021 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,9 +17,11 @@ extern alias TizenSystemSettings; using TizenSystemSettings.Tizen.System; + using System; using System.Globalization; using System.ComponentModel; +using Tizen.NUI.Text; using Tizen.NUI.Binding; namespace Tizen.NUI.BaseComponents @@ -49,17 +51,23 @@ namespace Tizen.NUI.BaseComponents } else { + var minSize = Owner.MinimumSize; + var maxSize = Owner.MaximumSize; + var naturalSize = Owner.GetNaturalSize(); + if (heightMeasureSpec.Mode == MeasureSpecification.ModeType.Exactly) { // GetWidthForHeight is not implemented. - totalWidth = Owner.GetNaturalSize().Width; + float width = naturalSize != null ? naturalSize.Width : 0; + totalWidth = Math.Min(Math.Max(width, minSize.Width), (maxSize.Width < 0 ? Int32.MaxValue : maxSize.Width)); widthMeasureSpec = new MeasureSpecification(new LayoutLength(totalWidth), MeasureSpecification.ModeType.Exactly); } else { - Vector3 naturalSize = Owner.GetNaturalSize(); - totalWidth = naturalSize.Width; - totalHeight = naturalSize.Height; + float width = naturalSize != null ? naturalSize.Width : 0; + float height = naturalSize != null ? naturalSize.Height : 0; + totalWidth = Math.Min(Math.Max(width, minSize.Width), (maxSize.Width < 0 ? Int32.MaxValue : maxSize.Width)); + totalHeight = Math.Min(Math.Max(height, minSize.Height), (maxSize.Height < 0 ? Int32.MaxValue : maxSize.Height)); heightMeasureSpec = new MeasureSpecification(new LayoutLength(totalHeight), MeasureSpecification.ModeType.Exactly); widthMeasureSpec = new MeasureSpecification(new LayoutLength(totalWidth), MeasureSpecification.ModeType.Exactly); @@ -76,35 +84,33 @@ namespace Tizen.NUI.BaseComponents static TextLabel() { } + private static SystemFontTypeChanged systemFontTypeChanged = new SystemFontTypeChanged(); + private static SystemLocaleLanguageChanged systemLocaleLanguageChanged = new SystemLocaleLanguageChanged(); + static private string defaultStyleName = "Tizen.NUI.BaseComponents.TextLabel"; + static private string defaultFontFamily = "BreezeSans"; private string textLabelSid = null; - private bool systemlangTextFlag = false; private TextLabelSelectorData selectorData; + private string fontFamily = defaultFontFamily; + private float fontSizeScale = 1.0f; + private bool hasSystemLanguageChanged = false; + private bool hasSystemFontSizeChanged = false; + private bool hasSystemFontTypeChanged = false; - /// - /// Return a copied Style instance of the TextLabel. - /// - /// - /// It returns copied style instance so that changing it does not effect to the view. - /// Style setting is possible by using constructor or the function of . - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public TextLabelStyle Style => new TextLabelStyle(this); + private Color internalTextColor; /// /// Creates the TextLabel control. /// /// 3 - public TextLabel() : this(Interop.TextLabel.TextLabel_New__SWIG_0(), true) + public TextLabel() : this(Interop.TextLabel.New(ThemeManager.GetStyle(defaultStyleName) == null ? false : true), true) { if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - Layout = new TextLayout(); } /// This will be public opened in next release of tizen after ACR done. Before ACR, it is used as HiddenAPI (InhouseAPI). [EditorBrowsable(EditorBrowsableState.Never)] - public TextLabel(TextLabelStyle viewStyle) : this(Interop.TextLabel.TextLabel_New__SWIG_0(), true, viewStyle) + public TextLabel(TextLabelStyle viewStyle) : this(Interop.TextLabel.New(ThemeManager.GetStyle(defaultStyleName) == null ? false : true), true, viewStyle) { - Layout = new TextLayout(); } /// @@ -113,10 +119,9 @@ namespace Tizen.NUI.BaseComponents /// false : Not displayed (hidden), true : displayed (shown) /// This will be public opened in next release of tizen after ACR done. Before ACR, it is used as HiddenAPI (InhouseAPI). [EditorBrowsable(EditorBrowsableState.Never)] - public TextLabel(bool shown) : this(Interop.TextLabel.TextLabel_New__SWIG_0(), true) + public TextLabel(bool shown) : this(Interop.TextLabel.New(ThemeManager.GetStyle(defaultStyleName) == null ? false : true), true) { if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - Layout = new TextLayout(); SetVisible(shown); } @@ -125,10 +130,9 @@ namespace Tizen.NUI.BaseComponents /// /// The text to display /// 3 - public TextLabel(string text) : this(Interop.TextLabel.TextLabel_New__SWIG_1(text), true) + public TextLabel(string text) : this(Interop.TextLabel.New(text, ThemeManager.GetStyle(defaultStyleName) == null ? false : true), true) { if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - Layout = new TextLayout(); } /// @@ -138,14 +142,13 @@ namespace Tizen.NUI.BaseComponents /// false : Not displayed (hidden), true : displayed (shown) /// This will be public opened in next release of tizen after ACR done. Before ACR, it is used as HiddenAPI (InhouseAPI). [EditorBrowsable(EditorBrowsableState.Never)] - public TextLabel(string text, bool shown) : this(Interop.TextLabel.TextLabel_New__SWIG_1(text), true) + public TextLabel(string text, bool shown) : this(Interop.TextLabel.New(text, ThemeManager.GetStyle(defaultStyleName) == null ? false : true), true) { if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - Layout = new TextLayout(); SetVisible(shown); } - internal TextLabel(TextLabel handle, bool shown = true) : this(Interop.TextLabel.new_TextLabel__SWIG_1(TextLabel.getCPtr(handle)), true) + internal TextLabel(TextLabel handle, bool shown = true) : this(Interop.TextLabel.NewTextLabel(TextLabel.getCPtr(handle)), true) { if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); @@ -155,7 +158,7 @@ namespace Tizen.NUI.BaseComponents } } - internal TextLabel(global::System.IntPtr cPtr, bool cMemoryOwn, ViewStyle viewStyle, bool shown = true) : base(Interop.TextLabel.TextLabel_SWIGUpcast(cPtr), cMemoryOwn, viewStyle) + internal TextLabel(global::System.IntPtr cPtr, bool cMemoryOwn, ViewStyle viewStyle, bool shown = true) : base(cPtr, cMemoryOwn, viewStyle) { if (!shown) { @@ -163,16 +166,19 @@ namespace Tizen.NUI.BaseComponents } } - internal TextLabel(global::System.IntPtr cPtr, bool cMemoryOwn, bool shown = true) : base(Interop.TextLabel.TextLabel_SWIGUpcast(cPtr), cMemoryOwn) + internal TextLabel(global::System.IntPtr cPtr, bool cMemoryOwn, bool shown = true) : base(cPtr, cMemoryOwn, null) { - ApplyStyle(ThemeManager.GetStyle(nameof(TextLabel))); - if (!shown) { SetVisible(false); } } + private bool HasStyle() + { + return ThemeManager.GetStyle(this.GetType()) == null ? false : true; + } + /// /// The TranslatableText property.
/// The text can set the SID value.
@@ -190,7 +196,6 @@ namespace Tizen.NUI.BaseComponents set { SetValue(TranslatableTextProperty, value); - selectorData?.TranslatableText.UpdateIfNeeds(this, value); } } private string translatableText @@ -203,7 +208,7 @@ namespace Tizen.NUI.BaseComponents { if (NUIApplication.MultilingualResourceManager == null) { - throw new ArgumentNullException("ResourceManager about multilingual is null"); + throw new ArgumentNullException(null, "ResourceManager about multilingual is null"); } string translatableText = null; textLabelSid = value; @@ -211,10 +216,10 @@ namespace Tizen.NUI.BaseComponents if (translatableText != null) { Text = translatableText; - if (systemlangTextFlag == false) + if (hasSystemLanguageChanged == false) { - SystemSettings.LocaleLanguageChanged += new WeakEventHandler(SystemSettings_LocaleLanguageChanged).Handler; - systemlangTextFlag = true; + systemLocaleLanguageChanged.Add(SystemSettingsLocaleLanguageChanged); + hasSystemLanguageChanged = true; } } else @@ -239,8 +244,7 @@ namespace Tizen.NUI.BaseComponents set { SetValue(TextProperty, value); - selectorData?.Text.UpdateIfNeeds(this, value); - NotifyPropertyChangedAndRequestLayout(); + NotifyPropertyChanged(); } } @@ -258,16 +262,67 @@ namespace Tizen.NUI.BaseComponents set { SetValue(FontFamilyProperty, value); - selectorData?.FontFamily.UpdateIfNeeds(this, value); - NotifyPropertyChangedAndRequestLayout(); + NotifyPropertyChanged(); } } + private string InternalFontFamily + { + get + { + if (HasStyle()) + return fontFamily; + else + return Object.InternalGetPropertyString(this.SwigCPtr, TextLabel.Property.FontFamily); + } + set + { + string newFontFamily; + + if (string.Equals(fontFamily, value)) return; + + fontFamily = value; + if (fontFamily == Tizen.NUI.FontFamily.UseSystemSetting) + { + try + { + newFontFamily = SystemSettings.FontType; + } + catch (Exception e) + { + Console.WriteLine("{0} Exception caught.", e); + newFontFamily = defaultFontFamily; + } + AddSystemSettingsFontTypeChanged(); + } + else + { + newFontFamily = fontFamily; + RemoveSystemSettingsFontTypeChanged(); + } + + SetInternalFontFamily(newFontFamily); + } + } + + private void SetInternalFontFamily(string fontFamily) + { + Object.InternalSetPropertyString(this.SwigCPtr, TextLabel.Property.FontFamily, (string)fontFamily); + RequestLayout(); + } + /// /// The FontStyle property.
/// The requested font style to use.
+ /// The fontStyle map contains the following keys :
+ /// + /// width (string)The width key defines occupied by each glyph. (values: ultraCondensed, extraCondensed, condensed, semiCondensed, normal, semiExpanded, expanded, extraExpanded, ultraExpanded) + /// weight (string)The weight key defines the thickness or darkness of the glyphs. (values: thin, ultraLight, extraLight, light, demiLight, semiLight, book, normal, regular, medium, demiBold, semiBold, bold, ultraBold, extraBold, black, heavy, extraBlack) + /// slant (string)The slant key defines whether to use italics. (values: normal, roman, italic, oblique) + /// ///
/// 3 + [System.Diagnostics.CodeAnalysis.SuppressMessage("Naming", "CA1721: Property names should not match get methods")] public PropertyMap FontStyle { get @@ -277,15 +332,60 @@ namespace Tizen.NUI.BaseComponents set { SetValue(FontStyleProperty, value); - NotifyPropertyChangedAndRequestLayout(); + NotifyPropertyChanged(); } } /// + /// Set FontStyle to TextLabel.
+ ///
+ /// The FontStyle + /// + /// SetFontStyle specifies the requested font style through .
+ ///
+ /// + /// The following example demonstrates how to use the SetFontStyle method. + /// + /// var fontStyle = new Tizen.NUI.Text.FontStyle(); + /// fontStyle.Width = FontWidthType.Expanded; + /// fontStyle.Weight = FontWeightType.Bold; + /// fontStyle.Slant = FontSlantType.Italic; + /// label.SetFontStyle(fontStyle); + /// + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public void SetFontStyle(FontStyle fontStyle) + { + using (var fontStyleMap = TextMapHelper.GetFontStyleMap(fontStyle)) + { + SetValue(FontStyleProperty, fontStyleMap); + } + } + + /// + /// Get FontStyle from TextLabel.
+ ///
+ /// The FontStyle + /// + /// + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public FontStyle GetFontStyle() + { + FontStyle fontStyle; + using (var fontStyleMap = (PropertyMap)GetValue(FontStyleProperty)) + { + fontStyle = TextMapHelper.GetFontStyleStruct(fontStyleMap); + } + return fontStyle; + } + + /// /// The PointSize property.
/// The size of font in points.
///
/// 3 + [Binding.TypeConverter(typeof(PointSizeTypeConverter))] public float PointSize { get @@ -295,8 +395,7 @@ namespace Tizen.NUI.BaseComponents set { SetValue(PointSizeProperty, value); - selectorData?.PointSize.UpdateIfNeeds(this, value); - NotifyPropertyChangedAndRequestLayout(); + NotifyPropertyChanged(); } } @@ -314,7 +413,7 @@ namespace Tizen.NUI.BaseComponents set { SetValue(MultiLineProperty, value); - NotifyPropertyChangedAndRequestLayout(); + NotifyPropertyChanged(); } } @@ -374,7 +473,6 @@ namespace Tizen.NUI.BaseComponents set { SetValue(TextColorProperty, value); - selectorData?.TextColor.UpdateIfNeeds(this, value); NotifyPropertyChanged(); } } @@ -388,25 +486,48 @@ namespace Tizen.NUI.BaseComponents /// Deprecated.(API Level 6) Use Shadow instead. /// The property cascade chaining set is possible. For example, this (textLabel.ShadowOffset.X = 0.1f;) is possible. /// - [Obsolete("Please do not use this ShadowOffset(Deprecated). Please use Shadow instead.")] + [Obsolete("Do not use this ShadowOffset(Deprecated). Use Shadow instead.")] public Vector2 ShadowOffset { get { - Vector2 shadowOffset = new Vector2(); - Shadow.Find(TextLabel.Property.SHADOW, "offset")?.Get(shadowOffset); - return new Vector2(OnShadowOffsetChanged, shadowOffset.X, shadowOffset.Y); + return GetValue(ShadowOffsetProperty) as Vector2; } set { - PropertyMap temp = new PropertyMap(); - temp.Insert("offset", new PropertyValue(value)); + SetValue(ShadowOffsetProperty, value); + } + } - PropertyMap shadowMap = Shadow; - shadowMap.Merge(temp); + private Vector2 InternalShadowOffset + { + get + { + float x = 0.0f, y = 0.0f; + using (var propertyValue = Shadow.Find(TextLabel.Property.SHADOW, "offset")) + using (var shadowOffset = new Vector2()) + { + if (null != propertyValue) + { + propertyValue.Get(shadowOffset); + x = shadowOffset.X; + y = shadowOffset.Y; + } + } + return new Vector2(OnShadowOffsetChanged, x, y); + } + set + { + using (var map = new PropertyMap()) + { + map.Add("offset", value); - SetValue(ShadowProperty, shadowMap); - NotifyPropertyChanged(); + var shadowMap = Shadow; + shadowMap.Merge(map); + + SetValue(ShadowProperty, shadowMap); + NotifyPropertyChanged(); + } } } @@ -419,25 +540,48 @@ namespace Tizen.NUI.BaseComponents /// Deprecated.(API Level 6) Use Shadow instead. /// The property cascade chaining set is possible. For example, this (textLabel.ShadowColor.X = 0.1f;) is possible. /// - [Obsolete("Please do not use this ShadowColor(Deprecated). Please use Shadow instead.")] + [Obsolete("Do not use this ShadowColor(Deprecated). Use Shadow instead.")] public Vector4 ShadowColor { get { - Vector4 shadowColor = new Vector4(); - Shadow.Find(TextLabel.Property.SHADOW, "color")?.Get(shadowColor); - return new Vector4(OnShadowColorChanged, shadowColor.X, shadowColor.Y, shadowColor.Z, shadowColor.W); + return GetValue(ShadowColorProperty) as Vector4; } set { - PropertyMap temp = new PropertyMap(); - temp.Insert("color", new PropertyValue(value)); - - PropertyMap shadowMap = Shadow; - shadowMap.Merge(temp); + SetValue(ShadowColorProperty, value); + } + } - SetValue(ShadowProperty, shadowMap); - NotifyPropertyChanged(); + private Vector4 InternalShadowColor + { + get + { + float x = 0.0f, y = 0.0f, z = 0.0f, w = 0.0f; + using (var propertyValue = Shadow.Find(TextLabel.Property.SHADOW, "color")) + using (var shadowColor = new Vector4()) + { + if (null != propertyValue) + { + propertyValue.Get(shadowColor); + x = shadowColor.X; + y = shadowColor.Y; + z = shadowColor.Z; + w = shadowColor.W; + } + } + return new Vector4(OnShadowColorChanged, x, y, z, w); + } + set + { + using (var map = new PropertyMap()) + { + map.Add("color", value); + var shadowMap = Shadow; + shadowMap.Merge(map); + SetValue(ShadowProperty, shadowMap); + NotifyPropertyChanged(); + } } } @@ -449,26 +593,43 @@ namespace Tizen.NUI.BaseComponents /// /// Deprecated.(API Level 6) Use Underline instead. /// - [Obsolete("Please do not use this UnderlineEnabled(Deprecated). Please use Underline instead.")] + [Obsolete("Do not use this UnderlineEnabled(Deprecated). Use Underline instead.")] public bool UnderlineEnabled { get { + return (bool)GetValue(UnderlineEnabledProperty); + } + set + { + SetValue(UnderlineEnabledProperty, value); + } + } + + private bool InternalUnderlineEnabled + { + get + { bool underlineEnabled = false; - Underline.Find(TextLabel.Property.UNDERLINE, "enable")?.Get(out underlineEnabled); + using (var propertyValue = Underline.Find(TextLabel.Property.UNDERLINE, "enable")) + { + if (propertyValue != null) + { + propertyValue.Get(out underlineEnabled); + } + } return underlineEnabled; } set { - PropertyMap temp = new PropertyMap(); - temp.Add("enable", new PropertyValue(value)); - - PropertyMap undelineMap = Underline; - undelineMap.Merge(temp); - - SetValue(UnderlineProperty, undelineMap); - NotifyPropertyChanged(); - + using (var map = new PropertyMap()) + { + map.Add("enable", value); + var undelineMap = Underline; + undelineMap.Merge(map); + SetValue(UnderlineProperty, undelineMap); + NotifyPropertyChanged(); + } } } @@ -481,25 +642,48 @@ namespace Tizen.NUI.BaseComponents /// Deprecated.(API Level 6) Use Underline instead. /// The property cascade chaining set is possible. For example, this (textLabel.UnderlineColor.X = 0.1f;) is possible. /// - [Obsolete("Please do not use this UnderlineColor(Deprecated). Please use Underline instead.")] + [Obsolete("Do not use this UnderlineColor(Deprecated). Use Underline instead.")] public Vector4 UnderlineColor { get { - Vector4 underlineColor = new Vector4(); - Underline.Find(TextLabel.Property.UNDERLINE, "color")?.Get(underlineColor); - return new Vector4(OnUnderlineColorChanged, underlineColor.X, underlineColor.Y, underlineColor.Z, underlineColor.W); + return GetValue(UnderlineColorProperty) as Vector4; } set { - PropertyMap temp = new PropertyMap(); - temp.Insert("color", new PropertyValue(value)); - - PropertyMap undelineMap = Underline; - undelineMap.Merge(temp); + SetValue(UnderlineColorProperty, value); + } + } - SetValue(UnderlineProperty, undelineMap); - NotifyPropertyChanged(); + private Vector4 InternalUnderlineColor + { + get + { + float x = 0.0f, y = 0.0f, z = 0.0f, w = 0.0f; + using (var propertyValue = Underline.Find(TextLabel.Property.UNDERLINE, "color")) + using (var underlineColor = new Vector4()) + { + if (null != propertyValue) + { + propertyValue.Get(underlineColor); + x = underlineColor.X; + y = underlineColor.Y; + z = underlineColor.Z; + w = underlineColor.W; + } + } + return new Vector4(OnUnderlineColorChanged, x, y, z, w); + } + set + { + using (var map = new PropertyMap()) + { + map.Add("color", value); + var undelineMap = Underline; + undelineMap.Merge(map); + SetValue(UnderlineProperty, undelineMap); + NotifyPropertyChanged(); + } } } @@ -511,25 +695,43 @@ namespace Tizen.NUI.BaseComponents /// /// Deprecated.(API Level 6) Use Underline instead. /// - [Obsolete("Please do not use this UnderlineHeight(Deprecated). Please use Underline instead.")] + [Obsolete("Do not use this UnderlineHeight(Deprecated). Use Underline instead.")] public float UnderlineHeight { get { + return (float)GetValue(UnderlineHeightProperty); + } + set + { + SetValue(UnderlineHeightProperty, value); + } + } + + private float InternalUnderlineHeight + { + get + { float underlineHeight = 0.0f; - Underline.Find(TextLabel.Property.UNDERLINE, "height")?.Get(out underlineHeight); + using (var propertyValue = Underline.Find(TextLabel.Property.UNDERLINE, "height")) + { + if (null != propertyValue) + { + propertyValue.Get(out underlineHeight); + } + } return underlineHeight; } set { - PropertyMap temp = new PropertyMap(); - temp.Insert("height", new PropertyValue(value)); - - PropertyMap undelineMap = Underline; - undelineMap.Merge(temp); - - SetValue(UnderlineProperty, undelineMap); - NotifyPropertyChanged(); + using (var map = new PropertyMap()) + { + map.Add("height", value); + var undelineMap = Underline; + undelineMap.Merge(map); + SetValue(UnderlineProperty, undelineMap); + NotifyPropertyChanged(); + } } } @@ -637,15 +839,40 @@ namespace Tizen.NUI.BaseComponents set { SetValue(LineSpacingProperty, value); - NotifyPropertyChangedAndRequestLayout(); + NotifyPropertyChanged(); + } + } + + /// + /// The relative height of the line (a factor that will be multiplied by text height).
+ /// If the value is less than 1, the lines could to be overlapped. + ///
+ [EditorBrowsable(EditorBrowsableState.Never)] + public float RelativeLineHeight + { + get + { + return (float)GetValue(RelativeLineHeightProperty); + } + set + { + SetValue(RelativeLineHeightProperty, value); + NotifyPropertyChanged(); } } /// /// The Underline property.
/// The default underline parameters.
+ /// The underline map contains the following keys :
+ /// + /// enable (bool)Whether the underline is enabled (the default value is false) + /// color (Color)The color of the underline (If not provided then the color of the text is used) + /// height (float)The height in pixels of the underline (the default value is 1.f) + /// ///
/// 3 + [System.Diagnostics.CodeAnalysis.SuppressMessage("Naming", "CA1721: Property names should not match get methods")] public PropertyMap Underline { get @@ -660,10 +887,61 @@ namespace Tizen.NUI.BaseComponents } /// + /// Set Underline to TextLabel.
+ ///
+ /// The Underline + /// + /// SetUnderline specifies the underline of the text through .
+ ///
+ /// + /// The following example demonstrates how to use the SetUnderline method. + /// + /// var underline = new Tizen.NUI.Text.Underline(); + /// underline.Enable = true; + /// underline.Color = new Color("#3498DB"); + /// underline.Height = 2.0f; + /// label.SetUnderline(underline); + /// + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public void SetUnderline(Underline underline) + { + using (var underlineMap = TextMapHelper.GetUnderlineMap(underline)) + { + SetValue(UnderlineProperty, underlineMap); + } + } + + /// + /// Get Underline from TextLabel.
+ ///
+ /// The Underline + /// + /// + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public Underline GetUnderline() + { + Underline underline; + using (var underlineMap = (PropertyMap)GetValue(UnderlineProperty)) + { + underline = TextMapHelper.GetUnderlineStruct(underlineMap); + } + return underline; + } + + /// /// The Shadow property.
/// The default shadow parameters.
+ /// The shadow map contains the following keys :
+ /// + /// color (Color)The color of the shadow (the default color is Color.Black) + /// offset (Vector2)The offset in pixels of the shadow (If not provided then the shadow is not enabled) + /// blurRadius (float)The radius of the Gaussian blur for the soft shadow (If not provided then the soft shadow is not enabled) + /// ///
/// 3 + [System.Diagnostics.CodeAnalysis.SuppressMessage("Naming", "CA1721: Property names should not match get methods")] public PropertyMap Shadow { get @@ -678,6 +956,50 @@ namespace Tizen.NUI.BaseComponents } /// + /// Set Shadow to TextLabel.
+ ///
+ /// The Shadow + /// + /// SetShadow specifies the shadow of the text through .
+ ///
+ /// + /// The following example demonstrates how to use the SetShadow method. + /// + /// var shadow = new Tizen.NUI.Text.Shadow(); + /// shadow.Offset = new Vector2(3, 3); + /// shadow.Color = new Color("#F1C40F"); + /// shadow.BlurRadius = 4.0f; + /// label.SetShadow(shadow); + /// + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public void SetShadow(Tizen.NUI.Text.Shadow shadow) + { + using (var shadowMap = TextMapHelper.GetShadowMap(shadow)) + { + SetValue(ShadowProperty, shadowMap); + } + } + + /// + /// Get Shadow from TextLabel.
+ ///
+ /// The Shadow + /// + /// + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public Tizen.NUI.Text.Shadow GetShadow() + { + Tizen.NUI.Text.Shadow shadow; + using (var shadowMap = (PropertyMap)GetValue(ShadowProperty)) + { + shadow = TextMapHelper.GetShadowStruct(shadowMap); + } + return shadow; + } + + /// /// Describes a text shadow for a TextLabel. /// It is null by default. /// @@ -691,7 +1013,6 @@ namespace Tizen.NUI.BaseComponents set { SetValue(TextShadowProperty, value); - selectorData?.TextShadow.UpdateIfNeeds(this, value); NotifyPropertyChanged(); } } @@ -717,8 +1038,14 @@ namespace Tizen.NUI.BaseComponents /// /// The Outline property.
/// The default outline parameters.
+ /// The outline map contains the following keys :
+ /// + /// color (Color)The color of the outline (the default color is Color.White) + /// width (float)The width in pixels of the outline (If not provided then the outline is not enabled) + /// ///
/// 3 + [System.Diagnostics.CodeAnalysis.SuppressMessage("Naming", "CA1721: Property names should not match get methods")] public PropertyMap Outline { get @@ -733,10 +1060,101 @@ namespace Tizen.NUI.BaseComponents } /// + /// Set Outline to TextLabel.
+ ///
+ /// The Outline + /// + /// SetOutline specifies the outline of the text through .
+ ///
+ /// + /// The following example demonstrates how to use the SetOutline method. + /// + /// var outline = new Tizen.NUI.Text.Outline(); + /// outline.Width = 2.0f; + /// outline.Color = new Color("#45B39D"); + /// label.SetOutline(outline); + /// + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public void SetOutline(Outline outline) + { + using (var outlineMap = TextMapHelper.GetOutlineMap(outline)) + { + SetValue(OutlineProperty, outlineMap); + } + } + + /// + /// Get Outline from TextLabel.
+ ///
+ /// The Outline + /// + /// + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public Outline GetOutline() + { + Outline outline; + using (var outlineMap = (PropertyMap)GetValue(OutlineProperty)) + { + outline = TextMapHelper.GetOutlineStruct(outlineMap); + } + return outline; + } + + /// + /// Set Strikethrough to TextLabel.
+ ///
+ /// The Strikethrough + /// + /// SetStrikethrough specifies the strikethrough of the text through .
+ ///
+ /// + /// The following example demonstrates how to use the SetStrikethrough method. + /// + /// var strikethrough = new Tizen.NUI.Text.Strikethrough(); + /// strikethrough.Enable = true; + /// strikethrough.Color = new Color("#3498DB"); + /// strikethrough.Height = 2.0f; + /// label.SetStrikethrough(strikethrough); + /// + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public void SetStrikethrough(Strikethrough strikethrough) + { + using (var map = TextMapHelper.GetStrikethroughMap(strikethrough)) + using (var propertyValue = new PropertyValue(map)) + { + SetProperty(TextLabel.Property.Strikethrough, propertyValue); + } + } + + /// + /// Get Strikethrough from TextLabel.
+ ///
+ /// The Strikethrough + /// + /// + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public Strikethrough GetStrikethrough() + { + Strikethrough strikethrough; + using (var propertyValue = GetProperty(TextLabel.Property.Strikethrough)) + using (var map = new PropertyMap()) + { + propertyValue.Get(map); + strikethrough = TextMapHelper.GetStrikethroughStruct(map); + } + return strikethrough; + } + + /// /// The PixelSize property.
/// The size of font in pixels.
///
/// 3 + [Binding.TypeConverter(typeof(FloatGraphicsTypeConverter))] public float PixelSize { get @@ -746,7 +1164,7 @@ namespace Tizen.NUI.BaseComponents set { SetValue(PixelSizeProperty, value); - NotifyPropertyChangedAndRequestLayout(); + NotifyPropertyChanged(); } } @@ -769,8 +1187,26 @@ namespace Tizen.NUI.BaseComponents } /// + /// The ellipsis position of the text. + /// Specifies which portion of the text should be replaced with an ellipsis when the text size exceeds the layout size.
+ ///
+ /// 9 + public EllipsisPosition EllipsisPosition + { + get + { + return (EllipsisPosition)GetValue(EllipsisPositionProperty); + } + set + { + SetValue(EllipsisPositionProperty, value); + NotifyPropertyChanged(); + } + } + + /// /// The AutoScrollLoopDelay property.
- /// Do something.
+ /// The amount of time to delay the starting time of auto scrolling and further loops.
///
/// 3 public float AutoScrollLoopDelay @@ -788,7 +1224,8 @@ namespace Tizen.NUI.BaseComponents /// /// The AutoScrollStopMode property.
- /// Do something.
+ /// The auto scrolling stop behaviour.
+ /// The default value is AutoScrollStopMode.FinishLoop.
///
/// 3 public AutoScrollStopMode AutoScrollStopMode @@ -812,9 +1249,12 @@ namespace Tizen.NUI.BaseComponents { get { - int temp = 0; - GetProperty(TextLabel.Property.LINE_COUNT).Get(out temp); - return temp; + int lineCount = 0; + using (var propertyValue = GetProperty(TextLabel.Property.LineCount)) + { + propertyValue.Get(out lineCount); + } + return lineCount; } } @@ -839,24 +1279,25 @@ namespace Tizen.NUI.BaseComponents /// /// The direction of the text such as left to right or right to left. /// - /// 5 - /// This will be released at Tizen.NET API Level 5, so currently this would be used as inhouse API. + /// This will be public opened in next release of tizen after ACR done. Before ACR, it is used as HiddenAPI (InhouseAPI). [EditorBrowsable(EditorBrowsableState.Never)] public TextDirection TextDirection { get { - int temp = 0; - GetProperty(TextLabel.Property.TEXT_DIRECTION).Get(out temp); - return (TextDirection)temp; + int textDirection = 0; + using (var propertyValue = GetProperty(TextLabel.Property.TextDirection)) + { + propertyValue.Get(out textDirection); + } + return (TextDirection)textDirection; } } /// /// The vertical line alignment of the text. /// - /// 5 - /// This will be released at Tizen.NET API Level 5, so currently this would be used as inhouse API. + /// This will be public opened in next release of tizen after ACR done. Before ACR, it is used as HiddenAPI (InhouseAPI). [EditorBrowsable(EditorBrowsableState.Never)] public VerticalLineAlignment VerticalLineAlignment { @@ -891,14 +1332,17 @@ namespace Tizen.NUI.BaseComponents /// /// The text fit parameters.
/// The textFit map contains the following keys :
- /// - enable (bool type) : True to enable the text fit or false to disable(the default value is false)
- /// - minSize (float type) : Minimum Size for text fit(the default value is 10.f)
- /// - maxSize (float type) : Maximum Size for text fit(the default value is 100.f)
- /// - stepSize (float type) : Step Size for font increase(the default value is 1.f)
- /// - fontSize (string type) : The size type of font, You can choose between "pointSize" or "pixelSize". (the default value is "pointSize")
+ /// + /// enable (bool)True to enable the text fit or false to disable (the default value is false) + /// minSize (float)Minimum Size for text fit (the default value is 10.f) + /// maxSize (float)Maximum Size for text fit (the default value is 100.f) + /// stepSize (float)Step Size for font increase (the default value is 1.f) + /// fontSize (string)The size type of font, You can choose between "pointSize" or "pixelSize". (the default value is "pointSize") + /// ///
- /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened in next release of tizen after ACR done. Before ACR, it is used as HiddenAPI (InhouseAPI). [EditorBrowsable(EditorBrowsableState.Never)] + [System.Diagnostics.CodeAnalysis.SuppressMessage("Naming", "CA1721: Property names should not match get methods")] public PropertyMap TextFit { get @@ -913,9 +1357,59 @@ namespace Tizen.NUI.BaseComponents } /// + /// Set TextFit to TextLabel.
+ ///
+ /// The TextFit + /// + /// SetTextFit specifies the textFit of the text through .
+ ///
+ /// + /// The following example demonstrates how to use the SetTextFit method. + /// + /// var textFit = new Tizen.NUI.Text.TextFit(); + /// textFit.Enable = true; + /// textFit.MinSize = 10.0f; + /// textFit.MaxSize = 100.0f; + /// textFit.StepSize = 5.0f; + /// textFit.FontSizeType = FontSizeType.PointSize; + /// label.SetTextFit(textFit); + /// + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public void SetTextFit(TextFit textFit) + { + using (var textFitMap = TextMapHelper.GetTextFitMap(textFit)) + { + SetValue(TextFitProperty, textFitMap); + } + } + + /// + /// Get TextFit from TextLabel.
+ ///
+ /// The TextFit + /// + /// TextFit is always returned based on PointSize.
+ /// If the user sets FontSizeType to PixelSize, then MinSize, MaxSize, and StepSize are converted based on PointSize and returned.
+ /// + ///
+ [EditorBrowsable(EditorBrowsableState.Never)] + public TextFit GetTextFit() + { + TextFit textFit; + using (var textFitMap = (PropertyMap)GetValue(TextFitProperty)) + { + textFit = TextMapHelper.GetTextFitStruct(textFitMap); + } + return textFit; + } + + /// /// The MinLineSize property.
+ /// The height of the line in points.
+ /// If the font size is larger than the line size, it works with the font size.
///
- /// 8 + /// This will be public opened in next release of tizen after ACR done. Before ACR, it is used as HiddenAPI (InhouseAPI). [EditorBrowsable(EditorBrowsableState.Never)] public float MinLineSize { @@ -926,39 +1420,137 @@ namespace Tizen.NUI.BaseComponents set { SetValue(MinLineSizeProperty, value); - NotifyPropertyChangedAndRequestLayout(); + NotifyPropertyChanged(); + } + } + + /// + /// The spaces between characters in Pixels. + /// + /// A positive value will make the characters far apart (expanded) and a negative value will bring them closer (condensed).
+ /// The default value is 0.f which does nothing. + ///
+ ///
+ [EditorBrowsable(EditorBrowsableState.Never)] + public float CharacterSpacing + { + get + { + return (float)GetValue(CharacterSpacingProperty); + } + set + { + SetValue(CharacterSpacingProperty, value); + NotifyPropertyChanged(); + } + } + + /// + /// The FontSizeScale property for scaling the specified font size up or down.
+ /// The default value is 1.0.
+ /// The given font size scale value is used for multiplying the specified font size before querying fonts.
+ /// If FontSizeScale.UseSystemSetting, will use the SystemSettings.FontSize internally.
+ ///
+ /// 9 + public float FontSizeScale + { + get + { + return (float)GetValue(FontSizeScaleProperty); + } + set + { + SetValue(FontSizeScaleProperty, value); + NotifyPropertyChanged(); } } - private TextLabelSelectorData SelectorData + private float InternalFontSizeScale { get { - if (selectorData == null) + return fontSizeScale; + } + set + { + float newFontSizeScale; + + if (fontSizeScale == value) return; + + fontSizeScale = value; + if (fontSizeScale == Tizen.NUI.FontSizeScale.UseSystemSetting) { - selectorData = new TextLabelSelectorData(); + SystemSettingsFontSize systemSettingsFontSize; + + try + { + systemSettingsFontSize = SystemSettings.FontSize; + } + catch (Exception e) + { + Console.WriteLine("{0} Exception caught.", e); + systemSettingsFontSize = SystemSettingsFontSize.Normal; + } + newFontSizeScale = TextUtils.GetFontSizeScale(systemSettingsFontSize); + AddSystemSettingsFontSizeChanged(); } - return selectorData; + else + { + newFontSizeScale = fontSizeScale; + RemoveSystemSettingsFontSizeChanged(); + } + + SetInternalFontSizeScale(newFontSizeScale); } } + private void SetInternalFontSizeScale(float fontSizeScale) + { + + Object.InternalSetPropertyFloat(this.SwigCPtr, TextLabel.Property.FontSizeScale, (float)fontSizeScale); + RequestLayout(); + } + + /// + /// The EnableFontSizeScale property.
+ /// Whether the font size scale is enabled. (The default value is true) + ///
+ [EditorBrowsable(EditorBrowsableState.Never)] + public bool EnableFontSizeScale + { + get + { + return (bool)GetValue(EnableFontSizeScaleProperty); + } + set + { + SetValue(EnableFontSizeScaleProperty, value); + NotifyPropertyChanged(); + } + } + + private TextLabelSelectorData EnsureSelectorData() => selectorData ?? (selectorData = new TextLabelSelectorData()); + /// /// Downcasts a handle to textLabel handle /// /// /// + /// Thrown when handle is null. /// 3 - /// Please do not use! this will be deprecated! - /// Instead please use as keyword. - [Obsolete("Please do not use! This will be deprecated! Please use as keyword instead! " + + /// Do not use this, that will be deprecated. Use as keyword instead. + [Obsolete("Do not use this, that will be deprecated. Use as keyword instead. " + "Like: " + "BaseHandle handle = new TextLabel(\"Hello World!\"); " + "TextLabel label = handle as TextLabel")] [EditorBrowsable(EditorBrowsableState.Never)] public static TextLabel DownCast(BaseHandle handle) { + if (null == handle) + { + throw new ArgumentNullException(nameof(handle)); + } TextLabel ret = Registry.GetManagedBaseHandleFromNativePtr(handle) as TextLabel; - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } @@ -972,6 +1564,16 @@ namespace Tizen.NUI.BaseComponents return; } + internalTextColor?.Dispose(); + + if (hasSystemLanguageChanged) + { + systemLocaleLanguageChanged.Remove(SystemSettingsLocaleLanguageChanged); + } + + RemoveSystemSettingsFontTypeChanged(); + RemoveSystemSettingsFontSizeChanged(); + if (type == DisposeTypes.Explicit) { //Called by User @@ -980,32 +1582,38 @@ namespace Tizen.NUI.BaseComponents selectorData?.Reset(this); } - base.Dispose(type); - } + if (this.HasBody()) + { + if (textLabelTextFitChangedCallbackDelegate != null) + { + TextFitChangedSignal().Disconnect(textLabelTextFitChangedCallbackDelegate); + } + } - internal static global::System.Runtime.InteropServices.HandleRef getCPtr(TextLabel obj) - { - return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; + base.Dispose(type); } /// This will not be public opened. [EditorBrowsable(EditorBrowsableState.Never)] protected override void ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef swigCPtr) { - Interop.TextLabel.delete_TextLabel(swigCPtr); + Interop.TextLabel.DeleteTextLabel(swigCPtr); } /// /// Get attribues, it is abstract function and must be override. /// - /// 6 - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] - protected override ViewStyle GetViewStyle() + protected override ViewStyle CreateViewStyle() { return new TextLabelStyle(); } + internal override LayoutItem CreateDefaultLayout() + { + return new TextLayout(); + } + /// /// Invoked whenever the binding context of the textlabel changes. Implement this method to add class handling for this event. /// @@ -1014,48 +1622,132 @@ namespace Tizen.NUI.BaseComponents base.OnBindingContextChanged(); } - private void SystemSettings_LocaleLanguageChanged(object sender, LocaleLanguageChangedEventArgs e) + private void SystemSettingsLocaleLanguageChanged(object sender, LocaleLanguageChangedEventArgs e) { Text = NUIApplication.MultilingualResourceManager?.GetString(textLabelSid, new CultureInfo(e.Value.Replace("_", "-"))); } - private void NotifyPropertyChangedAndRequestLayout() + private void SystemSettingsFontSizeChanged(object sender, FontSizeChangedEventArgs e) + { + float newFontSizeScale = TextUtils.GetFontSizeScale(e.Value); + SetInternalFontSizeScale(newFontSizeScale); + } + + private void AddSystemSettingsFontSizeChanged() + { + if (hasSystemFontSizeChanged != true) + { + try + { + SystemFontSizeChangedManager.Add(SystemSettingsFontSizeChanged); + hasSystemFontSizeChanged = true; + } + catch (Exception e) + { + Console.WriteLine("{0} Exception caught.", e); + hasSystemFontSizeChanged = false; + } + } + } + + private void RemoveSystemSettingsFontSizeChanged() + { + if (hasSystemFontSizeChanged == true) + { + try + { + SystemFontSizeChangedManager.Remove(SystemSettingsFontSizeChanged); + hasSystemFontSizeChanged = false; + } + catch (Exception e) + { + Console.WriteLine("{0} Exception caught.", e); + hasSystemFontSizeChanged = true; + } + } + } + + private void SystemSettingsFontTypeChanged(object sender, FontTypeChangedEventArgs e) + { + SetInternalFontFamily(e.Value); + } + + private void AddSystemSettingsFontTypeChanged() + { + if (HasStyle() && !hasSystemFontTypeChanged) + { + try + { + systemFontTypeChanged.Add(SystemSettingsFontTypeChanged); + hasSystemFontTypeChanged = true; + } + catch (Exception e) + { + Console.WriteLine("{0} Exception caught.", e); + hasSystemFontTypeChanged = false; + } + } + } + + private void RemoveSystemSettingsFontTypeChanged() + { + if (hasSystemFontTypeChanged) + { + try + { + systemFontTypeChanged.Remove(SystemSettingsFontTypeChanged); + hasSystemFontTypeChanged = false; + } + catch (Exception e) + { + Console.WriteLine("{0} Exception caught.", e); + hasSystemFontTypeChanged = true; + } + } + } + + private void RequestLayout() { - NotifyPropertyChanged(); Layout?.RequestLayout(); } internal new class Property { - internal static readonly int TEXT = Interop.TextLabel.TextLabel_Property_TEXT_get(); - internal static readonly int FONT_FAMILY = Interop.TextLabel.TextLabel_Property_FONT_FAMILY_get(); - internal static readonly int FONT_STYLE = Interop.TextLabel.TextLabel_Property_FONT_STYLE_get(); - internal static readonly int POINT_SIZE = Interop.TextLabel.TextLabel_Property_POINT_SIZE_get(); - internal static readonly int MULTI_LINE = Interop.TextLabel.TextLabel_Property_MULTI_LINE_get(); - internal static readonly int HORIZONTAL_ALIGNMENT = Interop.TextLabel.TextLabel_Property_HORIZONTAL_ALIGNMENT_get(); - internal static readonly int VERTICAL_ALIGNMENT = Interop.TextLabel.TextLabel_Property_VERTICAL_ALIGNMENT_get(); - internal static readonly int TEXT_COLOR = Interop.TextLabel.TextLabel_Property_TEXT_COLOR_get(); - internal static readonly int ENABLE_MARKUP = Interop.TextLabel.TextLabel_Property_ENABLE_MARKUP_get(); - internal static readonly int ENABLE_AUTO_SCROLL = Interop.TextLabel.TextLabel_Property_ENABLE_AUTO_SCROLL_get(); - internal static readonly int AUTO_SCROLL_SPEED = Interop.TextLabel.TextLabel_Property_AUTO_SCROLL_SPEED_get(); - internal static readonly int AUTO_SCROLL_LOOP_COUNT = Interop.TextLabel.TextLabel_Property_AUTO_SCROLL_LOOP_COUNT_get(); - internal static readonly int AUTO_SCROLL_GAP = Interop.TextLabel.TextLabel_Property_AUTO_SCROLL_GAP_get(); - internal static readonly int LINE_SPACING = Interop.TextLabel.TextLabel_Property_LINE_SPACING_get(); - internal static readonly int UNDERLINE = Interop.TextLabel.TextLabel_Property_UNDERLINE_get(); - internal static readonly int SHADOW = Interop.TextLabel.TextLabel_Property_SHADOW_get(); - internal static readonly int EMBOSS = Interop.TextLabel.TextLabel_Property_EMBOSS_get(); - internal static readonly int OUTLINE = Interop.TextLabel.TextLabel_Property_OUTLINE_get(); - internal static readonly int PIXEL_SIZE = Interop.TextLabel.TextLabel_Property_PIXEL_SIZE_get(); - internal static readonly int ELLIPSIS = Interop.TextLabel.TextLabel_Property_ELLIPSIS_get(); - internal static readonly int AUTO_SCROLL_STOP_MODE = Interop.TextLabel.TextLabel_Property_AUTO_SCROLL_STOP_MODE_get(); - internal static readonly int AUTO_SCROLL_LOOP_DELAY = Interop.TextLabel.TextLabel_Property_AUTO_SCROLL_LOOP_DELAY_get(); - internal static readonly int LINE_COUNT = Interop.TextLabel.TextLabel_Property_LINE_COUNT_get(); - internal static readonly int LINE_WRAP_MODE = Interop.TextLabel.TextLabel_Property_LINE_WRAP_MODE_get(); - internal static readonly int TEXT_DIRECTION = Interop.TextLabel.TextLabel_Property_TEXT_DIRECTION_get(); - internal static readonly int VERTICAL_LINE_ALIGNMENT = Interop.TextLabel.TextLabel_Property_VERTICAL_LINE_ALIGNMENT_get(); - internal static readonly int MATCH_SYSTEM_LANGUAGE_DIRECTION = Interop.TextLabel.TextLabel_Property_MATCH_SYSTEM_LANGUAGE_DIRECTION_get(); - internal static readonly int TEXT_FIT = Interop.TextLabel.TextLabel_Property_TEXT_FIT_get(); - internal static readonly int MIN_LINE_SIZE = Interop.TextLabel.TextLabel_Property_MIN_LINE_SIZE_get(); + internal static readonly int TEXT = Interop.TextLabel.TextGet(); + internal static readonly int FontFamily = Interop.TextLabel.FontFamilyGet(); + internal static readonly int FontStyle = Interop.TextLabel.FontStyleGet(); + internal static readonly int PointSize = Interop.TextLabel.PointSizeGet(); + internal static readonly int MultiLine = Interop.TextLabel.MultiLineGet(); + internal static readonly int HorizontalAlignment = Interop.TextLabel.HorizontalAlignmentGet(); + internal static readonly int VerticalAlignment = Interop.TextLabel.VerticalAlignmentGet(); + internal static readonly int TextColor = Interop.TextLabel.TextColorGet(); + internal static readonly int EnableMarkup = Interop.TextLabel.EnableMarkupGet(); + internal static readonly int EnableAutoScroll = Interop.TextLabel.EnableAutoScrollGet(); + internal static readonly int AutoScrollSpeed = Interop.TextLabel.AutoScrollSpeedGet(); + internal static readonly int AutoScrollLoopCount = Interop.TextLabel.AutoScrollLoopCountGet(); + internal static readonly int AutoScrollGap = Interop.TextLabel.AutoScrollGapGet(); + internal static readonly int LineSpacing = Interop.TextLabel.LineSpacingGet(); + internal static readonly int RelativeLineHeight = Interop.TextLabel.RelativeLineHeightGet(); + internal static readonly int UNDERLINE = Interop.TextLabel.UnderlineGet(); + internal static readonly int SHADOW = Interop.TextLabel.ShadowGet(); + internal static readonly int EMBOSS = Interop.TextLabel.EmbossGet(); + internal static readonly int OUTLINE = Interop.TextLabel.OutlineGet(); + internal static readonly int PixelSize = Interop.TextLabel.PixelSizeGet(); + internal static readonly int ELLIPSIS = Interop.TextLabel.EllipsisGet(); + internal static readonly int AutoScrollStopMode = Interop.TextLabel.AutoScrollStopModeGet(); + internal static readonly int AutoScrollLoopDelay = Interop.TextLabel.AutoScrollLoopDelayGet(); + internal static readonly int LineCount = Interop.TextLabel.LineCountGet(); + internal static readonly int LineWrapMode = Interop.TextLabel.LineWrapModeGet(); + internal static readonly int TextDirection = Interop.TextLabel.TextDirectionGet(); + internal static readonly int VerticalLineAlignment = Interop.TextLabel.VerticalLineAlignmentGet(); + internal static readonly int MatchSystemLanguageDirection = Interop.TextLabel.MatchSystemLanguageDirectionGet(); + 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 EnableFontSizeScale = Interop.TextLabel.EnableFontSizeScaleGet(); + internal static readonly int EllipsisPosition = Interop.TextLabel.EllipsisPositionGet(); + internal static readonly int Strikethrough = Interop.TextLabel.StrikethroughGet(); + internal static readonly int CharacterSpacing = Interop.TextLabel.CharacterSpacingGet(); } private void OnShadowColorChanged(float x, float y, float z, float w)