Plasma
animationdriver.h
Go to the documentation of this file.
00001 /* 00002 * Copyright 2007 Aaron Seigo <aseigo@kde.org> 00003 * Copyright 2007 Alexis Ménard <darktears31@gmail.com> 00004 * 00005 * This program is free software; you can redistribute it and/or modify 00006 * it under the terms of the GNU Library General Public License as 00007 * published by the Free Software Foundation; either version 2, or 00008 * (at your option) any later version. 00009 * 00010 * This program is distributed in the hope that it will be useful, 00011 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00012 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00013 * GNU General Public License for more details 00014 * 00015 * You should have received a copy of the GNU Library General Public 00016 * License along with this program; if not, write to the 00017 * Free Software Foundation, Inc., 00018 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 00019 */ 00020 00021 #ifndef PLASMA_ANIMATIONDRIVER_H 00022 #define PLASMA_ANIMATIONDRIVER_H 00023 00024 #include <QtCore/QObject> 00025 #include <QtGui/QRegion> 00026 #include <QtGui/QPixmap> 00027 00028 #include <kgenericfactory.h> 00029 00030 #include <plasma/version.h> 00031 #include <plasma/animator.h> 00032 00033 class QGraphicsItem; 00034 00035 namespace Plasma 00036 { 00037 00038 class AnimationDriverPrivate; 00039 00040 class PLASMA_EXPORT_DEPRECATED AnimationDriver : public QObject 00041 { 00042 Q_OBJECT 00043 00044 public: 00045 explicit AnimationDriver(QObject *parent = 0); 00046 ~AnimationDriver(); 00047 00048 // Parameter definitions 00049 virtual int animationFps(Plasma::Animator::Animation) const; 00050 virtual int movementAnimationFps(Plasma::Animator::Movement) const; 00051 virtual int elementAnimationFps(Plasma::Animator::Animation) const; 00052 virtual int animationDuration(Plasma::Animator::Animation) const; 00053 virtual int movementAnimationDuration(Plasma::Animator::Movement) const; 00054 virtual int elementAnimationDuration(Plasma::Animator::Animation) const; 00055 virtual Animator::CurveShape animationCurve(Plasma::Animator::Animation) const; 00056 virtual Animator::CurveShape movementAnimationCurve(Plasma::Animator::Movement) const; 00057 virtual Animator::CurveShape elementAnimationCurve(Plasma::Animator::Animation) const; 00058 00059 // Element animations 00060 virtual QPixmap elementAppear(qreal progress, const QPixmap &pixmap); 00061 virtual QPixmap elementDisappear(qreal progress, const QPixmap &pixmap); 00062 00063 // Item animations 00064 virtual void itemAppear(qreal progress, QGraphicsItem *item); 00065 virtual void itemDisappear(qreal progress, QGraphicsItem *item); 00066 virtual void itemActivated(qreal progress, QGraphicsItem *item); 00067 00068 // Item movements 00069 virtual void itemSlideIn(qreal progress, QGraphicsItem *item, 00070 const QPoint &start, const QPoint &destination); 00071 virtual void itemSlideOut(qreal progress, QGraphicsItem *item, 00072 const QPoint &start, const QPoint &destination); 00073 00074 private: 00075 AnimationDriverPrivate *const d; 00076 }; 00077 00078 } // Plasma namespace 00079 00080 #define K_EXPORT_PLASMA_ANIMATOR(libname, classname) \ 00081 K_PLUGIN_FACTORY(factory, registerPlugin<classname>();) \ 00082 K_EXPORT_PLUGIN(factory("plasma_animator_" #libname)) \ 00083 K_EXPORT_PLUGIN_VERSION(PLASMA_VERSION) 00084 00085 #endif // multiple inclusion guard
KDE 4.6 API Reference