CanvasRenderer:: Add Picture class
[platform/core/uifw/dali-adaptor.git] / dali / internal / canvas-renderer / tizen / picture-impl-tizen.h
1 #ifndef DALI_INTERNAL_TIZEN_PICTURE_IMPL_TIZEN_H
2 #define DALI_INTERNAL_TIZEN_PICTURE_IMPL_TIZEN_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 #ifdef THORVG_SUPPORT
23 #include <thorvg.h>
24 #endif
25 #include <dali/public-api/object/base-object.h>
26
27 // INTERNAL INCLUDES
28 #include <dali/devel-api/adaptor-framework/canvas-renderer-picture.h>
29 #include <dali/internal/canvas-renderer/common/picture-impl.h>
30
31 namespace Dali
32 {
33 namespace Internal
34 {
35 namespace Adaptor
36 {
37 /**
38  * Dali internal Picture.
39  */
40 class PictureTizen : public Dali::Internal::Adaptor::Picture
41 {
42 public:
43   /**
44    * @brief Creates a Picture object.
45    * @return A pointer to a newly allocated picture
46    */
47   static PictureTizen* New();
48
49   /**
50    * @copydoc Dali::CanvasRenderer::Picture::Load()
51    */
52   bool Load(const std::string& url) override;
53
54   /**
55    * @copydoc Dali::CanvasRenderer::Picture::SetSize()
56    */
57   bool SetSize(Vector2 size) override;
58
59   /**
60    * @copydoc Dali::CanvasRenderer::Picture::GetSize()
61    */
62   Vector2 GetSize() const override;
63
64 private:
65   PictureTizen(const PictureTizen&) = delete;
66   PictureTizen& operator=(PictureTizen&) = delete;
67   PictureTizen(PictureTizen&&)           = delete;
68   PictureTizen& operator=(PictureTizen&&) = delete;
69
70   /**
71    * @brief Constructor
72    */
73   PictureTizen();
74
75   /**
76    * @brief Destructor.
77    */
78   ~PictureTizen() override;
79
80 private:
81   /**
82    * @brief Initializes member data.
83    */
84   void Initialize();
85
86 private:
87 #ifdef THORVG_SUPPORT
88   tvg::Picture* mTvgPicture;
89 #endif
90 };
91
92 } // namespace Adaptor
93
94 } // namespace Internal
95
96 } // namespace Dali
97
98 #endif // DALI_INTERNAL_TIZEN_PICTURE_IMPL_TIZEN_H