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 
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 }
Base class for any "viewer" part.
Definition: readonlypart.h:51
OpenUrlArguments is the set of arguments that specify how a URL should be opened by KParts::ReadOnlyP...
The KParts namespace,.
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Thu Feb 15 2024 03:48:58 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.