f16c087846
* collapse all the frame rate methods into two (one for element anims and one for whole item anims) which take the Phase enumerations svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=677781
73 lines
2.3 KiB
C++
73 lines
2.3 KiB
C++
/*
|
|
* Copyright (C) 2007 Aaron Seigo <aseigo@kde.org>
|
|
*
|
|
* This program is free software; you can redistribute it and/or modify
|
|
* it under the terms of the GNU Library General Public License version 2 as
|
|
* published by the Free Software Foundation
|
|
*
|
|
* 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
|
|
|
|
#include <QtCore/QObject>
|
|
#include <QtGui/QRegion>
|
|
#include <QtGui/QPixmap>
|
|
|
|
#include <kgenericfactory.h>
|
|
|
|
#include <plasma/plasma_export.h>
|
|
#include <plasma/phase.h>
|
|
|
|
class QGraphicsItem;
|
|
|
|
namespace Plasma
|
|
{
|
|
|
|
class PLASMA_EXPORT Animator : public QObject
|
|
{
|
|
Q_OBJECT
|
|
|
|
public:
|
|
explicit Animator(QObject *parent = 0, const QStringList& list = QStringList());
|
|
~Animator();
|
|
|
|
virtual int frameCount(Plasma::Phase::Animation);
|
|
virtual int elementFrameCount(Plasma::Phase::ElementAnimation);
|
|
|
|
virtual QPixmap elementAppear(qreal frame, const QPixmap& pixmap);
|
|
virtual QPixmap elementDisappear(qreal frame, const QPixmap& pixmap);
|
|
|
|
virtual void appear(qreal frame, QGraphicsItem* item);
|
|
virtual void appearCompleted(QGraphicsItem* item);
|
|
|
|
virtual void disappear(qreal frame, QGraphicsItem* item);
|
|
virtual void disappearCompleted(QGraphicsItem* item);
|
|
|
|
virtual void frameAppear(qreal frame, QGraphicsItem* item, const QRegion& drawable);
|
|
virtual void frameAppearCompleted(QGraphicsItem* item, const QRegion& drawable);
|
|
|
|
virtual void activate(qreal frame, QGraphicsItem* item);
|
|
virtual void activateCompleted(QGraphicsItem* item);
|
|
|
|
virtual void renderBackground(QImage& background);
|
|
};
|
|
|
|
} // Plasma namespace
|
|
|
|
#define K_EXPORT_PLASMA_ANIMATOR(libname, classname) \
|
|
K_EXPORT_COMPONENT_FACTORY( \
|
|
plasma_animator_##libname, \
|
|
KGenericFactory<classname>("plasma_animator_" #libname))
|
|
|
|
#endif // multiple inclusion guard
|