]> cloud.milkyroute.net Git - dolphin.git/blob - src/dolphinmodel.h
Forwardport 773570:
[dolphin.git] / src / dolphinmodel.h
1 /**
2 * This file is part of the KDE project
3 * Copyright (C) 2007 Rafael Fernández López <ereslibre@kde.org>
4 *
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Library General Public
7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version.
9 *
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Library General Public License for more details.
14 *
15 * You should have received a copy of the GNU Library General Public License
16 * along with this library; see the file COPYING.LIB. If not, write to
17 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18 * Boston, MA 02110-1301, USA.
19 */
20
21 #ifndef DOLPHINMODEL_H
22 #define DOLPHINMODEL_H
23
24 #include <kdirmodel.h>
25
26 #include <libdolphin_export.h>
27
28 class LIBDOLPHINPRIVATE_EXPORT DolphinModel
29 : public KDirModel
30 {
31 public:
32 enum AdditionalColumns {
33 Rating = ColumnCount, // ColumnCount defined at KDirModel
34 Tags,
35 ExtraColumnCount
36 };
37
38 DolphinModel(QObject *parent = 0);
39 virtual ~DolphinModel();
40
41 virtual QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const;
42
43 virtual int columnCount(const QModelIndex &parent = QModelIndex()) const;
44
45 /**
46 * Returns the rating for the item with the index \a index. 0 is
47 * returned if no item could be found.
48 */
49 static quint32 ratingForIndex(const QModelIndex& index);
50
51 /**
52 * Returns the tags for the item with the index \a index. If no
53 * tag is applied, a predefined string will be returned.
54 */
55 static QString tagsForIndex(const QModelIndex& index);
56 };
57
58 #endif // DOLPHINMODEL_H