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 {
30 OrCondition,
31 AndCondition,
32 AllCondition
33 };
34
35 explicit SieveScriptBlockWidget(SieveEditorGraphicalModeWidget *graphicalModeWidget, QWidget *parent = nullptr);
36 ~SieveScriptBlockWidget() override;
37
38 void setPageType(PageType type) override;
39
40 void generatedScript(QString &script, QStringList &required, bool inForEveryPartLoop) override;
41
42 [[nodiscard]] MatchCondition matchCondition() const;
43
44 void loadScript(QXmlStreamReader &element, bool onlyActions, QString &error);
45
46 void loadLocalVariable(const SieveGlobalVariableActionWidget::VariableElement &var);
48 void addNewBlock(QWidget *widget, KSieveUi::SieveWidgetPageAbstract::PageType type);
49
50private:
51 void slotRadioClicked(QAbstractButton *);
52 void slotAddBlock();
53 void updateWidget();
54 void updateCondition();
55 MatchCondition mMatchCondition = AndCondition;
56 QGroupBox *mConditions = nullptr;
57 SieveEditorGraphicalModeWidget *const mSieveGraphicalModeWidget;
58 SieveConditionWidgetLister *mScriptConditionLister = nullptr;
59 SieveActionWidgetLister *mScriptActionLister = nullptr;
60 QRadioButton *mMatchAll = nullptr;
61 QRadioButton *mMatchAny = nullptr;
62 QRadioButton *mAllMessageRBtn = nullptr;
63 QComboBox *mNewBlockType = nullptr;
64 QPushButton *mAddBlockType = nullptr;
65};
66}
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 Fri Nov 22 2024 12:09:40 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.