Libksieve

sievecondition.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 "sievecondition.h"
21 #include "autocreatescripts/sieveeditorgraphicalmodewidget.h"
22 #include "libksieve_debug.h"
23 
24 #include <KLocalizedString>
25 
26 #include <QWidget>
27 
28 using namespace KSieveUi;
29 
30 SieveCondition::SieveCondition(SieveEditorGraphicalModeWidget *sieveGraphicalModeWidget, const QString &name, const QString &label, QObject *parent)
31  : SieveCommonActionCondition(sieveGraphicalModeWidget, name, label, parent)
32 {
33 }
34 
35 SieveCondition::~SieveCondition()
36 {
37 }
38 
39 void SieveCondition::setParamWidgetValue(QXmlStreamReader & /*element*/, QWidget * /*parent*/, bool /*notCondition*/, QString & /*error*/)
40 {
41 }
42 
43 void SieveCondition::unknownTag(const QStringRef &tag, QString &error)
44 {
45  error += i18n("Unknown tag \"%1\" during parsing condition \"%2\"", *tag.string(), name()) + QLatin1Char('\n');
46 }
47 
48 void SieveCondition::unknownTagValue(const QString &tagValue, QString &error)
49 {
50  error += i18n("An unknown tag value \"%1\" was found during parsing condition \"%2\".", tagValue, name()) + QLatin1Char('\n');
51 }
52 
53 void SieveCondition::tooManyArguments(const QString &tagName, int index, int maxValue, QString &error)
54 {
55  error += i18n("Too many argument found for \"%1\", max value is %2, number of value found %3 for %4", name(), maxValue, (index + 1), tagName) + QLatin1Char('\n');
56 }
57 
58 void SieveCondition::tooManyArguments(const QStringRef &tagName, int index, int maxValue, QString &error)
59 {
60  tooManyArguments(tagName.toString(), index, maxValue, error);
61 }
62 
63 void SieveCondition::serverDoesNotSupportFeatures(const QString &feature, QString &error)
64 {
65  error += i18n("A feature \"%1\" in condition \"%2\" is not supported by server", feature, name()) + QLatin1Char('\n');
66 }
QString name(const QVariant &location)
QString toString() const const
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 Mon Aug 10 2020 23:12:59 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.