File indexing completed on 2024-04-28 15:29:21

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 <kparts/event.h>
0012 
0013 namespace KParts
0014 {
0015 class Part;
0016 
0017 class PartActivateEventPrivate;
0018 /**
0019  * @class PartActivateEvent partactivateevent.h <KParts/PartActivateEvent>
0020  *
0021  * @short This event is sent by the part manager when the active part changes.
0022  * Each time the active part changes, it will send first a PartActivateEvent
0023  * with activated=false, part=oldActivePart, widget=oldActiveWidget
0024  * and then another PartActivateEvent
0025  * with activated=true, part=newPart, widget=newWidget.
0026  * @see KParts::Part::partActivateEvent
0027  */
0028 class KPARTS_EXPORT PartActivateEvent : public Event
0029 {
0030 public:
0031     PartActivateEvent(bool activated, Part *part, QWidget *widget);
0032     ~PartActivateEvent() override;
0033     bool activated() const;
0034 
0035     Part *part() const;
0036     QWidget *widget() const;
0037 
0038     static bool test(const QEvent *event);
0039 
0040 private:
0041     Q_DECLARE_PRIVATE_D(Event::d, PartActivateEvent)
0042 #if KPARTS_BUILD_DEPRECATED_SINCE(5, 79)
0043     QT_WARNING_PUSH
0044     QT_WARNING_DISABLE_CLANG("-Wunused-private-field")
0045     // Unused, kept for ABI compatibility
0046     const void *__kparts_d_do_not_use;
0047     QT_WARNING_POP
0048 #endif
0049 };
0050 
0051 } // namespace
0052 
0053 #endif