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

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 "ksieveui_export.h"
0010 
0011 #include <QDialog>
0012 namespace KSieveCore
0013 {
0014 class SieveImapAccountSettings;
0015 }
0016 namespace KSieveUi
0017 {
0018 class SieveEditorGraphicalModeWidget;
0019 /**
0020  * @brief The AutoCreateScriptDialog class
0021  * @author Laurent Montel <montel@kde.org>
0022  */
0023 class KSIEVEUI_EXPORT AutoCreateScriptDialog : public QDialog
0024 {
0025     Q_OBJECT
0026 public:
0027     explicit AutoCreateScriptDialog(QWidget *parent = nullptr);
0028     ~AutoCreateScriptDialog() override;
0029 
0030     [[nodiscard]] QString script(QStringList &required) const;
0031     void setSieveCapabilities(const QStringList &capabilities);
0032     void setListOfIncludeFile(const QStringList &listOfIncludeFile);
0033 
0034     void loadScript(const QString &doc, QString &error);
0035 
0036     void setSieveImapAccountSettings(const KSieveCore::SieveImapAccountSettings &sieveImapAccountSettings);
0037 
0038 protected:
0039     bool event(QEvent *e) override;
0040 
0041 private:
0042     KSIEVEUI_NO_EXPORT void readConfig();
0043     KSIEVEUI_NO_EXPORT void writeConfig();
0044 
0045 private:
0046     SieveEditorGraphicalModeWidget *const mEditor;
0047 };
0048 }