/src/libtomahawk/playlist/playlistview.h

http://github.com/tomahawk-player/tomahawk · C Header · 67 lines · 36 code · 13 blank · 18 comment · 0 complexity · c247c7c986f50ebc80911e62b181e5de 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-2012, 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 PLAYLISTVIEW_H
  20. #define PLAYLISTVIEW_H
  21. #include "playlist/PlayableProxyModel.h"
  22. #include "playlist/PlaylistModel.h"
  23. #include "TrackView.h"
  24. #include "ViewPage.h"
  25. #include "DllMacro.h"
  26. class DLLEXPORT PlaylistView : public TrackView
  27. {
  28. Q_OBJECT
  29. public:
  30. explicit PlaylistView( QWidget* parent = 0 );
  31. virtual ~PlaylistView();
  32. PlaylistModel* playlistModel() const { return m_model; }
  33. virtual void setPlaylistModel( PlaylistModel* model );
  34. virtual void setModel( QAbstractItemModel* model );
  35. virtual QList<Tomahawk::PlaylistUpdaterInterface*> updaters() const;
  36. virtual QPixmap pixmap() const { return QPixmap( RESPATH "images/playlist-icon.png" ); }
  37. virtual bool isTemporaryPage() const;
  38. signals:
  39. void nameChanged( const QString& title );
  40. void destroyed( QWidget* widget );
  41. void modelChanged();
  42. protected:
  43. void keyPressEvent( QKeyEvent* event );
  44. bool eventFilter( QObject* obj, QEvent* event );
  45. private slots:
  46. void onMenuTriggered( int action );
  47. void onDeleted();
  48. void onChanged();
  49. private:
  50. PlaylistModel* m_model;
  51. QString m_customTitle;
  52. QString m_customDescripton;
  53. };
  54. #endif // PLAYLISTVIEW_H