File indexing completed on 2024-05-12 07:51:58

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 #ifndef __kparts_partactivateevent_h__
0009 #define __kparts_partactivateevent_h__
0010 
0011 #include <QEvent>
0012 #include <kparts/kparts_export.h>
0013 #include <memory>
0014 
0015 class QWidget;
0016 
0017 namespace KParts
0018 {
0019 class Part;
0020 
0021 class PartActivateEventPrivate;
0022 /**
0023  * @class PartActivateEvent partactivateevent.h <KParts/PartActivateEvent>
0024  *
0025  * @short This event is sent by the part manager when the active part changes.
0026  * Each time the active part changes, it will send first a PartActivateEvent
0027  * with activated=false, part=oldActivePart, widget=oldActiveWidget
0028  * and then another PartActivateEvent
0029  * with activated=true, part=newPart, widget=newWidget.
0030  * @see KParts::Part::partActivateEvent
0031  */
0032 class KPARTS_EXPORT PartActivateEvent : public QEvent
0033 {
0034 public:
0035     PartActivateEvent(bool activated, Part *part, QWidget *widget);
0036     ~PartActivateEvent() override;
0037     bool activated() const;
0038 
0039     Part *part() const;
0040     QWidget *widget() const;
0041 
0042     static bool test(const QEvent *event);
0043 
0044 private:
0045     const std::unique_ptr<PartActivateEventPrivate> d;
0046 };
0047 
0048 } // namespace
0049 
0050 #endif