akonadi
collection.h
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef AKONADI_COLLECTION_H
00021 #define AKONADI_COLLECTION_H
00022
00023 #include "akonadi_export.h"
00024
00025 #include <akonadi/entity.h>
00026
00027 #include <QtCore/QMetaType>
00028 #include <QtCore/QSharedDataPointer>
00029
00030 class KUrl;
00031
00032 namespace Akonadi {
00033
00034 class CachePolicy;
00035 class CollectionPrivate;
00036 class CollectionStatistics;
00037
00065 class AKONADI_EXPORT Collection : public Entity
00066 {
00067 public:
00071 typedef QList<Collection> List;
00072
00076 enum Right {
00077 ReadOnly = 0x0,
00078 CanChangeItem = 0x1,
00079 CanCreateItem = 0x2,
00080 CanDeleteItem = 0x4,
00081 CanChangeCollection = 0x8,
00082 CanCreateCollection = 0x16,
00083 CanDeleteCollection = 0x32,
00084 AllRights = (CanChangeItem | CanCreateItem | CanDeleteItem |
00085 CanChangeCollection | CanCreateCollection | CanDeleteCollection)
00086 };
00087 Q_DECLARE_FLAGS(Rights, Right)
00088
00089
00092 Collection();
00093
00099 explicit Collection( Id id );
00100
00104 ~Collection();
00105
00109 Collection( const Collection &other );
00110
00114 static Collection fromUrl( const KUrl &url );
00115
00119 QString name() const;
00120
00126 void setName( const QString &name );
00127
00131 Rights rights() const;
00132
00136 void setRights( Rights rights );
00137
00143 QStringList contentMimeTypes() const;
00144
00148 void setContentMimeTypes( const QStringList &types );
00149
00153 Id parent() const;
00154
00158 void setParent( Id parent );
00159
00163 void setParent( const Collection &collection );
00164
00169 QString parentRemoteId() const;
00170
00174 void setParentRemoteId( const QString &identifier );
00175
00179 static Collection root();
00180
00184 static QString mimeType();
00185
00189 QString resource() const;
00190
00194 void setResource( const QString &identifier );
00195
00199 CachePolicy cachePolicy() const;
00200
00204 void setCachePolicy( const CachePolicy &policy );
00205
00209 CollectionStatistics statistics() const;
00210
00214 void setStatistics( const CollectionStatistics &statistics );
00215
00219 KUrl url() const;
00220
00221 private:
00222 AKONADI_DECLARE_PRIVATE( Collection )
00223 friend class CollectionFetchJob;
00224 friend class CollectionModifyJob;
00225 };
00226
00227 }
00228
00229 AKONADI_EXPORT uint qHash( const Akonadi::Collection &collection );
00230
00231 Q_DECLARE_METATYPE(Akonadi::Collection)
00232 Q_DECLARE_METATYPE(Akonadi::Collection::List)
00233
00234 #endif