Libksieve

sievescriptpage.h
1 /*
2  SPDX-FileCopyrightText: 2013-2021 Laurent Montel <[email protected]>
3 
4  SPDX-License-Identifier: LGPL-2.0-or-later
5 */
6 
7 #pragma once
8 
9 #include "ksieveui_private_export.h"
10 #include "sievescriptblockwidget.h"
11 #include <QWidget>
12 
13 namespace KSieveUi
14 {
15 class SieveScriptBlockWidget;
16 class SieveScriptTabWidget;
17 class SieveIncludeWidget;
18 class SieveForEveryPartWidget;
19 class SieveGlobalVariableWidget;
20 class SieveEditorGraphicalModeWidget;
21 class KSIEVEUI_TESTS_EXPORT SieveScriptPage : public QWidget
22 {
23  Q_OBJECT
24 public:
25  explicit SieveScriptPage(SieveEditorGraphicalModeWidget *sieveEditorGraphicalWidget, QWidget *parent = nullptr);
26  ~SieveScriptPage() override;
27 
28  void generatedScript(QString &script, QStringList &required);
29 
30  Q_REQUIRED_RESULT SieveIncludeWidget *includeWidget() const;
31  Q_REQUIRED_RESULT SieveForEveryPartWidget *forEveryPartWidget() const;
32  Q_REQUIRED_RESULT SieveGlobalVariableWidget *globalVariableWidget() const;
33  Q_REQUIRED_RESULT SieveScriptBlockWidget *blockIfWidget() const;
34  Q_REQUIRED_RESULT SieveScriptBlockWidget *addScriptBlock(KSieveUi::SieveWidgetPageAbstract::PageType type);
35 
36  void setListOfIncludeFile(const QStringList &lst);
37 
38 Q_SIGNALS:
39  void valueChanged();
40 
41 private Q_SLOTS:
42  void slotAddNewBlock(QWidget *widget, KSieveUi::SieveWidgetPageAbstract::PageType type);
43  void slotCloseTab(int);
44 
45 private:
46  SieveScriptBlockWidget *createScriptBlock(KSieveUi::SieveWidgetPageAbstract::PageType type);
47  Q_REQUIRED_RESULT bool hasAnElseBlock() const;
48  Q_REQUIRED_RESULT QString blockName(SieveWidgetPageAbstract::PageType type) const;
49 
50  SieveEditorGraphicalModeWidget *const mSieveGraphicalModeWidget;
51  SieveScriptTabWidget *mTabWidget = nullptr;
52  SieveIncludeWidget *mIncludeWidget = nullptr;
53  SieveForEveryPartWidget *mForEveryPartWidget = nullptr;
54  SieveGlobalVariableWidget *mGlobalVariableWidget = nullptr;
55  SieveScriptBlockWidget *mBlockIfWidget = nullptr;
56 };
57 }
58 
This file is part of the KDE documentation.
Documentation copyright © 1996-2021 The KDE developers.
Generated on Fri Apr 16 2021 23:09:34 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.