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

libplasma

phase.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 PHASE_H
00022 #define PHASE_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 
00038 class PLASMA_EXPORT Phase : public QObject
00039 {
00040     Q_OBJECT
00041     Q_ENUMS( Animation )
00042     Q_ENUMS( CurveShape )
00043     Q_ENUMS( Movement )
00044 
00045 public:
00046     enum Animation
00047     {
00048         Appear = 0 /*<< When some appears in the Corona */,
00049         Disappear /*<< When something is about to disappear */,
00050         Activate /*<< When something is activated or launched, such as an app icon being clicked */,
00051         FrameAppear /*<< Make a frame appear around an object */
00052     };
00053 
00054     enum ElementAnimation
00055     {
00056         ElementAppear = 0 /*<< Animate the appearance of an element */,
00057         ElementDisappear /*<< Animate the disappearance of an element */
00058     };
00059 
00060     enum CurveShape
00061     {
00062         EaseInCurve = 0,
00063         EaseOutCurve,
00064         EaseInOutCurve,
00065         LinearCurve
00066     };
00067 
00068     enum Movement
00069     {
00070         SlideIn = 0,
00071         SlideOut
00072     };
00073 
00074     typedef int AnimId;
00075 
00079     static Phase* self();
00080 
00081     explicit Phase(QObject * parent = 0);
00082     ~Phase();
00083 
00084     Q_INVOKABLE void animateItem(QGraphicsItem* item, Animation anim);
00085     Q_INVOKABLE void moveItem(QGraphicsItem* item, Movement movement, const QPoint &destination);
00086 
00101     Q_INVOKABLE AnimId customAnimation(int frames, int duration, Phase::CurveShape curve,
00102                                        QObject* receiver, const char* method);
00103 
00111     Q_INVOKABLE void stopCustomAnimation(AnimId id);
00112 
00113     Q_INVOKABLE AnimId animateElement(QGraphicsItem *obj, ElementAnimation);
00114     Q_INVOKABLE void stopElementAnimation(AnimId id);
00115     Q_INVOKABLE void setAnimationPixmap(AnimId id, const QPixmap &pixmap);
00116     Q_INVOKABLE QPixmap animationResult(AnimId id);
00117 
00118 Q_SIGNALS:
00119     void animationComplete(QGraphicsItem *item, Plasma::Phase::Animation anim);
00120     void movementComplete(QGraphicsItem *item);
00121     void elementAnimationComplete(AnimId id);
00122     void customAnimationComplete(AnimId id);
00123 
00124 protected:
00125     void timerEvent(QTimerEvent *event);
00126 
00127 protected Q_SLOTS:
00128     void animatedItemDestroyed(QObject*);
00129     void movingItemDestroyed(QObject*);
00130     void animatedElementDestroyed(QObject*);
00131     void customAnimReceiverDestroyed(QObject*);
00132 
00133 private:
00134     void init();
00135 
00136     class Private;
00137     Private * const d;
00138 };
00139 
00140 } // namespace Plasma
00141 
00142 #endif
00143 

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
  • 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