Revert previous commit, was incorrect
[amarok.git] / src / collectionbrowser / SingleCollectionTreeItemModel.h
blobac69f2f8ffb92864fdedd14b94c707068b5e00a0
1 /******************************************************************************
2 * copyright: (c) 2007 Alexandre Pereira de Oliveira <aleprj@gmail.com> *
3 * (c) 2007 Maximilian Kossick <maximilian.kossick@googlemail.com> *
4 * (c) 2007 Nikolaj Hald Nielsen <nhnFreespirit@gmail.com> *
5 * This program is free software; you can redistribute it and/or modify *
6 * it under the terms of the GNU General Public License version 2 *
7 * as published by the Free Software Foundation. *
8 ******************************************************************************/
10 #ifndef SINGLECOLLECTIONTREEITEMMODEL_H
11 #define SINGLECOLLECTIONTREEITEMMODEL_H
13 #include "amarok_export.h"
14 #include "CollectionTreeItemModelBase.h"
15 #include "meta/Meta.h"
17 #include <QAbstractItemModel>
18 #include <QMap>
19 #include <QPair>
20 #include <QPixmap>
22 class CollectionTreeItem;
23 class Collection;
24 //typedef QPair<Collection*, CollectionTreeItem* > CollectionRoot;
26 class AMAROK_EXPORT SingleCollectionTreeItemModel: public CollectionTreeItemModelBase {
27 Q_OBJECT
29 public:
30 SingleCollectionTreeItemModel( Collection * collection, const QList<int> &levelType );
32 virtual QVariant data(const QModelIndex &index, int role) const;
33 virtual bool hasChildren ( const QModelIndex & parent = QModelIndex() ) const;
34 virtual bool canFetchMore( const QModelIndex &parent ) const;
35 virtual void fetchMore( const QModelIndex &parent );
36 virtual void setLevels( const QList<int> &levelType );
38 protected:
39 virtual void filterChildren();
41 private:
43 void ensureChildrenLoaded( CollectionTreeItem *item ) const;
45 Collection* m_collection;
46 QueryMaker* m_queryMaker;
52 #endif