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

0001 /* SPDX-FileCopyrightText: 2013-2024 Laurent Montel <montel@kde.org>
0002  *
0003  * SPDX-License-Identifier: LGPL-2.0-or-later
0004  */
0005 
0006 #pragma once
0007 
0008 #include "ksieveui_private_export.h"
0009 #include <KSieveCore/SieveImapAccountSettings>
0010 #include <QWidget>
0011 namespace KSieveUi
0012 {
0013 class KSIEVEUI_TESTS_EXPORT SieveEditorAbstractWidget : public QWidget
0014 {
0015     Q_OBJECT
0016 public:
0017     explicit SieveEditorAbstractWidget(QWidget *parent = nullptr);
0018     ~SieveEditorAbstractWidget() override;
0019 
0020     [[nodiscard]] virtual QString currentscript();
0021     virtual void setImportScript(const QString &);
0022     void saveAs(const QString &defaultName);
0023 
0024     [[nodiscard]] KSieveCore::SieveImapAccountSettings sieveImapAccountSettings() const;
0025 
0026     void setSieveImapAccountSettings(const KSieveCore::SieveImapAccountSettings &sieveImapAccountSettings);
0027 
0028 public Q_SLOTS:
0029     void slotImport();
0030 
0031 protected:
0032     KSieveCore::SieveImapAccountSettings mSieveImapAccountSettings;
0033 
0034 private:
0035     bool loadFromFile(const QString &filename);
0036 };
0037 }