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

libplasma

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 ANIMATOR_H
00022 #define 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 
00040 class PLASMA_EXPORT Animator : public QObject
00041 {
00042     Q_OBJECT
00043     Q_ENUMS( Animation )
00044     Q_ENUMS( CurveShape )
00045     Q_ENUMS( Movement )
00046 
00047 public:
00048 
00049     enum Animation
00050     {
00051         AppearAnimation = 0 /*<< Animate the appearance of an element */,
00052         DisappearAnimation /*<< Animate the disappearance of an element */,
00053         ActivateAnimation /*<< When something is activated or launched, such as an app icon being clicked */
00054     };
00055 
00056     enum CurveShape
00057     {
00058         EaseInCurve = 0,
00059         EaseOutCurve,
00060         EaseInOutCurve,
00061         LinearCurve
00062     };
00063 
00064     enum Movement
00065     {
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 

libplasma

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

API Reference

Skip menu "API Reference"
  • KWin
  •   KWin Libraries
  • Libraries
  •   libkworkspace
  •   libplasma
  •   libsolidcontrol
  •   libtaskmanager
  • Plasma
  •   Animators
  •   Applets
  •   Engines
  • Solid Modules
Generated for API Reference by doxygen 1.5.4
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