Libksieve

sievejob.h
1 /* -*- c++ -*-
2  sievejob.h
3 
4  SPDX-FileCopyrightText: 2002 Marc Mutz <[email protected]>
5 
6  SPDX-License-Identifier: GPL-2.0-only
7 */
8 
9 #ifndef KSIEVE_KMANAGESIEVE_SIEVEJOB_H
10 #define KSIEVE_KMANAGESIEVE_SIEVEJOB_H
11 
12 #include "kmanagesieve_export.h"
13 
14 #include <QObject>
15 #include <QStringList>
16 
17 #include <QUrl>
18 #include <kio/global.h>
19 #include <kio/udsentry.h>
20 
21 namespace KIO {
22 class Job;
23 }
24 
25 class KJob;
26 
27 namespace KManageSieve {
28 class Session;
29 
36 class KMANAGESIEVE_EXPORT SieveJob : public QObject
37 {
38  Q_OBJECT
39 
40 public:
49  static SieveJob *put(const QUrl &destination, const QString &script, bool makeActive, bool wasActive);
50 
56  static SieveJob *get(const QUrl &source);
57 
61  static SieveJob *list(const QUrl &url);
62 
66  static SieveJob *del(const QUrl &url);
67 
71  static SieveJob *activate(const QUrl &url);
72 
76  static SieveJob *deactivate(const QUrl &url);
77 
82  static SieveJob *rename(const QUrl &url, const QString &newName);
83 
88  static SieveJob *check(const QUrl &url, const QString &script);
89 
93  void kill(KJob::KillVerbosity verbosity = KJob::Quietly);
94 
98  QStringList sieveCapabilities() const;
99 
104  bool fileExists() const;
105 
109  QString errorString() const;
110 
111 Q_SIGNALS:
120  void gotScript(KManageSieve::SieveJob *job, bool success, const QString &script, bool active);
121 
131  void gotList(KManageSieve::SieveJob *job, bool success, const QStringList &scriptList, const QString &activeScript);
132 
142  void result(KManageSieve::SieveJob *job, bool success, const QString &script, bool active);
143 
151  void item(KManageSieve::SieveJob *job, const QString &filename, bool active);
152 
153 private:
154  Q_DISABLE_COPY(SieveJob)
155  void setErrorMessage(const QString &str);
156 
157  //@cond PRIVATE
158  SieveJob(QObject *parent = nullptr);
159  ~SieveJob();
160 
161  class Private;
162  Private *const d;
163  friend class Session;
164  //@endcond
165 };
166 }
167 
168 #endif
A job to manage sieve scripts.
Definition: sievejob.h:36
A network session with a manage sieve server.
Definition: session.h:34
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Fri Aug 14 2020 23:08:30 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.