Merge branch 'devel/master' into devel/graphics
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / internal / text / rendering / text-backend-impl.h
1 #ifndef DALI_TOOLKIT_INTERNAL_TEXT_BACKEND_H
2 #define DALI_TOOLKIT_INTERNAL_TEXT_BACKEND_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-toolkit/internal/text/rendering/text-backend.h>
26
27 namespace Dali
28 {
29 namespace Toolkit
30 {
31 namespace Text
32 {
33 namespace Internal
34 {
35 /**
36  * Implementation of the text rendering backend
37  */
38 class Backend : public BaseObject
39 {
40 public:
41   /**
42    * Constructor
43    */
44   Backend();
45
46   /**
47    * Destructor
48    */
49   ~Backend();
50
51   /**
52    * @copydoc Dali::Toolkit::Text::Backend::Get()
53    */
54   static Dali::Toolkit::Text::Backend Get();
55
56   /**
57    * @copydoc Dali::Toolkit::Text::Backend::NewRenderer()
58    */
59   RendererPtr NewRenderer(unsigned int renderingType);
60
61 private:
62   // Undefined copy constructor.
63   Backend(const Backend&);
64
65   // Undefined assignment constructor.
66   Backend& operator=(Backend&);
67
68 private:
69   struct Impl;
70   Impl* mImpl;
71
72 }; // class Backend
73
74 } // namespace Internal
75
76 inline static Internal::Backend& GetImplementation(Backend& backend)
77 {
78   DALI_ASSERT_ALWAYS(backend && "backend handle is empty");
79   BaseObject& handle = backend.GetBaseObject();
80   return static_cast<Internal::Backend&>(handle);
81 }
82
83 inline static const Internal::Backend& GetImplementation(const Backend& backend)
84 {
85   DALI_ASSERT_ALWAYS(backend && "backend handle is empty");
86   const BaseObject& handle = backend.GetBaseObject();
87   return static_cast<const Internal::Backend&>(handle);
88 }
89
90 } // namespace Text
91
92 } // namespace Toolkit
93
94 } // namespace Dali
95
96 #endif // DALI_TOOLKIT_INTERNAL_TEXT_BACKEND_H