[dali_1.4.33] Merge branch 'devel/master'
[platform/core/uifw/dali-adaptor.git] / dali / devel-api / adaptor-framework / vector-animation-renderer.h
1 #ifndef DALI_VECTOR_ANIMATION_RENDERER_H
2 #define DALI_VECTOR_ANIMATION_RENDERER_H
3
4 /*
5  * Copyright (c) 2019 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 #include <dali/public-api/rendering/renderer.h>
24
25 // INTERNAL INCLUDES
26 #include <dali/public-api/dali-adaptor-common.h>
27
28 namespace Dali
29 {
30 /**
31  * @addtogroup dali_adaptor_framework
32  * @{
33  */
34
35 namespace Internal DALI_INTERNAL
36 {
37 namespace Adaptor
38 {
39 class VectorAnimationRenderer;
40 }
41 }
42
43 /**
44  * @brief Used for rendering a vector animation file
45  */
46 class DALI_ADAPTOR_API VectorAnimationRenderer : public BaseHandle
47 {
48 public:
49
50   /**
51    * @brief Creates an initialized handle to a new VectorAnimationRenderer.
52    *
53    * @param[in] url The url of the vector animation file
54    * @return A handle to a newly allocated VectorAnimationRenderer
55    */
56   static VectorAnimationRenderer New( const std::string& url );
57
58   /**
59    * @brief Creates an empty handle.
60    * Use VectorAnimationRenderer::New() to create an initialized object.
61    */
62   VectorAnimationRenderer();
63
64   /**
65    * @brief Destructor.
66    */
67   ~VectorAnimationRenderer();
68
69   /**
70    * @brief This copy constructor is required for (smart) pointer semantics.
71    *
72    * @param[in] handle A reference to the copied handle
73    */
74   VectorAnimationRenderer( const VectorAnimationRenderer& handle );
75
76   /**
77    * @brief This assignment operator is required for (smart) pointer semantics.
78    *
79    * @param[in] rhs A reference to the copied handle
80    * @return A reference to this
81    */
82   VectorAnimationRenderer& operator=( const VectorAnimationRenderer& rhs );
83
84   /**
85    * @brief Sets the renderer used to display the result image.
86    *
87    * @param[in] renderer The renderer used to display the result image
88    */
89   void SetRenderer( Renderer renderer );
90
91   /**
92    * @brief Sets the target image size.
93    *
94    * @param[in] width The target image width
95    * @param[in] height The target image height
96    */
97   void SetSize( uint32_t width, uint32_t height );
98
99   /**
100    * @brief Stops the rendering.
101    */
102   void StopRender();
103
104   /**
105    * @brief Renders the content to the target buffer synchronously.
106    *
107    * @param[in] frameNumber The frame number to be rendered
108    * @return True if the rendering success, false otherwise.
109    */
110   bool Render( uint32_t frameNumber );
111
112   /**
113    * @brief Gets the total number of frames of the file
114    *
115    * @return The total number of frames
116    */
117   uint32_t GetTotalFrameNumber() const;
118
119   /**
120    * @brief Gets the frame rate of the file.
121    *
122    * @return The frame rate of the file
123    */
124   float GetFrameRate() const;
125
126   /**
127    * @brief Gets the default size of the file,.
128    *
129    * @return The default size of the file
130    */
131   void GetDefaultSize( uint32_t& width, uint32_t& height ) const;
132
133 public: // Signals
134
135 public: // Not intended for application developers
136
137   /// @cond internal
138   /**
139    * @brief The constructor.
140    * @note  Not intended for application developers.
141    *
142    * @param[in] pointer A pointer to a newly allocated VectorAnimationRenderer
143    */
144   explicit DALI_INTERNAL VectorAnimationRenderer( Internal::Adaptor::VectorAnimationRenderer* internal );
145   /// @endcond
146
147 };
148
149 /**
150  * @}
151  */
152 } // namespace Dali
153
154 #endif // DALI_VECTOR_ANIMATION_RENDERER_H