2007-06-08 07:24:19 +02:00
|
|
|
/*
|
2007-08-06 13:20:02 +02:00
|
|
|
* Copyright 2007 Aaron Seigo <aseigo@kde.org>
|
2007-07-06 18:26:48 +02:00
|
|
|
* 2007 Alexis Ménard <darktears31@gmail.com>
|
2007-06-08 07:24:19 +02:00
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
2007-09-14 21:06:18 +02:00
|
|
|
* it under the terms of the GNU Library General Public License as
|
|
|
|
* published by the Free Software Foundation; either version 2, or
|
|
|
|
* (at your option) any later version.
|
2007-06-08 07:24:19 +02:00
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Library General Public
|
|
|
|
* License along with this program; if not, write to the
|
|
|
|
* Free Software Foundation, Inc.,
|
|
|
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
|
|
*/
|
|
|
|
|
2008-05-09 07:32:15 +02:00
|
|
|
#ifndef ANIMATIONDRIVER_H
|
|
|
|
#define ANIMATIONDRIVER_H
|
2007-06-08 07:24:19 +02:00
|
|
|
|
2007-06-17 11:28:55 +02:00
|
|
|
#include <QtCore/QObject>
|
|
|
|
#include <QtGui/QRegion>
|
2007-06-19 23:53:19 +02:00
|
|
|
#include <QtGui/QPixmap>
|
2007-06-08 07:24:19 +02:00
|
|
|
|
2007-06-17 11:28:55 +02:00
|
|
|
#include <kgenericfactory.h>
|
2007-06-10 08:02:38 +02:00
|
|
|
|
2008-07-17 03:27:43 +02:00
|
|
|
#include <plasma/version.h>
|
2008-04-25 05:23:31 +02:00
|
|
|
#include <plasma/animator.h>
|
2007-06-08 07:24:19 +02:00
|
|
|
|
|
|
|
class QGraphicsItem;
|
|
|
|
|
|
|
|
namespace Plasma
|
|
|
|
{
|
|
|
|
|
2008-07-01 20:56:43 +02:00
|
|
|
class AnimationDriverPrivate;
|
|
|
|
|
2008-04-25 05:11:59 +02:00
|
|
|
class PLASMA_EXPORT AnimationDriver : public QObject
|
2007-06-08 07:24:19 +02:00
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
2008-04-25 05:11:59 +02:00
|
|
|
explicit AnimationDriver(QObject *parent = 0);
|
|
|
|
~AnimationDriver();
|
2007-06-08 07:24:19 +02:00
|
|
|
|
2007-07-20 10:06:27 +02:00
|
|
|
// Parameter definitions
|
2008-04-27 11:02:18 +02:00
|
|
|
virtual int animationFps(Plasma::Animator::Animation) const;
|
|
|
|
virtual int movementAnimationFps(Plasma::Animator::Movement) const;
|
|
|
|
virtual int elementAnimationFps(Plasma::Animator::Animation) const;
|
2008-04-25 05:11:59 +02:00
|
|
|
virtual int animationDuration(Plasma::Animator::Animation) const;
|
|
|
|
virtual int movementAnimationDuration(Plasma::Animator::Movement) const;
|
|
|
|
virtual int elementAnimationDuration(Plasma::Animator::Animation) const;
|
|
|
|
virtual Animator::CurveShape animationCurve(Plasma::Animator::Animation) const;
|
|
|
|
virtual Animator::CurveShape movementAnimationCurve(Plasma::Animator::Movement) const;
|
|
|
|
virtual Animator::CurveShape elementAnimationCurve(Plasma::Animator::Animation) const;
|
2007-06-19 23:53:19 +02:00
|
|
|
|
2007-07-04 11:36:50 +02:00
|
|
|
// Element animations
|
2008-04-24 19:57:56 +02:00
|
|
|
virtual QPixmap elementAppear(qreal progress, const QPixmap& pixmap);
|
|
|
|
virtual QPixmap elementDisappear(qreal progress, const QPixmap& pixmap);
|
2007-06-19 23:53:19 +02:00
|
|
|
|
2007-07-04 11:36:50 +02:00
|
|
|
// Item animations
|
2008-04-24 19:16:36 +02:00
|
|
|
virtual void itemAppear(qreal progress, QGraphicsItem* item);
|
2008-04-24 19:30:49 +02:00
|
|
|
virtual void itemDisappear(qreal progress, QGraphicsItem* item);
|
2008-04-24 19:36:44 +02:00
|
|
|
virtual void itemActivated(qreal progress, QGraphicsItem* item);
|
2007-06-08 07:24:19 +02:00
|
|
|
|
2007-07-04 11:36:50 +02:00
|
|
|
// Item movements
|
2008-04-24 19:41:50 +02:00
|
|
|
virtual void itemSlideIn(qreal progress, QGraphicsItem* item, const QPoint &start, const QPoint &destination);
|
2008-04-24 19:51:33 +02:00
|
|
|
virtual void itemSlideOut(qreal progress, QGraphicsItem* item, const QPoint &start, const QPoint &destination);
|
2007-07-04 11:36:50 +02:00
|
|
|
|
2007-07-06 12:28:28 +02:00
|
|
|
private:
|
2008-07-01 20:56:43 +02:00
|
|
|
AnimationDriverPrivate * const d;
|
2007-06-08 07:24:19 +02:00
|
|
|
};
|
|
|
|
|
2007-06-08 09:23:09 +02:00
|
|
|
} // Plasma namespace
|
2007-06-08 07:24:19 +02:00
|
|
|
|
2007-06-10 08:02:38 +02:00
|
|
|
#define K_EXPORT_PLASMA_ANIMATOR(libname, classname) \
|
2007-08-29 04:45:20 +02:00
|
|
|
K_PLUGIN_FACTORY(factory, registerPlugin<classname>();) \
|
2008-07-17 03:27:43 +02:00
|
|
|
K_EXPORT_PLUGIN(factory("plasma_animator_" #libname)) \
|
|
|
|
K_EXPORT_PLUGIN_VERSION(PLASMA_VERSION)
|
2007-06-10 08:02:38 +02:00
|
|
|
|
2007-06-08 07:24:19 +02:00
|
|
|
#endif // multiple inclusion guard
|