00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef AKONADI_ASYNCSELECTIONHANDLER_P_H
00021 #define AKONADI_ASYNCSELECTIONHANDLER_P_H
00022
00023 #include <QtCore/QObject>
00024
00025 #include <akonadi/collection.h>
00026 #include <akonadi/item.h>
00027
00028 class QAbstractItemModel;
00029 class QModelIndex;
00030
00031 namespace Akonadi
00032 {
00033
00042 class AsyncSelectionHandler : public QObject
00043 {
00044 Q_OBJECT
00045
00046 public:
00049 explicit AsyncSelectionHandler( QAbstractItemModel *model, QObject *parent = 0 );
00050
00051 ~AsyncSelectionHandler();
00052
00053 void waitForCollection( const Collection &collection );
00054 void waitForItem( const Item &item );
00055
00056 Q_SIGNALS:
00057 void collectionAvailable( const QModelIndex &index );
00058 void itemAvailable( const QModelIndex &index );
00059
00060 private Q_SLOTS:
00061 void rowsInserted( const QModelIndex&, int, int );
00062
00063 private:
00064 bool scanSubTree( const QModelIndex &index, bool searchForItem );
00065
00066 QAbstractItemModel *mModel;
00067 Collection mCollection;
00068 Item mItem;
00069 };
00070
00071 }
00072
00073 #endif