1 #ifndef __DALI_INTERNAL_TEXT_ABSTRACTION_BIDIRECTIONAL_SUPPORT_IMPL_H__
2 #define __DALI_INTERNAL_TEXT_ABSTRACTION_BIDIRECTIONAL_SUPPORT_IMPL_H__
5 * Copyright (c) 2015 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/public-api/common/dali-vector.h>
23 #include <dali/public-api/object/base-object.h>
26 #include <dali/devel-api/text-abstraction/bidirectional-support.h>
31 namespace TextAbstraction
38 * Implementation of the BidirectionalSupport
40 class BidirectionalSupport : public BaseObject
47 BidirectionalSupport();
52 ~BidirectionalSupport();
55 * @copydoc Dali::BidirectionalSupport::Get()
57 static TextAbstraction::BidirectionalSupport Get();
60 * @copydoc Dali::BidirectionalSupport::CreateInfo()
62 BidiInfoIndex CreateInfo( const Character* const paragraph,
63 Length numberOfCharacters,
64 bool matchSystemLanguageDirection,
65 LayoutDirection::Type layoutDirection );
68 * @copydoc Dali::BidirectionalSupport::DestroyInfo()
70 void DestroyInfo( BidiInfoIndex bidiInfoIndex );
73 * @copydoc Dali::BidirectionalSupport::Reorder()
75 void Reorder( BidiInfoIndex bidiInfoIndex,
76 CharacterIndex firstCharacterIndex,
77 Length numberOfCharacters,
78 CharacterIndex* visualToLogicalMap );
81 * @copydoc Dali::BidirectionalSupport::GetMirroredText()
83 bool GetMirroredText( Character* text,
84 CharacterDirection* directions,
85 Length numberOfCharacters );
88 * @copydoc Dali::BidirectionalSupport::GetParagraphDirection()
90 bool GetParagraphDirection( BidiInfoIndex bidiInfoIndex ) const;
93 * @copydoc Dali::BidirectionalSupport::GetCharactersDirection()
95 void GetCharactersDirection( BidiInfoIndex bidiInfoIndex,
96 CharacterDirection* directions,
97 Length numberOfCharacters );
102 * Helper for lazy initialization.
108 // Undefined copy constructor.
109 BidirectionalSupport( const BidirectionalSupport& );
111 // Undefined assignment constructor.
112 BidirectionalSupport& operator=( const BidirectionalSupport& );
119 }; // class BidirectionalSupport
121 } // namespace Internal
123 } // namespace TextAbstraction
125 inline static TextAbstraction::Internal::BidirectionalSupport& GetImplementation( TextAbstraction::BidirectionalSupport& bidirectionalSupport )
127 DALI_ASSERT_ALWAYS( bidirectionalSupport && "bidirectional support handle is empty" );
128 BaseObject& handle = bidirectionalSupport.GetBaseObject();
129 return static_cast<TextAbstraction::Internal::BidirectionalSupport&>(handle);
132 inline static const TextAbstraction::Internal::BidirectionalSupport& GetImplementation( const TextAbstraction::BidirectionalSupport& bidirectionalSupport )
134 DALI_ASSERT_ALWAYS( bidirectionalSupport && "bidirectional support handle is empty" );
135 const BaseObject& handle = bidirectionalSupport.GetBaseObject();
136 return static_cast<const TextAbstraction::Internal::BidirectionalSupport&>(handle);
141 #endif // __DALI_INTERNAL_TEXT_ABSTRACTION_BIDIRECTIONAL_SUPPORT_IMPL_H__