File indexing completed on 2024-05-19 03:59:07

0001 /*
0002     This file is part of the KDE project
0003     SPDX-FileCopyrightText: 1999 Simon Hausmann <hausmann@kde.org>
0004     SPDX-FileCopyrightText: 1999 David Faure <faure@kde.org>
0005 
0006     SPDX-License-Identifier: LGPL-2.0-or-later
0007 */
0008 
0009 #ifndef __kparts_guiactivateevent_h__
0010 #define __kparts_guiactivateevent_h__
0011 
0012 #include <QEvent>
0013 #include <memory>
0014 
0015 #include <kparts/kparts_export.h>
0016 
0017 namespace KParts
0018 {
0019 class GUIActivateEventPrivate;
0020 /**
0021  * @class GUIActivateEvent guiactivateevent.h <KParts/GUIActivateEvent>
0022  *
0023  * @short This event is sent to a Part when its GUI has been activated or deactivated.
0024  * This is related to PartActivateEvent, but the difference is that
0025  * GUIActivateEvent happens later (when the GUI is actually built),
0026  * only for parts that have GUI elements, and only if using KParts::MainWindow.
0027  * @see KParts::Part::guiActivateEvent()
0028  */
0029 class KPARTS_EXPORT GUIActivateEvent : public QEvent
0030 {
0031 public:
0032     GUIActivateEvent(bool activated);
0033     ~GUIActivateEvent() override;
0034 
0035     bool activated() const;
0036 
0037     static bool test(const QEvent *event);
0038 
0039 private:
0040     const std::unique_ptr<GUIActivateEventPrivate> d;
0041 };
0042 
0043 } // namespace
0044 
0045 #endif