• Skip to content
  • Skip to link menu
KDE 4.2 API Reference
  • KDE API Reference
  • kdelibs
  • Sitemap
  • Contact Us
 

Plasma

animator.h

Go to the documentation of this file.
00001 /*
00002  *   Copyright 2007 Aaron Seigo <aseigo@kde.org>
00003  *                 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_ANIMATOR_H
00022 #define PLASMA_ANIMATOR_H
00023 
00024 #include <QtGui/QImage>
00025 #include <QtCore/QObject>
00026 
00027 #include <plasma/plasma_export.h>
00028 
00029 class QGraphicsItem;
00030 class QTimeLine;
00031 
00032 namespace Plasma
00033 {
00034 
00035 class AnimatorPrivate;
00036 
00042 class PLASMA_EXPORT Animator : public QObject
00043 {
00044     Q_OBJECT
00045     Q_ENUMS(Animation)
00046     Q_ENUMS(CurveShape)
00047     Q_ENUMS(Movement)
00048 
00049 public:
00050 
00051     enum Animation {
00052         AppearAnimation = 0, /*<< Animate the appearance of an element */
00053         DisappearAnimation,  /*<< Animate the disappearance of an element */
00054         ActivateAnimation    /*<< When something is activated or launched,
00055                                such as an app icon being clicked */
00056     };
00057 
00058     enum CurveShape {
00059         EaseInCurve = 0,
00060         EaseOutCurve,
00061         EaseInOutCurve,
00062         LinearCurve
00063     };
00064 
00065     enum Movement {
00066         SlideInMovement = 0,
00067         SlideOutMovement,
00068         FastSlideInMovement,
00069         FastSlideOutMovement
00070     };
00071 
00075     static Animator *self();
00076 
00084     Q_INVOKABLE int animateItem(QGraphicsItem *item, Animation anim);
00085 
00093     Q_INVOKABLE void stopItemAnimation(int id);
00094 
00102     Q_INVOKABLE int moveItem(QGraphicsItem *item, Movement movement, const QPoint &destination);
00103 
00111     Q_INVOKABLE void stopItemMovement(int id);
00112 
00130     Q_INVOKABLE int customAnimation(int frames, int duration, Animator::CurveShape curve,
00131                                     QObject *receiver, const char *method);
00132 
00140     Q_INVOKABLE void stopCustomAnimation(int id);
00141 
00142     Q_INVOKABLE int animateElement(QGraphicsItem *obj, Animation);
00143     Q_INVOKABLE void stopElementAnimation(int id);
00144     Q_INVOKABLE void setInitialPixmap(int id, const QPixmap &pixmap);
00145     Q_INVOKABLE QPixmap currentPixmap(int id);
00146 
00153     Q_INVOKABLE bool isAnimating() const;
00154 
00155 Q_SIGNALS:
00156     void animationFinished(QGraphicsItem *item, Plasma::Animator::Animation anim);
00157     void movementFinished(QGraphicsItem *item);
00158     void elementAnimationFinished(int id);
00159     void customAnimationFinished(int id);
00160 
00161 protected:
00162     void timerEvent(QTimerEvent *event);
00163 
00164 private:
00165     friend class AnimatorSingleton;
00166     explicit Animator(QObject * parent = 0);
00167     ~Animator();
00168 
00169     Q_PRIVATE_SLOT(d, void animatedItemDestroyed(QObject*))
00170     Q_PRIVATE_SLOT(d, void movingItemDestroyed(QObject*))
00171     Q_PRIVATE_SLOT(d, void animatedElementDestroyed(QObject*))
00172     Q_PRIVATE_SLOT(d, void customAnimReceiverDestroyed(QObject*))
00173 
00174     AnimatorPrivate * const d;
00175 };
00176 
00177 } // namespace Plasma
00178 
00179 #endif
00180 

Plasma

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

kdelibs

Skip menu "kdelibs"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • Kate
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • Kross
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
Generated for kdelibs by doxygen 1.5.7
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal