Libksieve

vacationcreatescriptjob.h
1 /*
2  SPDX-FileCopyrightText: 2013-2021 Laurent Montel <[email protected]>
3 
4  SPDX-License-Identifier: GPL-2.0-only
5 */
6 
7 #pragma once
8 
9 #include <QObject>
10 
11 #include <QUrl>
12 
13 namespace KManageSieve
14 {
15 class SieveJob;
16 }
17 
18 namespace KSieveUi
19 {
20 class ParseUserScriptJob;
21 class GenerateGlobalScriptJob;
22 class VacationCreateScriptJob : public QObject
23 {
24  Q_OBJECT
25 public:
26  explicit VacationCreateScriptJob(QObject *parent = nullptr);
27  ~VacationCreateScriptJob() override;
28 
29  void start();
30  void kill();
31 
32  void setServerUrl(const QUrl &url);
33  void setScript(const QString &script);
34  void setServerName(const QString &servername);
35  const QString &serverName() const;
36  void setStatus(bool activate, bool wasActive);
37  void setKep14Support(bool kep14Support);
38 
39 Q_SIGNALS:
40  void result(bool);
41  void scriptActive(bool activated, const QString &serverName);
42 
43 private Q_SLOTS:
44  void slotPutResult(KManageSieve::SieveJob *job, bool success);
45  void slotGetScript(KManageSieve::SieveJob *job, bool success, const QString &oldScript, bool active);
46  void slotGotActiveScripts(KSieveUi::ParseUserScriptJob *job);
47  void slotGenerateDone(const QString &error = QString());
48 
49 private:
50  Q_DISABLE_COPY(VacationCreateScriptJob)
51  void handleResult();
52  void createScript();
53  QUrl mUrl;
54  QString mScript;
55  QString mServerName;
56  bool mActivate = false;
57  bool mScriptActive = false;
58  bool mKep14Support = false;
59  bool mUserJobRunning = false;
60  bool mScriptJobRunning = false;
61  bool mSuccess = true;
62  KManageSieve::SieveJob *mSieveJob = nullptr;
63  ParseUserScriptJob *mParseUserJob = nullptr;
64  GenerateGlobalScriptJob *mCreateJob = nullptr;
65 };
66 }
67 
A job to manage sieve scripts.
Definition: sievejob.h:37
This file is part of the KDE documentation.
Documentation copyright © 1996-2021 The KDE developers.
Generated on Fri Apr 16 2021 23:09:34 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.