File indexing completed on 2024-06-16 07:42:27

0001 /*
0002     SPDX-FileCopyrightText: 1998-2008 Sebastian Trueg <trueg@k3b.org>
0003 
0004     SPDX-License-Identifier: GPL-2.0-or-later
0005 */
0006 
0007 #ifndef _K3B_MULTI_CHOICE_DIALOG_H_
0008 #define _K3B_MULTI_CHOICE_DIALOG_H_
0009 
0010 #include "k3b_export.h"
0011 
0012 #include <KStandardGuiItem>
0013 #include <QDialog>
0014 #include <QMessageBox>
0015 
0016 class QCloseEvent;
0017 
0018 namespace K3b {
0019     class LIBK3B_EXPORT MultiChoiceDialog : public QDialog
0020     {
0021         Q_OBJECT
0022 
0023     public:
0024         MultiChoiceDialog( const QString& caption,
0025                            const QString& text,
0026                            QMessageBox::Icon = QMessageBox::Information,
0027                            QWidget* parent = 0 );
0028         ~MultiChoiceDialog() override;
0029 
0030         /**
0031          * Adds a new button. returns it's number starting at 1.
0032          */
0033         int addButton( const KGuiItem& );
0034 
0035         static int choose( const QString& caption,
0036                            const QString& text,
0037                            QMessageBox::Icon = QMessageBox::Information,
0038                            QWidget* parent = 0,
0039                            int buttonCount = 2,
0040                            const KGuiItem& b1 = KStandardGuiItem::ok(),
0041                            const KGuiItem& b2 = KStandardGuiItem::cancel(),
0042                            const KGuiItem& b3 = KStandardGuiItem::cancel(),
0043                            const KGuiItem& b4 = KStandardGuiItem::cancel(),
0044                            const KGuiItem& b5 = KStandardGuiItem::cancel(),
0045                            const KGuiItem& b6 = KStandardGuiItem::cancel() );
0046 
0047     public Q_SLOTS:
0048         /**
0049          * returns the number of the clicked button starting at 1.
0050          */
0051         int exec() override;
0052 
0053     private Q_SLOTS:
0054         void slotButtonClicked( int );
0055 
0056     private:
0057         void closeEvent( QCloseEvent* ) override;
0058 
0059         class Private;
0060         Private* d;
0061     };
0062 }
0063 
0064 #endif