Libksieve

sievescriptblockwidget.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 "sieveglobalvariablewidget.h"
10#include "sievewidgetpageabstract.h"
11
12class QRadioButton;
13class QGroupBox;
14class QAbstractButton;
15class QComboBox;
16class QPushButton;
18
19namespace KSieveUi
20{
21class SieveConditionWidgetLister;
22class SieveActionWidgetLister;
23class SieveEditorGraphicalModeWidget;
24
25class SieveScriptBlockWidget : public SieveWidgetPageAbstract
26{
28public:
29 enum MatchCondition { OrCondition, AndCondition, AllCondition };
30
31 explicit SieveScriptBlockWidget(SieveEditorGraphicalModeWidget *graphicalModeWidget, QWidget *parent = nullptr);
32 ~SieveScriptBlockWidget() override;
33
34 void setPageType(PageType type) override;
35
36 void generatedScript(QString &script, QStringList &required, bool inForEveryPartLoop) override;
37
38 [[nodiscard]] MatchCondition matchCondition() const;
39
40 void loadScript(QXmlStreamReader &element, bool onlyActions, QString &error);
41
42 void loadLocalVariable(const SieveGlobalVariableActionWidget::VariableElement &var);
44 void addNewBlock(QWidget *widget, KSieveUi::SieveWidgetPageAbstract::PageType type);
45
46private:
47 void slotRadioClicked(QAbstractButton *);
48 void slotAddBlock();
49 void updateWidget();
50 void updateCondition();
51 MatchCondition mMatchCondition = AndCondition;
52 QGroupBox *mConditions = nullptr;
53 SieveEditorGraphicalModeWidget *const mSieveGraphicalModeWidget;
54 SieveConditionWidgetLister *mScriptConditionLister = nullptr;
55 SieveActionWidgetLister *mScriptActionLister = nullptr;
56 QRadioButton *mMatchAll = nullptr;
57 QRadioButton *mMatchAny = nullptr;
58 QRadioButton *mAllMessageRBtn = nullptr;
59 QComboBox *mNewBlockType = nullptr;
60 QPushButton *mAddBlockType = nullptr;
61};
62}
Q_OBJECTQ_OBJECT
Q_SIGNALSQ_SIGNALS
QObject * parent() const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Tue Mar 26 2024 11:17:19 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.