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