Text improvement
[platform/core/uifw/dali-adaptor.git] / dali / internal / text / text-abstraction / text-renderer-impl.h
1 #ifndef DALI_INTERNAL_TEXT_ABSTRACTION_TEXT_RENDERER_IMPL_H
2 #define DALI_INTERNAL_TEXT_ABSTRACTION_TEXT_RENDERER_IMPL_H
3
4 /*
5  * Copyright (c) 2019 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/text-renderer.h>
26
27 namespace Dali
28 {
29
30 namespace TextAbstraction
31 {
32
33 namespace Internal
34 {
35
36 /**
37  * Implementation of the TextRenderer
38  */
39 class TextRenderer : public BaseObject
40 {
41 public:
42
43   /**
44    * Constructor
45    */
46   TextRenderer();
47
48   /**
49    * Destructor
50    */
51   ~TextRenderer();
52
53   /**
54    * @copydoc Dali::TextRenderer::Get()
55    */
56   static TextAbstraction::TextRenderer Get();
57
58   /**
59    * @copydoc Dali::TextRenderer::Render()
60    */
61   Devel::PixelBuffer Render(const TextAbstraction::TextRenderer::Parameters& parameters);
62
63 private:
64
65   // Undefined copy constructor.
66   TextRenderer(const TextRenderer&);
67
68   // Undefined assignment constructor.
69   TextRenderer& operator=(const TextRenderer&);
70
71 }; // class TextRenderer
72
73 } // namespace Internal
74
75 } // namespace TextAbstraction
76
77 inline static TextAbstraction::Internal::TextRenderer& GetImplementation(TextAbstraction::TextRenderer& textRenderer)
78 {
79   DALI_ASSERT_ALWAYS(textRenderer && "textRenderer handle is empty");
80   BaseObject& handle = textRenderer.GetBaseObject();
81   return static_cast<TextAbstraction::Internal::TextRenderer&>(handle);
82 }
83
84 inline static const TextAbstraction::Internal::TextRenderer& GetImplementation(const TextAbstraction::TextRenderer& textRenderer)
85 {
86   DALI_ASSERT_ALWAYS(textRenderer && "textRenderer handle is empty");
87   const BaseObject& handle = textRenderer.GetBaseObject();
88   return static_cast<const TextAbstraction::Internal::TextRenderer&>(handle);
89 }
90
91 } // namespace Dali
92
93 #endif // DALI_INTERNAL_TEXT_ABSTRACTION_TEXT_RENDERER_IMPL_H