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

akonadi

  • sources
  • kde-4.12
  • kdepimlibs
  • 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 
30 class KUrl;
31 
32 namespace Akonadi {
33 
34 class CachePolicy;
35 class CollectionPrivate;
36 class CollectionStatistics;
37 
75 class AKONADI_EXPORT Collection : public Entity
76 {
77  public:
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 
291  private:
292  AKONADI_DECLARE_PRIVATE( Collection )
293  friend class CollectionFetchJob;
294  friend class CollectionModifyJob;
295 };
296 
297 }
298 
299 AKONADI_EXPORT uint qHash( const Akonadi::Collection &collection );
303 AKONADI_EXPORT QDebug operator<<( QDebug d, const Akonadi::Collection &collection );
304 
305 Q_DECLARE_METATYPE(Akonadi::Collection)
306 Q_DECLARE_METATYPE(Akonadi::Collection::List)
307 Q_DECLARE_OPERATORS_FOR_FLAGS( Akonadi::Collection::Rights )
308 
309 #endif
Akonadi::CollectionModifyJob
Job that modifies a collection in the Akonadi storage.
Definition: collectionmodifyjob.h:82
Akonadi::CollectionStatistics
Provides statistics information of a Collection.
Definition: collectionstatistics.h:69
Akonadi::Collection
Represents a collection of PIM items.
Definition: collection.h:75
Akonadi::CollectionFetchJob
Job that fetches collections from the Akonadi storage.
Definition: collectionfetchjob.h:53
Akonadi::Entity::Id
qint64 Id
Describes the unique id type.
Definition: entity.h:65
Akonadi::Collection::UrlType
UrlType
Describes the type of url which is returned in url().
Definition: collection.h:264
Akonadi::CachePolicy
Represents the caching policy for a collection.
Definition: cachepolicy.h:71
Akonadi::Entity
The base class for Item and Collection.
Definition: entity.h:59
Akonadi::Collection::Right
Right
Describes rights of a collection.
Definition: collection.h:86
Akonadi::Collection::List
QList< Collection > List
Describes a list of collections.
Definition: collection.h:81
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 23:00:26 by doxygen 1.8.7 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 API Reference

Skip menu "kdepimlibs API Reference"
  • akonadi
  •   contact
  •   kmime
  •   socialutils
  • kabc
  • kalarmcal
  • kblog
  • kcal
  • kcalcore
  • kcalutils
  • kholidays
  • kimap
  • kldap
  • kmbox
  • kmime
  • kpimidentities
  • kpimtextedit
  • kresources
  • ktnef
  • kxmlrpcclient
  • microblog

Search



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