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

0001 /*
0002    SPDX-FileCopyrightText: 2015-2024 Laurent Montel <montel@kde.org>
0003 
0004    SPDX-License-Identifier: LGPL-2.0-or-later
0005 */
0006 
0007 #pragma once
0008 
0009 #include "ksieveui_private_export.h"
0010 #include <QDialog>
0011 
0012 class QPushButton;
0013 namespace KSieveUi
0014 {
0015 class SieveScriptDebuggerWidget;
0016 class KSIEVEUI_TESTS_EXPORT SieveScriptDebuggerDialog : public QDialog
0017 {
0018     Q_OBJECT
0019 public:
0020     explicit SieveScriptDebuggerDialog(QWidget *parent = nullptr);
0021     ~SieveScriptDebuggerDialog() override;
0022 
0023     void setScript(const QString &script);
0024     [[nodiscard]] QString script() const;
0025 
0026 private:
0027     void slotScriptTextChanged();
0028     void slotAccepted();
0029     void writeConfig();
0030     void readConfig();
0031     void debugButtonEnableStateChanged(bool state);
0032     void updateButtons();
0033     QString mOriginScript;
0034     SieveScriptDebuggerWidget *mSieveScriptDebuggerWidget = nullptr;
0035     QPushButton *mOkButton = nullptr;
0036     QPushButton *mDebugScriptButton = nullptr;
0037 };
0038 }