akonadi
monitor.h
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef AKONADI_MONITOR_H
00021 #define AKONADI_MONITOR_H
00022
00023 #include <akonadi/collection.h>
00024 #include <akonadi/item.h>
00025
00026 #include <QtCore/QObject>
00027
00028 namespace Akonadi {
00029
00030 class CollectionFetchScope;
00031 class CollectionStatistics;
00032 class Item;
00033 class ItemFetchScope;
00034 class MonitorPrivate;
00035 class Session;
00036
00051 class AKONADI_EXPORT Monitor : public QObject
00052 {
00053 Q_OBJECT
00054
00055 public:
00061 explicit Monitor( QObject *parent = 0 );
00062
00066 virtual ~Monitor();
00067
00083 void setCollectionMonitored( const Collection &collection, bool monitored = true );
00084
00094 void setItemMonitored( const Item &item, bool monitored = true );
00095
00107 void setResourceMonitored( const QByteArray &resource, bool monitored = true );
00108
00122 void setMimeTypeMonitored( const QString &mimetype, bool monitored = true );
00123
00130 void setAllMonitored( bool monitored = true );
00131
00138 void ignoreSession( Session *session );
00139
00145 void fetchCollection( bool enable );
00146
00153 void fetchCollectionStatistics( bool enable );
00154
00165 void setItemFetchScope( const ItemFetchScope &fetchScope );
00166
00179 ItemFetchScope &itemFetchScope();
00180
00192 void setCollectionFetchScope( const CollectionFetchScope &fetchScope );
00193
00207 CollectionFetchScope &collectionFetchScope();
00208
00214 Collection::List collectionsMonitored() const;
00215
00221 QList<Item::Id> itemsMonitored() const;
00222
00228 QStringList mimeTypesMonitored() const;
00229
00235 QList<QByteArray> resourcesMonitored() const;
00236
00242 bool isAllMonitored() const;
00243
00250 void setSession( Akonadi::Session *session );
00251
00257 Session* session() const;
00258
00259 Q_SIGNALS:
00266 void itemChanged( const Akonadi::Item &item, const QSet<QByteArray> &partIdentifiers );
00267
00275 void itemMoved( const Akonadi::Item &item, const Akonadi::Collection &collectionSource,
00276 const Akonadi::Collection &collectionDestination );
00277
00284 void itemAdded( const Akonadi::Item &item, const Akonadi::Collection &collection );
00285
00294 void itemRemoved( const Akonadi::Item &item );
00295
00303 void itemLinked( const Akonadi::Item &item, const Akonadi::Collection &collection );
00304
00312 void itemUnlinked( const Akonadi::Item &item, const Akonadi::Collection &collection );
00313
00320 void collectionAdded( const Akonadi::Collection &collection, const Akonadi::Collection &parent );
00321
00327 void collectionChanged( const Akonadi::Collection &collection );
00328
00337 void collectionChanged( const Akonadi::Collection &collection, const QSet<QByteArray> &attributeNames );
00338
00348 void collectionMoved( const Akonadi::Collection &collection, const Akonadi::Collection &source, const Akonadi::Collection &destination );
00349
00355 void collectionRemoved( const Akonadi::Collection &collection );
00356
00365 void collectionStatisticsChanged( Akonadi::Collection::Id id,
00366 const Akonadi::CollectionStatistics &statistics );
00367
00375 void collectionMonitored( const Akonadi::Collection &collection, bool monitored );
00376
00384 void itemMonitored( const Akonadi::Item &item, bool monitored );
00385
00393 void resourceMonitored( const QByteArray &identifier, bool monitored );
00394
00402 void mimeTypeMonitored( const QString &mimeType, bool monitored );
00403
00410 void allMonitored( bool monitored );
00411
00412 protected:
00413
00414 friend class EntityTreeModel;
00415 friend class EntityTreeModelPrivate;
00416 MonitorPrivate *d_ptr;
00417 explicit Monitor( MonitorPrivate *d, QObject *parent = 0 );
00418
00419
00420 private:
00421 Q_DECLARE_PRIVATE( Monitor )
00422
00423
00424 Q_PRIVATE_SLOT( d_ptr, void slotSessionDestroyed( QObject* ) )
00425 Q_PRIVATE_SLOT( d_ptr, void slotStatisticsChangedFinished( KJob* ) )
00426 Q_PRIVATE_SLOT( d_ptr, void slotFlushRecentlyChangedCollections() )
00427 Q_PRIVATE_SLOT( d_ptr, void slotNotify( const Akonadi::NotificationMessage::List& ) )
00428 Q_PRIVATE_SLOT( d_ptr, void dataAvailable() )
00429
00430 friend class ResourceBasePrivate;
00431
00432 };
00433
00434 }
00435
00436 #endif