src/gui/widgets/qwidgetanimator_p.h

Go to the documentation of this file.
00001 /****************************************************************************
00002 **
00003 ** Copyright (C) 1992-2006 Trolltech ASA. All rights reserved.
00004 **
00005 ** This file is part of the QtGui module of the Qt Toolkit.
00006 **
00007 ** This file may be used under the terms of the GNU General Public
00008 ** License version 2.0 as published by the Free Software Foundation
00009 ** and appearing in the file LICENSE.GPL included in the packaging of
00010 ** this file.  Please review the following information to ensure GNU
00011 ** General Public Licensing requirements will be met:
00012 ** http://www.trolltech.com/products/qt/opensource.html
00013 **
00014 ** If you are unsure which license is appropriate for your use, please
00015 ** review the following information:
00016 ** http://www.trolltech.com/products/qt/licensing.html or contact the
00017 ** sales department at sales@trolltech.com.
00018 **
00019 ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
00020 ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
00021 **
00022 ****************************************************************************/
00023 
00024 #ifndef QWIDGET_ANIMATOR_P_H
00025 #define QWIDGET_ANIMATOR_P_H
00026 
00027 //
00028 //  W A R N I N G
00029 //  -------------
00030 //
00031 // This file is not part of the Qt API.  It exists for the convenience
00032 // of the QLibrary class.  This header file may change from
00033 // version to version without notice, or even be removed.
00034 //
00035 // We mean it.
00036 //
00037 
00038 #include <QObject>
00039 #include <QRect>
00040 #include <QMap>
00041 
00042 class QWidget;
00043 class QTimer;
00044 class QTime;
00045 
00046 class QWidgetAnimator : public QObject
00047 {
00048     Q_OBJECT
00049 public:
00050     QWidgetAnimator(QObject *parent = 0);
00051     ~QWidgetAnimator();
00052     void animate(QWidget *widget, const QRect &final_geometry, bool animate);
00053     bool animating() const;
00054     bool animating(QWidget *widget);
00055 
00056 signals:
00057     void finished(QWidget *widget);
00058     void finishedAll();
00059 
00060 private slots:
00061     void animationStep();
00062 
00063 private:
00064     struct AnimationItem {
00065         AnimationItem(QWidget *_widget = 0, const QRect &_r1 = QRect(),
00066                         const QRect &_r2 = QRect())
00067             : widget(_widget), r1(_r1), r2(_r2), step(0) {}
00068         QWidget *widget;
00069         QRect r1, r2;
00070         int step;
00071     };
00072     typedef QMap<QWidget*, AnimationItem> AnimationMap;
00073     AnimationMap m_animation_map;
00074     QTimer *m_timer;
00075     QTime *m_time;
00076 };
00077 
00078 #endif // QWIDGET_ANIMATOR_P_H

Generated on Thu Mar 15 11:57:09 2007 for Qt 4.2 User's Guide by  doxygen 1.5.1