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