Libksieve

sieveaction.cpp
1 /*
2  Copyright (C) 2013-2020 Laurent Montel <[email protected]>
3 
4  This library is free software; you can redistribute it and/or
5  modify it under the terms of the GNU Library General Public
6  License as published by the Free Software Foundation; either
7  version 2 of the License, or (at your option) any later version.
8 
9  This library is distributed in the hope that it will be useful,
10  but WITHOUT ANY WARRANTY; without even the implied warranty of
11  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12  Library General Public License for more details.
13 
14  You should have received a copy of the GNU Library General Public License
15  along with this library; see the file COPYING.LIB. If not, write to
16  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17  Boston, MA 02110-1301, USA.
18 */
19 
20 #include "sieveaction.h"
21 #include "libksieve_debug.h"
22 
23 #include <KLocalizedString>
24 
25 #include <QWidget>
26 #include <QXmlStreamReader>
27 #include "autocreatescripts/sieveeditorgraphicalmodewidget.h"
28 
29 using namespace KSieveUi;
30 
31 SieveAction::SieveAction(SieveEditorGraphicalModeWidget *sieveGraphicalModeWidget, const QString &name, const QString &label, QObject *parent)
32  : SieveCommonActionCondition(sieveGraphicalModeWidget, name, label, parent)
33 {
34 }
35 
36 SieveAction::~SieveAction()
37 {
38 }
39 
40 QStringList SieveAction::listOfIncludeFile() const
41 {
42  if (mSieveGraphicalModeWidget) {
43  return mSieveGraphicalModeWidget->listOfIncludeFile();
44  }
45  qCWarning(LIBKSIEVE_LOG) << "SieveAction::listOfIncludeFile Problem during initialize mSieveGraphicalModeWidget ";
46  return {};
47 }
48 
49 void SieveAction::setParamWidgetValue(QXmlStreamReader &n, QWidget *, QString &)
50 {
52 }
53 
54 void SieveAction::unknownTag(const QStringRef &tag, QString &error)
55 {
56  error += i18n("An unknown tag \"%1\" was found during parsing action \"%2\".", *tag.string(), name()) + QLatin1Char('\n');
57 }
58 
59 void SieveAction::unknownTagValue(const QString &tagValue, QString &error)
60 {
61  error += i18n("An unknown tag value \"%1\" was found during parsing action \"%2\".", tagValue, name()) + QLatin1Char('\n');
62 }
63 
64 void SieveAction::tooManyArguments(const QStringRef &tagName, int index, int maxValue, QString &error)
65 {
66  error += i18n("Too many arguments found for \"%1\", max value is %2, number of value found %3 for %4", name(), maxValue, index, *tagName.string()) + QLatin1Char('\n');
67 }
68 
69 void SieveAction::serverDoesNotSupportFeatures(const QString &feature, QString &error)
70 {
71  error += i18n("A feature \"%1\" in condition \"%2\" is not supported by server", feature, name()) + QLatin1Char('\n');
72 }
QString name(const QVariant &location)
void skipCurrentElement()
QString i18n(const char *text, const TYPE &arg...)
const QString * string() const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Fri Jun 5 2020 23:09:20 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.