PageRenderTime 283ms CodeModel.GetById 120ms app.highlight 4ms RepoModel.GetById 157ms app.codeStats 0ms

/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
19#ifndef ALBUMITEM_H
20#define ALBUMITEM_H
21
22#include <QAbstractItemModel>
23#include <QHash>
24#include <QPersistentModelIndex>
25#include <QPixmap>
26
27#include "artist.h"
28#include "album.h"
29
30#include "dllmacro.h"
31
32class DLLEXPORT AlbumItem : public QObject
33{
34Q_OBJECT
35
36public:
37    ~AlbumItem();
38
39    explicit AlbumItem( AlbumItem* parent = 0, QAbstractItemModel* model = 0 );
40    explicit AlbumItem( const Tomahawk::artist_ptr& artist, AlbumItem* parent = 0, int row = -1 );
41    explicit AlbumItem( const Tomahawk::album_ptr& album, AlbumItem* parent = 0, int row = -1 );
42
43    const Tomahawk::artist_ptr& artist() const { return m_artist; }
44    const Tomahawk::album_ptr& album() const { return m_album; }
45
46    AlbumItem* parent;
47    QList<AlbumItem*> children;
48    QHash<QString, AlbumItem*> hash;
49    int childCount;
50    QPersistentModelIndex index;
51    QAbstractItemModel* model;
52    bool toberemoved;
53
54signals:
55    void dataChanged();
56
57private:
58    Tomahawk::artist_ptr m_artist;
59    Tomahawk::album_ptr m_album;
60};
61
62#endif // ALBUMITEM_H