/src/libtomahawk/playlist/AlbumModel.h

http://github.com/tomahawk-player/tomahawk · C Header · 68 lines · 34 code · 16 blank · 18 comment · 0 complexity · 9dc2ef857bd78a306a3c88abd25cd8b6 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 ALBUMMODEL_H
  20. #define ALBUMMODEL_H
  21. #include <QPixmap>
  22. #include "Album.h"
  23. #include "PlaylistInterface.h"
  24. #include "database/DatabaseCommand_AllAlbums.h"
  25. #include "PlayableModel.h"
  26. #include "DllMacro.h"
  27. class PlayableItem;
  28. class QMetaData;
  29. class DLLEXPORT AlbumModel : public PlayableModel
  30. {
  31. Q_OBJECT
  32. public:
  33. explicit AlbumModel( QObject* parent = 0 );
  34. virtual ~AlbumModel();
  35. Tomahawk::collection_ptr collection() const { return m_collection; }
  36. void addCollection( const Tomahawk::collection_ptr& collection, bool overwrite = false );
  37. void addFilteredCollection( const Tomahawk::collection_ptr& collection, unsigned int amount, Tomahawk::DatabaseCommand_AllAlbums::SortOrder order, bool overwrite = false );
  38. PlayableItem* findItem( const Tomahawk::artist_ptr& artist ) const;
  39. PlayableItem* findItem( const Tomahawk::album_ptr& album ) const;
  40. public slots:
  41. void addAlbums( const QList<Tomahawk::album_ptr>& albums );
  42. void addArtists( const QList<Tomahawk::artist_ptr>& artists );
  43. void addQueries( const QList<Tomahawk::query_ptr>& queries );
  44. signals:
  45. private slots:
  46. void onSourceAdded( const Tomahawk::source_ptr& source );
  47. void onCollectionChanged();
  48. private:
  49. bool m_overwriteOnAdd;
  50. Tomahawk::collection_ptr m_collection;
  51. };
  52. #endif // ALBUMMODEL_H