1 #ifndef __DALI_PLATFORM_TEXT_ABSTRACTION_BIDIRECTIONAL_SUPPORT_H__
2 #define __DALI_PLATFORM_TEXT_ABSTRACTION_BIDIRECTIONAL_SUPPORT_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/text-abstraction/text-abstraction.h>
25 #include <dali/public-api/object/base-handle.h>
30 namespace Internal DALI_INTERNAL
33 namespace TextAbstraction
35 class BidirectionalSupport;
39 namespace TextAbstraction
44 * BidirectionalSupport API
47 class DALI_IMPORT_API BidirectionalSupport : public BaseHandle
53 * @brief Create an uninitialized TextAbstraction handle.
56 BidirectionalSupport();
61 * This is non-virtual since derived Handle types must not contain data or virtual methods.
63 ~BidirectionalSupport();
66 * @brief This constructor is used by BidirectionalSupport::Get().
68 * @param[in] implementation a pointer to the internal bidirectional support object.
70 explicit DALI_INTERNAL BidirectionalSupport( Dali::Internal::TextAbstraction::BidirectionalSupport* implementation );
73 * @brief Retrieve a handle to the BidirectionalSupport instance.
75 * @return A handle to the BidirectionalSupport
77 static BidirectionalSupport Get();
80 * @brief Creates bidirectional data for the whole paragraph.
82 * @param[in] paragraph Pointer to the first character of the paragraph coded in UTF32.
83 * @param[in] numberOfCharacters The number of characters of the paragraph.
85 * @return An index of an object inside a table storing the bidirectional data.
87 BidiInfoIndex CreateInfo( const Character* const paragraph,
88 Length numberOfCharacters );
91 * @brief Destroys the bidirectional data.
93 * @param[in] bidiInfoIndex The index to the of the object inside the table storing the bidirectional data for the current paragraph.
95 void DestroyInfo( BidiInfoIndex bidiInfoIndex );
98 * @brief Reorders a line of a paragraph.
100 * @pre visualToLogicalMap must have enough space allocated for @p numberOfCharacters.
102 * @param[in] bidiInfoIndex The index to the of the object inside the table storing the bidirectional data for the current paragraph.
103 * @param[in] firstCharacterIndex The first character of the line within the whole paragraph.
104 * @param[in] numberOfCharacters The number of characters of the line.
105 * @param[out] visualToLogicalMap The visual to logical conversion map.
107 void Reorder( BidiInfoIndex bidiInfoIndex,
108 CharacterIndex firstCharacterIndex,
109 Length numberOfCharacters,
110 CharacterIndex* visualToLogicalMap );
113 } // namespace TextAbstraction
117 #endif // __DALI_PLATFORM_TEXT_ABSTRACTION_BIDIRECTIONAL_SUPPORT_H__