KParts

openurlevent.cpp
1 /*
2  This file is part of the KDE project
3  SPDX-FileCopyrightText: 1999 Simon Hausmann <[email protected]>
4  SPDX-FileCopyrightText: 1999 David Faure <[email protected]>
5 
6  SPDX-License-Identifier: LGPL-2.0-or-later
7 */
8 
9 #include "openurlevent.h"
10 #include "event_p.h"
11 
12 #include <QUrl>
13 
14 using namespace KParts;
15 
16 class KParts::OpenUrlEventPrivate : public KParts::EventPrivate
17 {
18 public:
19  OpenUrlEventPrivate(const char *eventName, ReadOnlyPart *part, const QUrl &url, const OpenUrlArguments &args, const BrowserArguments &browserArgs)
20  : EventPrivate(eventName)
21  , m_part(part)
22  , m_url(url)
23  , m_args(args)
24  , m_browserArgs(browserArgs)
25  {
26  }
27  ~OpenUrlEventPrivate() override
28  {
29  }
30  static const char s_strOpenUrlEvent[];
31  ReadOnlyPart *const m_part;
32  const QUrl m_url;
33  const OpenUrlArguments m_args;
34  const BrowserArguments m_browserArgs;
35 };
36 
37 const char KParts::OpenUrlEventPrivate::s_strOpenUrlEvent[] = "KParts/BrowserExtension/OpenURLevent";
38 
39 OpenUrlEvent::OpenUrlEvent(ReadOnlyPart *part, const QUrl &url, const OpenUrlArguments &args, const BrowserArguments &browserArgs)
40  : Event(*new OpenUrlEventPrivate(OpenUrlEventPrivate::s_strOpenUrlEvent, part, url, args, browserArgs))
41 {
42 }
43 
44 OpenUrlEvent::~OpenUrlEvent() = default;
45 
46 ReadOnlyPart *OpenUrlEvent::part() const
47 {
48  Q_D(const OpenUrlEvent);
49 
50  return d->m_part;
51 }
52 
53 QUrl OpenUrlEvent::url() const
54 {
55  Q_D(const OpenUrlEvent);
56 
57  return d->m_url;
58 }
59 
60 OpenUrlArguments OpenUrlEvent::arguments() const
61 {
62  Q_D(const OpenUrlEvent);
63 
64  return d->m_args;
65 }
66 
67 BrowserArguments OpenUrlEvent::browserArguments() const
68 {
69  Q_D(const OpenUrlEvent);
70 
71  return d->m_browserArgs;
72 }
73 
74 bool OpenUrlEvent::test(const QEvent *event)
75 {
76  return Event::test(event, OpenUrlEventPrivate::s_strOpenUrlEvent);
77 }
BrowserArguments is a set of web-browsing-specific arguments, which allow specifying how a URL should...
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::OpenUrlEvent event informs that a given part has opened a given URL. Applications can use...
Definition: openurlevent.h:32
The KParts namespace,.
Q_D(Todo)
Base class for all KParts events.
Definition: event.h:27
This file is part of the KDE documentation.
Documentation copyright © 1996-2022 The KDE developers.
Generated on Tue Aug 9 2022 03:51:33 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.