2 * This file is part of the KDE project
3 * Copyright (C) 2007 Rafael Fernández López <ereslibre@kde.org>
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.
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.
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.
21 #ifndef DOLPHINMODEL_H
22 #define DOLPHINMODEL_H
25 #include <kversioncontrolplugin.h>
26 #include <libdolphin_export.h>
29 #include <QPersistentModelIndex>
31 class LIBDOLPHINPRIVATE_EXPORT DolphinModel
: public KDirModel
36 enum AdditionalColumns
{
37 LinkDest
= KDirModel::ColumnCount
,
39 // Assure that invisible columns are added as last entries:
41 ExtraColumnCount
// Mandatory last entry
44 DolphinModel(QObject
* parent
= 0);
45 virtual ~DolphinModel();
47 virtual bool setData(const QModelIndex
& index
, const QVariant
& value
, int role
= Qt::EditRole
);
48 virtual QVariant
data(const QModelIndex
& index
, int role
= Qt::DisplayRole
) const;
49 virtual QVariant
headerData(int section
, Qt::Orientation orientation
, int role
= Qt::DisplayRole
) const;
50 virtual int columnCount(const QModelIndex
& parent
= QModelIndex()) const;
52 void clearVersionData();
53 bool hasVersionData() const;
56 void slotRowsRemoved(const QModelIndex
& parent
, int start
, int end
);
59 QVariant
displayRoleData(const QModelIndex
& index
) const;
60 QVariant
sortRoleData(const QModelIndex
& index
) const;
63 bool m_hasVersionData
;
64 QHash
<QPersistentModelIndex
, KVersionControlPlugin::VersionState
> m_revisionHash
;
66 static const char* const m_others
;
69 #endif // DOLPHINMODEL_H