Akonadi

specialcollections.h
1 /*
2  SPDX-FileCopyrightText: 2009 Constantin Berzan <[email protected]>
3 
4  SPDX-License-Identifier: LGPL-2.0-or-later
5 */
6 
7 #ifndef AKONADI_SPECIALCOLLECTIONS_H
8 #define AKONADI_SPECIALCOLLECTIONS_H
9 
10 #include "akonadicore_export.h"
11 #include "collection.h"
12 #include "item.h"
13 
14 #include <QObject>
15 
17 
18 namespace Akonadi
19 {
20 
21 class AgentInstance;
22 class SpecialCollectionsPrivate;
23 
51 class AKONADICORE_EXPORT SpecialCollections : public QObject
52 {
53  Q_OBJECT
54 
55 public:
60 
65  Q_REQUIRED_RESULT bool hasCollection(const QByteArray &type, const AgentInstance &instance) const;
66 
71  Q_REQUIRED_RESULT Akonadi::Collection collection(const QByteArray &type, const AgentInstance &instance) const;
72 
82  bool registerCollection(const QByteArray &type, const Akonadi::Collection &collection);
83 
89  bool unregisterCollection(const Collection &collection);
90 
96  static void unsetSpecialCollection(const Akonadi::Collection &collection);
97 
106  static void setSpecialCollectionType(const QByteArray &type, const Akonadi::Collection &collection);
107 
112  Q_REQUIRED_RESULT bool hasDefaultCollection(const QByteArray &type) const;
113 
118  Q_REQUIRED_RESULT Akonadi::Collection defaultCollection(const QByteArray &type) const;
119 
120 Q_SIGNALS:
127  void collectionsChanged(const Akonadi::AgentInstance &instance);
128 
133  void defaultCollectionsChanged();
134 
135 protected:
142  explicit SpecialCollections(KCoreConfigSkeleton *config, QObject *parent = nullptr);
143 
144 private:
145  //@cond PRIVATE
146  friend class SpecialCollectionsRequestJob;
147  friend class SpecialCollectionsRequestJobPrivate;
148  friend class SpecialCollectionsPrivate;
149 #ifdef BUILD_TESTING
150  friend class SpecialMailCollectionsTesting;
151  friend class LocalFoldersTest;
152 #endif
153 
154  SpecialCollectionsPrivate *const d;
155  //@endcond
156 };
157 
158 } // namespace Akonadi
159 
160 #endif // AKONADI_SPECIALCOLLECTIONS_H
An interface to special collections.
Represents a collection of PIM items.
Definition: collection.h:63
Represents one agent instance and takes care of communication with it.
Helper integration between Akonadi and Qt.
A representation of an agent instance.
A job to request SpecialCollections.
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Sat Jul 11 2020 23:16:09 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.