File indexing completed on 2024-05-12 03:57:42
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_openurlevent_h__ 0010 #define __kparts_openurlevent_h__ 0011 0012 #include <QEvent> 0013 #include <kparts/openurlarguments.h> 0014 #include <memory> 0015 0016 class QUrl; 0017 0018 namespace KParts 0019 { 0020 class ReadOnlyPart; 0021 class OpenUrlEventPrivate; 0022 0023 /** 0024 * @class OpenUrlEvent openurlevent.h <KParts/OpenUrlEvent> 0025 * 0026 * @short The KParts::OpenUrlEvent event informs that a given part has opened a given URL. 0027 * Applications can use this event to send this information to interested plugins. 0028 * 0029 * The event should be sent before opening the URL in the part, so that the plugins 0030 * can use part()->url() to get the old URL. 0031 */ 0032 class KPARTS_EXPORT OpenUrlEvent : public QEvent 0033 { 0034 public: 0035 OpenUrlEvent(ReadOnlyPart *part, const QUrl &url, const OpenUrlArguments &args = OpenUrlArguments()); 0036 ~OpenUrlEvent() override; 0037 0038 ReadOnlyPart *part() const; 0039 QUrl url() const; 0040 OpenUrlArguments arguments() const; 0041 0042 static bool test(const QEvent *event); 0043 0044 private: 0045 const std::unique_ptr<OpenUrlEventPrivate> d; 0046 }; 0047 0048 } 0049 0050 #endif