• Skip to content
  • Skip to link menu
  • KDE API Reference
  • kdepimlibs-4.14.10 API Reference
  • KDE Home
  • Contact Us
 

akonadi

  • akonadi
collection.h
1/*
2 Copyright (c) 2006 - 2007 Volker Krause <vkrause@kde.org>
3
4 This library is free software; you can redistribute it and/or modify it
5 under the terms of the GNU Library General Public License as published by
6 the Free Software Foundation; either version 2 of the License, or (at your
7 option) any later version.
8
9 This library is distributed in the hope that it will be useful, but WITHOUT
10 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
12 License for more details.
13
14 You should have received a copy of the GNU Library General Public License
15 along with this library; see the file COPYING.LIB. If not, write to the
16 Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
17 02110-1301, USA.
18*/
19
20#ifndef AKONADI_COLLECTION_H
21#define AKONADI_COLLECTION_H
22
23#include "akonadi_export.h"
24
25#include <akonadi/entity.h>
26
27#include <QtCore/QMetaType>
28#include <QtCore/QSharedDataPointer>
29
30class KUrl;
31
32namespace Akonadi {
33
34class CachePolicy;
35class CollectionPrivate;
36class CollectionStatistics;
37
75class AKONADI_EXPORT Collection : public Entity
76{
77public:
81 typedef QList<Collection> List;
82
86 enum Right {
87 ReadOnly = 0x0,
88 CanChangeItem = 0x1,
89 CanCreateItem = 0x2,
90 CanDeleteItem = 0x4,
91 CanChangeCollection = 0x8,
92 CanCreateCollection = 0x10,
93 CanDeleteCollection = 0x20,
94 CanLinkItem = 0x40,
95 CanUnlinkItem = 0x80,
96 AllRights = (CanChangeItem | CanCreateItem | CanDeleteItem |
97 CanChangeCollection | CanCreateCollection | CanDeleteCollection)
98 };
99 Q_DECLARE_FLAGS(Rights, Right)
100
101
104 Collection();
105
111 explicit Collection(Id id);
112
116 ~Collection();
117
121 Collection(const Collection &other);
122
126 static Collection fromUrl(const KUrl &url);
127
131 QString name() const;
132
140 QString displayName() const;
141
147 void setName(const QString &name);
148
152 Rights rights() const;
153
157 void setRights(Rights rights);
158
164 QStringList contentMimeTypes() const;
165
169 void setContentMimeTypes(const QStringList &types);
170
175 AKONADI_DEPRECATED Id parent() const;
176
182 AKONADI_DEPRECATED void setParent(Id parent);
183
189 AKONADI_DEPRECATED void setParent(const Collection &collection);
190
196 AKONADI_DEPRECATED QString parentRemoteId() const;
197
203 AKONADI_DEPRECATED void setParentRemoteId(const QString &identifier);
204
208 static Collection root();
209
213 static QString mimeType();
214
220 static QString virtualMimeType();
221
225 QString resource() const;
226
230 void setResource(const QString &identifier);
231
235 CachePolicy cachePolicy() const;
236
240 void setCachePolicy(const CachePolicy &policy);
241
245 CollectionStatistics statistics() const;
246
250 void setStatistics(const CollectionStatistics &statistics);
251
257 KUrl url() const;
258
264 enum UrlType {
265 UrlShort = 0,
266 UrlWithName = 1
267 };
268
274 KUrl url(UrlType type) const;
275
281 bool isVirtual() const;
282
289 void setVirtual(bool isVirtual);
290
310 void setEnabled(bool enabled);
311
317 bool enabled() const;
318
324 enum ListPreference {
325 ListEnabled,
326 ListDisabled,
327 ListDefault
328 };
329
335 enum ListPurpose {
336 ListSync,
337 ListDisplay,
338 ListIndex
339 };
340
352 void setLocalListPreference(ListPurpose purpose, ListPreference preference);
353
359 ListPreference localListPreference(ListPurpose purpose) const;
360
368 bool shouldList(ListPurpose purpose) const;
369
380 void setShouldList(ListPurpose purpose, bool shouldList);
381
392 void setReferenced(bool referenced);
393
398 bool referenced() const;
399
400private:
401 AKONADI_DECLARE_PRIVATE(Collection)
402 friend class CollectionFetchJob;
403 friend class CollectionModifyJob;
404};
405
406}
407
408AKONADI_EXPORT uint qHash(const Akonadi::Collection &collection);
412AKONADI_EXPORT QDebug operator<<(QDebug d, const Akonadi::Collection &collection);
413
414Q_DECLARE_METATYPE(Akonadi::Collection)
415Q_DECLARE_METATYPE(Akonadi::Collection::List)
416Q_DECLARE_OPERATORS_FOR_FLAGS(Akonadi::Collection::Rights)
417
418#endif
Akonadi::CachePolicy
Represents the caching policy for a collection.
Definition: cachepolicy.h:72
Akonadi::CollectionFetchJob
Job that fetches collections from the Akonadi storage.
Definition: collectionfetchjob.h:54
Akonadi::CollectionModifyJob
Job that modifies a collection in the Akonadi storage.
Definition: collectionmodifyjob.h:83
Akonadi::CollectionStatistics
Provides statistics information of a Collection.
Definition: collectionstatistics.h:70
Akonadi::Collection
Represents a collection of PIM items.
Definition: collection.h:76
Akonadi::Collection::UrlType
UrlType
Describes the type of url which is returned in url().
Definition: collection.h:264
Akonadi::Collection::ListPurpose
ListPurpose
Describes the purpose of the listing.
Definition: collection.h:335
Akonadi::Collection::ListSync
@ ListSync
Listing for synchronization.
Definition: collection.h:336
Akonadi::Collection::ListDisplay
@ ListDisplay
Listing for display to the user.
Definition: collection.h:337
Akonadi::Collection::List
QList< Collection > List
Describes a list of collections.
Definition: collection.h:81
Akonadi::Collection::Right
Right
Describes rights of a collection.
Definition: collection.h:86
Akonadi::Collection::ListPreference
ListPreference
Describes the list preference value.
Definition: collection.h:324
Akonadi::Collection::ListDisabled
@ ListDisabled
Disable collectoin for specified purpose.
Definition: collection.h:326
Akonadi::Collection::ListEnabled
@ ListEnabled
Enable collection for specified purpose.
Definition: collection.h:325
Akonadi::Entity
The base class for Item and Collection.
Definition: entity.h:60
Akonadi
FreeBusyManager::Singleton.
Definition: actionstatemanager_p.h:28
This file is part of the KDE documentation.
Documentation copyright © 1996-2022 The KDE developers.
Generated on Thu Jul 21 2022 00:00:00 by doxygen 1.9.5 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

akonadi

Skip menu "akonadi"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • Modules
  • Related Pages

kdepimlibs-4.14.10 API Reference

Skip menu "kdepimlibs-4.14.10 API Reference"
  • akonadi
  •   contact
  •   kmime
  •   socialutils
  • kabc
  • kalarmcal
  • kblog
  • kcal
  • kcalcore
  • kcalutils
  • kholidays
  • kimap
  • kioslave
  •   imap4
  •   mbox
  •   nntp
  • kldap
  • kmbox
  • kmime
  • kontactinterface
  • kpimidentities
  • kpimtextedit
  • kpimutils
  • kresources
  • ktnef
  • kxmlrpcclient
  • mailtransport
  • microblog
  • qgpgme
  • syndication
  •   atom
  •   rdf
  •   rss2
Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal