#include <dali/public-api/object/ref-object.h>
#include <dali/public-api/animation/animation.h>
#include <dali/public-api/object/base-object.h>
-#include <dali/internal/event/animation/animator-connector-base.h>
+#include <dali/devel-api/animation/animation-devel.h>
+#include <dali/devel-api/common/owner-container.h>
#include <dali/internal/event/animation/key-frames-impl.h>
-#include <dali/internal/event/animation/path-impl.h>
+#include <dali/internal/event/common/event-thread-services.h>
namespace Dali
{
class Actor;
class Animation;
class AnimationPlaylist;
+class AnimatorConnectorBase;
class Object;
+class Path;
typedef IntrusivePtr<Animation> AnimationPtr;
typedef std::vector<AnimationPtr> AnimationContainer;
{
public:
+ enum Type
+ {
+ TO, ///< Animating TO the given value
+ BY, ///< Animating BY the given value
+ BETWEEN ///< Animating BETWEEN key-frames
+ };
+
typedef Dali::Animation::EndAction EndAction;
typedef Dali::Animation::Interpolation Interpolation;
void SetDuration(float seconds);
/**
+ * @copydoc Dali::DevelAnimation::SetProgressNotification()
+ */
+ void SetProgressNotification( float progress );
+
+ /**
+ * @copydoc Dali::DevelAnimation::GetProgressNotification()
+ */
+ float GetProgressNotification();
+
+ /**
* @copydoc Dali::Animation::GetDuration()
*/
float GetDuration() const;
void PlayFrom( float progress );
/**
+ * @copydoc Dali::Animation::PlayAfter()
+ */
+ void PlayAfter( float delaySeconds );
+
+ /**
* @copydoc Dali::Animation::Pause()
*/
void Pause();
Dali::Animation::AnimationSignalType& FinishedSignal();
/**
+ * @copydoc Dali::DevelAnimation::ProgressHasBeenReachedSignal()
+ */
+ Dali::Animation::AnimationSignalType& ProgressReachedSignal();
+
+ /**
* Emit the Finished signal
*/
void EmitSignalFinish();
/**
+ * Emit the ProgressReached signal
+ */
+ void EmitSignalProgressReached();
+
+ /**
* Connects a callback function with the object's signals.
* @param[in] object The object providing the signal.
* @param[in] tracker Used to disconnect the signal.
*/
void Hide(Actor& actor, float delaySeconds);
- /*
+ /**
* @copydoc Dali::Animation::SetCurrentProgress()
*/
void SetCurrentProgress(float progress);
- /*
+ /**
* @copydoc Dali::Animation::GetCurrentProgress()
*/
float GetCurrentProgress();
- /*
+ /**
* @copydoc Dali::Animation::SetSpeedFactor()
*/
void SetSpeedFactor( float factor );
- /*
+ /**
* @copydoc Dali::Animation::GetSpeedFactor()
*/
float GetSpeedFactor() const;
- /*
+ /**
* @copydoc Dali::Animation::SetPlayRange()
*/
void SetPlayRange( const Vector2& range );
- /*
- * @copydoc Dali::Animation::GetPlayRange
+ /**
+ * @copydoc Dali::Animation::GetPlayRange()
*/
Vector2 GetPlayRange() const;
+ /**
+ * @copydoc Dali::Animation::SetLoopingMode()
+ */
+ void SetLoopingMode( Dali::DevelAnimation::LoopingMode loopingMode );
+
+ /**
+ * @copydoc Dali::Animation::GetLoopingMode()
+ */
+ Dali::DevelAnimation::LoopingMode GetLoopingMode();
+
public: // For connecting animators to animations
/**
struct ConnectorTargetValues
{
- unsigned int connectorIndex;
+ ConnectorTargetValues()
+ : targetValue(),
+ timePeriod( 0.0f ),
+ connectorIndex( 0 ),
+ animatorType( TO )
+ {
+ }
+
Property::Value targetValue;
+ TimePeriod timePeriod;
+ unsigned int connectorIndex;
+ Animation::Type animatorType;
};
+private:
+
+ /**
+ * Compares the end times of the animators returning true if lhs end time is less than rhs end time.
+ * @param[in] lhs The first comparator
+ * @param[in] rhs The second comparator
+ * @return True if end time of lhs is less, false otherwise.
+ */
+ static bool CompareConnectorEndTimes( const ConnectorTargetValues& lhs, const ConnectorTargetValues& rhs );
+
+ /**
+ * Notifies all the objects whose properties are being animated.
+ */
+ void NotifyObjects();
+
+ /**
+ * Sends message to SceneGraph with final progress value
+ */
+ void SendFinalProgressNotificationMessage();
+
+private:
+
const SceneGraph::Animation* mAnimation;
EventThreadServices& mEventThreadServices;
Dali::Animation::AnimationSignalType mFinishedSignal;
+ Dali::Animation::AnimationSignalType mProgressReachedSignal;
+
+ typedef OwnerContainer< AnimatorConnectorBase* > AnimatorConnectorContainer;
AnimatorConnectorContainer mConnectors; ///< Owned by the Animation
- std::vector< ConnectorTargetValues > mConnectorTargetValues; //< Used to store animating property target value information
+ typedef std::vector< ConnectorTargetValues > ConnectorTargetValuesContainer;
+ ConnectorTargetValuesContainer mConnectorTargetValues; //< Used to store animating property target value information
Vector2 mPlayRange;
EndAction mDisconnectAction;
AlphaFunction mDefaultAlpha;
Dali::Animation::State mState;
+ float mProgressReachedMarker;
+ float mDelaySeconds;
+ bool mAutoReverseEnabled; ///< Flag to identify that the looping mode is auto reverse.
};
} // namespace Internal