Plasma
animation.h
Go to the documentation of this file.
00001 /* 00002 * Copyright 2009 Mehmet Ali Akmanalp <makmanalp@wpi.edu> 00003 * 00004 * This program is free software; you can redistribute it and/or modify 00005 * it under the terms of the GNU Library General Public License as 00006 * published by the Free Software Foundation; either version 2, or 00007 * (at your option) any later version. 00008 * 00009 * This program is distributed in the hope that it will be useful, 00010 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00012 * GNU General Public License for more details 00013 * 00014 * You should have received a copy of the GNU Library General Public 00015 * License along with this program; if not, write to the 00016 * Free Software Foundation, Inc., 00017 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 00018 */ 00019 00025 #ifndef PLASMA_ANIMATION_H 00026 #define PLASMA_ANIMATION_H 00027 00028 #include <QtGui/QGraphicsWidget> 00029 #include <QtCore/QObject> 00030 #include <QtCore/QPropertyAnimation> 00031 #include <QtCore/QAbstractAnimation> 00032 #include <QtCore/QEasingCurve> 00033 00034 #include <plasma/plasma_export.h> 00035 #include <plasma/plasma.h> 00036 00037 namespace Plasma 00038 { 00039 00040 class AnimationPrivate; 00041 00046 class PLASMA_EXPORT Animation : public QAbstractAnimation 00047 { 00048 00049 Q_OBJECT 00050 Q_ENUMS(Reference) 00051 Q_ENUMS(MovementDirection) 00052 Q_PROPERTY(int duration READ duration WRITE setDuration) 00053 Q_PROPERTY(QEasingCurve easingCurve READ easingCurve WRITE setEasingCurve) 00054 Q_PROPERTY(QGraphicsWidget *targetWidget READ targetWidget WRITE setTargetWidget) 00055 00056 public: 00061 int duration() const; 00062 00066 enum ReferenceFlag { 00067 Center = 0, 00068 Up = 0x1, 00069 Down = 0x2, 00070 Left = 0x4, 00071 Right = 0x8 00072 }; 00073 00074 Q_DECLARE_FLAGS(Reference, ReferenceFlag) 00075 00076 00079 enum MovementDirectionFlag { 00080 MoveAny = 0, 00081 MoveUp = 0x1, 00082 MoveRight = 0x2, 00083 MoveDown = 0x4, 00084 MoveLeft = 0x8 00085 }; 00086 00087 Q_DECLARE_FLAGS(MovementDirection, MovementDirectionFlag) 00088 00089 00096 explicit Animation(QObject* parent = 0); 00097 00101 ~Animation() = 0; 00102 00107 void setTargetWidget(QGraphicsWidget* widget); 00108 00112 QGraphicsWidget *targetWidget() const; 00113 00117 void setEasingCurve(const QEasingCurve &curve); 00118 00122 QEasingCurve easingCurve() const; 00123 00124 protected: 00129 virtual void setDuration(int duration = 250); 00130 00139 virtual void updateCurrentTime(int currentTime); 00140 00141 private: 00142 00147 AnimationPrivate *const d; 00148 00149 }; 00150 00151 } //namespace Plasma 00152 00153 #endif
KDE 4.6 API Reference