[dali_2.3.21] Merge branch 'devel/master'
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / devel-api / controls / text-controls / text-label-devel.cpp
1 /*
2  * Copyright (c) 2021 Samsung Electronics Co., Ltd.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  *
16  */
17
18 // INTERNAL INCLUDES
19 #include <dali-toolkit/devel-api/controls/text-controls/text-label-devel.h>
20 #include <dali-toolkit/internal/controls/text-controls/text-label-impl.h>
21
22 namespace Dali
23 {
24 namespace Toolkit
25 {
26 namespace DevelTextLabel
27 {
28 AnchorClickedSignalType& AnchorClickedSignal(TextLabel textLabel)
29 {
30   return GetImpl(textLabel).AnchorClickedSignal();
31 }
32
33 TextFitChangedSignalType& TextFitChangedSignal(TextLabel textLabel)
34 {
35   return GetImpl(textLabel).TextFitChangedSignal();
36 }
37
38 Vector<Vector2> GetTextSize(TextLabel textLabel, const uint32_t startIndex, const uint32_t endIndex)
39 {
40   return GetImpl(textLabel).GetTextSize(startIndex, endIndex);
41 }
42
43 Vector<Vector2> GetTextPosition(TextLabel textLabel, const uint32_t startIndex, const uint32_t endIndex)
44 {
45   return GetImpl(textLabel).GetTextPosition(startIndex, endIndex);
46 }
47
48 Rect<> GetTextBoundingRectangle(TextLabel textLabel, uint32_t startIndex, uint32_t endIndex)
49 {
50   return GetImpl(textLabel).GetTextBoundingRectangle(startIndex, endIndex);
51 }
52
53 void SetTextFitArray(TextLabel textLabel, const bool enable, std::vector<FitOption>& fitOptions)
54 {
55   GetImpl(textLabel).SetTextFitArray(enable, fitOptions);
56 }
57
58 std::vector<FitOption>& GetTextFitArray(TextLabel textLabel)
59 {
60   return GetImpl(textLabel).GetTextFitArray();
61 }
62
63 bool IsTextFitArrayEnabled(TextLabel textLabel)
64 {
65   return GetImpl(textLabel).IsTextFitArrayEnabled();
66 }
67
68 void SetRemoveFrontInset(TextLabel textLabel, const bool remove)
69 {
70   GetImpl(textLabel).SetRemoveFrontInset(remove);
71 }
72
73 bool IsRemoveFrontInset(TextLabel textLabel)
74 {
75   return GetImpl(textLabel).IsRemoveFrontInset();
76 }
77
78 void SetRemoveBackInset(TextLabel textLabel, const bool remove)
79 {
80   GetImpl(textLabel).SetRemoveBackInset(remove);
81 }
82
83 bool IsRemoveBackInset(TextLabel textLabel)
84 {
85   return GetImpl(textLabel).IsRemoveBackInset();
86 }
87
88 } // namespace DevelTextLabel
89
90 } // namespace Toolkit
91
92 } // namespace Dali