File indexing completed on 2021-12-21 12:34:04

0001 /*  This file is part of the KDE libraries
0002     Copyright (C) 2006 Michaël Larouche <michael.larouche@kdemail.net>
0003 
0004     This library is free software; you can redistribute it and/or
0005     modify it under the terms of the GNU Library General Public
0006     License as published by the Free Software Foundation; version 2
0007     of the License.
0008 
0009     This library is distributed in the hope that it will be useful,
0010     but WITHOUT ANY WARRANTY; without even the implied warranty of
0011     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
0012     Library General Public License for more details.
0013 
0014     You should have received a copy of the GNU Library General Public License
0015     along with this library; see the file COPYING.LIB.  If not, write to
0016     the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
0017     Boston, MA 02110-1301, USA.
0018 */
0019 #ifndef KDEUI_KMESSAGEBOXMESSAGEHANDLER_H
0020 #define KDEUI_KMESSAGEBOXMESSAGEHANDLER_H
0021 
0022 #include <kdelibs4support_export.h>
0023 #include <kmessage.h>
0024 
0025 #include <QObject>
0026 
0027 class QWidget;
0028 class KMessageBoxMessageHandlerPrivate;
0029 /**
0030  * @brief This is a convience KMessageHandler that use KMessageBox.
0031  *
0032  * @author Michaël Larouche <michael.larouche@kdemail.net>
0033 */
0034 class KDELIBS4SUPPORT_DEPRECATED_EXPORT KMessageBoxMessageHandler : public QObject, public KMessageHandler
0035 {
0036     Q_OBJECT
0037 public:
0038     /**
0039      * @brief Create a new KMessageBoxMessageHandler
0040      * @param parent Parent widget to use for the KMessageBox.
0041      */
0042     KDELIBS4SUPPORT_DEPRECATED explicit KMessageBoxMessageHandler(QWidget *parent = nullptr);
0043 
0044     /**
0045      * Destroys the KMessageBoxMessageHandler.
0046      */
0047     ~KMessageBoxMessageHandler() override;
0048 
0049     /**
0050      * @copydoc KMessageHandler::message
0051      */
0052     void message(KMessage::MessageType messageType, const QString &text, const QString &caption) override;
0053 
0054 private:
0055     KMessageBoxMessageHandlerPrivate *const d;
0056 };
0057 
0058 #endif