#ifndef MUSICLIBRARYMODEL_H
#define MUSICLIBRARYMODEL_H

#include <QStandardItemModel>
#include "musiclibrary.h"
#include "musiclibrarymodel_global.h"

class MusicLibraryModelPrivate;

class MUSICLIBRARYMODELSHARED_EXPORT MusicLibraryModel : public QObject
{
    Q_OBJECT

public:

    /**
     * Creates model API
     */
    MusicLibraryModel(MusicLibrary *library);

    /**
     * Frees model API
     */
    ~MusicLibraryModel();

    /**
     * Gets a tree model of the library contents
     */
    QAbstractItemModel *tree();

    /**
     * Gets a standard item based tree from library contents
     */
    QStandardItemModel *stdTree();

    /**
     * Gets a model that contains the artists of library in a list.
     * Artists are sorted alphabetically by default.
     */
    QAbstractItemModel *artists();

    /**
     * Gets a model that contains the records of library in a list
     * Records are sorted by release date by default.
     */
    QAbstractItemModel *records();

    /**
     * Gets a model that contains the songs of library in a list
     * Songs are sorted alphabetically by default.
     */
    QAbstractItemModel *songs();

private:
    MusicLibraryModelPrivate *pPtr;
};

#endif // MUSICLIBRARYMODEL_H
