[dali_2.3.20] Merge branch 'devel/master'
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / internal / text / line-helper-functions.h
1 #ifndef DALI_TOOLKIT_TEXT_LINE_HELPER_FUNCTIONS_H
2 #define DALI_TOOLKIT_TEXT_LINE_HELPER_FUNCTIONS_H
3
4 /*
5  * Copyright (c) 2021 Samsung Electronics Co., Ltd.
6  *
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
10  *
11  * http://www.apache.org/licenses/LICENSE-2.0
12  *
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.
18  *
19  */
20
21 // INTERNAL INCLUDES
22
23 #include <dali-toolkit/devel-api/text/text-enumerations-devel.h>
24 #include <dali-toolkit/internal/text/line-run.h>
25
26 namespace Dali
27 {
28 namespace Toolkit
29 {
30 namespace Text
31 {
32 /**
33   * @brief Retrieves the vertical offset to shift text inside line to up by negative value and to down by positive value.
34   * The shifting depends on the vertical line alignment @p verLineAlign and lineSpacing when the lineSpacing is poistive.
35   * When the lineSpacing is negative then ignore @p verLineAlign
36   * @param[in] line the line.
37   * @param[in] line the line.
38   *
39   * @return The vertical offset before text.
40   */
41 float GetPreOffsetVerticalLineAlignment(const LineRun& line, const Dali::Toolkit::DevelText::VerticalLineAlignment::Type& verLineAlign);
42
43 /**
44   * @brief Retrieves the vertical offset to shift the next line to up by negative value and to down by positive value.
45   * The shifting depends on the vertical line alignment @p verLineAlign and lineSpacing when the lineSpacing is poistive.
46   * When the lineSpacing is negative then ignore @p verLineAlign
47   * @param[in] line the line.
48   * @param[in] line the line.
49   *
50   * @return The vertical offset after text.
51   */
52 float GetPostOffsetVerticalLineAlignment(const LineRun& line, const Dali::Toolkit::DevelText::VerticalLineAlignment::Type& verLineAlign);
53 } // namespace Text
54
55 } // namespace Toolkit
56
57 } // namespace Dali
58
59 #endif // DALI_TOOLKIT_TEXT_LINE_HELPER_FUNCTIONS_H