1 /*
2     SPDX-FileCopyrightText: 1998-2008 Sebastian Trueg <trueg@k3b.org>
3 
4     SPDX-License-Identifier: GPL-2.0-or-later
5 */
6 
7 #ifndef _K3B_MULTI_CHOICE_DIALOG_H_
8 #define _K3B_MULTI_CHOICE_DIALOG_H_
9 
10 #include "k3b_export.h"
11 
12 #include <KStandardGuiItem>
13 #include <QDialog>
14 #include <QMessageBox>
15 
16 class QCloseEvent;
17 
18 namespace K3b {
19     class LIBK3B_EXPORT MultiChoiceDialog : public QDialog
20     {
21         Q_OBJECT
22 
23     public:
24         MultiChoiceDialog( const QString& caption,
25                            const QString& text,
26                            QMessageBox::Icon = QMessageBox::Information,
27                            QWidget* parent = 0 );
28         ~MultiChoiceDialog() override;
29 
30         /**
31          * Adds a new button. returns it's number starting at 1.
32          */
33         int addButton( const KGuiItem& );
34 
35         static int choose( const QString& caption,
36                            const QString& text,
37                            QMessageBox::Icon = QMessageBox::Information,
38                            QWidget* parent = 0,
39                            int buttonCount = 2,
40                            const KGuiItem& b1 = KStandardGuiItem::yes(),
41                            const KGuiItem& b2 = KStandardGuiItem::no(),
42                            const KGuiItem& b3 = KStandardGuiItem::no(),
43                            const KGuiItem& b4 = KStandardGuiItem::no(),
44                            const KGuiItem& b5 = KStandardGuiItem::no(),
45                            const KGuiItem& b6 = KStandardGuiItem::no() );
46 
47     public Q_SLOTS:
48         /**
49          * returns the number of the clicked button starting at 1.
50          */
51         int exec() override;
52 
53     private Q_SLOTS:
54         void slotButtonClicked( int );
55 
56     private:
57         void closeEvent( QCloseEvent* ) override;
58 
59         class Private;
60         Private* d;
61     };
62 }
63 
64 #endif
65