Libksieve

xmlprintingscriptbuilder.h
1/*
2 SPDX-FileCopyrightText: 2013-2024 Laurent Montel <montel@kde.org>
3
4 SPDX-License-Identifier: LGPL-2.0-or-later
5*/
6
7#pragma once
8#include "ksievecore_export.h"
9#include "scriptbuilder.h"
10#include <QString>
12namespace KSieveCore
13{
14class KSIEVECORE_EXPORT XMLPrintingScriptBuilder : public KSieve::ScriptBuilder
15{
16public:
17 XMLPrintingScriptBuilder();
18 XMLPrintingScriptBuilder(int indent);
19 ~XMLPrintingScriptBuilder() override;
20
21 void taggedArgument(const QString &tag) override;
22 void stringArgument(const QString &string, bool multiLine, const QString & /*fixme*/) override;
23 void numberArgument(unsigned long number, char quantifier) override;
24 void commandStart(const QString &identifier, int lineNumber) override;
25 void commandEnd(int lineNumber) override;
26 void testStart(const QString &identifier) override;
27 void testEnd() override;
28 void testListStart() override;
29 void testListEnd() override;
30 void blockStart(int lineNumber) override;
31 void blockEnd(int lineNumber) override;
32 void stringListArgumentStart() override;
33 void stringListArgumentEnd() override;
34 void stringListEntry(const QString &string, bool multiline, const QString &hashComment) override;
35 void hashComment(const QString &comment) override;
36 void bracketComment(const QString &comment) override;
37
38 void lineFeed() override;
39 void error(const KSieve::Error &error) override;
40 void finished() override;
41
42 [[nodiscard]] QString result() const;
43 [[nodiscard]] QString error() const;
44 [[nodiscard]] bool hasError() const;
45
46 void clear();
47
48private:
49 KSIEVECORE_NO_EXPORT void initialize(int indent = 0);
50 KSIEVECORE_NO_EXPORT void write(const QString &key, const QString &value);
51 KSIEVECORE_NO_EXPORT void write(const QString &key, const QString &qualifiedName, const QString &attribute, const QString &value);
52
53 QXmlStreamWriter *mStream = nullptr;
54 QString mResult;
55 QString mError;
56};
57}
KCRASH_EXPORT void initialize()
void error(QWidget *parent, const QString &text, const QString &title, const KGuiItem &buttonOk, Options options=Notify)
KGuiItem clear()
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.