/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. #ifndef DYNAMIC_SETUP_WIDGET_H
  19. #define DYNAMIC_SETUP_WIDGET_H
  20. #include <QWidget>
  21. #include <Typedefs.h>
  22. class QPropertyAnimation;
  23. class QPaintEvent;
  24. class QHBoxLayout;
  25. class QSpinBox;
  26. class QPushButton;
  27. class QLabel;
  28. class ReadOrWriteWidget;
  29. class QLabel;
  30. namespace Tomahawk
  31. {
  32. /**
  33. * Widget used to choose a type of dynamic playlist, and to set the number/generate if it's a static one.
  34. */
  35. class DynamicSetupWidget : public QWidget
  36. {
  37. Q_OBJECT
  38. Q_PROPERTY( qreal opacity READ opacity WRITE setOpacity )
  39. public:
  40. DynamicSetupWidget( const Tomahawk::dynplaylist_ptr& playlist, QWidget* parent = 0 );
  41. virtual ~DynamicSetupWidget();
  42. void setPlaylist( const dynplaylist_ptr& playlist );
  43. qreal opacity() const { return m_opacity; }
  44. void setOpacity( qreal opacity );
  45. virtual void paintEvent( QPaintEvent* );
  46. public slots:
  47. void fadeIn();
  48. void fadeOut();
  49. signals:
  50. void generatePressed( int num );
  51. void typeChanged( const QString& playlistType );
  52. private slots:
  53. void generatePressed( bool );
  54. private:
  55. dynplaylist_ptr m_playlist;
  56. QLabel* m_headerText;
  57. QHBoxLayout* m_layout;
  58. ReadOrWriteWidget* m_generatorCombo;
  59. QLabel* m_logo;
  60. QPushButton* m_generateButton;
  61. QSpinBox* m_genNumber;
  62. QPropertyAnimation* m_fadeAnim;
  63. qreal m_opacity;
  64. };
  65. };
  66. #endif