Libksieve

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

KDE's Doxygen guidelines are available online.