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 KParts::PartActivateEvent
24 * \inheaderfile KParts/PartActivateEvent
25 * \inmodule KParts
26 *
27 * \brief This event is sent by the part manager when the active part changes.
28 *
29 * Each time the active part changes, it will send first a PartActivateEvent
30 * with activated=false, part=oldActivePart, widget=oldActiveWidget
31 * and then another PartActivateEvent
32 * with activated=true, part=newPart, widget=newWidget.
33 * \sa KParts::Part::partActivateEvent
34 */
35class KPARTS_EXPORT PartActivateEvent : public QEvent
36{
37public:
38 /*!
39 *
40 */
41 PartActivateEvent(bool activated, Part *part, QWidget *widget);
42 ~PartActivateEvent() override;
43
44 /*!
45 *
46 */
47 bool activated() const;
48
49 /*!
50 *
51 */
52 Part *part() const;
53
54 /*!
55 *
56 */
57 QWidget *widget() const;
58
59 /*!
60 *
61 */
62 static bool test(const QEvent *event);
63
64private:
65 const std::unique_ptr<PartActivateEventPrivate> d;
66};
67
68} // namespace
69
70#endif
71

source code of kparts/src/partactivateevent.h