Libksieve

generateglobalscriptjob.h
1 /*
2  Copyright (C) 2013-2020 Laurent Montel <[email protected]>
3 
4  This program is free software; you can redistribute it and/or modify it
5  under the terms of the GNU General Public License, version 2, as
6  published by the Free Software Foundation.
7 
8  This program is distributed in the hope that it will be useful, but
9  WITHOUT ANY WARRANTY; without even the implied warranty of
10  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11  General Public License for more details.
12 
13  You should have received a copy of the GNU General Public License along
14  with this program; if not, write to the Free Software Foundation, Inc.,
15  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
16 */
17 
18 #ifndef GENERATEGLOBALSCRIPTJOB_H
19 #define GENERATEGLOBALSCRIPTJOB_H
20 
21 #include <QObject>
22 #include <QStringList>
23 #include <QUrl>
24 namespace KManageSieve {
25 class SieveJob;
26 }
27 namespace KSieveUi {
28 class GenerateGlobalScriptJob : public QObject
29 {
30  Q_OBJECT
31 public:
32  explicit GenerateGlobalScriptJob(const QUrl &url, QObject *parent = nullptr);
33  ~GenerateGlobalScriptJob();
34 
35  void start();
36  void kill();
37 
38  void addUserActiveScripts(const QStringList &lstScript);
39 
40 Q_SIGNALS:
41  void success();
42  void error(const QString &msgError);
43 
44 private:
45  Q_DISABLE_COPY(GenerateGlobalScriptJob)
46  void slotPutMasterResult(KManageSieve::SieveJob *job, bool success);
47  void slotPutUserResult(KManageSieve::SieveJob *, bool success);
48  void disableAllOtherScripts();
49  void writeMasterScript();
50  void writeUserScript();
51  QStringList mListUserActiveScripts;
52  QUrl mCurrentUrl;
53  KManageSieve::SieveJob *mMasterJob = nullptr;
54  KManageSieve::SieveJob *mUserJob = nullptr;
55 };
56 }
57 
58 #endif // GENERATEGLOBALSCRIPTJOB_H
void error(QWidget *parent, const QString &text, const QString &caption=QString(), Options options=Notify)
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Fri Jun 5 2020 23:09:19 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.