Libksieve

parseuserscriptjob.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>
12namespace KManageSieve
13{
14class SieveJob;
15}
17namespace KSieveCore
18{
19class KSIEVECORE_EXPORT ParseUserScriptJob : public QObject
20{
21 Q_OBJECT
22
23 friend class ParseUserTest;
24
25public:
26 explicit ParseUserScriptJob(const QUrl &url, QObject *parent = nullptr);
27 ~ParseUserScriptJob() override;
28
29 void start();
30 void setAutoDelete(bool deleteMe);
31
32 [[nodiscard]] QUrl scriptUrl() const;
33
34 [[nodiscard]] QStringList activeScriptList() const;
35 [[nodiscard]] QString error() const;
36 void kill();
37 [[nodiscard]] QStringList parsescript(const QString &script, bool &result);
38
39Q_SIGNALS:
40 void finished(KSieveCore::ParseUserScriptJob *job);
41
42private:
43 void slotGetResult(KManageSieve::SieveJob *job, bool, const QString &, bool);
44 void emitSuccess(const QStringList &activeScriptList);
45 void emitError(const QString &msgError);
46 [[nodiscard]] QString loadInclude();
47 [[nodiscard]] QStringList extractActiveScript(const QString &doc);
48 const QUrl mCurrentUrl;
49 KManageSieve::SieveJob *mSieveJob = nullptr;
50 QXmlStreamReader *mStreamReader = nullptr;
51 QStringList mActiveScripts;
52 QString mError;
53 bool mAutoDelete = false;
54};
55}
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 Mon Nov 18 2024 12:14:30 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.