add custom animation in animator factory

svn path=/trunk/KDE/kdelibs/; revision=1073140
This commit is contained in:
Igor Trindade Oliveira 2010-01-11 17:53:35 +00:00
parent a51ab88ce0
commit 196172bc19
3 changed files with 9 additions and 2 deletions

View File

@ -38,7 +38,7 @@ class CustomAnimation : public Animation
Q_PROPERTY(QVariant endValue READ endValue WRITE setEndValue) Q_PROPERTY(QVariant endValue READ endValue WRITE setEndValue)
public: public:
CustomAnimation(QObject *parent); CustomAnimation(QObject *parent = 0);
QString callback() const; QString callback() const;
void setCallback(const QString &method); void setCallback(const QString &method);

View File

@ -29,6 +29,8 @@
#include "animations/rotationstacked_p.h" #include "animations/rotationstacked_p.h"
#include "animations/geometry_p.h" #include "animations/geometry_p.h"
#include "animations/zoom_p.h" #include "animations/zoom_p.h"
#include "animations/woobly_p.h"
#include "animations/customanimation_p.h"
namespace Plasma namespace Plasma
{ {
@ -70,6 +72,10 @@ Plasma::Animation* Animator::create(Animator::Animation type, QObject *parent)
result = new Plasma::ZoomAnimation(parent); result = new Plasma::ZoomAnimation(parent);
break; break;
case CustomAnimation:
result = new Plasma::CustomAnimation(parent);
break;
default: default:
kDebug() << "Unsupported animation type."; kDebug() << "Unsupported animation type.";
} }

View File

@ -65,7 +65,8 @@ public:
RotationStackedAnimation, /*<< for flipping one object with another */ RotationStackedAnimation, /*<< for flipping one object with another */
SlideAnimation, /*<< Move the position of animated object */ SlideAnimation, /*<< Move the position of animated object */
GeometryAnimation, /*<< Geometry animation*/ GeometryAnimation, /*<< Geometry animation*/
ZoomAnimation /*<<Zoom animation */ ZoomAnimation, /*<<Zoom animation */
CustomAnimation
}; };
enum CurveShape { enum CurveShape {