File indexing completed on 2024-12-29 04:54:46

0001 /*
0002    SPDX-FileCopyrightText: 2013-2024 Laurent Montel <montel@kde.org>
0003 
0004    SPDX-License-Identifier: LGPL-2.0-or-later
0005 */
0006 
0007 #pragma once
0008 
0009 #include <QWidget>
0010 
0011 namespace KSieveUi
0012 {
0013 class SieveWidgetPageAbstract : public QWidget
0014 {
0015     Q_OBJECT
0016 public:
0017     enum PageType { BlockIf = 0, BlockElsIf = 1, BlockElse = 2, Include = 3, ForEveryPart = 4, GlobalVariable = 5 };
0018 
0019     explicit SieveWidgetPageAbstract(QWidget *parent = nullptr);
0020     ~SieveWidgetPageAbstract() override;
0021 
0022     virtual void generatedScript(QString &script, QStringList &required, bool inForEveryPartLoop) = 0;
0023 
0024     virtual void setPageType(PageType type);
0025     [[nodiscard]] PageType pageType() const;
0026 
0027 Q_SIGNALS:
0028     void valueChanged();
0029 
0030 private:
0031     PageType mType = BlockIf;
0032 };
0033 }