#ifndef MUSICLIBRARYTREEPRIVATE_H
#define MUSICLIBRARYTREEPRIVATE_H

#include <QAbstractItemModel>

class MusicLibrary;
class Artist;
class Record;
class Song;
class MusicObject;

class MusicLibraryTreePrivate : public QAbstractItemModel
{
    Q_OBJECT

public:
    MusicLibraryTreePrivate(MusicLibrary *l);

    QModelIndex index(int row, int column, const QModelIndex &parent) const;
    QModelIndex parent(const QModelIndex &child) const;
    int rowCount(const QModelIndex &parent) const;
    int columnCount(const QModelIndex &parent) const;
    QVariant data(const QModelIndex &index, int role) const;

private slots:
    void objectChanged(MusicObject *obj);

private:
    // Index lookup functions
    QModelIndex artistToIndex(Artist *artist) const;
    QModelIndex recordToIndex(Record *record) const;
    QModelIndex songToIndex(Song *song) const;
    int objType(MusicObject *obj) const;

private:
    MusicLibrary *library;
};

#endif // MUSICLIBRARYTREEPRIVATE_H
