File indexing completed on 2024-04-28 15:29:20
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_event_h__ 0010 #define __kparts_event_h__ 0011 0012 #include <kparts/kparts_export.h> 0013 0014 #include <QEvent> 0015 #include <memory> 0016 0017 class QWidget; 0018 0019 namespace KParts 0020 { 0021 class EventPrivate; 0022 /** 0023 * @class Event event.h <KParts/Event> 0024 * 0025 * @short Base class for all KParts events. 0026 */ 0027 class KPARTS_EXPORT Event : public QEvent 0028 { 0029 public: 0030 Event(const char *eventName); 0031 ~Event() override; 0032 virtual const char *eventName() const; 0033 0034 static bool test(const QEvent *event); 0035 static bool test(const QEvent *event, const char *name); 0036 0037 protected: 0038 explicit Event(EventPrivate &dd); 0039 0040 private: 0041 friend class GUIActivateEvent; 0042 friend class OpenUrlEvent; 0043 friend class PartActivateEvent; 0044 friend class PartSelectEvent; 0045 Q_DECLARE_PRIVATE_D(d, Event) 0046 std::unique_ptr<class EventPrivate> const d; 0047 // KF6 TODO: change private d to protected d_ptr, use normal Q_DECLARE_PRIVATE, remove friend 0048 }; 0049 0050 } // namespace 0051 0052 #endif