akonadi
specialcollections.h
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef AKONADI_SPECIALCOLLECTIONS_H
00021 #define AKONADI_SPECIALCOLLECTIONS_H
00022
00023 #include "akonadi_export.h"
00024
00025 #include <QtCore/QObject>
00026
00027 #include "akonadi/collection.h"
00028
00029 class KCoreConfigSkeleton;
00030 class KJob;
00031
00032 namespace Akonadi {
00033
00034 class AgentInstance;
00035 class SpecialCollectionsPrivate;
00036
00064 class AKONADI_EXPORT SpecialCollections : public QObject
00065 {
00066 Q_OBJECT
00067
00068 public:
00072 ~SpecialCollections();
00073
00078 bool hasCollection( const QByteArray &type, const AgentInstance &instance ) const;
00079
00084 Akonadi::Collection collection( const QByteArray &type, const AgentInstance &instance ) const;
00085
00094 bool registerCollection( const QByteArray &type, const Akonadi::Collection &collection );
00095
00100 bool hasDefaultCollection( const QByteArray &type ) const;
00101
00106 Akonadi::Collection defaultCollection( const QByteArray &type ) const;
00107
00108 Q_SIGNALS:
00115 void collectionsChanged( const Akonadi::AgentInstance &instance );
00116
00121 void defaultCollectionsChanged();
00122
00123 protected:
00130 explicit SpecialCollections( KCoreConfigSkeleton *config, QObject *parent = 0 );
00131
00132 private:
00133
00134 friend class SpecialCollectionsRequestJob;
00135 friend class SpecialCollectionsRequestJobPrivate;
00136 friend class SpecialCollectionsPrivate;
00137
00138 #if 1 // TODO do this only if building tests:
00139 friend class SpecialMailCollectionsTesting;
00140 friend class LocalFoldersTest;
00141 #endif
00142
00143 SpecialCollectionsPrivate *const d;
00144
00145 Q_PRIVATE_SLOT( d, void collectionRemoved( Akonadi::Collection ) )
00146
00147 };
00148
00149 }
00150
00151 #endif // AKONADI_SPECIALCOLLECTIONS_H