Libksieve

vacationcheckjob.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 VACATIONCHECKJOB_H
19 #define VACATIONCHECKJOB_H
20 
21 #include <QObject>
22 #include <QStringList>
23 #include <QUrl>
24 
25 namespace KManageSieve {
26 class SieveJob;
27 }
28 
29 namespace KSieveUi {
30 class ParseUserScriptJob;
31 class VacationCheckJob : public QObject
32 {
33  Q_OBJECT
34 public:
35  explicit VacationCheckJob(const QUrl &url, const QString &serverName, QObject *parent = nullptr);
36  ~VacationCheckJob();
37  void setKep14Support(bool kep14Support);
38  void start();
39  void kill();
40  Q_REQUIRED_RESULT bool noScriptFound() const;
41  Q_REQUIRED_RESULT QString script() const;
42  Q_REQUIRED_RESULT QStringList sieveCapabilities() const;
43  Q_REQUIRED_RESULT QString serverName() const;
44 
45 Q_SIGNALS:
46  void vacationScriptActive(VacationCheckJob *job, const QString &sscriptName, bool active);
47  void error(const QString &errorStr);
48 
49 private Q_SLOTS:
50  void slotGetResult(KManageSieve::SieveJob *job, bool success, const QString &script, bool active);
51  void slotGotActiveScripts(ParseUserScriptJob *job);
52  void slotGotList(KManageSieve::SieveJob *job, bool success, const QStringList &availableScripts, const QString &activeScript);
53  void emitError(const QString &errorMessage);
54  void searchVacationScript();
55  void getNextScript();
56 
57 private:
58  Q_REQUIRED_RESULT bool isLastScript() const;
59  Q_DISABLE_COPY(VacationCheckJob)
60  QStringList mAvailableScripts;
61  QStringList mActiveScripts;
62  QStringList mSieveCapabilities;
63  QString mScript;
64  QString mServerName;
65  QUrl mUrl;
66  KManageSieve::SieveJob *mSieveJob = nullptr;
67  ParseUserScriptJob *mParseJob = nullptr;
68  int mScriptPos = -1;
69  bool mKep14Support = false;
70  bool mNoScriptFound = false;
71 };
72 }
73 
74 #endif // VACATIONCHECKJOB_H
void error(QWidget *parent, const QString &text, const QString &caption=QString(), Options options=Notify)
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 Sun May 24 2020 22:46:41 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.