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 <QWidget> 0011 0012 namespace TextCustomEditor 0013 { 0014 class PlainTextEditorWidget; 0015 } 0016 class KUrlRequester; 0017 class QProcess; 0018 class QLineEdit; 0019 class QSplitter; 0020 namespace KSieveUi 0021 { 0022 class SieveTextEditWidget; 0023 class SieveScriptDebuggerWarning; 0024 class KSIEVEUI_TESTS_EXPORT SieveScriptDebuggerFrontEndWidget : public QWidget 0025 { 0026 Q_OBJECT 0027 public: 0028 explicit SieveScriptDebuggerFrontEndWidget(QWidget *parent = nullptr); 0029 ~SieveScriptDebuggerFrontEndWidget() override; 0030 0031 [[nodiscard]] QString script() const; 0032 void setScript(const QString &script); 0033 [[nodiscard]] bool canAccept() const; 0034 0035 [[nodiscard]] QList<int> splitterSizes() const; 0036 void setSplitterSizes(const QList<int> &sizes); 0037 0038 Q_SIGNALS: 0039 void scriptTextChanged(); 0040 void debugScriptButtonClicked(); 0041 void debugButtonEnabled(bool state); 0042 0043 private Q_SLOTS: 0044 void slotDebugScript(); 0045 void slotEmailChanged(const QString &text); 0046 void slotReadStandardOutput(); 0047 void slotReadErrorOutput(); 0048 void slotDebugFinished(); 0049 void slotScriptTextChanged(); 0050 0051 private: 0052 void updateDebugButton(); 0053 KSieveUi::SieveTextEditWidget *mSieveTextEditWidget = nullptr; 0054 KSieveUi::SieveScriptDebuggerWarning *mSieveScriptDebuggerWarning = nullptr; 0055 TextCustomEditor::PlainTextEditorWidget *mSieveTestResult = nullptr; 0056 KUrlRequester *mEmailPath = nullptr; 0057 QProcess *mProcess = nullptr; 0058 QLineEdit *mExtension = nullptr; 0059 QSplitter *mSplitter = nullptr; 0060 }; 0061 }