add a small widget for showing an animation from the "animations" category of the...
[kdegraphics.git] / okular / ui / animatedwidget.h
blobc8cca236c9f1375507ec578c36455c14a4c63a9e
1 /***************************************************************************
2 * Copyright (C) 2009 by Pino Toscano <pino@kde.org> *
3 * *
4 * This program is free software; you can redistribute it and/or modify *
5 * it under the terms of the GNU General Public License as published by *
6 * the Free Software Foundation; either version 2 of the License, or *
7 * (at your option) any later version. *
8 ***************************************************************************/
10 #ifndef ANIMATEDWIDGET_H
11 #define ANIMATEDWIDGET_H
13 #include <qbasictimer.h>
14 #include <qpixmap.h>
15 #include <qwidget.h>
17 class AnimatedWidget : public QWidget
19 Q_OBJECT
21 public:
22 AnimatedWidget( const QString& iconName, QWidget *parent = 0 );
23 virtual ~AnimatedWidget();
25 public slots:
26 void start();
27 void stop();
29 protected:
30 void paintEvent( QPaintEvent *event );
31 void resizeEvent( QResizeEvent *event );
32 void timerEvent( QTimerEvent *event );
34 private:
35 void load();
37 QString m_icon;
38 QPixmap m_pixmap;
39 int m_frames;
40 int m_currentFrame;
41 int m_size;
42 QBasicTimer m_timer;
45 #endif