/src/libtomahawk/playlist/albumitem.h

http://github.com/tomahawk-player/tomahawk · C Header · 62 lines · 33 code · 12 blank · 17 comment · 0 complexity · aa10416774b9449629671075a70f1d96 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. *
  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 ALBUMITEM_H
  19. #define ALBUMITEM_H
  20. #include <QAbstractItemModel>
  21. #include <QHash>
  22. #include <QPersistentModelIndex>
  23. #include <QPixmap>
  24. #include "artist.h"
  25. #include "album.h"
  26. #include "dllmacro.h"
  27. class DLLEXPORT AlbumItem : public QObject
  28. {
  29. Q_OBJECT
  30. public:
  31. ~AlbumItem();
  32. explicit AlbumItem( AlbumItem* parent = 0, QAbstractItemModel* model = 0 );
  33. explicit AlbumItem( const Tomahawk::artist_ptr& artist, AlbumItem* parent = 0, int row = -1 );
  34. explicit AlbumItem( const Tomahawk::album_ptr& album, AlbumItem* parent = 0, int row = -1 );
  35. const Tomahawk::artist_ptr& artist() const { return m_artist; }
  36. const Tomahawk::album_ptr& album() const { return m_album; }
  37. AlbumItem* parent;
  38. QList<AlbumItem*> children;
  39. QHash<QString, AlbumItem*> hash;
  40. int childCount;
  41. QPersistentModelIndex index;
  42. QAbstractItemModel* model;
  43. bool toberemoved;
  44. signals:
  45. void dataChanged();
  46. private:
  47. Tomahawk::artist_ptr m_artist;
  48. Tomahawk::album_ptr m_album;
  49. };
  50. #endif // ALBUMITEM_H