PageRenderTime 92ms CodeModel.GetById 50ms app.highlight 5ms RepoModel.GetById 36ms app.codeStats 0ms

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

http://github.com/tomahawk-player/tomahawk
C Header | 82 lines | 46 code | 16 blank | 20 comment | 0 complexity | a2eb7a7636b08a20ed3d6958f4732c6b MD5 | raw file
 1/* === This file is part of Tomahawk Player - <http://tomahawk-player.org> ===
 2 *
 3 *   Copyright 2010-2011, 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 DYNAMIC_SETUP_WIDGET_H
20#define DYNAMIC_SETUP_WIDGET_H
21
22#include <QWidget>
23#include <Typedefs.h>
24
25class QPropertyAnimation;
26class QPaintEvent;
27class QHBoxLayout;
28class QSpinBox;
29class QPushButton;
30class QLabel;
31class ReadOrWriteWidget;
32class QLabel;
33
34namespace Tomahawk
35{
36
37/**
38 * Widget used to choose a type of dynamic playlist, and to set the number/generate if it's a static one.
39 */
40class DynamicSetupWidget : public QWidget
41{
42    Q_OBJECT
43    Q_PROPERTY( qreal opacity READ opacity WRITE setOpacity )
44public:
45    DynamicSetupWidget( const Tomahawk::dynplaylist_ptr& playlist, QWidget* parent = 0 );
46    virtual ~DynamicSetupWidget();
47
48    void setPlaylist( const dynplaylist_ptr& playlist );
49
50    qreal opacity() const { return m_opacity; }
51    void setOpacity( qreal opacity );
52
53    virtual void paintEvent( QPaintEvent* );
54
55public slots:
56    void fadeIn();
57    void fadeOut();
58
59signals:
60    void generatePressed( int num );
61    void typeChanged( const QString& playlistType );
62
63private slots:
64    void generatePressed( bool );
65
66private:
67    dynplaylist_ptr m_playlist;
68
69    QLabel* m_headerText;
70    QHBoxLayout* m_layout;
71    ReadOrWriteWidget* m_generatorCombo;
72    QLabel* m_logo;
73    QPushButton* m_generateButton;
74    QSpinBox* m_genNumber;
75
76    QPropertyAnimation* m_fadeAnim;
77    qreal m_opacity;
78};
79
80};
81
82#endif