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

akonadi

  • 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 
96 // ===================== DefaultResourceJob ============================
97 
98 class DefaultResourceJobPrivate;
99 
117 class AKONADI_TESTS_EXPORT DefaultResourceJob : public ResourceScanJob
118 {
119  Q_OBJECT
120 
121  public:
125  explicit DefaultResourceJob( KCoreConfigSkeleton *settings, QObject *parent = 0 );
126 
130  ~DefaultResourceJob();
131 
136  void setDefaultResourceType( const QString &type );
137 
142  void setDefaultResourceOptions( const QVariantMap &options );
143 
147  void setTypes( const QList<QByteArray> &types );
148 
152  void setNameForTypeMap( const QMap<QByteArray, QString> &map );
153 
157  void setIconForTypeMap( const QMap<QByteArray, QString> &map );
158 
159  protected:
160  /* reimpl */
161  virtual void doStart();
162  /* reimpl */
163  virtual void slotResult( KJob *job );
164 
165  private:
166  friend class DefaultResourceJobPrivate;
167  DefaultResourceJobPrivate *const d;
168 
169  Q_PRIVATE_SLOT( d, void resourceCreateResult( KJob* ) )
170  Q_PRIVATE_SLOT( d, void resourceSyncResult( KJob* ) )
171  Q_PRIVATE_SLOT( d, void collectionFetchResult( KJob* ) )
172  Q_PRIVATE_SLOT( d, void collectionModifyResult( KJob* ) )
173 };
174 
175 
176 // ===================== GetLockJob ============================
177 
196 class AKONADI_TESTS_EXPORT GetLockJob : public KJob
197 {
198  Q_OBJECT
199 
200  public:
204  explicit GetLockJob( QObject *parent = 0 );
205 
209  ~GetLockJob();
210 
211  /* reimpl */
212  virtual void start();
213 
214  private:
215  class Private;
216  friend class Private;
217  Private *const d;
218 
219  Q_PRIVATE_SLOT( d, void doStart() )
220  Q_PRIVATE_SLOT( d, void serviceOwnerChanged( QString, QString, QString ) )
221  Q_PRIVATE_SLOT( d, void timeout() )
222 };
223 
224 
225 // ===================== helper functions ============================
226 
235 void setCollectionAttributes( Akonadi::Collection &col, const QByteArray &type,
236  const QMap<QByteArray, QString> &nameForType,
237  const QMap<QByteArray, QString> &iconForType );
238 
244 bool AKONADI_TESTS_EXPORT releaseLock();
245 
246 } // namespace Akonadi
247 
248 #endif // AKONADI_SPECIALCOLLECTIONSHELPERJOBS_P_H
Akonadi::releaseLock
bool AKONADI_TESTS_EXPORT releaseLock()
Releases the SpecialCollectionsRequestJob lock that was obtained through GetLockJob.
Definition: specialcollectionshelperjobs.cpp:651
Akonadi::Collection
Represents a collection of PIM items.
Definition: collection.h:75
Akonadi::GetLockJob
Definition: specialcollectionshelperjobs_p.h:196
Akonadi::Job
Base class for all actions in the Akonadi storage.
Definition: job.h:86
Akonadi::DefaultResourceJob
Definition: specialcollectionshelperjobs_p.h:117
Akonadi::ResourceScanJob
Definition: specialcollectionshelperjobs_p.h:45
Akonadi::Collection::List
QList< Collection > List
Describes a list of collections.
Definition: collection.h:81
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:633
This file is part of the KDE documentation.
Documentation copyright © 1996-2013 The KDE developers.
Generated on Tue Nov 26 2013 09:03:19 by doxygen 1.8.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.11.3 API Reference

Skip menu "kdepimlibs-4.11.3 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