da87b26eaf26c0669ca8345425b6918bd114e5fb
[platform/core/uifw/dali-adaptor.git] / dali / devel-api / adaptor-framework / canvas-renderer-radial-gradient.h
1 #ifndef DALI_CANVAS_RENDERER_RADIAL_GRADIENT_H
2 #define DALI_CANVAS_RENDERER_RADIAL_GRADIENT_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-handle.h>
23
24 // INTERNAL INCLUDES
25 #include <dali/devel-api/adaptor-framework/canvas-renderer-gradient.h>
26 #include <dali/devel-api/adaptor-framework/canvas-renderer.h>
27 #include <dali/public-api/dali-adaptor-common.h>
28
29 namespace Dali
30 {
31 /**
32  * @addtogroup dali_adaptor_framework
33  * @{
34  */
35
36 namespace Internal DALI_INTERNAL
37 {
38 namespace Adaptor
39 {
40 class CanvasRenderer;
41 class RadialGradient;
42 } // namespace Adaptor
43 } // namespace DALI_INTERNAL
44
45 /**
46  * @brief A class representing the radial gradient fill of the Shape object.
47  */
48 class DALI_ADAPTOR_API CanvasRenderer::RadialGradient : public CanvasRenderer::Gradient
49 {
50 public:
51   /**
52    * @brief Creates an initialized handle to a new CanvasRenderer::RadialGradient.
53    * @return A handle to a newly allocated RadialGradient
54    */
55   static RadialGradient New();
56
57 public:
58   /**
59    * @brief Creates an empty handle. Use CanvasRenderer::RadialGradient::New() to create an initialized object.
60    */
61   RadialGradient();
62
63   /**
64    * @brief Destructor.
65    */
66   ~RadialGradient();
67
68   /**
69    * @brief This copy constructor is required for (smart) pointer semantics.
70    *
71    * @param[in] handle A reference to the copied handle
72    */
73   RadialGradient(const RadialGradient& handle) = default;
74
75 public:
76   /**
77    * @brief Sets the radial gradient bounds.
78    * The radial gradient bounds are defined as a circle centered in a given point of a given radius.
79    * @param[in] centerPoint The point of the center of the bounding circle.
80    * @param[in] radius The radius of the bounding circle.
81    * @return Returns True when it's successful. False otherwise.
82    */
83   bool SetBounds(Vector2 centerPoint, float radius);
84
85   /**
86    * @brief Gets the radial gradient bounds.
87    * @param[out] centerPoint The point used to determine the gradient bounds.
88    * @param[out] radius The radius of the bounding circle.
89    * @return Returns True when it's successful. False otherwise.
90    */
91   bool GetBounds(Vector2& centerPoint, float& radius) const;
92
93 public: // Not intended for application developers
94   /// @cond internal
95   /**
96    * @brief The constructor.
97    * @note  Not intended for application developers.
98    *
99    * @param[in] pointer A pointer to a newly allocated CanvasRenderer::RadialGradient
100    */
101   explicit DALI_INTERNAL RadialGradient(Internal::Adaptor::RadialGradient* impl);
102   /// @endcond
103 };
104
105 /**
106  * @}
107  */
108 } // namespace Dali
109
110 #endif // DALI_CANVAS_RENDERER_RADIAL_GRADIENT_H