d4ff5b32c4af8b2a4c05d438e6ce92a92b17fbd8
[platform/core/uifw/dali-adaptor.git] / text / dali / internal / text-abstraction / bidirectional-support-impl.h
1 #ifndef __DALI_INTERNAL_TEXT_ABSTRACTION_BIDIRECTIONAL_SUPPORT_IMPL_H__
2 #define __DALI_INTERNAL_TEXT_ABSTRACTION_BIDIRECTIONAL_SUPPORT_IMPL_H__
3
4 /*
5  * Copyright (c) 2015 Samsung Electronics Co., Ltd.
6  *
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
10  *
11  * http://www.apache.org/licenses/LICENSE-2.0
12  *
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.
18  *
19  */
20
21 // EXTERNAL INCLUDES
22 #include <dali/public-api/object/base-object.h>
23
24 // INTERNAL INCLUDES
25 #include <dali/public-api/text-abstraction/bidirectional-support.h>
26
27 namespace Dali
28 {
29
30 namespace TextAbstraction
31 {
32
33 namespace Internal
34 {
35
36 /**
37  * Implementation of the BidirectionalSupport
38  */
39
40 class BidirectionalSupport : public Dali::BaseObject
41 {
42 public:
43
44   /**
45    * Constructor
46    */
47   BidirectionalSupport();
48
49   /**
50    * Destructor
51    */
52   ~BidirectionalSupport();
53
54   /**
55    * @copydoc Dali::BidirectionalSupport::Get()
56    */
57   static TextAbstraction::BidirectionalSupport Get();
58
59   /**
60    * @copydoc Dali::BidirectionalSupport::CreateInfo()
61    */
62   BidiInfoIndex CreateInfo( const Character* const paragraph,
63                             Length numberOfCharacters );
64
65   /**
66    * @copydoc Dali::BidirectionalSupport::DestroyInfo()
67    */
68   void DestroyInfo( BidiInfoIndex bidiInfoIndex );
69
70   /**
71    * @copydoc Dali::BidirectionalSupport::Reorder()
72    */
73   void Reorder( BidiInfoIndex bidiInfoIndex,
74                 CharacterIndex firstCharacterIndex,
75                 Length numberOfCharacters,
76                 CharacterIndex* visualToLogicalMap );
77
78 private:
79
80   // Undefined copy constructor.
81   BidirectionalSupport( const BidirectionalSupport& );
82
83   // Undefined assignment constructor.
84   BidirectionalSupport& operator=( BidirectionalSupport& );
85
86   void* mPlugin; ///< TODO replace this with bidirectional support plugin
87
88 }; // class BidirectionalSupport
89
90 } // namespace Internal
91
92 } // namespace TextAbstraction
93
94 inline static TextAbstraction::Internal::BidirectionalSupport& GetImplementation( TextAbstraction::BidirectionalSupport& bidirectionalSupport )
95 {
96   DALI_ASSERT_ALWAYS( bidirectionalSupport && "bidirectional support handle is empty" );
97   BaseObject& handle = bidirectionalSupport.GetBaseObject();
98   return static_cast<TextAbstraction::Internal::BidirectionalSupport&>(handle);
99 }
100
101 inline static const TextAbstraction::Internal::BidirectionalSupport& GetImplementation( const TextAbstraction::BidirectionalSupport& bidirectionalSupport )
102 {
103   DALI_ASSERT_ALWAYS( bidirectionalSupport && "bidirectional support handle is empty" );
104   const BaseObject& handle = bidirectionalSupport.GetBaseObject();
105   return static_cast<const TextAbstraction::Internal::BidirectionalSupport&>(handle);
106 }
107
108 } // namespace Dali
109
110 #endif // __DALI_INTERNAL_TEXT_ABSTRACTION_BIDIRECTIONAL_SUPPORT_IMPL_H__