Ensure cached values of properties animated using AnimateTo are updated
[platform/core/uifw/dali-core.git] / dali / internal / event / animation / animation-impl.h
index 6272042..fa28101 100644 (file)
@@ -2,7 +2,7 @@
 #define __DALI_INTERNAL_ANIMATION_H__
 
 /*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -43,7 +43,6 @@ class Actor;
 class Animation;
 class AnimationPlaylist;
 class Object;
-class ShaderEffect;
 
 typedef IntrusivePtr<Animation> AnimationPtr;
 typedef std::vector<AnimationPtr> AnimationContainer;
@@ -85,7 +84,22 @@ public:
   /**
    * @copydoc Dali::Animation::SetLooping()
    */
-  void SetLooping(bool looping);
+  void SetLooping(bool on);
+
+  /**
+   * @copydoc Dali::Animation::SetLoopCount()
+   */
+  void SetLoopCount(int count);
+
+  /**
+   * @copydoc Dali::Animation::GetLoopCount()
+   */
+  int GetLoopCount();
+
+  /**
+   * @copydoc Dali::Animation::GetCurrentLoop()
+   */
+  int GetCurrentLoop();
 
   /**
    * @copydoc Dali::Animation::IsLooping()
@@ -144,6 +158,11 @@ public:
   void Pause();
 
   /**
+   * @copydoc Dali::Animation::GetState()
+   */
+  Dali::Animation::State GetState() const;
+
+  /**
    * @copydoc Dali::Animation::Stop()
    */
   void Stop();
@@ -429,6 +448,13 @@ private:
   Animation& operator=(const Animation& rhs);
 
 private:
+
+  struct ConnectorTargetValues
+  {
+    unsigned int connectorIndex;
+    Property::Value targetValue;
+  };
+
   EventThreadServices& mEventThreadServices;
   AnimationPlaylist& mPlaylist;
 
@@ -443,14 +469,18 @@ private:
 
   AnimatorConnectorContainer mConnectors; ///< Owned by the Animation
 
+  std::vector< ConnectorTargetValues > mConnectorTargetValues; //< Used to store animating property target value information
+
   // Cached for public getters
   float mDurationSeconds;
   float mSpeedFactor;
-  bool mIsLooping;
+  int mLoopCount;
+  int mCurrentLoop;
   Vector2 mPlayRange;
   EndAction mEndAction;
   EndAction mDisconnectAction;
   AlphaFunction mDefaultAlpha;
+  Dali::Animation::State mState;
 
 };