[4.0] Add VisualEventSignal to Control and a property to AnimatedVectorImageVisual
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / internal / visuals / animated-vector-image / vector-rasterize-thread.h
index f05f8b6..daa8058 100644 (file)
@@ -26,6 +26,9 @@
 #include <dali/integration-api/adaptors/log-factory-interface.h>
 #include <string>
 
+// INTERNAL INCLUDES
+#include <dali-toolkit/devel-api/visuals/image-visual-properties-devel.h>
+
 namespace Dali
 {
 
@@ -81,11 +84,6 @@ public:
   void PauseAnimation();
 
   /**
-   * @brief Resume the vector animation.
-   */
-  void ResumeAnimation();
-
-  /**
    * @brief Render one frame. The current frame number will be increased.
    */
   void RenderFrame();
@@ -97,6 +95,12 @@ public:
   void SetResourceReadyCallback( EventThreadCallback* callback );
 
   /**
+   * @brief This callback is called after the animation is finished.
+   * @param[in] callback The animation finished callback
+   */
+  void SetAnimationFinishedCallback( EventThreadCallback* callback );
+
+  /**
    * @brief Enable looping for 'count' repeats. -1 means to repeat forever.
    * @param[in] count The number of times to loop
    */
@@ -109,6 +113,12 @@ public:
    */
   void SetPlayRange( Vector2 range );
 
+  /**
+   * @brief Get the play state
+   * @return The play state
+   */
+  DevelImageVisual::PlayState GetPlayState();
+
 protected:
 
   /**
@@ -143,25 +153,25 @@ private:
 
 private:
 
-  std::string                mUrl;
-  VectorAnimationRenderer    mVectorRenderer;
-  ConditionalWait            mConditionalWait;
-  Dali::Mutex                mMutex;
-  EventThreadCallback*       mResourceReadyTrigger;
-  Vector2                    mPlayRange;
-  uint32_t                   mCurrentFrame;
-  uint32_t                   mTotalFrame;
-  uint32_t                   mStartFrame;
-  uint32_t                   mEndFrame;
-  uint32_t                   mWidth;
-  uint32_t                   mHeight;
-  int16_t                    mLoopCount;
-  int16_t                    mCurrentLoop;
-  bool                       mNeedRender;
-  bool                       mPlaying;
-  bool                       mPaused;
-  bool                       mDestroyThread;  ///< Whether the thread be destroyed
-  bool                       mResourceReady;
+  std::string                 mUrl;
+  VectorAnimationRenderer     mVectorRenderer;
+  ConditionalWait             mConditionalWait;
+  Dali::Mutex                 mMutex;
+  EventThreadCallback*        mResourceReadyTrigger;
+  EventThreadCallback*        mAnimationFinishedTrigger;
+  Vector2                     mPlayRange;
+  DevelImageVisual::PlayState mPlayState;
+  uint32_t                    mCurrentFrame;
+  uint32_t                    mTotalFrame;
+  uint32_t                    mStartFrame;
+  uint32_t                    mEndFrame;
+  uint32_t                    mWidth;
+  uint32_t                    mHeight;
+  int16_t                     mLoopCount;
+  int16_t                     mCurrentLoop;
+  bool                        mNeedRender;
+  bool                        mDestroyThread;  ///< Whether the thread be destroyed
+  bool                        mResourceReady;
   const Dali::LogFactoryInterface& mLogFactory; ///< The log factory
 
 };