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 | |
9 | #include "openurlevent.h" |
10 | |
11 | #include <QUrl> |
12 | |
13 | using namespace KParts; |
14 | |
15 | class KParts::OpenUrlEventPrivate |
16 | { |
17 | public: |
18 | OpenUrlEventPrivate(ReadOnlyPart *part, const QUrl &url, const OpenUrlArguments &args) |
19 | : m_part(part) |
20 | , m_url(url) |
21 | , m_args(args) |
22 | { |
23 | } |
24 | ReadOnlyPart *const m_part; |
25 | const QUrl m_url; |
26 | const OpenUrlArguments m_args; |
27 | }; |
28 | |
29 | const QEvent::Type openUrlEventType = (QEvent::Type)8958; |
30 | OpenUrlEvent::OpenUrlEvent(ReadOnlyPart *part, const QUrl &url, const OpenUrlArguments &args) |
31 | : QEvent(openUrlEventType) |
32 | , d(new OpenUrlEventPrivate(part, url, args)) |
33 | { |
34 | } |
35 | |
36 | OpenUrlEvent::~OpenUrlEvent() = default; |
37 | |
38 | ReadOnlyPart *OpenUrlEvent::part() const |
39 | { |
40 | return d->m_part; |
41 | } |
42 | |
43 | QUrl OpenUrlEvent::url() const |
44 | { |
45 | return d->m_url; |
46 | } |
47 | |
48 | OpenUrlArguments OpenUrlEvent::arguments() const |
49 | { |
50 | return d->m_args; |
51 | } |
52 | |
53 | bool OpenUrlEvent::test(const QEvent *event) |
54 | { |
55 | return event->type() == openUrlEventType; |
56 | } |
57 |