Libksieve

vacationcreatescriptjob.h
1 /*
2  Copyright (C) 2013-2020 Laurent Montel <[email protected]>
3 
4  This program is free software; you can redistribute it and/or modify it
5  under the terms of the GNU General Public License, version 2, as
6  published by the Free Software Foundation.
7 
8  This program is distributed in the hope that it will be useful, but
9  WITHOUT ANY WARRANTY; without even the implied warranty of
10  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11  General Public License for more details.
12 
13  You should have received a copy of the GNU General Public License along
14  with this program; if not, write to the Free Software Foundation, Inc.,
15  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
16 */
17 
18 #ifndef VACATIONCREATESCRIPTJOB_H
19 #define VACATIONCREATESCRIPTJOB_H
20 
21 #include <QObject>
22 
23 #include <QUrl>
24 
25 namespace KManageSieve {
26 class SieveJob;
27 }
28 
29 namespace KSieveUi {
30 class ParseUserScriptJob;
31 class GenerateGlobalScriptJob;
32 class VacationCreateScriptJob : public QObject
33 {
34  Q_OBJECT
35 public:
36  explicit VacationCreateScriptJob(QObject *parent = nullptr);
37  ~VacationCreateScriptJob();
38 
39  void start();
40  void kill();
41 
42  void setServerUrl(const QUrl &url);
43  void setScript(const QString &script);
44  void setServerName(const QString &servername);
45  const QString &serverName() const;
46  void setStatus(bool activate, bool wasActive);
47  void setKep14Support(bool kep14Support);
48 
49 Q_SIGNALS:
50  void result(bool);
51  void scriptActive(bool activated, const QString &serverName);
52 
53 private Q_SLOTS:
54  void slotPutResult(KManageSieve::SieveJob *job, bool success);
55  void slotGetScript(KManageSieve::SieveJob *job, bool success, const QString &oldScript, bool active);
56  void slotGotActiveScripts(KSieveUi::ParseUserScriptJob *job);
57  void slotGenerateDone(const QString &error = QString());
58 
59 private:
60  Q_DISABLE_COPY(VacationCreateScriptJob)
61  void handleResult();
62  void createScript();
63  QUrl mUrl;
64  QString mScript;
65  QString mServerName;
66  bool mActivate = false;
67  bool mScriptActive = false;
68  bool mKep14Support = false;
69  bool mUserJobRunning = false;
70  bool mScriptJobRunning = false;
71  bool mSuccess = true;
72  KManageSieve::SieveJob *mSieveJob = nullptr;
73  ParseUserScriptJob *mParseUserJob = nullptr;
74  GenerateGlobalScriptJob *mCreateJob = nullptr;
75 };
76 }
77 
78 #endif // VACATIONCREATESCRIPTJOB_H
A job to manage sieve scripts.
Definition: sievejob.h:41
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Thu Jul 9 2020 23:07:45 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.