Libksieve

sieveaction.cpp
1/*
2 SPDX-FileCopyrightText: 2013-2024 Laurent Montel <montel@kde.org>
3
4 SPDX-License-Identifier: LGPL-2.0-or-later
5*/
6
7#include "sieveaction.h"
8#include "libksieveui_debug.h"
9
10#include <KLocalizedString>
11
12#include "autocreatescripts/sieveeditorgraphicalmodewidget.h"
13#include <QWidget>
14#include <QXmlStreamReader>
15
16using namespace KSieveUi;
17
18SieveAction::SieveAction(SieveEditorGraphicalModeWidget *sieveGraphicalModeWidget, const QString &name, const QString &label, QObject *parent)
19 : SieveCommonActionCondition(sieveGraphicalModeWidget, name, label, parent)
20{
21}
22
23SieveAction::~SieveAction() = default;
24
25QStringList SieveAction::listOfIncludeFile() const
26{
27 if (mSieveGraphicalModeWidget) {
28 return mSieveGraphicalModeWidget->listOfIncludeFile();
29 }
30 qCWarning(LIBKSIEVEUI_LOG) << "SieveAction::listOfIncludeFile Problem during initialize mSieveGraphicalModeWidget ";
31 return {};
32}
33
34void SieveAction::setParamWidgetValue(QXmlStreamReader &n, QWidget *, QString &)
35{
37}
38void SieveAction::unknownTag(const QStringView &tag, QString &error)
39{
40 const QString result = tag.toString();
41 error += i18n("An unknown tag \"%1\" was found during parsing action \"%2\".", result, name()) + QLatin1Char('\n');
42}
43
44void SieveAction::tooManyArguments(const QStringView &tagName, int index, int maxValue, QString &error)
45{
46 const QString result = tagName.toString();
47
48 error += i18n("Too many arguments found for \"%1\", max value is %2, number of value found %3 for %4", name(), maxValue, index, result) + QLatin1Char('\n');
49}
50
51void SieveAction::unknownTagValue(const QString &tagValue, QString &error)
52{
53 error += i18n("An unknown tag value \"%1\" was found during parsing action \"%2\".", tagValue, name()) + QLatin1Char('\n');
54}
55
56void SieveAction::serverDoesNotSupportFeatures(const QString &feature, QString &error)
57{
58 error += i18n("A feature \"%1\" in condition \"%2\" is not supported by server", feature, name()) + QLatin1Char('\n');
59}
60
61#include "moc_sieveaction.cpp"
QString i18n(const char *text, const TYPE &arg...)
void error(QWidget *parent, const QString &text, const QString &title, const KGuiItem &buttonOk, Options options=Notify)
QString name(StandardAction id)
QString label(StandardShortcut id)
QString toString() const const
void skipCurrentElement()
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.