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/object/base-object.h>
25 #include <dali/public-api/text-abstraction/bidirectional-support.h>
30 namespace TextAbstraction
37 * Implementation of the BidirectionalSupport
39 class BidirectionalSupport : public Dali::BaseObject
46 BidirectionalSupport();
51 ~BidirectionalSupport();
54 * @copydoc Dali::BidirectionalSupport::Get()
56 static TextAbstraction::BidirectionalSupport Get();
59 * @copydoc Dali::BidirectionalSupport::CreateInfo()
61 BidiInfoIndex CreateInfo( const Character* const paragraph,
62 Length numberOfCharacters );
65 * @copydoc Dali::BidirectionalSupport::DestroyInfo()
67 void DestroyInfo( BidiInfoIndex bidiInfoIndex );
70 * @copydoc Dali::BidirectionalSupport::Reorder()
72 void Reorder( BidiInfoIndex bidiInfoIndex,
73 CharacterIndex firstCharacterIndex,
74 Length numberOfCharacters,
75 CharacterIndex* visualToLogicalMap );
79 // Undefined copy constructor.
80 BidirectionalSupport( const BidirectionalSupport& );
82 // Undefined assignment constructor.
83 BidirectionalSupport& operator=( BidirectionalSupport& );
85 void* mPlugin; ///< TODO replace this with bidirectional support plugin
90 * Stores bidirectional info per paragraph.
92 struct BidirectionalInfo;
94 Vector<BidirectionalInfo*> mParagraphBidirectionalInfo; ///< Stores the bidirectional info per paragraph.
95 Vector<BidiInfoIndex> mFreeIndices; ///< Stores indices of free positions in the bidirectional info vector.
97 }; // class BidirectionalSupport
99 } // namespace Internal
101 } // namespace TextAbstraction
103 inline static TextAbstraction::Internal::BidirectionalSupport& GetImplementation( TextAbstraction::BidirectionalSupport& bidirectionalSupport )
105 DALI_ASSERT_ALWAYS( bidirectionalSupport && "bidirectional support handle is empty" );
106 BaseObject& handle = bidirectionalSupport.GetBaseObject();
107 return static_cast<TextAbstraction::Internal::BidirectionalSupport&>(handle);
110 inline static const TextAbstraction::Internal::BidirectionalSupport& GetImplementation( const TextAbstraction::BidirectionalSupport& bidirectionalSupport )
112 DALI_ASSERT_ALWAYS( bidirectionalSupport && "bidirectional support handle is empty" );
113 const BaseObject& handle = bidirectionalSupport.GetBaseObject();
114 return static_cast<const TextAbstraction::Internal::BidirectionalSupport&>(handle);
119 #endif // __DALI_INTERNAL_TEXT_ABSTRACTION_BIDIRECTIONAL_SUPPORT_IMPL_H__