Akonadi

job.h
1 /*
2  SPDX-FileCopyrightText: 2006 Tobias Koenig <[email protected]>
3  2006 Marc Mutz <[email protected]>
4  2006 - 2007 Volker Krause <[email protected]>
5 
6  SPDX-License-Identifier: LGPL-2.0-or-later
7 */
8 
9 #ifndef AKONADI_JOB_H
10 #define AKONADI_JOB_H
11 
12 #include "akonadicore_export.h"
13 
14 #include <KCompositeJob>
15 
16 class QString;
17 
18 namespace Akonadi
19 {
20 
21 namespace Protocol
22 {
23 class Command;
24 using CommandPtr = QSharedPointer<Command>;
25 }
26 
27 class JobPrivate;
28 class Session;
29 class SessionPrivate;
30 
80 class AKONADICORE_EXPORT Job : public KCompositeJob
81 {
82  Q_OBJECT
83 
84  friend class Session;
85  friend class SessionPrivate;
86 
87 public:
91  typedef QList<Job *> List;
92 
98  enum Error {
99  ConnectionFailed = UserDefinedError,
103  UserError = UserDefinedError + 42
104  };
105 
115  explicit Job(QObject *parent = nullptr);
116 
120  ~Job() override;
121 
126  void start() override;
127 
132  Q_REQUIRED_RESULT QString errorString() const final;
133 
134 Q_SIGNALS:
140  void aboutToStart(Akonadi::Job *job);
141 
150  void writeFinished(Akonadi::Job *job);
151 
152 protected:
158  virtual void doStart() = 0;
159 
171  virtual bool doHandleResponse(qint64 tag, const Protocol::CommandPtr &response);
172 
181  bool addSubjob(KJob *job) override;
182 
188  bool removeSubjob(KJob *job) override;
189 
193  bool doKill() override;
194 
199  void emitWriteFinished();
200 
201 protected Q_SLOTS:
202  void slotResult(KJob *job) override;
203 
204 protected:
205  //@cond PRIVATE
206  Job(JobPrivate *dd, QObject *parent);
207  JobPrivate *const d_ptr;
208  //@endcond
209 
210 private:
211  Q_DECLARE_PRIVATE(Job)
212 
213  //@cond PRIVATE
214  Q_PRIVATE_SLOT(d_func(), void startNext())
215  Q_PRIVATE_SLOT(d_func(), void signalCreationToJobTracker())
216  Q_PRIVATE_SLOT(d_func(), void signalStartedToJobTracker())
217  Q_PRIVATE_SLOT(d_func(), void delayedEmitResult())
218  //@endcond
219 };
220 
221 }
222 
223 #endif
The server protocol version is too old or too new.
Definition: job.h:100
Unknown error.
Definition: job.h:102
Base class for all actions in the Akonadi storage.
Definition: job.h:80
A communication session with the Akonadi storage.
Definition: core/session.h:54
QList< Job * > List
Describes a list of jobs.
Definition: job.h:91
ASAP CLI session.
Helper integration between Akonadi and Qt.
The user canceled this job.
Definition: job.h:101
Error
Describes the error codes that can be emitted by this class.
Definition: job.h:98
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Sat Nov 28 2020 23:17:16 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.