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
00025 #include <QtCore/QObject>
00026
00027 namespace Akonadi {
00028
00029 class CollectionStatistics;
00030 class Item;
00031 class ItemFetchScope;
00032 class MonitorPrivate;
00033 class Session;
00034
00049 class AKONADI_EXPORT Monitor : public QObject
00050 {
00051 Q_OBJECT
00052
00053 public:
00059 explicit Monitor( QObject *parent = 0 );
00060
00064 virtual ~Monitor();
00065
00073 void setCollectionMonitored( const Collection &collection, bool monitored = true );
00074
00080 void setItemMonitored( const Item &item, bool monitored = true );
00081
00087 void setResourceMonitored( const QByteArray &resource, bool monitored = true );
00088
00094 void setMimeTypeMonitored( const QString &mimetype, bool monitored = true );
00095
00099 void setAllMonitored( bool monitored = true );
00100
00106 void ignoreSession( Session *session );
00107
00113 void fetchCollection( bool enable );
00114
00121 void fetchCollectionStatistics( bool enable );
00122
00133 void setItemFetchScope( const ItemFetchScope &fetchScope );
00134
00147 ItemFetchScope &itemFetchScope();
00148
00149 Q_SIGNALS:
00156 void itemChanged( const Akonadi::Item &item, const QSet<QByteArray> &partIdentifiers );
00157
00165 void itemMoved( const Akonadi::Item &item, const Akonadi::Collection &collectionSource,
00166 const Akonadi::Collection &collectionDestination );
00167
00174 void itemAdded( const Akonadi::Item &item, const Akonadi::Collection &collection );
00175
00184 void itemRemoved( const Akonadi::Item &item );
00185
00193 void itemLinked( const Akonadi::Item &item, const Akonadi::Collection &collection );
00194
00202 void itemUnlinked( const Akonadi::Item &item, const Akonadi::Collection &collection );
00203
00210 void collectionAdded( const Akonadi::Collection &collection, const Akonadi::Collection &parent );
00211
00218 void collectionChanged( const Akonadi::Collection &collection );
00219
00225 void collectionRemoved( const Akonadi::Collection &collection );
00226
00235 void collectionStatisticsChanged( Akonadi::Collection::Id id,
00236 const Akonadi::CollectionStatistics &statistics );
00237
00238 protected:
00239
00240 MonitorPrivate *d_ptr;
00241 explicit Monitor( MonitorPrivate *d, QObject *parent = 0 );
00242
00243
00244 private:
00245 Q_DECLARE_PRIVATE( Monitor )
00246
00247
00248 Q_PRIVATE_SLOT( d_ptr, void slotStatisticsChangedFinished( KJob* ) )
00249 Q_PRIVATE_SLOT( d_ptr, void slotFlushRecentlyChangedCollections() )
00250 Q_PRIVATE_SLOT( d_ptr, void slotNotify( const Akonadi::NotificationMessage::List& ) )
00251 Q_PRIVATE_SLOT( d_ptr, void slotItemJobFinished( KJob* ) )
00252 Q_PRIVATE_SLOT( d_ptr, void slotCollectionJobFinished( KJob* ) )
00253
00254 };
00255
00256 }
00257
00258 #endif