00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef AKONADI_ENTITYORDERPROXYMODEL_H
00023 #define AKONADI_ENTITYORDERPROXYMODEL_H
00024
00025 #include <QtGui/QSortFilterProxyModel>
00026
00027 #include "akonadi_export.h"
00028
00029 class KConfigGroup;
00030
00031 namespace Akonadi
00032 {
00033 class EntityOrderProxyModelPrivate;
00034
00044 class AKONADI_EXPORT EntityOrderProxyModel : public QSortFilterProxyModel
00045 {
00046 Q_OBJECT
00047
00048 public:
00054 EntityOrderProxyModel( QObject *parent = 0 );
00055
00059 virtual ~EntityOrderProxyModel();
00060
00064 void setOrderConfig( KConfigGroup &group );
00065
00069 void saveOrder();
00070
00071 void clearOrder( const QModelIndex &index );
00072 void clearTreeOrder();
00073
00077 virtual bool lessThan( const QModelIndex &left, const QModelIndex &right ) const;
00078
00082 virtual bool dropMimeData( const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &parent );
00083
00087 virtual QModelIndexList match( const QModelIndex& start, int role, const QVariant& value, int hits = 1,
00088 Qt::MatchFlags flags = Qt::MatchFlags( Qt::MatchStartsWith | Qt::MatchWrap ) ) const;
00089
00090 protected:
00091 EntityOrderProxyModelPrivate * const d_ptr;
00092
00093 virtual QString parentConfigString( const QModelIndex &index ) const;
00094 virtual QString configString( const QModelIndex &index ) const;
00095
00096 private:
00097
00098 Q_DECLARE_PRIVATE( EntityOrderProxyModel )
00099
00100 };
00101
00102 }
00103
00104 #endif