From e5a11dafb1b34ba06a2d95e139dc7e8ecf63893a Mon Sep 17 00:00:00 2001 From: Bowon Ryu Date: Tue, 23 Nov 2021 13:05:59 +0900 Subject: [PATCH] [NUI] Separate text constants for better readability Signed-off-by: Bowon Ryu --- .../src/public/BaseComponents/TextConstants.cs | 340 +++++++++++++++++++++ src/Tizen.NUI/src/public/Common/NUIConstants.cs | 324 -------------------- 2 files changed, 340 insertions(+), 324 deletions(-) create mode 100644 src/Tizen.NUI/src/public/BaseComponents/TextConstants.cs diff --git a/src/Tizen.NUI/src/public/BaseComponents/TextConstants.cs b/src/Tizen.NUI/src/public/BaseComponents/TextConstants.cs new file mode 100644 index 0000000..47bad7a --- /dev/null +++ b/src/Tizen.NUI/src/public/BaseComponents/TextConstants.cs @@ -0,0 +1,340 @@ +// 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. +// 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 System.Diagnostics.CodeAnalysis; + +namespace Tizen.NUI.Text +{ + /// + /// A struct to pass data of InputFilter PropertyMap.
+ ///
+ /// + /// InputFilter filters input based on regular expressions.
+ /// Users can set the Accepted or Rejected regular expression set, or both.
+ /// If both are used, Rejected has higher priority.
+ /// The character set must follow the regular expression rules.
+ /// Behaviour can not be guaranteed for incorrect grammars.
+ /// Refer the link below for detailed rules.
+ /// The functions in std::regex library use the ECMAScript grammar:
+ /// http://cplusplus.com/reference/regex/ECMAScript/
+ /// The InputFilter struct is used as an argument to SetInputFilter and GetInputFilter methods.
+ /// See , , and .
+ ///
+ [EditorBrowsable(EditorBrowsableState.Never)] + public struct InputFilter + { + /// + /// A regular expression in the set of characters to be accepted by the inputFilter. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public string Accepted { get; set; } + + /// + /// A regular expression in the set of characters to be rejected by the inputFilter. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public string Rejected { get; set; } + } + + /// + /// A struct to pass data of FontStyle PropertyMap.
+ ///
+ /// + /// The FontStyle struct is used as an argument to SetFontStyle and GetFontStyle methods.
+ /// See , , , , and .
+ ///
+ [EditorBrowsable(EditorBrowsableState.Never)] + public struct FontStyle + { + /// + /// The Width defines occupied by each glyph. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public FontWidthType Width { get; set; } + + /// + /// The Weight defines the thickness or darkness of the glyphs. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public FontWeightType Weight { get; set; } + + /// + /// The Slant defines whether to use italics. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public FontSlantType Slant { get; set; } + } + + /// + /// A struct to pass data of Underline PropertyMap.
+ ///
+ /// + /// The Underline struct is used as an argument to SetUnderline and GetUnderline methods.
+ /// See , , , , and .
+ ///
+ [EditorBrowsable(EditorBrowsableState.Never)] + public struct Underline + { + /// + /// Whether the underline is enabled (the default value is false). + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public bool Enable { get; set; } + + /// + /// The color of the underline (if not provided then the color of the text is used). + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public Color Color { get; set; } + + /// + /// The height in pixels of the underline (if null, the default value is 1.0f). + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public float? Height { get; set; } + } + + /// + /// A struct to pass data of Shadow PropertyMap.
+ ///
+ /// + /// The Shadow struct is used as an argument to SetShadow and GetShadow methods.
+ /// See , , , , and .
+ ///
+ [EditorBrowsable(EditorBrowsableState.Never)] + public struct Shadow + { + /// + /// The color of the shadow (the default color is Color.Black). + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public Color Color { get; set; } + + /// + /// The offset in pixels of the shadow (if null, the default value is 0, 0).
+ /// If not provided then the shadow is not enabled.
+ /// + ///
+ [EditorBrowsable(EditorBrowsableState.Never)] + public Vector2 Offset { get; set; } + + /// + /// The radius of the Gaussian blur for the soft shadow (if null, the default value is 0.0f).
+ /// If not provided then the soft shadow is not enabled.
+ ///
+ [EditorBrowsable(EditorBrowsableState.Never)] + public float? BlurRadius { get; set; } + } + + /// + /// A struct to pass data of Outline PropertyMap.
+ ///
+ /// + /// The Outline struct is used as an argument to SetOutline and GetOutline methods.
+ /// See , , , , and .
+ ///
+ [EditorBrowsable(EditorBrowsableState.Never)] + public struct Outline + { + /// + /// The color of the outline (the default color is Color.White). + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public Color Color { get; set; } + + /// + /// The width in pixels of the outline (if null, the default value is 0.0f).
+ /// If not provided then the outline is not enabled.
+ ///
+ [EditorBrowsable(EditorBrowsableState.Never)] + public float? Width { get; set; } + } + + /// + /// A struct to pass data of TextFit PropertyMap.
+ ///
+ /// + /// The TextFit struct is used as an argument to SetTextFit and GetTextFit methods.
+ /// See and .
+ ///
+ [EditorBrowsable(EditorBrowsableState.Never)] + public struct TextFit + { + /// + /// True to enable the text fit or false to disable (the default value is false). + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public bool Enable { get; set; } + + /// + /// Minimum Size for text fit (if null, the default value is 10.0f). + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public float? MinSize { get; set; } + + /// + /// Maximum Size for text fit (if null, the default value is 100.0f). + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public float? MaxSize { get; set; } + + /// + /// Step Size for font increase (if null, the default value is 1.0f). + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public float? StepSize { get; set; } + + /// + /// The size type of font, PointSize or PixelSize (the default value is PointSize). + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public FontSizeType FontSizeType { get; set; } + + /// + /// Font Size for text fit + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public float? FontSize { get; set; } + } + + /// + /// A struct to pass data of Placeholder PropertyMap.
+ ///
+ /// + /// The Placeholder struct is used as an argument to SetPlaceholder and GetPlaceholder methods.
+ /// See , , and .
+ ///
+ [EditorBrowsable(EditorBrowsableState.Never)] + public struct Placeholder + { + /// + /// The text to display when the TextField is empty and inactive. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public string Text { get; set; } + + /// + /// The text to display when the placeholder has focus. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public string TextFocused { get; set; } + + /// + /// The color of the placeholder text. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public Color Color { get; set; } + + /// + /// The FontFamily of the placeholder text. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public string FontFamily { get; set; } + + /// + /// The FontStyle of the placeholder text (if null, the text control FontStyle is used). + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public FontStyle? FontStyle { get; set; } + + /// + /// The PointSize of the placeholder text.
+ /// Not required if PixelSize provided.
+ /// If both provided or neither provided then the text control point size is used.
+ ///
+ [EditorBrowsable(EditorBrowsableState.Never)] + public float? PointSize { get; set; } + + /// + /// The PiexSize of the placeholder text. + /// Not required if PointSize provided.
+ /// If both provided or neither provided then the text control point size is used.
+ ///
+ [EditorBrowsable(EditorBrowsableState.Never)] + public float? PixelSize { get; set; } + + /// + /// The ellipsis of the placeholder text (the default value is false). + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public bool Ellipsis { get; set; } + } + + /// + /// A struct to pass data of HiddenInputSettings PropertyMap.
+ ///
+ /// + /// The HiddenInput struct is used as an argument to SetHiddenInput and GetHiddenInput methods.
+ /// See and .
+ ///
+ [EditorBrowsable(EditorBrowsableState.Never)] + public struct HiddenInput + { + /// + /// The mode for input text display.
+ ///
+ [EditorBrowsable(EditorBrowsableState.Never)] + public HiddenInputModeType Mode { get; set; } + + /// + /// All input characters are substituted by this character (if null, the default value is '*').
+ ///
+ [EditorBrowsable(EditorBrowsableState.Never)] + public char? SubstituteCharacter { get; set; } + + /// + /// Length of text to show or hide, available when HideCount/ShowCount mode is used (if null, the default value is 0).
+ ///
+ [EditorBrowsable(EditorBrowsableState.Never)] + public int? SubstituteCount { get; set; } + + /// + /// Hide last character after this duration, available when ShowLastCharacter mode (if null, the default value is 1000).
+ ///
+ [EditorBrowsable(EditorBrowsableState.Never)] + public int? ShowLastCharacterDuration { get; set; } + } + + /// + /// A struct to pass data of SelectionHandleImageLeft, SelectionHandleImageRight, SelectionHandlePressedImageLeft, SelectionHandlePressedImageRight, SelectionHandleMarkerImageLeft and SelectionHandleMarkerImageRight PropertyMap.
+ ///
+ /// + /// The SelectionHandleImage struct is used as an argument to SetSelectionHandleImage, GetSelectionHandleImage methods, SetSelectionHandlePressedImage, GetSelectionHandlePressedImage, SetSelectionHandleMarkerImage and GetSelectionHandleMarkerImage.
+ /// See , , , , , ,
+ /// , , , , and .
+ ///
+ [EditorBrowsable(EditorBrowsableState.Never)] + public struct SelectionHandleImage + { + /// + /// The image path to display for the left selection handle.
+ /// It means the handle in the bottom-left.
+ /// If the handle needs to be displayed in the top-left, this image will be vertically flipped.
+ /// If null or empty string, it doesn't change the property.
+ ///
+ [EditorBrowsable(EditorBrowsableState.Never)] + public string LeftImageUrl { get; set; } + + /// + /// The image path to display for the right selection handle.
+ /// It means the handle in the bottom-right.
+ /// If the handle needs to be displayed in the top-right, this image will be vertically flipped.
+ /// If null or empty string, it doesn't change the property.
+ ///
+ [EditorBrowsable(EditorBrowsableState.Never)] + public string RightImageUrl { get; set; } + } +} \ No newline at end of file diff --git a/src/Tizen.NUI/src/public/Common/NUIConstants.cs b/src/Tizen.NUI/src/public/Common/NUIConstants.cs index 3d01873..82fb478 100755 --- a/src/Tizen.NUI/src/public/Common/NUIConstants.cs +++ b/src/Tizen.NUI/src/public/Common/NUIConstants.cs @@ -2029,330 +2029,6 @@ namespace Tizen.NUI PixelSize } - namespace Text - { - /// - /// A struct to pass data of InputFilter PropertyMap.
- ///
- /// - /// InputFilter filters input based on regular expressions.
- /// Users can set the Accepted or Rejected regular expression set, or both.
- /// If both are used, Rejected has higher priority.
- /// The character set must follow the regular expression rules.
- /// Behaviour can not be guaranteed for incorrect grammars.
- /// Refer the link below for detailed rules.
- /// The functions in std::regex library use the ECMAScript grammar:
- /// http://cplusplus.com/reference/regex/ECMAScript/
- /// The InputFilter struct is used as an argument to SetInputFilter and GetInputFilter methods.
- /// See , , and .
- ///
- [EditorBrowsable(EditorBrowsableState.Never)] - public struct InputFilter - { - /// - /// A regular expression in the set of characters to be accepted by the inputFilter. - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public string Accepted { get; set; } - - /// - /// A regular expression in the set of characters to be rejected by the inputFilter. - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public string Rejected { get; set; } - } - - /// - /// A struct to pass data of FontStyle PropertyMap.
- ///
- /// - /// The FontStyle struct is used as an argument to SetFontStyle and GetFontStyle methods.
- /// See , , , , and .
- ///
- [EditorBrowsable(EditorBrowsableState.Never)] - public struct FontStyle - { - /// - /// The Width defines occupied by each glyph. - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public FontWidthType Width { get; set; } - - /// - /// The Weight defines the thickness or darkness of the glyphs. - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public FontWeightType Weight { get; set; } - - /// - /// The Slant defines whether to use italics. - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public FontSlantType Slant { get; set; } - } - - /// - /// A struct to pass data of Underline PropertyMap.
- ///
- /// - /// The Underline struct is used as an argument to SetUnderline and GetUnderline methods.
- /// See , , , , and .
- ///
- [EditorBrowsable(EditorBrowsableState.Never)] - public struct Underline - { - /// - /// Whether the underline is enabled (the default value is false). - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public bool Enable { get; set; } - - /// - /// The color of the underline (if not provided then the color of the text is used). - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public Color Color { get; set; } - - /// - /// The height in pixels of the underline (if null, the default value is 1.0f). - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public float? Height { get; set; } - } - - /// - /// A struct to pass data of Shadow PropertyMap.
- ///
- /// - /// The Shadow struct is used as an argument to SetShadow and GetShadow methods.
- /// See , , , , and .
- ///
- [EditorBrowsable(EditorBrowsableState.Never)] - public struct Shadow - { - /// - /// The color of the shadow (the default color is Color.Black). - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public Color Color { get; set; } - - /// - /// The offset in pixels of the shadow (if null, the default value is 0, 0).
- /// If not provided then the shadow is not enabled.
- /// - ///
- [EditorBrowsable(EditorBrowsableState.Never)] - public Vector2 Offset { get; set; } - - /// - /// The radius of the Gaussian blur for the soft shadow (if null, the default value is 0.0f).
- /// If not provided then the soft shadow is not enabled.
- ///
- [EditorBrowsable(EditorBrowsableState.Never)] - public float? BlurRadius { get; set; } - } - - /// - /// A struct to pass data of Outline PropertyMap.
- ///
- /// - /// The Outline struct is used as an argument to SetOutline and GetOutline methods.
- /// See , , , , and .
- ///
- [EditorBrowsable(EditorBrowsableState.Never)] - public struct Outline - { - /// - /// The color of the outline (the default color is Color.White). - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public Color Color { get; set; } - - /// - /// The width in pixels of the outline (if null, the default value is 0.0f).
- /// If not provided then the outline is not enabled.
- ///
- [EditorBrowsable(EditorBrowsableState.Never)] - public float? Width { get; set; } - } - - /// - /// A struct to pass data of TextFit PropertyMap.
- ///
- /// - /// The TextFit struct is used as an argument to SetTextFit and GetTextFit methods.
- /// See and .
- ///
- [EditorBrowsable(EditorBrowsableState.Never)] - public struct TextFit - { - /// - /// True to enable the text fit or false to disable (the default value is false). - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public bool Enable { get; set; } - - /// - /// Minimum Size for text fit (if null, the default value is 10.0f). - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public float? MinSize { get; set; } - - /// - /// Maximum Size for text fit (if null, the default value is 100.0f). - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public float? MaxSize { get; set; } - - /// - /// Step Size for font increase (if null, the default value is 1.0f). - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public float? StepSize { get; set; } - - /// - /// The size type of font, PointSize or PixelSize (the default value is PointSize). - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public FontSizeType FontSizeType { get; set; } - - /// - /// Font Size for text fit - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public float? FontSize { get; set; } - } - - /// - /// A struct to pass data of Placeholder PropertyMap.
- ///
- /// - /// The Placeholder struct is used as an argument to SetPlaceholder and GetPlaceholder methods.
- /// See , , and .
- ///
- [EditorBrowsable(EditorBrowsableState.Never)] - public struct Placeholder - { - /// - /// The text to display when the TextField is empty and inactive. - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public string Text { get; set; } - - /// - /// The text to display when the placeholder has focus. - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public string TextFocused { get; set; } - - /// - /// The color of the placeholder text. - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public Color Color { get; set; } - - /// - /// The FontFamily of the placeholder text. - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public string FontFamily { get; set; } - - /// - /// The FontStyle of the placeholder text (if null, the text control FontStyle is used). - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public FontStyle? FontStyle { get; set; } - - /// - /// The PointSize of the placeholder text.
- /// Not required if PixelSize provided.
- /// If both provided or neither provided then the text control point size is used.
- ///
- [EditorBrowsable(EditorBrowsableState.Never)] - public float? PointSize { get; set; } - - /// - /// The PiexSize of the placeholder text. - /// Not required if PointSize provided.
- /// If both provided or neither provided then the text control point size is used.
- ///
- [EditorBrowsable(EditorBrowsableState.Never)] - public float? PixelSize { get; set; } - - /// - /// The ellipsis of the placeholder text (the default value is false). - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public bool Ellipsis { get; set; } - } - - /// - /// A struct to pass data of HiddenInputSettings PropertyMap.
- ///
- /// - /// The HiddenInput struct is used as an argument to SetHiddenInput and GetHiddenInput methods.
- /// See and .
- ///
- [EditorBrowsable(EditorBrowsableState.Never)] - public struct HiddenInput - { - /// - /// The mode for input text display.
- ///
- [EditorBrowsable(EditorBrowsableState.Never)] - public HiddenInputModeType Mode { get; set; } - - /// - /// All input characters are substituted by this character (if null, the default value is '*').
- ///
- [EditorBrowsable(EditorBrowsableState.Never)] - public char? SubstituteCharacter { get; set; } - - /// - /// Length of text to show or hide, available when HideCount/ShowCount mode is used (if null, the default value is 0).
- ///
- [EditorBrowsable(EditorBrowsableState.Never)] - public int? SubstituteCount { get; set; } - - /// - /// Hide last character after this duration, available when ShowLastCharacter mode (if null, the default value is 1000).
- ///
- [EditorBrowsable(EditorBrowsableState.Never)] - public int? ShowLastCharacterDuration { get; set; } - } - - /// - /// A struct to pass data of SelectionHandleImageLeft, SelectionHandleImageRight, SelectionHandlePressedImageLeft, SelectionHandlePressedImageRight, SelectionHandleMarkerImageLeft and SelectionHandleMarkerImageRight PropertyMap.
- ///
- /// - /// The SelectionHandleImage struct is used as an argument to SetSelectionHandleImage, GetSelectionHandleImage methods, SetSelectionHandlePressedImage, GetSelectionHandlePressedImage, SetSelectionHandleMarkerImage and GetSelectionHandleMarkerImage.
- /// See , , , , , ,
- /// , , , , and .
- ///
- [EditorBrowsable(EditorBrowsableState.Never)] - public struct SelectionHandleImage - { - /// - /// The image path to display for the left selection handle.
- /// It means the handle in the bottom-left.
- /// If the handle needs to be displayed in the top-left, this image will be vertically flipped.
- /// If null or empty string, it doesn't change the property.
- ///
- [EditorBrowsable(EditorBrowsableState.Never)] - public string LeftImageUrl { get; set; } - - /// - /// The image path to display for the right selection handle.
- /// It means the handle in the bottom-right.
- /// If the handle needs to be displayed in the top-right, this image will be vertically flipped.
- /// If null or empty string, it doesn't change the property.
- ///
- [EditorBrowsable(EditorBrowsableState.Never)] - public string RightImageUrl { get; set; } - } - } - - /// /// Pre-defined SlideTransition Direction /// -- 2.7.4