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
00192 void collectionAdded( const Akonadi::Collection &collection, const Akonadi::Collection &parent );
00193
00200 void collectionChanged( const Akonadi::Collection &collection );
00201
00207 void collectionRemoved( const Akonadi::Collection &collection );
00208
00217 void collectionStatisticsChanged( Akonadi::Collection::Id id,
00218 const Akonadi::CollectionStatistics &statistics );
00219
00220 protected:
00221
00222 MonitorPrivate *d_ptr;
00223 explicit Monitor( MonitorPrivate *d, QObject *parent = 0 );
00224
00225
00226 private:
00227 Q_DECLARE_PRIVATE( Monitor )
00228
00229
00230 Q_PRIVATE_SLOT( d_ptr, void slotStatisticsChangedFinished( KJob* ) )
00231 Q_PRIVATE_SLOT( d_ptr, void slotFlushRecentlyChangedCollections() )
00232 Q_PRIVATE_SLOT( d_ptr, void slotNotify( const Akonadi::NotificationMessage::List& ) )
00233 Q_PRIVATE_SLOT( d_ptr, void slotItemJobFinished( KJob* ) )
00234 Q_PRIVATE_SLOT( d_ptr, void slotCollectionJobFinished( KJob* ) )
00235
00236 };
00237
00238 }
00239
00240 #endif