File indexing completed on 2024-04-21 14:55:52

0001 /*  This file is part of the KDE Libraries
0002  *  Copyright (C) 1998 Thomas Tanghus (tanghus@earthling.net)
0003  *  Additions 1999-2000 by Espen Sand (espen@kde.org)
0004  *                      and Holger Freyther <freyther@kde.org>
0005  *            2005-2006   Olivier Goffart <ogoffart @ kde.org>
0006  *            2006      Tobias Koenig <tokoe@kde.org>
0007  *
0008  *  This library is free software; you can redistribute it and/or
0009  *  modify it under the terms of the GNU Library General Public
0010  *  License as published by the Free Software Foundation; either
0011  *  version 2 of the License, or (at your option) any later version.
0012  *
0013  *  This library is distributed in the hope that it will be useful,
0014  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
0015  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
0016  *  Library General Public License for more details.
0017  *
0018  *  You should have received a copy of the GNU Library General Public License
0019  *  along with this library; see the file COPYING.LIB.  If not, write to
0020  *  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
0021  *  Boston, MA 02110-1301, USA.
0022  */
0023 
0024 #ifndef KDIALOGQUEUE_H
0025 #define KDIALOGQUEUE_H
0026 
0027 #include <QDialog>
0028 
0029 /**
0030  * \brief Queue for showing modal dialogs one after the other.
0031  *
0032  * This is useful if you want to show a modal dialog but are not in the
0033  * position to start a new event loop at that point in your code.
0034  *
0035  * The disadvantage is that you will not be able to get any information from
0036  * the dialog, so it can currently only be used for simple dialogs.
0037  *
0038  * You probably want to use KMessageBox::queueMessageBox() instead
0039  * of this class directly.
0040  *
0041  * @author Waldo Bastian <bastian@kde.org>
0042  */
0043 class KDialogQueue : public QObject
0044 {
0045     Q_OBJECT
0046 
0047 public:
0048     static void queueDialog(QDialog *);
0049 
0050     ~KDialogQueue() override;
0051 
0052 protected:
0053     KDialogQueue();
0054     static KDialogQueue *self();
0055     friend class KDialogQueueSingleton;
0056 
0057 private:
0058     Q_PRIVATE_SLOT(d, void slotShowQueuedDialog())
0059 
0060 private:
0061     class Private;
0062     friend class Private;
0063     Private *const d;
0064 
0065     Q_DISABLE_COPY(KDialogQueue)
0066 };
0067 
0068 #endif
0069