/* * Copyright(c) 2019 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. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ using System; using System.ComponentModel; using Tizen.NUI.Binding; namespace Tizen.NUI.BaseComponents { /// /// The base class for Children attributes in Components. /// /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public class TextLabelStyle : ViewStyle { /// 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 TranslatableTextSelectorProperty = BindableProperty.Create("TranslatableTextSelector", typeof(Selector), typeof(TextLabelStyle), null, propertyChanged: (bindable, oldValue, newValue) => { ((TextLabelStyle)bindable).translatableTextSelector = ((Selector)newValue)?.Clone(); }, defaultValueCreator: (bindable) => { return ((TextLabelStyle)bindable).translatableTextSelector; }); /// 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 TextSelectorProperty = BindableProperty.Create("TextSelector", typeof(Selector), typeof(TextLabelStyle), null, propertyChanged: (bindable, oldValue, newValue) => { ((TextLabelStyle)bindable).textSelector = ((Selector)newValue)?.Clone(); }, defaultValueCreator: (bindable) => { return ((TextLabelStyle)bindable).textSelector; }); /// 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 FontFamilySelectorProperty = BindableProperty.Create("FontFamilySelector", typeof(Selector), typeof(TextLabelStyle), null, propertyChanged: (bindable, oldValue, newValue) => { ((TextLabelStyle)bindable).fontFamilySelector = ((Selector)newValue)?.Clone(); }, defaultValueCreator: (bindable) => { return ((TextLabelStyle)bindable).fontFamilySelector; }); /// 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 PointSizeSelectorProperty = BindableProperty.Create("PointSizeSelector", typeof(Selector), typeof(TextLabelStyle), null, propertyChanged: (bindable, oldValue, newValue) => { ((TextLabelStyle)bindable).pointSizeSelector = ((Selector)newValue)?.Clone(); }, defaultValueCreator: (bindable) => { return ((TextLabelStyle)bindable).pointSizeSelector; }); /// 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 TextColorSelectorProperty = BindableProperty.Create("TextColorSelector", typeof(Selector), typeof(TextLabelStyle), null, propertyChanged: (bindable, oldValue, newValue) => { ((TextLabelStyle)bindable).textColorSelector = ((Selector)newValue)?.Clone(); }, defaultValueCreator: (bindable) => { return ((TextLabelStyle)bindable).textColorSelector; }); /// 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 MultiLineProperty = BindableProperty.Create(nameof(MultiLine), typeof(bool?), typeof(TextLabelStyle), null, propertyChanged: (bindable, oldValue, newValue) => { var textLabelStyle = (TextLabelStyle)bindable; textLabelStyle.multiLine = (bool?)newValue; }, defaultValueCreator: (bindable) => { var textLabelStyle = (TextLabelStyle)bindable; return textLabelStyle.multiLine; }); /// 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 HorizontalAlignmentProperty = BindableProperty.Create(nameof(HorizontalAlignment), typeof(HorizontalAlignment?), typeof(TextLabelStyle), null, propertyChanged: (bindable, oldValue, newValue) => { var textLabelStyle = (TextLabelStyle)bindable; textLabelStyle.horizontalAlignment = (HorizontalAlignment?)newValue; }, defaultValueCreator: (bindable) => { var textLabelStyle = (TextLabelStyle)bindable; return textLabelStyle.horizontalAlignment; }); /// 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 VerticalAlignmentProperty = BindableProperty.Create(nameof(VerticalAlignment), typeof(VerticalAlignment?), typeof(TextLabelStyle), null, propertyChanged: (bindable, oldValue, newValue) => { var textLabelStyle = (TextLabelStyle)bindable; textLabelStyle.verticalAlignment = (VerticalAlignment?)newValue; }, defaultValueCreator: (bindable) => { var textLabelStyle = (TextLabelStyle)bindable; return textLabelStyle.verticalAlignment; }); /// 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 EnableMarkupProperty = BindableProperty.Create(nameof(EnableMarkup), typeof(bool?), typeof(TextLabelStyle), null, propertyChanged: (bindable, oldValue, newValue) => { var textLabelStyle = (TextLabelStyle)bindable; textLabelStyle.enableMarkup = (bool?)newValue; }, defaultValueCreator: (bindable) => { var textLabelStyle = (TextLabelStyle)bindable; return textLabelStyle.enableMarkup; }); /// 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 EnableAutoScrollProperty = BindableProperty.Create(nameof(EnableAutoScroll), typeof(bool?), typeof(TextLabelStyle), null, propertyChanged: (bindable, oldValue, newValue) => { var textLabelStyle = (TextLabelStyle)bindable; textLabelStyle.enableAutoScroll = (bool?)newValue; }, defaultValueCreator: (bindable) => { var textLabelStyle = (TextLabelStyle)bindable; return textLabelStyle.enableAutoScroll; }); /// 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 AutoScrollSpeedProperty = BindableProperty.Create(nameof(AutoScrollSpeed), typeof(int?), typeof(TextLabelStyle), null, propertyChanged: (bindable, oldValue, newValue) => { var textLabelStyle = (TextLabelStyle)bindable; textLabelStyle.autoScrollSpeed = (int?)newValue; }, defaultValueCreator: (bindable) => { var textLabelStyle = (TextLabelStyle)bindable; return textLabelStyle.autoScrollSpeed; }); /// 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 AutoScrollLoopCountProperty = BindableProperty.Create(nameof(AutoScrollLoopCount), typeof(int?), typeof(TextLabelStyle), null, propertyChanged: (bindable, oldValue, newValue) => { var textLabelStyle = (TextLabelStyle)bindable; textLabelStyle.autoScrollLoopCount = (int?)newValue; }, defaultValueCreator: (bindable) => { var textLabelStyle = (TextLabelStyle)bindable; return textLabelStyle.autoScrollLoopCount; }); /// 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 AutoScrollGapProperty = BindableProperty.Create(nameof(AutoScrollGap), typeof(float?), typeof(TextLabelStyle), null, propertyChanged: (bindable, oldValue, newValue) => { var textLabelStyle = (TextLabelStyle)bindable; textLabelStyle.autoScrollGap = (float?)newValue; }, defaultValueCreator: (bindable) => { var textLabelStyle = (TextLabelStyle)bindable; return textLabelStyle.autoScrollGap; }); /// 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 LineSpacingProperty = BindableProperty.Create(nameof(LineSpacing), typeof(float?), typeof(TextLabelStyle), null, propertyChanged: (bindable, oldValue, newValue) => { var textLabelStyle = (TextLabelStyle)bindable; textLabelStyle.lineSpacing = (float?)newValue; }, defaultValueCreator: (bindable) => { var textLabelStyle = (TextLabelStyle)bindable; return textLabelStyle.lineSpacing; }); /// 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 EmbossProperty = BindableProperty.Create(nameof(Emboss), typeof(string), typeof(TextLabelStyle), null, propertyChanged: (bindable, oldValue, newValue) => { var textLabelStyle = (TextLabelStyle)bindable; textLabelStyle.emboss = (string)newValue; }, defaultValueCreator: (bindable) => { var textLabelStyle = (TextLabelStyle)bindable; return textLabelStyle.emboss; }); /// 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 PixelSizeProperty = BindableProperty.Create(nameof(PixelSize), typeof(float?), typeof(TextLabelStyle), null, propertyChanged: (bindable, oldValue, newValue) => { var textLabelStyle = (TextLabelStyle)bindable; textLabelStyle.pixelSize = (float?)newValue; }, defaultValueCreator: (bindable) => { var textLabelStyle = (TextLabelStyle)bindable; return textLabelStyle.pixelSize; }); /// 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(TextLabelStyle), null, propertyChanged: (bindable, oldValue, newValue) => { var textLabelStyle = (TextLabelStyle)bindable; textLabelStyle.ellipsis = (bool?)newValue; }, defaultValueCreator: (bindable) => { var textLabelStyle = (TextLabelStyle)bindable; return textLabelStyle.ellipsis; }); /// 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 AutoScrollLoopDelayProperty = BindableProperty.Create(nameof(AutoScrollLoopDelay), typeof(float?), typeof(TextLabelStyle), null, propertyChanged: (bindable, oldValue, newValue) => { var textLabelStyle = (TextLabelStyle)bindable; textLabelStyle.autoScrollLoopDelay = (float?)newValue; }, defaultValueCreator: (bindable) => { var textLabelStyle = (TextLabelStyle)bindable; return textLabelStyle.autoScrollLoopDelay; }); /// 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 AutoScrollStopModeProperty = BindableProperty.Create(nameof(AutoScrollStopMode), typeof(AutoScrollStopMode?), typeof(TextLabelStyle), null, propertyChanged: (bindable, oldValue, newValue) => { var textLabelStyle = (TextLabelStyle)bindable; textLabelStyle.autoScrollStopMode = (AutoScrollStopMode?)newValue; }, defaultValueCreator: (bindable) => { var textLabelStyle = (TextLabelStyle)bindable; return textLabelStyle.autoScrollStopMode; }); /// 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 LineWrapModeProperty = BindableProperty.Create(nameof(LineWrapMode), typeof(LineWrapMode?), typeof(TextLabelStyle), null, propertyChanged: (bindable, oldValue, newValue) => { var textLabelStyle = (TextLabelStyle)bindable; textLabelStyle.lineWrapMode = (LineWrapMode?)newValue; }, defaultValueCreator: (bindable) => { var textLabelStyle = (TextLabelStyle)bindable; return textLabelStyle.lineWrapMode; }); /// 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 VerticalLineAlignmentProperty = BindableProperty.Create(nameof(VerticalLineAlignment), typeof(VerticalLineAlignment?), typeof(TextLabelStyle), null, propertyChanged: (bindable, oldValue, newValue) => { var textLabelStyle = (TextLabelStyle)bindable; textLabelStyle.verticalLineAlignment = (VerticalLineAlignment?)newValue; }, defaultValueCreator: (bindable) => { var textLabelStyle = (TextLabelStyle)bindable; return textLabelStyle.verticalLineAlignment; }); /// 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) => { var textLabelStyle = (TextLabelStyle)bindable; textLabelStyle.matchSystemLanguageDirection = (bool?)newValue; }, defaultValueCreator: (bindable) => { var textLabelStyle = (TextLabelStyle)bindable; return textLabelStyle.matchSystemLanguageDirection; }); /// A BindableProperty for ImageShadow [EditorBrowsable(EditorBrowsableState.Never)] public static readonly BindableProperty TextShadowProperty = BindableProperty.Create("TextShadowSelector", typeof(Selector), typeof(TextLabelStyle), null, propertyChanged: (bindable, oldValue, newValue) => { ((TextLabelStyle)bindable).textShadow = ((Selector)newValue)?.Clone(); }, defaultValueCreator: (bindable) => { return ((TextLabelStyle)bindable).textShadow; }); private bool? multiLine; private HorizontalAlignment? horizontalAlignment; private VerticalAlignment? verticalAlignment; private bool? enableMarkup; private bool? enableAutoScroll; private int? autoScrollSpeed; private int? autoScrollLoopCount; private float? autoScrollGap; private float? lineSpacing; private string emboss; private float? pixelSize; private bool? ellipsis; private float? autoScrollLoopDelay; private AutoScrollStopMode? autoScrollStopMode; private LineWrapMode? lineWrapMode; private VerticalLineAlignment? verticalLineAlignment; private bool? matchSystemLanguageDirection; private Selector translatableTextSelector; private Selector fontFamilySelector; private Selector textSelector; private Selector textColorSelector; private Selector pointSizeSelector; private Selector textShadow; static TextLabelStyle() { } /// /// Create an empty instance. /// [EditorBrowsable(EditorBrowsableState.Never)] public TextLabelStyle() { } /// /// Create an instance and set properties from the given TextLabel. /// /// The TextLabel instance that includes property data. [EditorBrowsable(EditorBrowsableState.Never)] public TextLabelStyle(TextLabel textLabel) : base(textLabel) { } /// 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 Selector TranslatableText { get { Selector tmp = (Selector)GetValue(TranslatableTextSelectorProperty); return (null != tmp) ? tmp : translatableTextSelector = new Selector(); } set => SetValue(TranslatableTextSelectorProperty, 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 Selector FontFamily { get { Selector tmp = (Selector)GetValue(FontFamilySelectorProperty); return (null != tmp) ? tmp : fontFamilySelector = new Selector(); } set => SetValue(FontFamilySelectorProperty, 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? MultiLine { get => (bool?)GetValue(MultiLineProperty); set => SetValue(MultiLineProperty, 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 HorizontalAlignment? HorizontalAlignment { get => (HorizontalAlignment?)GetValue(HorizontalAlignmentProperty); set => SetValue(HorizontalAlignmentProperty, 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 VerticalAlignment? VerticalAlignment { get => (VerticalAlignment?)GetValue(VerticalAlignmentProperty); set => SetValue(VerticalAlignmentProperty, 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? EnableMarkup { get => (bool?)GetValue(EnableMarkupProperty); set => SetValue(EnableMarkupProperty, 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? EnableAutoScroll { get => (bool?)GetValue(EnableAutoScrollProperty); set => SetValue(EnableAutoScrollProperty, 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 int? AutoScrollSpeed { get => (int?)GetValue(AutoScrollSpeedProperty); set => SetValue(AutoScrollSpeedProperty, 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 int? AutoScrollLoopCount { get => (int?)GetValue(AutoScrollLoopCountProperty); set => SetValue(AutoScrollLoopCountProperty, 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 float? AutoScrollGap { get => (float?)GetValue(AutoScrollGapProperty); set => SetValue(AutoScrollGapProperty, 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 float? LineSpacing { get => (float?)GetValue(LineSpacingProperty); set => SetValue(LineSpacingProperty, 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 string Emboss { get => (string)GetValue(EmbossProperty); set => SetValue(EmbossProperty, 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 float? PixelSize { get => (float?)GetValue(PixelSizeProperty); set => SetValue(PixelSizeProperty, 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? Ellipsis { get => (bool?)GetValue(EllipsisProperty); set => SetValue(EllipsisProperty, 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 float? AutoScrollLoopDelay { get => (float?)GetValue(AutoScrollLoopDelayProperty); set => SetValue(AutoScrollLoopDelayProperty, 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 AutoScrollStopMode? AutoScrollStopMode { get => (AutoScrollStopMode?)GetValue(AutoScrollStopModeProperty); set => SetValue(AutoScrollStopModeProperty, 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 LineWrapMode? LineWrapMode { get => (LineWrapMode?)GetValue(LineWrapModeProperty); set => SetValue(LineWrapModeProperty, 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 VerticalLineAlignment? VerticalLineAlignment { get => (VerticalLineAlignment?)GetValue(VerticalLineAlignmentProperty); set => SetValue(VerticalLineAlignmentProperty, 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 { get => (bool?)GetValue(MatchSystemLanguageDirectionProperty); set => SetValue(MatchSystemLanguageDirectionProperty, 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 Selector Text { get { Selector tmp = (Selector)GetValue(TextSelectorProperty); return (null != tmp) ? tmp : textSelector = new Selector(); } set => SetValue(TextSelectorProperty, 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 Selector TextColor { get { Selector tmp = (Selector)GetValue(TextColorSelectorProperty); return (null != tmp) ? tmp : textColorSelector = new Selector(); } set => SetValue(TextColorSelectorProperty, 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 Selector PointSize { get { Selector tmp = (Selector)GetValue(PointSizeSelectorProperty); return (null != tmp) ? tmp : pointSizeSelector = new Selector(); } set => SetValue(PointSizeSelectorProperty, 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 Selector TextShadow { get => (Selector)GetValue(TextShadowProperty); set => SetValue(TextShadowProperty, value); } } }