Libksieve

vacationcheckjob.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 #include <QStringList>
11 #include <QUrl>
12 
13 namespace KManageSieve
14 {
15 class SieveJob;
16 }
17 
18 namespace KSieveUi
19 {
20 class ParseUserScriptJob;
21 class VacationCheckJob : public QObject
22 {
23  Q_OBJECT
24 public:
25  explicit VacationCheckJob(const QUrl &url, const QString &serverName, QObject *parent = nullptr);
26  ~VacationCheckJob() override;
27  void setKep14Support(bool kep14Support);
28  void start();
29  void kill();
30  Q_REQUIRED_RESULT bool noScriptFound() const;
31  Q_REQUIRED_RESULT QString script() const;
32  Q_REQUIRED_RESULT QStringList sieveCapabilities() const;
33  Q_REQUIRED_RESULT QString serverName() const;
34 
35 Q_SIGNALS:
36  void vacationScriptActive(VacationCheckJob *job, const QString &sscriptName, bool active);
37  void error(const QString &errorStr);
38 
39 private Q_SLOTS:
40  void slotGetResult(KManageSieve::SieveJob *job, bool success, const QString &script, bool active);
41  void slotGotActiveScripts(ParseUserScriptJob *job);
42  void slotGotList(KManageSieve::SieveJob *job, bool success, const QStringList &availableScripts, const QString &activeScript);
43  void emitError(const QString &errorMessage);
44  void searchVacationScript();
45  void getNextScript();
46 
47 private:
48  Q_REQUIRED_RESULT bool isLastScript() const;
49  Q_DISABLE_COPY(VacationCheckJob)
50  QStringList mAvailableScripts;
51  QStringList mActiveScripts;
52  QStringList mSieveCapabilities;
53  QString mScript;
54  const QString mServerName;
55  const QUrl mUrl;
56  KManageSieve::SieveJob *mSieveJob = nullptr;
57  ParseUserScriptJob *mParseJob = nullptr;
58  int mScriptPos = -1;
59  bool mKep14Support = false;
60  bool mNoScriptFound = false;
61 };
62 }
63 
void error(QWidget *parent, const QString &text, const QString &caption=QString(), Options options=Notify)
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.