/src/libtomahawk/widgets/newplaylistwidget.h

http://github.com/tomahawk-player/tomahawk · C Header · 82 lines · 44 code · 20 blank · 18 comment · 0 complexity · 6c2d3a92fd5067fdeb5cc8bb274382da MD5 · raw file

  1. /* === This file is part of Tomahawk Player - <http://tomahawk-player.org> ===
  2. *
  3. * Copyright 2010-2011, Christian Muehlhaeuser <muesli@tomahawk-player.org>
  4. * Copyright 2010-2011, Jeff Mitchell <jeff@tomahawk-player.org>
  5. *
  6. * Tomahawk is free software: you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License as published by
  8. * the Free Software Foundation, either version 3 of the License, or
  9. * (at your option) any later version.
  10. *
  11. * Tomahawk is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. * GNU General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU General Public License
  17. * along with Tomahawk. If not, see <http://www.gnu.org/licenses/>.
  18. */
  19. #ifndef NEWPLAYLISTWIDGET_H
  20. #define NEWPLAYLISTWIDGET_H
  21. #include <QtGui/QWidget>
  22. #include <QtCore/QTimer>
  23. #include "PlaylistInterface.h"
  24. #include "ViewPage.h"
  25. #include "DllMacro.h"
  26. class QPushButton;
  27. class PlaylistModel;
  28. namespace Ui
  29. {
  30. class NewPlaylistWidget;
  31. }
  32. class DLLEXPORT NewPlaylistWidget : public QWidget, public Tomahawk::ViewPage
  33. {
  34. Q_OBJECT
  35. public:
  36. NewPlaylistWidget( QWidget* parent = 0 );
  37. ~NewPlaylistWidget();
  38. virtual QWidget* widget() { return this; }
  39. virtual Tomahawk::playlistinterface_ptr playlistInterface() const { return Tomahawk::playlistinterface_ptr(); }
  40. virtual QString title() const { return tr( "Create a new playlist" ); }
  41. virtual QString description() const { return QString(); }
  42. virtual bool jumpToCurrentTrack() { return false; }
  43. protected:
  44. void changeEvent( QEvent* e );
  45. signals:
  46. void destroyed( QWidget* widget );
  47. private slots:
  48. void onTitleChanged( const QString& title );
  49. void onTagChanged();
  50. void updateSuggestions();
  51. void suggestionsFound();
  52. void savePlaylist();
  53. void cancel();
  54. private:
  55. Ui::NewPlaylistWidget *ui;
  56. PlaylistModel* m_suggestionsModel;
  57. QList< Tomahawk::query_ptr > m_queries;
  58. QTimer m_filterTimer;
  59. QString m_tag;
  60. QPushButton* m_saveButton;
  61. };
  62. #endif // NEWPLAYLISTWIDGET_H