Akonadi

specialcollectionsrequestjob.h
1 /*
2  Copyright (c) 2009 Constantin Berzan <[email protected]>
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_SPECIALCOLLECTIONSREQUESTJOB_H
21 #define AKONADI_SPECIALCOLLECTIONSREQUESTJOB_H
22 
23 #include "akonadicore_export.h"
24 #include "collection.h"
25 #include "specialcollections.h"
26 #include "transactionsequence.h"
27 
28 #include <QVariant>
29 
30 namespace Akonadi
31 {
32 
33 class SpecialCollectionsRequestJobPrivate;
34 
54 class AKONADICORE_EXPORT SpecialCollectionsRequestJob : public TransactionSequence
55 {
56  Q_OBJECT
57 
58 public:
59 
63  ~SpecialCollectionsRequestJob() override;
64 
68  void requestDefaultCollection(const QByteArray &type);
69 
73  void requestCollection(const QByteArray &type, const AgentInstance &instance);
74 
78  Q_REQUIRED_RESULT Collection collection() const;
79 
80 protected:
87  explicit SpecialCollectionsRequestJob(SpecialCollections *collections, QObject *parent = nullptr);
88 
93  void setDefaultResourceType(const QString &type);
94 
99  void setDefaultResourceOptions(const QVariantMap &options);
100 
104  void setTypes(const QList<QByteArray> &types);
105 
109  void setNameForTypeMap(const QMap<QByteArray, QString> &map);
110 
114  void setIconForTypeMap(const QMap<QByteArray, QString> &map);
115 
116  /* reimpl */
117  void doStart() override;
118  /* reimpl */
119  void slotResult(KJob *job) override;
120 
121 private:
122  //@cond PRIVATE
123  friend class SpecialCollectionsRequestJobPrivate;
124  friend class DefaultResourceJobPrivate;
125 
126  SpecialCollectionsRequestJobPrivate *const d;
127 
128  Q_PRIVATE_SLOT(d, void releaseLock())
129  Q_PRIVATE_SLOT(d, void resourceScanResult(KJob *))
130  Q_PRIVATE_SLOT(d, void collectionCreateResult(KJob *))
131  //@endcond
132 };
133 
134 } // namespace Akonadi
135 
136 #endif // AKONADI_SPECIALCOLLECTIONSREQUESTJOB_H
An interface to special collections.
Represents a collection of PIM items.
Definition: collection.h:76
Base class for jobs that need to run a sequence of sub-jobs in a transaction.
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 Fri Jun 5 2020 23:08:56 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.