Libksieve

sievescriptblockwidget.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 "sieveglobalvariablewidget.h"
10 #include "sievewidgetpageabstract.h"
11 
12 class QRadioButton;
13 class QGroupBox;
14 class QAbstractButton;
15 class QComboBox;
16 class QPushButton;
17 class QXmlStreamReader;
18 
19 namespace KSieveUi
20 {
21 class SieveConditionWidgetLister;
22 class SieveActionWidgetLister;
23 class SieveEditorGraphicalModeWidget;
24 
25 class SieveScriptBlockWidget : public SieveWidgetPageAbstract
26 {
27  Q_OBJECT
28 public:
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  Q_REQUIRED_RESULT MatchCondition matchCondition() const;
39 
40  void loadScript(QXmlStreamReader &element, bool onlyActions, QString &error);
41 
42  void loadLocalVariable(const SieveGlobalVariableActionWidget::VariableElement &var);
43 Q_SIGNALS:
44  void addNewBlock(QWidget *widget, KSieveUi::SieveWidgetPageAbstract::PageType type);
45 
46 private:
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 }
63 
Q_SIGNALSQ_SIGNALS
Q_OBJECTQ_OBJECT
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.