Libksieve

selectflagswidget.h
1 /*
2  SPDX-FileCopyrightText: 2013-2021 Laurent Montel <[email protected]>
3 
4  SPDX-License-Identifier: LGPL-2.0-or-later
5 */
6 #pragma once
7 
8 #include <QDialog>
9 #include <QListWidget>
10 class QLineEdit;
11 
12 namespace KSieveUi
13 {
14 class SelectFlagsListWidget : public QListWidget
15 {
16  Q_OBJECT
17 public:
18  explicit SelectFlagsListWidget(QWidget *parent = nullptr);
19  ~SelectFlagsListWidget() override;
20 
21  void setFlags(const QStringList &list);
22  Q_REQUIRED_RESULT QStringList flags() const;
23 
24 private:
25  enum Type { FlagsRealName = Qt::UserRole + 1 };
26  void init();
27 };
28 
29 class SelectFlagsListDialog : public QDialog
30 {
31  Q_OBJECT
32 public:
33  explicit SelectFlagsListDialog(QWidget *parent = nullptr);
34  ~SelectFlagsListDialog();
35 
36  void setFlags(const QStringList &list);
37  Q_REQUIRED_RESULT QStringList flags() const;
38 
39 private:
40  void readConfig();
41  void writeConfig();
42  SelectFlagsListWidget *const mListWidget;
43 };
44 
45 class SelectFlagsWidget : public QWidget
46 {
47  Q_OBJECT
48 public:
49  explicit SelectFlagsWidget(QWidget *parent = nullptr);
50  ~SelectFlagsWidget();
51 
52  Q_REQUIRED_RESULT QString code() const;
53  void setFlags(const QStringList &flags);
54 
55 Q_SIGNALS:
56  void valueChanged();
57 
58 private:
59  void slotSelectFlags();
60  QLineEdit *mEdit = nullptr;
61 };
62 }
63 
KCRASH_EXPORT void setFlags(KCrash::CrashFlags flags)
Q_OBJECTQ_OBJECT
UserRole
QCA_EXPORT void init()
void readConfig()
This file is part of the KDE documentation.
Documentation copyright © 1996-2021 The KDE developers.
Generated on Fri Apr 16 2021 23:09:33 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.