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.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef ANIMATOR_H
|
|
|
|
#define ANIMATOR_H
|
|
|
|
|
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
|
|
|
|
|
|
|
#include <plasma/plasma_export.h>
|
2007-06-19 23:53:19 +02:00
|
|
|
#include <plasma/phase.h>
|
2007-06-08 07:24:19 +02:00
|
|
|
|
|
|
|
class QGraphicsItem;
|
|
|
|
|
|
|
|
namespace Plasma
|
|
|
|
{
|
|
|
|
|
|
|
|
class PLASMA_EXPORT Animator : public QObject
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
2007-08-29 04:45:20 +02:00
|
|
|
explicit Animator(QObject *parent = 0);
|
2007-06-08 07:24:19 +02:00
|
|
|
~Animator();
|
|
|
|
|
2007-07-20 10:06:27 +02:00
|
|
|
// Parameter definitions
|
2008-04-24 20:06:26 +02:00
|
|
|
virtual int animationFramesPerSecond(Plasma::Phase::Animation) const;
|
2008-04-24 20:41:47 +02:00
|
|
|
virtual int movementAnimationFramesPerSecond(Plasma::Phase::Movement) const;
|
2008-04-24 20:45:47 +02:00
|
|
|
virtual int elementAnimationFramesPerSecond(Plasma::Phase::ElementAnimation) const;
|
2008-04-24 20:20:58 +02:00
|
|
|
virtual int animationDuration(Plasma::Phase::Animation) const;
|
2008-01-23 00:37:48 +01:00
|
|
|
virtual int duration(Plasma::Phase::Movement) const;
|
|
|
|
virtual int duration(Plasma::Phase::ElementAnimation) const;
|
|
|
|
virtual Phase::CurveShape curve(Plasma::Phase::Animation) const;
|
|
|
|
virtual Phase::CurveShape curve(Plasma::Phase::Movement) const;
|
|
|
|
virtual Phase::CurveShape curve(Plasma::Phase::ElementAnimation) 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:
|
|
|
|
class Private;
|
|
|
|
Private * 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>();) \
|
|
|
|
K_EXPORT_PLUGIN(factory("plasma_animator_" #libname))
|
2007-06-10 08:02:38 +02:00
|
|
|
|
2007-06-08 07:24:19 +02:00
|
|
|
#endif // multiple inclusion guard
|