Libksieve

selectflagswidget.h
1/*
2 SPDX-FileCopyrightText: 2013-2024 Laurent Montel <montel@kde.org>
3
4 SPDX-License-Identifier: LGPL-2.0-or-later
5*/
6#pragma once
7
8#include <QDialog>
9#include <QListWidget>
10class QLineEdit;
11
12namespace KSieveUi
13{
14class SelectFlagsListWidget : public QListWidget
15{
17public:
18 explicit SelectFlagsListWidget(QWidget *parent = nullptr);
19 ~SelectFlagsListWidget() override;
20
21 void setFlags(const QStringList &list);
22 [[nodiscard]] QStringList flags() const;
23
24private:
25 enum Type {
26 FlagsRealName = Qt::UserRole + 1
27 };
28 void init();
29};
30
31class SelectFlagsListDialog : public QDialog
32{
34public:
35 explicit SelectFlagsListDialog(QWidget *parent = nullptr);
36 ~SelectFlagsListDialog() override;
37
38 void setFlags(const QStringList &list);
39 [[nodiscard]] QStringList flags() const;
40
41private:
42 void readConfig();
43 void writeConfig();
44 SelectFlagsListWidget *const mListWidget;
45};
46
47class SelectFlagsWidget : public QWidget
48{
50public:
51 explicit SelectFlagsWidget(QWidget *parent = nullptr);
52 ~SelectFlagsWidget() override;
53
54 [[nodiscard]] QString code() const;
55 void setFlags(const QStringList &flags);
56
58 void valueChanged();
59
60private:
61 void slotSelectFlags();
62 QLineEdit *mEdit = nullptr;
63};
64}
Q_OBJECTQ_OBJECT
Q_SIGNALSQ_SIGNALS
QObject * parent() const const
UserRole
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.