1 | /* |
2 | * Copyright 2007 Aaron Seigo <aseigo@kde.org> |
3 | * Copyright 2007 Alexis Ménard <darktears31@gmail.com> |
4 | * |
5 | * This program is free software; you can redistribute it and/or modify |
6 | * it under the terms of the GNU Library General Public License as |
7 | * published by the Free Software Foundation; either version 2, or |
8 | * (at your option) any later version. |
9 | * |
10 | * This program is distributed in the hope that it will be useful, |
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
13 | * GNU General Public License for more details |
14 | * |
15 | * You should have received a copy of the GNU Library General Public |
16 | * License along with this program; if not, write to the |
17 | * Free Software Foundation, Inc., |
18 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
19 | */ |
20 | |
21 | #ifndef PLASMA_ANIMATIONDRIVER_H |
22 | #define PLASMA_ANIMATIONDRIVER_H |
23 | |
24 | #include <QtCore/QObject> |
25 | #include <QtGui/QRegion> |
26 | #include <QtGui/QPixmap> |
27 | |
28 | #include <kgenericfactory.h> |
29 | |
30 | #include <plasma/version.h> |
31 | #include <plasma/animator.h> |
32 | |
33 | class QGraphicsItem; |
34 | |
35 | namespace Plasma |
36 | { |
37 | |
38 | class AnimationDriverPrivate; |
39 | |
40 | class PLASMA_EXPORT_DEPRECATED AnimationDriver : public QObject |
41 | { |
42 | Q_OBJECT |
43 | |
44 | public: |
45 | explicit AnimationDriver(QObject *parent = 0); |
46 | ~AnimationDriver(); |
47 | |
48 | // Parameter definitions |
49 | virtual int animationFps(Plasma::Animator::Animation) const; |
50 | virtual int movementAnimationFps(Plasma::Animator::Movement) const; |
51 | virtual int elementAnimationFps(Plasma::Animator::Animation) const; |
52 | virtual int animationDuration(Plasma::Animator::Animation) const; |
53 | virtual int movementAnimationDuration(Plasma::Animator::Movement) const; |
54 | virtual int elementAnimationDuration(Plasma::Animator::Animation) const; |
55 | virtual Animator::CurveShape animationCurve(Plasma::Animator::Animation) const; |
56 | virtual Animator::CurveShape movementAnimationCurve(Plasma::Animator::Movement) const; |
57 | virtual Animator::CurveShape elementAnimationCurve(Plasma::Animator::Animation) const; |
58 | |
59 | // Element animations |
60 | virtual QPixmap elementAppear(qreal progress, const QPixmap &pixmap); |
61 | virtual QPixmap elementDisappear(qreal progress, const QPixmap &pixmap); |
62 | |
63 | // Item animations |
64 | virtual void itemAppear(qreal progress, QGraphicsItem *item); |
65 | virtual void itemDisappear(qreal progress, QGraphicsItem *item); |
66 | virtual void itemActivated(qreal progress, QGraphicsItem *item); |
67 | |
68 | // Item movements |
69 | virtual void itemSlideIn(qreal progress, QGraphicsItem *item, |
70 | const QPoint &start, const QPoint &destination); |
71 | virtual void itemSlideOut(qreal progress, QGraphicsItem *item, |
72 | const QPoint &start, const QPoint &destination); |
73 | |
74 | private: |
75 | AnimationDriverPrivate *const d; |
76 | }; |
77 | |
78 | } // Plasma namespace |
79 | |
80 | #define K_EXPORT_PLASMA_ANIMATOR(libname, classname) \ |
81 | K_PLUGIN_FACTORY(factory, registerPlugin<classname>();) \ |
82 | K_EXPORT_PLUGIN(factory("plasma_animator_" #libname)) \ |
83 | K_EXPORT_PLUGIN_VERSION(PLASMA_VERSION) |
84 | |
85 | #endif // multiple inclusion guard |
86 | |