Libksieve

vacationcreatescriptjob.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
11#include <QUrl>
12
13namespace KManageSieve
14{
15class SieveJob;
16}
17
18namespace KSieveCore
19{
20class ParseUserScriptJob;
21class GenerateGlobalScriptJob;
22class KSIEVECORE_EXPORT VacationCreateScriptJob : public QObject
23{
24 Q_OBJECT
25public:
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 [[nodiscard]] const QString &serverName() const;
36 void setStatus(bool activate, bool wasActive);
37 void setKep14Support(bool kep14Support);
38
39Q_SIGNALS:
40 void result(bool);
41 void scriptActive(bool activated, const QString &serverName);
42
43private 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(KSieveCore::ParseUserScriptJob *job);
47 void slotGenerateDone(const QString &error = QString());
48
49private:
50 void handleResult();
51 void createScript();
52 QUrl mUrl;
53 QString mScript;
54 QString mServerName;
55 bool mActivate = false;
56 bool mScriptActive = false;
57 bool mKep14Support = false;
58 bool mUserJobRunning = false;
59 bool mScriptJobRunning = false;
60 bool mSuccess = true;
61 KManageSieve::SieveJob *mSieveJob = nullptr;
62 KSieveCore::ParseUserScriptJob *mParseUserJob = nullptr;
63 KSieveCore::GenerateGlobalScriptJob *mCreateJob = nullptr;
64};
65}
A job to manage sieve scripts.
Definition sievejob.h:31
Q_SCRIPTABLE Q_NOREPLY void start()
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Nov 22 2024 12:09:39 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.