9#include "sievewidgetpageabstract.h"
10#include <Libkdepim/KWidgetLister>
21class SieveGlobalVariableWidget;
23class SieveGlobalVariableActionWidget :
public QWidget
27 struct VariableElement {
29 QString variableValue;
32 return !variableName.isEmpty();
36 explicit SieveGlobalVariableActionWidget(
QWidget *
parent =
nullptr);
37 ~SieveGlobalVariableActionWidget()
override;
39 void generatedScript(QString &script);
40 void updateAddRemoveButton(
bool addButtonEnabled,
bool removeButtonEnabled);
41 [[nodiscard]]
bool isInitialized()
const;
42 void loadScript(QXmlStreamReader &element, QString &error);
43 void setVariableValue(
const QString &name);
44 [[nodiscard]] QString variableName()
const;
49 void slotRemoveWidget();
58 QPushButton *mAdd =
nullptr;
59 QPushButton *mRemove =
nullptr;
60 QGridLayout *mLayout =
nullptr;
61 QLineEdit *mVariableName =
nullptr;
62 QCheckBox *mSetValueTo =
nullptr;
63 QLineEdit *mVariableValue =
nullptr;
66class SieveGlobalVariableLister :
public KPIM::KWidgetLister
70 explicit SieveGlobalVariableLister(
QWidget *
parent =
nullptr);
71 ~SieveGlobalVariableLister()
override;
73 void generatedScript(QString &script, QStringList &requireModules);
74 void loadScript(QXmlStreamReader &element, QString &error);
75 SieveGlobalVariableActionWidget::VariableElement loadSetVariable(QXmlStreamReader &element, QString &error);
82 void slotRemoveWidget(
QWidget *w);
85 void clearWidget(
QWidget *aWidget)
override;
89 void reconnectWidget(SieveGlobalVariableActionWidget *w);
90 void updateAddRemoveButton();
93class SieveGlobalVariableWidget :
public SieveWidgetPageAbstract
97 explicit SieveGlobalVariableWidget(
QWidget *
parent =
nullptr);
98 ~SieveGlobalVariableWidget()
override;
100 void generatedScript(QString &script, QStringList &requireModules,
bool inForEveryPartLoop)
override;
102 void loadScript(QXmlStreamReader &element, QString &error);
103 SieveGlobalVariableActionWidget::VariableElement loadSetVariable(QXmlStreamReader &element, QString &error);
109 SieveGlobalVariableLister *mGlobalVariableLister =
nullptr;
110 SieveHelpButton *mHelpButton =
nullptr;
QObject * parent() const const