f7e3e2fa6bbbaa80eadf196444e61f19af239e78
[platform/core/uifw/dali-adaptor.git] / dali / devel-api / text-abstraction / bidirectional-support.cpp
1 /*
2  * Copyright (c) 2020 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 // CLASS HEADER
19 #include <dali/devel-api/text-abstraction/bidirectional-support.h>
20
21 // INTERNAL INCLUDES
22 #include <dali/internal/text/text-abstraction/bidirectional-support-impl.h>
23
24 namespace Dali
25 {
26 namespace TextAbstraction
27 {
28 BidirectionalSupport::BidirectionalSupport()
29 {
30 }
31
32 BidirectionalSupport::~BidirectionalSupport()
33 {
34 }
35
36 BidirectionalSupport::BidirectionalSupport(Internal::BidirectionalSupport* implementation)
37 : BaseHandle(implementation)
38 {
39 }
40
41 BidirectionalSupport BidirectionalSupport::Get()
42 {
43   return Internal::BidirectionalSupport::Get();
44 }
45
46 BidiInfoIndex BidirectionalSupport::CreateInfo(const Character* const paragraph,
47                                                Length                 numberOfCharacters,
48                                                bool                   matchSystemLanguageDirection,
49                                                LayoutDirection::Type  layoutDirection)
50 {
51   return GetImplementation(*this).CreateInfo(paragraph,
52                                              numberOfCharacters,
53                                              matchSystemLanguageDirection,
54                                              layoutDirection);
55 }
56
57 void BidirectionalSupport::DestroyInfo(BidiInfoIndex bidiInfoIndex)
58 {
59   GetImplementation(*this).DestroyInfo(bidiInfoIndex);
60 }
61
62 void BidirectionalSupport::Reorder(BidiInfoIndex   bidiInfoIndex,
63                                    CharacterIndex  firstCharacterIndex,
64                                    Length          numberOfCharacters,
65                                    CharacterIndex* visualToLogicalMap)
66 {
67   GetImplementation(*this).Reorder(bidiInfoIndex,
68                                    firstCharacterIndex,
69                                    numberOfCharacters,
70                                    visualToLogicalMap);
71 }
72
73 bool BidirectionalSupport::GetMirroredText(Character*          text,
74                                            CharacterDirection* directions,
75                                            Length              numberOfCharacters)
76 {
77   return GetImplementation(*this).GetMirroredText(text,
78                                                   directions,
79                                                   numberOfCharacters);
80 }
81
82 bool BidirectionalSupport::GetParagraphDirection(BidiInfoIndex bidiInfoIndex) const
83 {
84   return GetImplementation(*this).GetParagraphDirection(bidiInfoIndex);
85 }
86
87 void BidirectionalSupport::GetCharactersDirection(BidiInfoIndex       bidiInfoIndex,
88                                                   CharacterDirection* directions,
89                                                   Length              numberOfCharacters)
90 {
91   GetImplementation(*this).GetCharactersDirection(bidiInfoIndex,
92                                                   directions,
93                                                   numberOfCharacters);
94 }
95
96 } // namespace TextAbstraction
97
98 } // namespace Dali