File indexing completed on 2024-12-29 04:54:50
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 <QDialog> 0010 0011 class QLineEdit; 0012 class QPushButton; 0013 0014 namespace KSieveUi 0015 { 0016 class SieveTextEditWidget; 0017 class SieveTemplateEditDialog : public QDialog 0018 { 0019 Q_OBJECT 0020 public: 0021 explicit SieveTemplateEditDialog(QWidget *parent = nullptr, bool defaultTemplate = false); 0022 ~SieveTemplateEditDialog() override; 0023 0024 void setTemplateName(const QString &name); 0025 [[nodiscard]] QString templateName() const; 0026 0027 void setScript(const QString &); 0028 [[nodiscard]] QString script() const; 0029 void setSieveCapabilities(const QStringList &capabilities); 0030 0031 private: 0032 void slotTemplateChanged(); 0033 void readConfig(); 0034 void writeConfig(); 0035 SieveTextEditWidget *mTextEditWidget = nullptr; 0036 QLineEdit *mTemplateNameEdit = nullptr; 0037 QPushButton *mOkButton = nullptr; 0038 }; 0039 }