X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali-toolkit%2Finternal%2Ftext%2Ftext-controller-relayouter.h;h=1b586b2b0b3aa6ad3c21785dd8c5c119449051a2;hb=75fe6c4a2f784bd52ccf8eb16049317825338a6e;hp=cfb7e83526b4ce0de2b7d2e6c3dbd874ee24ea9b;hpb=28e96ebc81b38645d8b46ca923fa6aaa0517d2cd;p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git diff --git a/dali-toolkit/internal/text/text-controller-relayouter.h b/dali-toolkit/internal/text/text-controller-relayouter.h index cfb7e83..1b586b2 100644 --- a/dali-toolkit/internal/text/text-controller-relayouter.h +++ b/dali-toolkit/internal/text/text-controller-relayouter.h @@ -2,7 +2,7 @@ #define DALI_TOOLKIT_TEXT_CONTROLLER_RELAYOUTER_H /* - * 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. @@ -28,13 +28,10 @@ namespace Dali { - namespace Toolkit { - namespace Text { - /** * Contains all the relayouting related methods for Text::Controller */ @@ -59,6 +56,14 @@ struct Controller::Relayouter static bool CheckForTextFit(Controller& controller, float pointSize, const Size& layoutSize); /** + * @brief Calculates the point size for text for given layout() + * + * @param[in] controller A reference to the controller class + * @param[in] layoutSize The layout size + */ + static void FitPointSizeforLayout(Controller& controller, const Size& layoutSize); + + /** * @brief Called by the Controller to get the height for a particular width. * * @param[in] controller A reference to the controller class @@ -86,7 +91,7 @@ struct Controller::Relayouter * @param[in/out] layoutSize The Layout size which can be updated depending on the result of the performed operations * @return */ - static bool DoRelayout(Controller& controller, const Size& size, OperationsMask operationsRequired, Size& layoutSize ); + static bool DoRelayout(Controller& controller, const Size& size, OperationsMask operationsRequired, Size& layoutSize); /** * @brief Called by the Controller to calculate the veritcal offset give the control size. @@ -95,6 +100,21 @@ struct Controller::Relayouter * @param[in] controlSize The control size */ static void CalculateVerticalOffset(Controller& controller, const Size& controlSize); + + /** + * @brief Calculates the layout size of control according to @p requestedControllerSize and @p requestedOperationsMask + * + * GetNaturalSize() and GetHeightForWidth() calls this method. + * + * @param[in] controller The controller to calcualte size on it. + * @param[in] requestedControllerSize The requested size of controller to calcualte layout size on it. + * @param[in] requestedOperationsMask The requested operations-mask to calcualte layout size according to it. + * @param[in] restoreLinesAndGlyphPositions whether to restore lines and glyph-positions to status before requesting calculation on size. + * + * @return The calculated layout-size. + */ + static Size CalculateLayoutSizeOnRequiredControllerSize(Controller& controller, const Size& requestedControllerSize, const OperationsMask& requestedOperationsMask, bool restoreLinesAndGlyphPositions); + }; } // namespace Text