Libksieve

sievescriptpage.h
1/*
2 SPDX-FileCopyrightText: 2013-2024 Laurent Montel <montel@kde.org>
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
13namespace KSieveUi
14{
15class SieveScriptBlockWidget;
16class SieveScriptTabWidget;
17class SieveIncludeWidget;
18class SieveForEveryPartWidget;
19class SieveGlobalVariableWidget;
20class SieveEditorGraphicalModeWidget;
21class KSIEVEUI_TESTS_EXPORT SieveScriptPage : public QWidget
22{
23 Q_OBJECT
24public:
25 explicit SieveScriptPage(SieveEditorGraphicalModeWidget *sieveEditorGraphicalWidget, QWidget *parent = nullptr);
26 ~SieveScriptPage() override;
27
28 void generatedScript(QString &script, QStringList &required);
29
30 [[nodiscard]] SieveIncludeWidget *includeWidget() const;
31 [[nodiscard]] SieveForEveryPartWidget *forEveryPartWidget() const;
32 [[nodiscard]] SieveGlobalVariableWidget *globalVariableWidget() const;
33 [[nodiscard]] SieveScriptBlockWidget *blockIfWidget() const;
34 [[nodiscard]] SieveScriptBlockWidget *addScriptBlock(KSieveUi::SieveWidgetPageAbstract::PageType type);
35
36 void setListOfIncludeFile(const QStringList &lst);
37
38Q_SIGNALS:
39 void valueChanged();
40
41private Q_SLOTS:
42 void slotAddNewBlock(QWidget *widget, KSieveUi::SieveWidgetPageAbstract::PageType type);
43 void slotCloseTab(int);
44
45private:
46 [[nodiscard]] SieveScriptBlockWidget *createScriptBlock(KSieveUi::SieveWidgetPageAbstract::PageType type);
47 [[nodiscard]] bool hasAnElseBlock() const;
48 [[nodiscard]] 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}
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:14:30 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.