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

akonadi

  • sources
  • kde-4.14
  • kdepimlibs
  • akonadi
specialcollectionshelperjobs_p.h
1 /*
2  Copyright (c) 2009 Constantin Berzan <exit3219@gmail.com>
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_SPECIALCOLLECTIONSHELPERJOBS_P_H
21 #define AKONADI_SPECIALCOLLECTIONSHELPERJOBS_P_H
22 
23 #include "akonadiprivate_export.h"
24 
25 #include <akonadi/collection.h>
26 #include <akonadi/specialcollections.h>
27 #include <akonadi/transactionsequence.h>
28 
29 #include <QtCore/QVariant>
30 
31 namespace Akonadi {
32 
33 // ===================== ResourceScanJob ============================
34 
45 class AKONADI_TESTS_EXPORT ResourceScanJob : public Job
46 {
47  Q_OBJECT
48 
49 public:
53  explicit ResourceScanJob(const QString &resourceId, KCoreConfigSkeleton *settings, QObject *parent = 0);
54 
58  ~ResourceScanJob();
59 
63  QString resourceId() const;
64 
68  void setResourceId(const QString &resourceId);
69 
75  Akonadi::Collection rootResourceCollection() const;
76 
81  Akonadi::Collection::List specialCollections() const;
82 
83 protected:
84  /* reimpl */
85  virtual void doStart();
86 
87 private:
88  class Private;
89  friend class Private;
90  Private *const d;
91 
92  Q_PRIVATE_SLOT(d, void fetchResult(KJob *))
93 };
94 
95 // ===================== DefaultResourceJob ============================
96 
97 class DefaultResourceJobPrivate;
98 
116 class AKONADI_TESTS_EXPORT DefaultResourceJob : public ResourceScanJob
117 {
118  Q_OBJECT
119 
120 public:
124  explicit DefaultResourceJob(KCoreConfigSkeleton *settings, QObject *parent = 0);
125 
129  ~DefaultResourceJob();
130 
135  void setDefaultResourceType(const QString &type);
136 
141  void setDefaultResourceOptions(const QVariantMap &options);
142 
146  void setTypes(const QList<QByteArray> &types);
147 
151  void setNameForTypeMap(const QMap<QByteArray, QString> &map);
152 
156  void setIconForTypeMap(const QMap<QByteArray, QString> &map);
157 
158 protected:
159  /* reimpl */
160  virtual void doStart();
161  /* reimpl */
162  virtual void slotResult(KJob *job);
163 
164 private:
165  friend class DefaultResourceJobPrivate;
166  DefaultResourceJobPrivate *const d;
167 
168  Q_PRIVATE_SLOT(d, void resourceCreateResult(KJob *))
169  Q_PRIVATE_SLOT(d, void resourceSyncResult(KJob *))
170  Q_PRIVATE_SLOT(d, void collectionFetchResult(KJob *))
171  Q_PRIVATE_SLOT(d, void collectionModifyResult(KJob *))
172 };
173 
174 // ===================== GetLockJob ============================
175 
194 class AKONADI_TESTS_EXPORT GetLockJob : public KJob
195 {
196  Q_OBJECT
197 
198 public:
202  explicit GetLockJob(QObject *parent = 0);
203 
207  ~GetLockJob();
208 
209  /* reimpl */
210  virtual void start();
211 
212 private:
213  class Private;
214  friend class Private;
215  Private *const d;
216 
217  Q_PRIVATE_SLOT(d, void doStart())
218  Q_PRIVATE_SLOT(d, void serviceOwnerChanged(QString, QString, QString))
219  Q_PRIVATE_SLOT(d, void timeout())
220 };
221 
222 // ===================== helper functions ============================
223 
232 void setCollectionAttributes(Akonadi::Collection &col, const QByteArray &type,
233  const QMap<QByteArray, QString> &nameForType,
234  const QMap<QByteArray, QString> &iconForType);
235 
241 bool AKONADI_TESTS_EXPORT releaseLock();
242 
243 } // namespace Akonadi
244 
245 #endif // AKONADI_SPECIALCOLLECTIONSHELPERJOBS_P_H
Akonadi::releaseLock
bool AKONADI_TESTS_EXPORT releaseLock()
Releases the SpecialCollectionsRequestJob lock that was obtained through GetLockJob.
Definition: specialcollectionshelperjobs.cpp:655
QByteArray
Akonadi::Collection
Represents a collection of PIM items.
Definition: collection.h:75
QMap
Akonadi::GetLockJob
Definition: specialcollectionshelperjobs_p.h:194
Akonadi::Job
Base class for all actions in the Akonadi storage.
Definition: job.h:86
QObject
QString
QList
Akonadi::DefaultResourceJob
Definition: specialcollectionshelperjobs_p.h:116
Akonadi::ResourceScanJob
Definition: specialcollectionshelperjobs_p.h:45
Akonadi::setCollectionAttributes
void setCollectionAttributes(Akonadi::Collection &col, const QByteArray &type, const QMap< QByteArray, QString > &nameForType, const QMap< QByteArray, QString > &iconForType)
Sets on col the required attributes of SpecialCollection type type These are a SpecialCollectionAttri...
Definition: specialcollectionshelperjobs.cpp:637
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:38:03 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
  • kioslave
  •   imap4
  •   mbox
  •   nntp
  • kldap
  • kmbox
  • kmime
  • kontactinterface
  • kpimidentities
  • kpimtextedit
  • kpimutils
  • kresources
  • ktnef
  • kxmlrpcclient
  • mailtransport
  • microblog
  • qgpgme
  • syndication
  •   atom
  •   rdf
  •   rss2

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