PageRenderTime 152ms CodeModel.GetById 60ms app.highlight 10ms RepoModel.GetById 45ms app.codeStats 0ms

/src/libtomahawk/playlist/dynamic/widgets/LoadingSpinner.h

http://github.com/tomahawk-player/tomahawk
C++ Header | 56 lines | 25 code | 11 blank | 20 comment | 0 complexity | 4f6eed7f06fe31d3757281dc7e30919d MD5 | raw file
 1/* === This file is part of Tomahawk Player - <http://tomahawk-player.org> ===
 2 *
 3 *   Copyright 2010 Leo Franchi <lfranchi@kde.org>
 4 *
 5 *   Tomahawk is free software: you can redistribute it and/or modify
 6 *   it under the terms of the GNU General Public License as published by
 7 *   the Free Software Foundation, either version 3 of the License, or
 8 *   (at your option) any later version.
 9 *
10 *   Tomahawk is distributed in the hope that it will be useful,
11 *   but WITHOUT ANY WARRANTY; without even the implied warranty of
12 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 *   GNU General Public License for more details.
14 *
15 *   You should have received a copy of the GNU General Public License
16 *   along with Tomahawk. If not, see <http://www.gnu.org/licenses/>.
17 */
18
19#ifndef LOADING_SPINNER_H
20#define LOADING_SPINNER_H
21
22#include <QWidget>
23
24#include "dllmacro.h"
25
26class QMovie;
27class QTimeLine;
28/**
29 * A small widget that displays an animated loading spinner
30 */
31class DLLEXPORT LoadingSpinner : public QWidget {
32    Q_OBJECT
33public:
34    LoadingSpinner( QWidget* parent );
35    virtual ~LoadingSpinner();
36
37    virtual QSize sizeHint() const;
38    virtual void paintEvent( QPaintEvent* );
39
40public slots:
41    void fadeIn();
42    void fadeOut();
43
44private slots:
45    void hideFinished();
46
47private:
48    void reposition();
49
50    QTimeLine* m_showHide;
51    QMovie* m_anim;
52};
53
54#endif
55
56class QPaintEvent;