Libksieve

sieveeditorgraphicalmodewidget.h
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 #ifndef SIEVEEDITORGRAPHICALMODEWIDGET_H
21 #define SIEVEEDITORGRAPHICALMODEWIDGET_H
22 
23 #include "sieveeditorgraphicalmodewidgetabstract.h"
24 #include "util/sieveimapaccountsettings.h"
25 #include "ksieveui_private_export.h"
26 class QSplitter;
27 class QStackedWidget;
28 
29 namespace KSieveUi {
30 class SieveScriptPage;
31 class SieveScriptListBox;
32 class SieveEditorParsingMissingFeatureWarning;
33 class KSIEVEUI_TESTS_EXPORT SieveEditorGraphicalModeWidget : public SieveEditorGraphicalModeWidgetAbstract
34 {
35  Q_OBJECT
36 public:
37  explicit SieveEditorGraphicalModeWidget(QWidget *parent = nullptr);
38  ~SieveEditorGraphicalModeWidget();
39 
40  Q_REQUIRED_RESULT QString script(QStringList &required) const override;
41 
42  void setSieveCapabilities(const QStringList &capabilities) override;
43  Q_REQUIRED_RESULT QStringList sieveCapabilities() override;
44 
45  void loadScript(const QString &doc, QString &error) override;
46 
47  Q_REQUIRED_RESULT QString currentscript() override;
48  void setImportScript(const QString &) override;
49 
50  void setListOfIncludeFile(const QStringList &listOfIncludeFile) override;
51  Q_REQUIRED_RESULT QStringList listOfIncludeFile() const override;
52 
53 Q_SIGNALS:
54  void enableButtonOk(bool);
55  void switchTextMode(const QString &script);
56  void valueChanged();
57 
58 private:
59  void readConfig();
60  void writeConfig();
61 
62 private Q_SLOTS:
63  void slotSwitchToTextMode();
64  void slotAddScriptPage(KSieveUi::SieveScriptPage *page);
65  void slotRemoveScriptPage(QWidget *page);
66  void slotActivateScriptPage(QWidget *page);
67 
68 private:
69  QStringList mCapabilities;
70  QStringList mListOfIncludeFile;
71  SieveScriptListBox *mSieveScript = nullptr;
72  QStackedWidget *mStackWidget = nullptr;
73  QSplitter *mSplitter = nullptr;
74  SieveEditorParsingMissingFeatureWarning *mSieveParsingWarning = nullptr;
75 };
76 }
77 
78 #endif // SIEVEEDITORGRAPHICALMODEWIDGET_H
void readConfig()
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Tue Aug 4 2020 23:07:29 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.