• Skip to content
  • Skip to link menu
  • KDE API Reference
  • kdelibs-4.14.38 API Reference
  • KDE Home
  • Contact Us
 

Plasma

  • plasma
animator.h
Go to the documentation of this file.
1/*
2 * Copyright 2007 Aaron Seigo <aseigo@kde.org>
3 * 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_ANIMATOR_H
22#define PLASMA_ANIMATOR_H
23
24#include <QtGui/QImage>
25#include <QtCore/QObject>
26#include <QtCore/QAbstractAnimation>
27#include <QtCore/QEasingCurve>
28
29#include <plasma/plasma_export.h>
30
31class QGraphicsItem;
32class QGraphicsWidget;
33class QTimeLine;
34
35namespace Plasma
36{
37
38class AnimatorPrivate;
39class Animation;
40
46class PLASMA_EXPORT Animator : public QObject
47{
48 Q_OBJECT
49 Q_ENUMS(Animation)
50 Q_ENUMS(CurveShape)
51 Q_ENUMS(Movement)
52
53public:
54
55 enum Animation {
56 AppearAnimation = 0, /*<< Animate the appearance of an element */
57 DisappearAnimation, /*<< Animate the disappearance of an element */
58 ActivateAnimation, /*<< When something is activated or launched,
59 such as an app icon being clicked */
60 FadeAnimation, /*<< Can be used for both fade in and out */
61 GrowAnimation, /*<< Grow animated object geometry */
62 PulseAnimation, /*<< Pulse animated object (opacity/geometry/scale) */
63 RotationAnimation, /*<< Rotate an animated object */
64 RotationStackedAnimation, /*<< for flipping one object with another */
65 SlideAnimation, /*<< Move the position of animated object */
66 GeometryAnimation, /*<< Geometry animation*/
67 ZoomAnimation, /*<<Zoom animation */
68 PixmapTransitionAnimation, /*<< Transition between two pixmaps*/
69 WaterAnimation /*<< Water animation using ripple effect */,
70 LastAnimation = 1024
71 };
72
73 enum CurveShape {
74 EaseInCurve = 0,
75 EaseOutCurve,
76 EaseInOutCurve,
77 LinearCurve,
78 PendularCurve
79 };
80
81 enum Movement {
82 SlideInMovement = 0,
83 SlideOutMovement,
84 FastSlideInMovement,
85 FastSlideOutMovement
86 };
87
91#ifndef KDE_NO_DEPRECATED
92 static KDE_DEPRECATED Animator *self();
93#endif
94
100 static Plasma::Animation *create(Animator::Animation type, QObject *parent = 0);
101
107 static Plasma::Animation *create(const QString &animationName, QObject *parent = 0);
108
113 static QEasingCurve create(Animator::CurveShape type);
114
123#ifndef KDE_NO_DEPRECATED
124 KDE_DEPRECATED Q_INVOKABLE int animateItem(QGraphicsItem *item,Animation anim);
125#endif
126
135#ifndef KDE_NO_DEPRECATED
136 KDE_DEPRECATED Q_INVOKABLE void stopItemAnimation(int id);
137#endif
138
147#ifndef KDE_NO_DEPRECATED
148 KDE_DEPRECATED Q_INVOKABLE int moveItem(QGraphicsItem *item, Movement movement, const QPoint &destination);
149#endif
150
159#ifndef KDE_NO_DEPRECATED
160 KDE_DEPRECATED Q_INVOKABLE void stopItemMovement(int id);
161#endif
162
181#ifndef KDE_NO_DEPRECATED
182 KDE_DEPRECATED Q_INVOKABLE int customAnimation(int frames, int duration,
183 Animator::CurveShape curve, QObject *receiver, const char *method);
184#endif
185
194#ifndef KDE_NO_DEPRECATED
195 KDE_DEPRECATED Q_INVOKABLE void stopCustomAnimation(int id);
196#endif
197
198#ifndef KDE_NO_DEPRECATED
199 KDE_DEPRECATED Q_INVOKABLE int animateElement(QGraphicsItem *obj, Animation);
200#endif
201#ifndef KDE_NO_DEPRECATED
202 KDE_DEPRECATED Q_INVOKABLE void stopElementAnimation(int id);
203#endif
204#ifndef KDE_NO_DEPRECATED
205 KDE_DEPRECATED Q_INVOKABLE void setInitialPixmap(int id, const QPixmap &pixmap);
206#endif
207#ifndef KDE_NO_DEPRECATED
208 KDE_DEPRECATED Q_INVOKABLE QPixmap currentPixmap(int id);
209#endif
210
218#ifndef KDE_NO_DEPRECATED
219 KDE_DEPRECATED Q_INVOKABLE bool isAnimating() const;
220#endif
221
230#ifndef KDE_NO_DEPRECATED
231 KDE_DEPRECATED void registerScrollingManager(QGraphicsWidget *widget);
232#endif
233
241#ifndef KDE_NO_DEPRECATED
242 KDE_DEPRECATED void unregisterScrollingManager(QGraphicsWidget *widget);
243#endif
244
245Q_SIGNALS:
246 void animationFinished(QGraphicsItem *item, Plasma::Animator::Animation anim);
247 void movementFinished(QGraphicsItem *item);
248 void elementAnimationFinished(int id);
249 void customAnimationFinished(int id);
250#ifndef KDE_NO_DEPRECATED
251 KDE_DEPRECATED void scrollStateChanged(QGraphicsWidget *widget, QAbstractAnimation::State newState,
252 QAbstractAnimation::State oldState);
253#endif
254
255#ifndef KDE_NO_DEPRECATED
256protected:
257 void timerEvent(QTimerEvent *event);
258#endif
259
260private:
261#ifndef KDE_NO_DEPRECATED
262 friend class AnimatorSingleton;
263 explicit Animator(QObject * parent = 0);
264 ~Animator();
265
266 Q_PRIVATE_SLOT(d, void animatedItemDestroyed(QObject*))
267 Q_PRIVATE_SLOT(d, void movingItemDestroyed(QObject*))
268 Q_PRIVATE_SLOT(d, void animatedElementDestroyed(QObject*))
269 Q_PRIVATE_SLOT(d, void customAnimReceiverDestroyed(QObject*))
270 Q_PRIVATE_SLOT(d, void scrollStateChanged(QAbstractAnimation::State,
271 QAbstractAnimation::State))
272#else
273 Animator();
274#endif
275
276 friend class AnimatorPrivate;
277 AnimatorPrivate * const d;
278};
279
280} // namespace Plasma
281
282#endif
283
Plasma::Animation
Abstract representation of a single animation.
Definition: animation.h:47
Plasma::Animator
A system for applying effects to Plasma elements.
Definition: animator.h:47
Plasma::Animator::Movement
Movement
Definition: animator.h:81
Plasma::Animator::SlideOutMovement
@ SlideOutMovement
Definition: animator.h:83
Plasma::Animator::FastSlideInMovement
@ FastSlideInMovement
Definition: animator.h:84
Plasma::Animator::customAnimationFinished
void customAnimationFinished(int id)
Plasma::Animator::movementFinished
void movementFinished(QGraphicsItem *item)
Plasma::Animator::CurveShape
CurveShape
Definition: animator.h:73
Plasma::Animator::EaseInOutCurve
@ EaseInOutCurve
Definition: animator.h:76
Plasma::Animator::EaseOutCurve
@ EaseOutCurve
Definition: animator.h:75
Plasma::Animator::LinearCurve
@ LinearCurve
Definition: animator.h:77
Plasma::Animator::animationFinished
void animationFinished(QGraphicsItem *item, Plasma::Animator::Animation anim)
Plasma::Animator::scrollStateChanged
void scrollStateChanged(QGraphicsWidget *widget, QAbstractAnimation::State newState, QAbstractAnimation::State oldState)
Plasma::Animator::Animation
Animation
Definition: animator.h:55
Plasma::Animator::DisappearAnimation
@ DisappearAnimation
Definition: animator.h:57
Plasma::Animator::RotationStackedAnimation
@ RotationStackedAnimation
Definition: animator.h:64
Plasma::Animator::GeometryAnimation
@ GeometryAnimation
Definition: animator.h:66
Plasma::Animator::PixmapTransitionAnimation
@ PixmapTransitionAnimation
Definition: animator.h:68
Plasma::Animator::FadeAnimation
@ FadeAnimation
Definition: animator.h:60
Plasma::Animator::SlideAnimation
@ SlideAnimation
Definition: animator.h:65
Plasma::Animator::RotationAnimation
@ RotationAnimation
Definition: animator.h:63
Plasma::Animator::ZoomAnimation
@ ZoomAnimation
Definition: animator.h:67
Plasma::Animator::GrowAnimation
@ GrowAnimation
Definition: animator.h:61
Plasma::Animator::PulseAnimation
@ PulseAnimation
Definition: animator.h:62
Plasma::Animator::ActivateAnimation
@ ActivateAnimation
Definition: animator.h:58
Plasma::Animator::elementAnimationFinished
void elementAnimationFinished(int id)
QGraphicsWidget
QObject
Plasma
Namespace for everything in libplasma.
Definition: abstractdialogmanager.cpp:25
plasma_export.h
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Mon Feb 20 2023 00:00:00 by doxygen 1.9.6 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

Plasma

Skip menu "Plasma"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kdelibs-4.14.38 API Reference

Skip menu "kdelibs-4.14.38 API Reference"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDEWebKit
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal