00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifndef LEAFEXTENSIONPROXYMODEL_H
00024 #define LEAFEXTENSIONPROXYMODEL_H
00025
00026 #include <QtGui/QSortFilterProxyModel>
00027
00028 namespace Akonadi {
00029
00030 class LeafExtensionProxyModel : public QSortFilterProxyModel
00031 {
00032 Q_OBJECT
00033
00034 public:
00035 LeafExtensionProxyModel( QObject *parent = 0 );
00036 ~LeafExtensionProxyModel();
00037
00038 QModelIndex index( int row, int column, const QModelIndex &parent = QModelIndex() ) const;
00039 QModelIndex parent( const QModelIndex &index ) const;
00040 int rowCount( const QModelIndex &index ) const;
00041 int columnCount( const QModelIndex &index ) const;
00042
00043 QVariant data( const QModelIndex &proxyIndex, int role = Qt::DisplayRole ) const;
00044 Qt::ItemFlags flags( const QModelIndex &index ) const;
00045 bool setData( const QModelIndex &index, const QVariant &data, int role = Qt::EditRole );
00046 bool hasChildren( const QModelIndex &parent = QModelIndex() ) const;
00047 QModelIndex buddy( const QModelIndex &index ) const;
00048 void fetchMore( const QModelIndex &index );
00049
00050 void setSourceModel( QAbstractItemModel *sourceModel );
00051
00052 protected:
00056 virtual int leafRowCount( const QModelIndex &index ) const = 0;
00057
00061 virtual int leafColumnCount( const QModelIndex &index ) const = 0;
00062
00067 virtual QVariant leafData( const QModelIndex &index, int row, int column, int role = Qt::DisplayRole ) const = 0;
00068
00069 private:
00070
00071 class Private;
00072 Private* const d;
00073
00074 Q_PRIVATE_SLOT( d, void sourceRowsInserted( const QModelIndex&, int, int ) )
00075 Q_PRIVATE_SLOT( d, void sourceRowsRemoved( const QModelIndex&, int, int ) )
00076
00077 };
00078
00079 }
00080
00081 #endif