File indexing completed on 2025-01-19 04:56:59
0001 /* 0002 * SPDX-FileCopyrightText: 2014 David Faure <faure@kde.org> 0003 * SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL 0004 */ 0005 0006 0007 #ifndef MESSAGEBOX_STUB_H 0008 #define MESSAGEBOX_STUB_H 0009 0010 #include "widgets/messageboxinterface.h" 0011 0012 class MessageBoxStub : public Widgets::MessageBoxInterface 0013 { 0014 public: 0015 typedef QSharedPointer<MessageBoxStub> Ptr; 0016 0017 MessageBoxStub() : m_called(false) {} 0018 0019 QMessageBox::Button askConfirmation(QWidget *, const QString &, const QString &) override { 0020 m_called = true; 0021 return QMessageBox::Yes; 0022 } 0023 0024 bool called() const { return m_called; } 0025 0026 private: 0027 bool m_called; 0028 }; 0029 0030 #endif