Changeset View
Changeset View
Standalone View
Standalone View
libksieve/ksieveui/managescriptsjob/checkkep14supportjob.h
- This file was copied from libksieve/ksieveui/managescriptsjob/parseuserscriptjob.h.
/* | /* | ||||
Copyright (c) 2013, 2014 Montel Laurent <montel@kde.org> | Copyright (c) 2015 Sandro Knauß <knauss@kolabsys.com> | ||||
This program is free software; you can redistribute it and/or modify it | This program is free software; you can redistribute it and/or modify it | ||||
under the terms of the GNU General Public License, version 2, as | under the terms of the GNU General Public License, version 2, as | ||||
published by the Free Software Foundation. | published by the Free Software Foundation. | ||||
This program is distributed in the hope that it will be useful, but | This program is distributed in the hope that it will be useful, but | ||||
WITHOUT ANY WARRANTY; without even the implied warranty of | WITHOUT ANY WARRANTY; without even the implied warranty of | ||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||||
General Public License for more details. | General Public License for more details. | ||||
You should have received a copy of the GNU General Public License along | You should have received a copy of the GNU General Public License along | ||||
with this program; if not, write to the Free Software Foundation, Inc., | with this program; if not, write to the Free Software Foundation, Inc., | ||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | ||||
*/ | */ | ||||
#ifndef PARSEUSERSCRIPTJOB_H | #ifndef CHECKKEP14SUPPORTJOB_H | ||||
#define PARSEUSERSCRIPTJOB_H | #define CHECKKEP14SUPPORTJOB_H | ||||
#include <QObject> | #include <QObject> | ||||
#include <KUrl> | #include <QStringList> | ||||
#include "ksieveui_export.h" | #include "ksieveui_export.h" | ||||
class QDomDocument; | |||||
class QDomElement; | #include <KUrl> | ||||
namespace KManageSieve { | namespace KManageSieve { | ||||
class SieveJob; | class SieveJob; | ||||
} | } | ||||
namespace KSieveUi { | namespace KSieveUi { | ||||
class KSIEVEUI_EXPORT ParseUserScriptJob : public QObject | class KSIEVEUI_EXPORT CheckKep14SupportJob : public QObject | ||||
{ | { | ||||
Q_OBJECT | Q_OBJECT | ||||
public: | public: | ||||
explicit ParseUserScriptJob(QObject *parent=0); | explicit CheckKep14SupportJob(QObject *parent=0); | ||||
~ParseUserScriptJob(); | ~CheckKep14SupportJob(); | ||||
void start(); | void start(); | ||||
void scriptUrl(const KUrl &url); | void setServerUrl(const KUrl &url); | ||||
static QStringList parsescript(const QString &script, bool &result); | void setServerName(const QString &name); | ||||
QString serverName(); | |||||
private Q_SLOTS: | QStringList availableScripts(); | ||||
void slotGetResult( KManageSieve::SieveJob *, bool, const QString &, bool ); | bool hasKep14Support(); | ||||
KUrl serverUrl(); | |||||
Q_SIGNALS: | Q_SIGNALS: | ||||
void success(const QStringList &activeScriptList); | void result(CheckKep14SupportJob*, bool); | ||||
void error(const QString &msgError); | |||||
private: | private: | ||||
static QString loadInclude(const QDomElement &element); | KUrl mUrl; | ||||
static QStringList extractActiveScript(const QDomDocument &doc); | |||||
KUrl mCurrentUrl; | |||||
KManageSieve::SieveJob *mSieveJob; | KManageSieve::SieveJob *mSieveJob; | ||||
QStringList mAvailableScripts; | |||||
bool mKep14Support; | |||||
QString mServerName; | |||||
private slots: | |||||
void slotCheckKep14Support(KManageSieve::SieveJob *job, bool success, const QStringList &availableScripts, const QString &activeScript); | |||||
}; | }; | ||||
} | } | ||||
#endif // PARSEUSERSCRIPTJOB_H | #endif // CHECKKEP14SUPPORTJOB_H |