X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=automated-tests%2Fsrc%2Fdali-toolkit-internal%2Fdali-toolkit-test-utils%2Ftoolkit-text-utils.h;h=b064bfa3877055cd325bf340dc0426f40fc917fe;hb=HEAD;hp=6e30bbb35efa9fd404b3c6eb742ab6aaf1bfe55b;hpb=9161d9828d1a5bb3c7eaf83002863de84b23b751;p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git diff --git a/automated-tests/src/dali-toolkit-internal/dali-toolkit-test-utils/toolkit-text-utils.h b/automated-tests/src/dali-toolkit-internal/dali-toolkit-test-utils/toolkit-text-utils.h index 6e30bbb..b064bfa 100644 --- a/automated-tests/src/dali-toolkit-internal/dali-toolkit-test-utils/toolkit-text-utils.h +++ b/automated-tests/src/dali-toolkit-internal/dali-toolkit-test-utils/toolkit-text-utils.h @@ -2,7 +2,7 @@ #define DALI_TOOLKIT_TEXT_UTILS_H /* - * Copyright (c) 2021 Samsung Electronics Co., Ltd. + * Copyright (c) 2022 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. @@ -20,28 +20,26 @@ // INTERNAL INCLUDES #include -#include +#include #include namespace Dali { - namespace Toolkit { - namespace Text { - /** * @brief Some layout options. */ struct LayoutOptions { LayoutOptions() - : align{ true } - {} + : align{true} + { + } - bool align : 1; ///< Whether to align the lines. + bool align : 1; ///< Whether to align the lines. }; /** @@ -56,37 +54,76 @@ struct LayoutOptions * @param[out] textModel Pointer to a text model instance. * @param[out] metrics Pointer to a wrapper around FontClient used to get metrics. * @param[in] markupProcessorEnabled Enable markup processor to use markup text. + * @param[in] wrapMode Line wrap mode. + * @param[in] ellipsisEnabled Whether the ellipsis layout option is enabled. + * @param[in] ellipsisPosition Where is the location the text elide. + * @param[in] lineSpacing The height of the line in points. + * @param[in] characterSpacing The spacing between the characters. */ -void CreateTextModel( const std::string& text, - const Size& textArea, - const Vector& fontDescriptions, - const LayoutOptions& options, - Size& layoutSize, - ModelPtr& textModel, - MetricsPtr& metrics, - bool markupProcessorEnabled, - LineWrap::Mode wrapMode ); +void CreateTextModel(const std::string& text, + const Size& textArea, + const Vector& fontDescriptions, + const LayoutOptions& options, + Size& layoutSize, + ModelPtr& textModel, + MetricsPtr& metrics, + bool markupProcessorEnabled, + LineWrap::Mode wrapMode, + bool ellipsisEnabled, + DevelText::EllipsisPosition::Type ellipsisPosition, + float lineSpacing, + float characterSpacing); /** * @brief Configures the text @p controller similarly to the one configured by the text-label. * * @param[in,out] The text controller to configure. */ -void ConfigureTextLabel( ControllerPtr controller ); +void ConfigureTextLabel(ControllerPtr controller); /** * @brief Configures the text @p controller similarly to the one configured by the text-field. * * @param[in,out] The text controller to configure. */ -void ConfigureTextField( ControllerPtr controller ); +void ConfigureTextField(ControllerPtr controller); /** * @brief Configures the text @p controller similarly to the one configured by the text-editor. * * @param[in,out] The text controller to configure. */ -void ConfigureTextEditor( ControllerPtr controller ); +void ConfigureTextEditor(ControllerPtr controller); + +/** + * @brief Creates one FontDescriptionRun then add it to FontDescription list. + * + * @param[in] characterRun The initial character index and the number of characters of the run. + * @param[in] fontFamilyName The font's family name. + * @param[in] weight The font's weight. + * @param[in] width The font's width. + * @param[in] slant The font's slant. + * @param[in] size Whether the font's family is defined. + * @param[in] familyDefined Whether the font's weight is defined. + * @param[in] weightDefined Whether the font's width is defined. + * @param[in] widthDefined Whether the ellipsis layout option is enabled. + * @param[in] slantDefined Whether the font's slant is defined. + * @param[in] sizeDefined Whether the font's size is defined. + +* @return vector contains one FontDescriptionRun. + */ +Vector CreateSingleFontDescription( + const CharacterRun& characterRun, + const std::string fontFamilyName, + const FontWeight weight, + const FontWidth width, + const FontSlant slant, + const PointSize26Dot6 size, + const bool familyDefined, + const bool weightDefined, + const bool widthDefined, + const bool slantDefined, + const bool sizeDefined); } // namespace Text