[dali_2.3.20] Merge branch 'devel/master'
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / internal / text / rendering / vector-based / vector-blob-atlas-share.h
1 #ifndef DALI_TOOLKIT_VECTOR_BLOB_ATLAS_SHARE_H
2 #define DALI_TOOLKIT_VECTOR_BLOB_ATLAS_SHARE_H
3
4 /*
5  * Copyright (c) 2022 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 // INTERNAL INCLUDES
22 #include <dali-toolkit/internal/text/rendering/vector-based/vector-blob-atlas.h>
23
24 namespace Dali
25 {
26 namespace Toolkit
27 {
28 namespace Text
29 {
30 /**
31  * @brief A singleton for sharing atlases containing vector data
32  *
33  */
34 class VectorBlobAtlasShare : public BaseHandle
35 {
36 public:
37   /**
38    * @brief Create a VectorBlobAtlasShare handle.
39    *
40    * Calling member functions with an uninitialised handle is not allowed.
41    */
42   VectorBlobAtlasShare();
43
44   /**
45    * @brief Destructor
46    *
47    * This is non-virtual since derived Handle types must not contain data or virtual methods.
48    */
49   ~VectorBlobAtlasShare();
50
51   /**
52    * @brief Create or retrieve VectorBlobAtlasShare singleton.
53    *
54    * @return A handle to the VectorBlobAtlasShare control.
55    */
56   static VectorBlobAtlasShare Get();
57
58   /**
59    * @brief Retrieve the current (empty or partially empty) atlas.
60    *
61    * @return The current atlas.
62    */
63   VectorBlobAtlas* GetCurrentAtlas();
64
65   /**
66    * @brief Retrieve a new empty atlas.
67    *
68    * @pre The current atlas should be full.
69    * @return A new atlas.
70    */
71   VectorBlobAtlas* GetNewAtlas();
72
73 public:
74   // Default copy and move operator
75   VectorBlobAtlasShare(const VectorBlobAtlasShare& rhs) = default;
76   VectorBlobAtlasShare(VectorBlobAtlasShare&& rhs)      = default;
77   VectorBlobAtlasShare& operator=(const VectorBlobAtlasShare& rhs) = default;
78   VectorBlobAtlasShare& operator=(VectorBlobAtlasShare&& rhs) = default;
79
80 private:
81   class Impl;
82
83   explicit DALI_INTERNAL VectorBlobAtlasShare(VectorBlobAtlasShare::Impl* impl);
84 };
85
86 } // namespace Text
87
88 } // namespace Toolkit
89
90 } // namespace Dali
91
92 #endif // DALI_TOOLKIT_VECTOR_BLOB_ATLAS_SHARE_H