streamdirectorymodel.h

Go to the documentation of this file.
00001 /*
00002     Copyright (C) 2008-2010  Lukas Sommer < SommerLuk at gmail dot com >
00003 
00004     This program is free software; you can redistribute it and/or
00005     modify it under the terms of the GNU General Public License as
00006     published by the Free Software Foundation; either version 2 of
00007     the License or (at your option) version 3 or any later version
00008     accepted by the membership of KDE e.V. (or its successor approved
00009     by the membership of KDE e.V.), which shall act as a proxy
00010     defined in Section 14 of version 3 of the license.
00011 
00012     This program is distributed in the hope that it will be useful,
00013     but WITHOUT ANY WARRANTY; without even the implied warranty of
00014     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
00015     GNU General Public License for more details.
00016 
00017     You should have received a copy of the GNU General Public License
00018     along with this program.  If not, see <http://www.gnu.org/licenses/>.
00019 */
00020 
00021 #ifndef STREAMDIRECTORYMODEL_H
00022 #define STREAMDIRECTORYMODEL_H
00023 
00024 #include <QAbstractItemModel>
00025 #include <KIcon>
00026 #include "streamdirectoryentry_root.h"
00027 
00034 class streamDirectoryModel : public QAbstractItemModel
00035 {
00036 
00037   Q_OBJECT
00038 
00039   public:
00043     explicit streamDirectoryModel(QObject *parent, const QString & genreIconFileName = QString());
00045     virtual ~streamDirectoryModel();
00047     virtual int columnCount(const QModelIndex & parent = QModelIndex()) const;
00051     virtual QVariant data(const QModelIndex & index, int role = Qt::DisplayRole) const;
00053     virtual Qt::ItemFlags flags(const QModelIndex & index) const;
00055     virtual bool hasChildren(const QModelIndex & parent = QModelIndex()) const;
00056     virtual QVariant headerData(int section,
00057                                 Qt::Orientation orientation,
00058                                 int role = Qt::DisplayRole) const;
00060     virtual QModelIndex index (int row,
00061                                int column,
00062                                const QModelIndex & parent = QModelIndex()) const;
00064     virtual QStringList mimeTypes() const;
00066     virtual QMimeData *mimeData(const QModelIndexList & indexes) const;
00068     virtual QModelIndex parent(const QModelIndex & index) const;
00070     virtual int rowCount(const QModelIndex & parent = QModelIndex()) const;
00071 
00072   protected:
00074     streamDirectoryEntry_root *rootEntry;
00075 
00076   private:
00079     KIcon genreIcon;
00080 };
00081 
00082 #endif

doxygen