Make GlyphBufferData as another class
[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) 2021 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 namespace TextAbstraction
30 {
31 namespace Internal
32 {
33 /**
34  * Implementation of the TextRenderer
35  */
36 class TextRenderer : public BaseObject
37 {
38 public:
39   /**
40    * Constructor
41    */
42   TextRenderer();
43
44   /**
45    * Destructor
46    */
47   ~TextRenderer();
48
49   /**
50    * @copydoc Dali::TextRenderer::Get()
51    */
52   static TextAbstraction::TextRenderer Get();
53
54   /**
55    * @copydoc Dali::TextRenderer::Render()
56    */
57   Devel::PixelBuffer Render(const TextAbstraction::TextRenderer::Parameters& parameters);
58
59 private:
60   // Undefined copy constructor.
61   TextRenderer(const TextRenderer&);
62
63   // Undefined assignment constructor.
64   TextRenderer& operator=(const TextRenderer&);
65
66 }; // class TextRenderer
67
68 } // namespace Internal
69
70 } // namespace TextAbstraction
71
72 inline static TextAbstraction::Internal::TextRenderer& GetImplementation(TextAbstraction::TextRenderer& textRenderer)
73 {
74   DALI_ASSERT_ALWAYS(textRenderer && "textRenderer handle is empty");
75   BaseObject& handle = textRenderer.GetBaseObject();
76   return static_cast<TextAbstraction::Internal::TextRenderer&>(handle);
77 }
78
79 inline static const TextAbstraction::Internal::TextRenderer& GetImplementation(const TextAbstraction::TextRenderer& textRenderer)
80 {
81   DALI_ASSERT_ALWAYS(textRenderer && "textRenderer handle is empty");
82   const BaseObject& handle = textRenderer.GetBaseObject();
83   return static_cast<const TextAbstraction::Internal::TextRenderer&>(handle);
84 }
85
86 } // namespace Dali
87
88 #endif // DALI_INTERNAL_TEXT_ABSTRACTION_TEXT_RENDERER_IMPL_H