Revert "vector-animation: Imeplements rive animation"
[platform/core/uifw/dali-adaptor.git] / dali / internal / vector-animation / common / vector-animation-renderer-plugin-proxy.h
1 #ifndef DALI_INTERNAL_VECTOR_ANIMATION_RENDERER_PLUGIN_PROXY_H
2 #define DALI_INTERNAL_VECTOR_ANIMATION_RENDERER_PLUGIN_PROXY_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 // INTERNAL INCLUDES
22 #include <dali/devel-api/adaptor-framework/vector-animation-renderer-plugin.h>
23
24 namespace Dali
25 {
26 namespace Internal
27 {
28 namespace Adaptor
29 {
30 /**
31  * Proxy class to dynamically load, use and unload vector animation renderer plugin.
32  */
33 class VectorAnimationRendererPluginProxy
34 {
35 public:
36   /**
37    * @brief Constructor
38    */
39   VectorAnimationRendererPluginProxy(const std::string& sharedObjectName);
40
41   /**
42    * @brief Destructor
43    */
44   ~VectorAnimationRendererPluginProxy();
45
46   /**
47    * @copydoc Dali::VectorAnimationRendererPlugin::Finalize()
48    */
49   void Finalize();
50
51   /**
52    * @copydoc Dali::VectorAnimationRendererPlugin::Load()
53    */
54   bool Load(const std::string& url);
55
56   /**
57    * @copydoc Dali::VectorAnimationRendererPlugin::SetRenderer()
58    */
59   void SetRenderer(Dali::Renderer renderer);
60
61   /**
62    * @copydoc Dali::VectorAnimationRendererPlugin::SetSize()
63    */
64   void SetSize(uint32_t width, uint32_t height);
65
66   /**
67    * @copydoc Dali::VectorAnimationRendererPlugin::Render()
68    */
69   bool Render(uint32_t frameNumber);
70
71   /**
72    * @copydoc Dali::VectorAnimationRendererPlugin::GetTotalFrameNumber()
73    */
74   uint32_t GetTotalFrameNumber() const;
75
76   /**
77    * @copydoc Dali::VectorAnimationRendererPlugin::GetFrameRate()
78    */
79   float GetFrameRate() const;
80
81   /**
82    * @copydoc Dali::VectorAnimationRendererPlugin::GetDefaultSize()
83    */
84   void GetDefaultSize(uint32_t& width, uint32_t& height) const;
85
86   /**
87    * @copydoc Dali::VectorAnimationRendererPlugin::GetLayerInfo()
88    */
89   void GetLayerInfo(Property::Map& map) const;
90
91   /**
92    * @copydoc Dali::VectorAnimationRendererPlugin::GetMarkerInfo()
93    */
94   bool GetMarkerInfo(const std::string& marker, uint32_t& startFrame, uint32_t& endFrame) const;
95
96   /**
97    * @copydoc Dali::VectorAnimationRendererPlugin::IgnoreRenderedFrame()
98    */
99   void IgnoreRenderedFrame();
100
101   /**
102    * @copydoc Dali::VectorAnimationRendererPlugin::UploadCompletedSignal()
103    */
104   VectorAnimationRendererPlugin::UploadCompletedSignalType& UploadCompletedSignal();
105
106   // Not copyable or movable
107   VectorAnimationRendererPluginProxy(const VectorAnimationRendererPluginProxy&) = delete;            ///< Deleted copy constructor
108   VectorAnimationRendererPluginProxy(VectorAnimationRendererPluginProxy&&)      = delete;            ///< Deleted move constructor
109   VectorAnimationRendererPluginProxy& operator=(const VectorAnimationRendererPluginProxy&) = delete; ///< Deleted copy assignment operator
110   VectorAnimationRendererPluginProxy& operator=(VectorAnimationRendererPluginProxy&&) = delete;      ///< Deleted move assignment operator
111
112 private:
113   /**
114    * Dynamically loads the plugin.
115    */
116   void Initialize();
117
118 private:
119   using CreateVectorAnimationRendererFunction = Dali::VectorAnimationRendererPlugin* (*)();
120
121   std::string                          mSharedObjectName; ///< Shared object name
122   void*                                mLibHandle;        ///< Handle for the loaded library
123   Dali::VectorAnimationRendererPlugin* mPlugin;           ///< Plugin handle
124
125   CreateVectorAnimationRendererFunction                    mCreateVectorAnimationRendererPtr; ///< Function pointer called in adaptor to create a plugin instance
126   VectorAnimationRendererPlugin::UploadCompletedSignalType mDefaultSignal;
127 };
128
129 } // namespace Adaptor
130
131 } // namespace Internal
132
133 } // namespace Dali
134
135 #endif // DALI_INTERNAL_VECTOR_ANIMATION_RENDERER_PLUGIN_PROXY_H