1 | /* |
2 | Copyright (C) 2010 Klarälvdalens Datakonsult AB, |
3 | a KDAB Group company, info@kdab.net, |
4 | author Stephen Kelly <stephen@kdab.com> |
5 | |
6 | This library is free software; you can redistribute it and/or modify it |
7 | under the terms of the GNU Library General Public License as published by |
8 | the Free Software Foundation; either version 2 of the License, or (at your |
9 | option) any later version. |
10 | |
11 | This library is distributed in the hope that it will be useful, but WITHOUT |
12 | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
13 | FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public |
14 | License for more details. |
15 | |
16 | You should have received a copy of the GNU Library General Public License |
17 | along with this library; see the file COPYING.LIB. If not, write to the |
18 | Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA |
19 | 02110-1301, USA. |
20 | */ |
21 | |
22 | #ifndef KIDENTITYPROXYMODEL_H |
23 | #define KIDENTITYPROXYMODEL_H |
24 | |
25 | #include <QtGui/QAbstractProxyModel> |
26 | |
27 | #include "kdeui_export.h" |
28 | |
29 | class KIdentityProxyModelPrivate; |
30 | |
31 | class KDEUI_EXPORT KIdentityProxyModel : public QAbstractProxyModel |
32 | { |
33 | Q_OBJECT |
34 | public: |
35 | explicit KIdentityProxyModel(QObject* parent = 0); |
36 | virtual ~KIdentityProxyModel(); |
37 | |
38 | int columnCount(const QModelIndex& parent = QModelIndex()) const; |
39 | QModelIndex index(int row, int column, const QModelIndex& parent = QModelIndex()) const; |
40 | QModelIndex mapFromSource(const QModelIndex& sourceIndex) const; |
41 | QModelIndex mapToSource(const QModelIndex& proxyIndex) const; |
42 | QModelIndex parent(const QModelIndex& child) const; |
43 | int rowCount(const QModelIndex& parent = QModelIndex()) const; |
44 | bool dropMimeData(const QMimeData* data, Qt::DropAction action, int row, int column, const QModelIndex& parent); |
45 | |
46 | QItemSelection mapSelectionFromSource(const QItemSelection& selection) const; |
47 | QItemSelection mapSelectionToSource(const QItemSelection& selection) const; |
48 | QModelIndexList match(const QModelIndex& start, int role, const QVariant& value, int hits = 1, Qt::MatchFlags flags = Qt::MatchFlags(Qt::MatchStartsWith|Qt::MatchWrap)) const; |
49 | void setSourceModel(QAbstractItemModel* sourceModel); |
50 | |
51 | bool insertColumns(int column, int count, const QModelIndex& parent = QModelIndex()); |
52 | bool insertRows(int row, int count, const QModelIndex& parent = QModelIndex()); |
53 | bool removeColumns(int column, int count, const QModelIndex& parent = QModelIndex()); |
54 | bool removeRows(int row, int count, const QModelIndex& parent = QModelIndex()); |
55 | |
56 | virtual bool canFetchMore(const QModelIndex& parent) const; |
57 | virtual void fetchMore(const QModelIndex& parent); |
58 | virtual QStringList mimeTypes() const; |
59 | virtual QMimeData* mimeData(const QModelIndexList& indexes) const; |
60 | virtual Qt::DropActions supportedDropActions() const; |
61 | |
62 | protected: |
63 | KIdentityProxyModel(KIdentityProxyModelPrivate *privateClass, QObject* parent); |
64 | KIdentityProxyModelPrivate * const d_ptr; |
65 | |
66 | protected Q_SLOTS: |
67 | virtual void resetInternalData(); |
68 | |
69 | private: |
70 | Q_DECLARE_PRIVATE(KIdentityProxyModel) |
71 | Q_DISABLE_COPY(KIdentityProxyModel) |
72 | |
73 | Q_PRIVATE_SLOT(d_func(), void _k_sourceRowsAboutToBeInserted(QModelIndex,int,int)) |
74 | Q_PRIVATE_SLOT(d_func(), void _k_sourceRowsInserted(QModelIndex,int,int)) |
75 | Q_PRIVATE_SLOT(d_func(), void _k_sourceRowsAboutToBeRemoved(QModelIndex,int,int)) |
76 | Q_PRIVATE_SLOT(d_func(), void _k_sourceRowsRemoved(QModelIndex,int,int)) |
77 | Q_PRIVATE_SLOT(d_func(), void _k_sourceRowsAboutToBeMoved(QModelIndex,int,int,QModelIndex,int)) |
78 | Q_PRIVATE_SLOT(d_func(), void _k_sourceRowsMoved(QModelIndex,int,int,QModelIndex,int)) |
79 | |
80 | Q_PRIVATE_SLOT(d_func(), void _k_sourceColumnsAboutToBeInserted(QModelIndex,int,int)) |
81 | Q_PRIVATE_SLOT(d_func(), void _k_sourceColumnsInserted(QModelIndex,int,int)) |
82 | Q_PRIVATE_SLOT(d_func(), void _k_sourceColumnsAboutToBeRemoved(QModelIndex,int,int)) |
83 | Q_PRIVATE_SLOT(d_func(), void _k_sourceColumnsRemoved(QModelIndex,int,int)) |
84 | Q_PRIVATE_SLOT(d_func(), void _k_sourceColumnsAboutToBeMoved(QModelIndex,int,int,QModelIndex,int)) |
85 | Q_PRIVATE_SLOT(d_func(), void _k_sourceColumnsMoved(QModelIndex,int,int,QModelIndex,int)) |
86 | |
87 | Q_PRIVATE_SLOT(d_func(), void _k_sourceDataChanged(QModelIndex,QModelIndex)) |
88 | Q_PRIVATE_SLOT(d_func(), void _k_sourceHeaderDataChanged(Qt::Orientation orientation, int first, int last)) |
89 | |
90 | Q_PRIVATE_SLOT(d_func(), void _k_sourceLayoutAboutToBeChanged()) |
91 | Q_PRIVATE_SLOT(d_func(), void _k_sourceLayoutChanged()) |
92 | // Q_PRIVATE_SLOT(d_func(), void _k_sourceChildrenLayoutsAboutToBeChanged(const QModelIndex &parent1, const QModelIndex &parent2)) |
93 | // Q_PRIVATE_SLOT(d_func(), void _k_sourceChildrenLayoutsChanged(const QModelIndex &parent1, const QModelIndex &parent2)) |
94 | Q_PRIVATE_SLOT(d_func(), void _k_sourceModelAboutToBeReset()) |
95 | Q_PRIVATE_SLOT(d_func(), void _k_sourceModelReset()) |
96 | Q_PRIVATE_SLOT(d_func(), void _k_sourceModelDestroyed()) |
97 | }; |
98 | |
99 | #endif // KIDENTITYPROXYMODEL_H |
100 | |