Revert "CanvasRenderer: Add missing parentheses for @copydoc"
[platform/core/uifw/dali-adaptor.git] / dali / internal / canvas-renderer / common / drawable-impl.h
1 #ifndef DALI_INTERNAL_DRAWABLE_IMPL_H
2 #define DALI_INTERNAL_DRAWABLE_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 #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-drawable.h>
29 #include <dali/devel-api/adaptor-framework/canvas-renderer.h>
30
31 namespace Dali
32 {
33 namespace Internal
34 {
35 namespace Adaptor
36 {
37 /**
38  * Dali internal Drawable.
39  */
40 class Drawable : public Dali::BaseObject
41 {
42 public:
43   /**
44    * @brief Enumeration for type of drawable.
45    */
46   enum class DrawableTypes
47   {
48     NONE = 0,      ///< Means that type is not defined.
49     SHAPE,         ///< Meaning of Shape class that inherits Drawable.
50     DRAWABLE_GROUP ///< Meaning of DrawableGorup class that inherits Drawable.
51   };
52
53 public:
54   /**
55    * @brief Constructor
56    */
57   Drawable();
58
59   /**
60    * @brief Destructor.
61    */
62   virtual ~Drawable() override;
63
64   /**
65    * @brief Create factory item(implementation) object.
66    */
67   void Create();
68
69   /**
70    * @copydoc Dali::CanvasRenderer::Drawable::SetOpacity
71    */
72   virtual bool SetOpacity(float opacity);
73
74   /**
75    * @copydoc Dali::CanvasRenderer::Drawable::GetOpacity
76    */
77   virtual float GetOpacity() const;
78
79   /**
80    * @copydoc Dali::CanvasRenderer::Drawable::Rotate
81    */
82   virtual bool Rotate(Degree degree);
83
84   /**
85    * @copydoc Dali::CanvasRenderer::Drawable::Scale
86    */
87   virtual bool Scale(float factor);
88
89   /**
90    * @copydoc Dali::CanvasRenderer::Drawable::Translate
91    */
92   virtual bool Translate(Vector2 translate);
93
94   /**
95    * @copydoc Dali::CanvasRenderer::Drawable::Transform
96    */
97   virtual bool Transform(const Dali::Matrix3& matrix);
98
99   /**
100    * @brief Set whether drawable added to the other object(canvas or drawable) or not.
101    * @param[in] added Ture if added, false otherwise.
102    */
103   virtual void SetDrawableAdded(bool added);
104
105   /**
106    * @brief Returns whether this object was added to another object(canvas or drawable).
107    * @return Returns Ture if added, false otherwise.
108    */
109   virtual bool IsDrawableAdded();
110
111   /**
112    * @brief Returns a drawable object pointer.
113    * @return Returns a drawable object pointer.
114    */
115   virtual void* GetObject() const;
116
117   /**
118    * @brief Set a drawable object
119    * @param[in] object drawable object
120    */
121   virtual void SetObject(const void* object);
122
123   /**
124    * @brief Set a changed state.
125    * @param[in] changed The state of changed.
126    */
127   virtual void SetChanged(bool changed);
128
129   /**
130    * @brief Get a changed state.
131    * @return Returns state of changed.
132    */
133   virtual bool GetChanged() const;
134
135   /**
136    * @brief Set drawable's type.
137    * @param[in] type Type of drawable.
138    */
139   virtual void SetDrawableType(DrawableTypes type);
140
141   /**
142    * @brief Get drawable's type.
143    * @return Returns type of drawable.
144    */
145   virtual DrawableTypes GetDrawableType() const;
146
147   /**
148    * @brief Returns a drawable's implements object pointer.
149    * @return Returns a drawable's implements object pointer.
150    */
151   Dali::Internal::Adaptor::Drawable* GetImplementation();
152
153   Drawable(const Drawable&) = delete;
154   Drawable& operator=(Drawable&) = delete;
155   Drawable(Drawable&&)           = delete;
156   Drawable& operator=(Drawable&&) = delete;
157
158 private:
159   Dali::Internal::Adaptor::Drawable* pImpl = nullptr;
160 };
161
162 } // namespace Adaptor
163
164 } // namespace Internal
165
166 inline static Internal::Adaptor::Drawable& GetImplementation(Dali::CanvasRenderer::Drawable& drawable)
167 {
168   DALI_ASSERT_ALWAYS(drawable && "Drawable handle is empty.");
169
170   BaseObject& handle = drawable.GetBaseObject();
171
172   return static_cast<Internal::Adaptor::Drawable&>(handle);
173 }
174
175 inline static const Internal::Adaptor::Drawable& GetImplementation(const Dali::CanvasRenderer::Drawable& drawable)
176 {
177   DALI_ASSERT_ALWAYS(drawable && "Drawable handle is empty.");
178
179   const BaseObject& handle = drawable.GetBaseObject();
180
181   return static_cast<const Internal::Adaptor::Drawable&>(handle);
182 }
183
184 } // namespace Dali
185
186 #endif // DALI_INTERNAL_DRAWABLE_IMPL_H