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 
0009 #ifndef __kparts_openurlevent_h__
0010 #define __kparts_openurlevent_h__
0011 
0012 #include <kparts/browserarguments.h>
0013 #include <kparts/event.h>
0014 #include <kparts/openurlarguments.h>
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 Event
0033 {
0034 public:
0035     OpenUrlEvent(ReadOnlyPart *part,
0036                  const QUrl &url,
0037                  const OpenUrlArguments &args = OpenUrlArguments(),
0038                  const BrowserArguments &browserArgs = BrowserArguments());
0039     ~OpenUrlEvent() override;
0040 
0041     ReadOnlyPart *part() const;
0042     QUrl url() const;
0043     OpenUrlArguments arguments() const;
0044     BrowserArguments browserArguments() const;
0045 
0046     static bool test(const QEvent *event);
0047 
0048 private:
0049     Q_DECLARE_PRIVATE_D(Event::d, OpenUrlEvent)
0050 #if KPARTS_BUILD_DEPRECATED_SINCE(5, 79)
0051     QT_WARNING_PUSH
0052     QT_WARNING_DISABLE_CLANG("-Wunused-private-field")
0053     // Unused, kept for ABI compatibility
0054     const void *__kparts_d_do_not_use;
0055     QT_WARNING_POP
0056 #endif
0057 };
0058 
0059 }
0060 
0061 #endif