1 #ifndef DALI_TOOLKIT_TEXT_GEOMETRY_DEVEL_H
2 #define DALI_TOOLKIT_TEXT_GEOMETRY_DEVEL_H
5 * Copyright (c) 2022 Samsung Electronics Co., Ltd.
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
22 #include <dali-toolkit/public-api/controls/text-controls/text-label.h>
23 #include <dali-toolkit/public-api/controls/text-controls/text-editor.h>
24 #include <dali-toolkit/public-api/controls/text-controls/text-field.h>
32 namespace TextGeometry
36 * @brief Get the line bounding rectangle.
37 * if the requested index is out of range or the line is not yet rendered, a rect of {0, 0, 0, 0} is returned.
39 * @param[in] editor the editor controller that contains the line.
40 * @param[in] lineIndex line index to which we want to calculate the geometry for.
41 * @return bounding rectangle.
43 DALI_TOOLKIT_API Rect<float> GetLineBoundingRectangle(TextEditor editor, const uint32_t lineIndex);
46 * @brief Get the line bounding rectangle.
47 * if the requested index is out of range or the line is not yet rendered, a rect of {0, 0, 0, 0} is returned.
49 * @param[in] label the label controller that contains the line.
50 * @param[in] lineIndex line index to which we want to calculate the geometry for.
51 * @return bounding rectangle.
53 DALI_TOOLKIT_API Rect<float> GetLineBoundingRectangle(TextLabel label, const uint32_t lineIndex);
56 * @brief Get the line bounding rectangle.
57 * if the requested index is out of range or the line is not yet rendered, a rect of {0, 0, 0, 0} is returned.
59 * @param[in] field the field controller that contains the line.
60 * @param[in] lineIndex line index to which we want to calculate the geometry for.
61 * @return bounding rectangle.
63 DALI_TOOLKIT_API Rect<float> GetLineBoundingRectangle(TextField field, const uint32_t lineIndex);
66 * @brief Get the character bounding rectangle.
67 * If the text is not yet rendered or the index > text.Count(); a rect of {0, 0, 0, 0} is returned.
69 * @param[in] label text model containing text info.
70 * @param[in] charIndex character index to which we want to calculate the geometry for.
71 * @return bounding rectangle.
73 DALI_TOOLKIT_API Rect<float> GetCharacterBoundingRectangle(TextLabel label, const uint32_t charIndex);
76 * @brief Get the character bounding rectangle.
77 * If the text is not yet rendered or the index > text.Count(); a rect of {0, 0, 0, 0} is returned.
79 * @param[in] field text model containing text info.
80 * @param[in] charIndex character index to which we want to calculate the geometry for.
81 * @return bounding rectangle.
83 DALI_TOOLKIT_API Rect<float> GetCharacterBoundingRectangle(TextField field, const uint32_t charIndex);
86 * @brief Get the character bounding rectangle.
87 * If the text is not yet rendered or the index > text.Count(); a rect of {0, 0, 0, 0} is returned.
89 * @param[in] editor text model containing text info.
90 * @param[in] charIndex character index to which we want to calculate the geometry for.
91 * @return bounding rectangle.
93 DALI_TOOLKIT_API Rect<float> GetCharacterBoundingRectangle(TextEditor editor, const uint32_t charIndex);
96 } // namespace TextGeometry
100 } // namespace Toolkit
104 #endif //DALI_TOOLKIT_TEXT_GEOMETRY_DEVEL_H