KParts

openurlevent.cpp
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
13using namespace KParts;
14
15class KParts::OpenUrlEventPrivate
16{
17public:
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
29const QEvent::Type openUrlEventType = (QEvent::Type)8958;
30OpenUrlEvent::OpenUrlEvent(ReadOnlyPart *part, const QUrl &url, const OpenUrlArguments &args)
31 : QEvent(openUrlEventType)
32 , d(new OpenUrlEventPrivate(part, url, args))
33{
34}
35
36OpenUrlEvent::~OpenUrlEvent() = default;
37
38ReadOnlyPart *OpenUrlEvent::part() const
39{
40 return d->m_part;
41}
42
43QUrl OpenUrlEvent::url() const
44{
45 return d->m_url;
46}
47
48OpenUrlArguments OpenUrlEvent::arguments() const
49{
50 return d->m_args;
51}
52
53bool OpenUrlEvent::test(const QEvent *event)
54{
55 return event->type() == openUrlEventType;
56}
OpenUrlArguments is the set of arguments that specify how a URL should be opened by KParts::ReadOnlyP...
Base class for any "viewer" part.
The KParts namespace,.
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Dec 20 2024 12:00:53 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.