Revert "[Tizen] Support custom fonts registration"
[platform/core/uifw/dali-adaptor.git] / dali / internal / text / text-abstraction / shaping-impl.h
1 #ifndef __DALI_INTERNAL_TEXT_ABSTRACTION_SHAPING_IMPL_H__
2 #define __DALI_INTERNAL_TEXT_ABSTRACTION_SHAPING_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/common/dali-vector.h>
26 #include <dali/devel-api/text-abstraction/shaping.h>
27
28 namespace Dali
29 {
30
31 namespace TextAbstraction
32 {
33
34 namespace Internal
35 {
36
37 /**
38  * Implementation of the Shaping
39  */
40 class Shaping : public BaseObject
41 {
42 public:
43
44   /**
45    * Constructor
46    */
47   Shaping();
48
49   /**
50    * Destructor
51    */
52   ~Shaping();
53
54   /**
55    * @copydoc Dali::Shaping::Get()
56    */
57   static TextAbstraction::Shaping Get();
58
59   /**
60    * @copydoc Dali::Shaping::Shape()
61    */
62   Length Shape( const Character* const text,
63                 Length numberOfCharacters,
64                 FontId fontId,
65                 Script script );
66
67   /**
68    * @copydoc Dali::Shaping::GetGlyphs()
69    */
70   void GetGlyphs( GlyphInfo* glyphInfo,
71                   CharacterIndex* glyphToCharacterMap );
72
73 private:
74
75   /**
76    * Helper for lazy initialization.
77    */
78   void CreatePlugin();
79
80 private:
81
82   // Undefined copy constructor.
83   Shaping( const Shaping& );
84
85   // Undefined assignment constructor.
86   Shaping& operator=( const Shaping& );
87
88   struct Plugin;
89   Plugin* mPlugin;
90
91 }; // class Shaping
92
93 } // namespace Internal
94
95 } // namespace TextAbstraction
96
97 inline static TextAbstraction::Internal::Shaping& GetImplementation( TextAbstraction::Shaping& shaping )
98 {
99   DALI_ASSERT_ALWAYS( shaping && "shaping handle is empty" );
100   BaseObject& handle = shaping.GetBaseObject();
101   return static_cast<TextAbstraction::Internal::Shaping&>( handle );
102 }
103
104 inline static const TextAbstraction::Internal::Shaping& GetImplementation( const TextAbstraction::Shaping& shaping )
105 {
106   DALI_ASSERT_ALWAYS( shaping && "shaping handle is empty" );
107   const BaseObject& handle = shaping.GetBaseObject();
108   return static_cast<const TextAbstraction::Internal::Shaping&>( handle );
109 }
110
111 } // namespace Dali
112
113 #endif // __DALI_INTERNAL_TEXT_ABSTRACTION_SHAPING_IMPL_H__