Messagelib

webengineaccesskeyanchor.cpp
1 /*
2  SPDX-FileCopyrightText: 2016-2021 Laurent Montel <[email protected]>
3 
4  SPDX-License-Identifier: LGPL-2.0-or-later
5 */
6 
7 #include "webengineaccesskeyanchor.h"
8 
9 using namespace WebEngineViewer;
10 
11 WebEngineAccessKeyAnchor::WebEngineAccessKeyAnchor(const QVariant &result)
12 {
13  initialize(result);
14 }
15 
16 WebEngineAccessKeyAnchor::WebEngineAccessKeyAnchor() = default;
17 
18 void WebEngineAccessKeyAnchor::initialize(const QVariant &result)
19 {
20  if (result.isValid()) {
21  const QVariantMap map = result.toMap();
22  const QVariantList &rect = map.value(QStringLiteral("boundingRect")).toList();
23  if (rect.size() == 4) {
24  mBoundingRect = QRect(rect.at(0).toInt(), rect.at(1).toInt(), rect.at(2).toInt(), rect.at(3).toInt());
25  }
26  mHref = map.value(QStringLiteral("src")).toString();
27  mAccessKey = map.value(QStringLiteral("accessKey")).toString();
28  mTarget = map.value(QStringLiteral("target")).toString();
29  mTagName = map.value(QStringLiteral("tagName")).toString();
30  mInnerText = map.value(QStringLiteral("text")).toString();
31  }
32 }
33 
34 QString WebEngineAccessKeyAnchor::innerText() const
35 {
36  return mInnerText;
37 }
38 
39 QString WebEngineAccessKeyAnchor::tagName() const
40 {
41  return mTagName;
42 }
43 
44 QString WebEngineAccessKeyAnchor::target() const
45 {
46  return mTarget;
47 }
48 
49 QString WebEngineAccessKeyAnchor::href() const
50 {
51  return mHref;
52 }
53 
54 QString WebEngineAccessKeyAnchor::accessKey() const
55 {
56  return mAccessKey;
57 }
58 
59 QRect WebEngineAccessKeyAnchor::boundingRect() const
60 {
61  return mBoundingRect;
62 }
KCRASH_EXPORT void initialize()
QMap< QString, QVariant > toMap() const const
bool isValid() const const
QFuture< void > map(Sequence &sequence, MapFunctor function)
This file is part of the KDE documentation.
Documentation copyright © 1996-2021 The KDE developers.
Generated on Sat Dec 4 2021 23:12:55 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.