1/*
2 This file is part of the KDE project
3 SPDX-FileCopyrightText: 1999 Simon Hausmann <hausmann@kde.org>
4 SPDX-FileCopyrightText: 1999 David Faure <faure@kde.org>
5
6 SPDX-License-Identifier: LGPL-2.0-or-later
7*/
8#ifndef __kparts_partactivateevent_h__
9#define __kparts_partactivateevent_h__
10
11#include <QEvent>
12#include <kparts/kparts_export.h>
13#include <memory>
14
15class QWidget;
16
17namespace KParts
18{
19class Part;
20
21class PartActivateEventPrivate;
22/**
23 * @class PartActivateEvent partactivateevent.h <KParts/PartActivateEvent>
24 *
25 * @short This event is sent by the part manager when the active part changes.
26 * Each time the active part changes, it will send first a PartActivateEvent
27 * with activated=false, part=oldActivePart, widget=oldActiveWidget
28 * and then another PartActivateEvent
29 * with activated=true, part=newPart, widget=newWidget.
30 * @see KParts::Part::partActivateEvent
31 */
32class KPARTS_EXPORT PartActivateEvent : public QEvent
33{
34public:
35 PartActivateEvent(bool activated, Part *part, QWidget *widget);
36 ~PartActivateEvent() override;
37 bool activated() const;
38
39 Part *part() const;
40 QWidget *widget() const;
41
42 static bool test(const QEvent *event);
43
44private:
45 const std::unique_ptr<PartActivateEventPrivate> d;
46};
47
48} // namespace
49
50#endif
51

source code of kparts/src/partactivateevent.h