Libksieve

sievetemplatewidget.h
1/*
2 SPDX-FileCopyrightText: 2013-2024 Laurent Montel <montel@kde.org>
3
4 SPDX-License-Identifier: LGPL-2.0-or-later
5*/
6
7#pragma once
8
9#include <PimCommon/TemplateListWidget>
10
11namespace PimCommon
12{
13class TemplateManager;
14}
15
16namespace KSieveUi
17{
18class SieveTemplateListWidget : public PimCommon::TemplateListWidget
19{
21public:
22 explicit SieveTemplateListWidget(const QString &configName, QWidget *parent = nullptr);
23 ~SieveTemplateListWidget() override;
24
25 [[nodiscard]] QList<PimCommon::defaultTemplate> defaultTemplates() override;
26 [[nodiscard]] bool addNewTemplate(QString &templateName, QString &templateScript) override;
27 [[nodiscard]] bool modifyTemplate(QString &templateName, QString &templateScript, bool defaultTemplate) override;
28 void setSieveCapabilities(const QStringList &capabilities);
29
30protected:
31 QMimeData *mimeData(const QList<QListWidgetItem *> &items) const override;
32
33private:
34 QStringList mCapabilities;
35 PimCommon::TemplateManager *mTemplateManager = nullptr;
36};
37
38class SieveTemplateWidget : public QWidget
39{
41public:
42 explicit SieveTemplateWidget(const QString &title, QWidget *parent = nullptr);
43 ~SieveTemplateWidget() override;
44
45 void setSieveCapabilities(const QStringList &capabilities);
47 void insertTemplate(const QString &);
48
49private:
50 SieveTemplateListWidget *mListTemplate = nullptr;
51};
52}
QList< QListWidgetItem * > items(const QMimeData *data) const const
Q_OBJECTQ_OBJECT
Q_SIGNALSQ_SIGNALS
QObject * parent() const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Dec 21 2024 16:57:10 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.