Plasma
animation.cpp
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 00020 #include "animation.h" 00021 #include "private/animationprivate_p.h" 00022 00023 #include <QMapIterator> 00024 #include <QObject> 00025 #include <QParallelAnimationGroup> 00026 #include <QSequentialAnimationGroup> 00027 #include <QDebug> 00028 #include <kdebug.h> 00029 #include <kglobalsettings.h> 00030 00031 namespace Plasma 00032 { 00033 00034 00035 AnimationPrivate::AnimationPrivate() 00036 : easingCurve(QEasingCurve::Linear), 00037 duration(250) 00038 { 00039 } 00040 00041 Animation::Animation(QObject* parent) 00042 : QAbstractAnimation(parent), 00043 d(new AnimationPrivate) 00044 { 00045 } 00046 00047 Animation::~Animation() 00048 { 00049 delete d; 00050 } 00051 00052 int Animation::duration() const 00053 { 00054 return d->duration; 00055 } 00056 00057 void Animation::setDuration(int duration) 00058 { 00059 d->duration = qMax(0, duration); 00060 } 00061 00062 void Animation::setTargetWidget(QGraphicsWidget* widget) 00063 { 00064 d->animObject = widget; 00065 if (parent() == 0) { 00066 setParent(widget); 00067 } 00068 } 00069 00070 QGraphicsWidget* Animation::targetWidget() const 00071 { 00072 return d->animObject.data(); 00073 } 00074 00075 void Animation::setEasingCurve(const QEasingCurve &curve) 00076 { 00077 d->easingCurve = curve; 00078 } 00079 00080 QEasingCurve Animation::easingCurve() const 00081 { 00082 return d->easingCurve; 00083 } 00084 00085 void Animation::updateCurrentTime(int currentTime) 00086 { 00087 Q_UNUSED(currentTime) 00088 } 00089 00090 } //namespace Plasma 00091 00092 #include "animation.moc"
KDE 4.6 API Reference