Libksieve

vacationcheckjob.h
1/*
2 SPDX-FileCopyrightText: 2013-2024 Laurent Montel <montel@kde.org>
3
4 SPDX-License-Identifier: GPL-2.0-only
5*/
6
7#pragma once
8#include "ksievecore_export.h"
9#include <QObject>
10#include <QStringList>
11#include <QUrl>
12
13namespace KManageSieve
14{
15class SieveJob;
16}
17
18namespace KSieveCore
19{
20class ParseUserScriptJob;
21class KSIEVECORE_EXPORT VacationCheckJob : public QObject
22{
23 Q_OBJECT
24public:
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 [[nodiscard]] bool noScriptFound() const;
31 [[nodiscard]] QString script() const;
32 [[nodiscard]] QStringList sieveCapabilities() const;
33 [[nodiscard]] QString serverName() const;
34
35Q_SIGNALS:
36 void vacationScriptActive(KSieveCore::VacationCheckJob *job, const QString &sscriptName, bool active);
37 void error(const QString &errorStr);
38
39private Q_SLOTS:
40 void slotGetResult(KManageSieve::SieveJob *job, bool success, const QString &script, bool active);
41 void slotGotActiveScripts(KSieveCore::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
47private:
48 [[nodiscard]] bool isLastScript() const;
49 QStringList mAvailableScripts;
50 QStringList mActiveScripts;
51 QStringList mSieveCapabilities;
52 QString mScript;
53 const QString mServerName;
54 const QUrl mUrl;
55 KManageSieve::SieveJob *mSieveJob = nullptr;
56 KSieveCore::ParseUserScriptJob *mParseJob = nullptr;
57 int mScriptPos = -1;
58 bool mKep14Support = false;
59 bool mNoScriptFound = false;
60};
61}
A job to manage sieve scripts.
Definition sievejob.h:31
Q_SCRIPTABLE Q_NOREPLY void start()
void error(QWidget *parent, const QString &text, const QString &title, const KGuiItem &buttonOk, Options options=Notify)
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Dec 21 2024 16:57:10 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.