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>
22 class CollectionTreeItem
;
24 //typedef QPair<Collection*, CollectionTreeItem* > CollectionRoot;
26 class AMAROK_EXPORT SingleCollectionTreeItemModel
: public CollectionTreeItemModelBase
{
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
);
39 virtual void filterChildren();
43 void ensureChildrenLoaded( CollectionTreeItem
*item
) const;
45 Collection
* m_collection
;
46 QueryMaker
* m_queryMaker
;