umbrello 2.39.2 Umbrello UML Modeller is a Unified Modelling Language (UML) diagram program based on KDE Technology

- Main Page
- Related Pages
- Topics
- Namespaces
- Classes
- Files

- File List
- File Members

dontaskagain.h
Go to the documentation of this file.
1/*
2 SPDX-License-Identifier: GPL-2.0-or-later
3 SPDX-FileCopyrightText: 2018-2020 Umbrello UML Modeller Authors <umbrello-devel@kde.org>
4*/
5
6#ifndef DONTASKAGAIN_H
7#define DONTASKAGAIN_H
8
9// Qt includes
10#include <QList>
11#include <QString>
12#include <QWidget>
13
14// KDE includes
15#include <KLocalizedString>
16
17 class QVBoxLayout;
18
25 class DontAskAgainItem {
26 public:
27 DontAskAgainItem(const QString &name);
28 virtual ~DontAskAgainItem();
29 QString &name();
30 virtual QString text() const = 0;
31 bool isAll();
32 bool isEnabled();
33 void setEnabled(bool state = true);
34
35 protected:
36 QString m_name;
37};
38
39#define DefineDontAskAgainItem(name,key,_text) \
40 class DontAskAgainItem##name : public DontAskAgainItem \
41{ \
42 public: \
43 DontAskAgainItem##name() : DontAskAgainItem(QStringLiteral(key)) {} \
44 virtual QString text() const { return _text; } \
45}; \
46 static DontAskAgainItem##name name;
47
61 class DontAskAgainWidget : public QWidget
62{
63 Q_OBJECT
64 public:
65 DontAskAgainWidget(QList<DontAskAgainItem *> &items, QWidget *parent = 0);
66 bool apply();
67 void setDefaults();
68
69 protected:
70 void addItem(DontAskAgainItem *item);
71 QVBoxLayout *m_layout;
72 QList<DontAskAgainItem *> &m_items;
73
74 protected slots:
75 void slotToggled(bool state);
76};
77
102 class DontAskAgainHandler
103{
104 public:
105 void addItem(DontAskAgainItem *item);
106 static DontAskAgainHandler &instance();
107 DontAskAgainWidget *createWidget();
108 protected:
109 QList<DontAskAgainItem*> m_items;
110};
111
112#endif // DONTASKAGAIN_H
DontAskAgainHandler
Definition dontaskagain.h:103
DontAskAgainHandler::instance
static DontAskAgainHandler & instance()
Definition dontaskagain.cpp:133
DontAskAgainHandler::addItem
void addItem(DontAskAgainItem *item)
Definition dontaskagain.cpp:123
DontAskAgainHandler::createWidget
DontAskAgainWidget * createWidget()
Definition dontaskagain.cpp:128
DontAskAgainHandler::m_items
QList< DontAskAgainItem * > m_items
Definition dontaskagain.h:109
DontAskAgainItem
Definition dontaskagain.h:25
DontAskAgainItem::text
virtual QString text() const =0
DontAskAgainItem::~DontAskAgainItem
virtual ~DontAskAgainItem()
Definition dontaskagain.cpp:27
DontAskAgainItem::isAll
bool isAll()
Definition dontaskagain.cpp:36
DontAskAgainItem::setEnabled
void setEnabled(bool state=true)
Definition dontaskagain.cpp:46
DontAskAgainItem::name
QString & name()
Definition dontaskagain.cpp:31
DontAskAgainItem::isEnabled
bool isEnabled()
Definition dontaskagain.cpp:41
DontAskAgainItem::DontAskAgainItem
DontAskAgainItem(const QString &name)
Definition dontaskagain.cpp:21
DontAskAgainItem::m_name
QString m_name
Definition dontaskagain.h:36
DontAskAgainWidget
Definition dontaskagain.h:62
DontAskAgainWidget::m_items
QList< DontAskAgainItem * > & m_items
Definition dontaskagain.h:72
DontAskAgainWidget::slotToggled
void slotToggled(bool state)
Definition dontaskagain.cpp:108
DontAskAgainWidget::addItem
void addItem(DontAskAgainItem *item)
Definition dontaskagain.cpp:99
DontAskAgainWidget::apply
bool apply()
Definition dontaskagain.cpp:69
DontAskAgainWidget::DontAskAgainWidget
DontAskAgainWidget(QList< DontAskAgainItem * > &items, QWidget *parent=0)
Definition dontaskagain.cpp:56
DontAskAgainWidget::m_layout
QVBoxLayout * m_layout
Definition dontaskagain.h:71
DontAskAgainWidget::setDefaults
void setDefaults()
Definition dontaskagain.cpp:88