File indexing completed on 2025-02-16 04:55:55

0001 /*
0002    SPDX-FileCopyrightText: 2013-2024 Laurent Montel <montel@kde.org>
0003 
0004    SPDX-License-Identifier: LGPL-2.0-or-later
0005 */
0006 #pragma once
0007 
0008 #include <QComboBox>
0009 
0010 namespace KSieveUi
0011 {
0012 class SieveEditorGraphicalModeWidget;
0013 class SelectMatchTypeComboBox : public QComboBox
0014 {
0015     Q_OBJECT
0016 public:
0017     explicit SelectMatchTypeComboBox(KSieveUi::SieveEditorGraphicalModeWidget *sieveGraphicalModeWidget, QWidget *parent = nullptr);
0018     ~SelectMatchTypeComboBox() override;
0019 
0020     [[nodiscard]] QString code(bool &negative) const;
0021     void setCode(const QString &code, const QString &name, QString &error);
0022 
0023     QStringList needRequires() const;
0024 Q_SIGNALS:
0025     void valueChanged();
0026     void switchToRegexp(bool useReg);
0027 
0028 private:
0029     void slotValueChanged(int val);
0030     void initialize();
0031     bool mHasRegexCapability = false;
0032 };
0033 }