24#include "webhittestresult.h"
27using namespace WebEngineViewer;
29class WebEngineViewer::WebHitTestResultPrivate
39 void init(
const QVariantMap &map);
50 bool mIsContentEditable =
false;
51 bool mIsContentSelected =
false;
52 bool mMediaPaused =
false;
53 bool mMediaMuted =
false;
57void WebHitTestResultPrivate::init(
const QVariantMap &map)
63 mAlternateText =
map.value(QStringLiteral(
"alternateText")).toString();
64 mImageUrl =
map.value(QStringLiteral(
"imageUrl")).toUrl();
65 mIsContentEditable =
map.value(QStringLiteral(
"contentEditable")).toBool();
66 mIsContentSelected =
map.value(QStringLiteral(
"contentSelected")).toBool();
67 mLinkTitle =
map.value(QStringLiteral(
"linkTitle")).toString();
68 mLinkUrl =
map.value(QStringLiteral(
"linkUrl")).toUrl();
69 mMediaUrl =
map.value(QStringLiteral(
"mediaUrl")).toUrl();
70 mMediaPaused =
map.value(QStringLiteral(
"mediaPaused")).toBool();
71 mMediaMuted =
map.value(QStringLiteral(
"mediaMuted")).toBool();
72 mTagName =
map.value(QStringLiteral(
"tagName")).toString();
74 const QVariantList &rect =
map.value(QStringLiteral(
"boundingRect")).toList();
75 if (rect.size() == 4) {
76 mBoundingRect =
QRect(rect.at(0).toInt(), rect.at(1).toInt(), rect.at(2).toInt(), rect.at(3).toInt());
80 mImageUrl = mPageUrl.
resolved(mImageUrl);
83 mLinkUrl = mPageUrl.
resolved(mLinkUrl);
86 mMediaUrl = mPageUrl.
resolved(mMediaUrl);
91WebHitTestResult::WebHitTestResult()
92 : d(new WebHitTestResultPrivate)
96WebHitTestResult::WebHitTestResult(
const QPoint &pos,
const QUrl &pageUrl,
const QVariant &result)
97 : d(new WebHitTestResultPrivate(pos, pageUrl, result))
102 : d(new WebHitTestResultPrivate)
107WebHitTestResult::~WebHitTestResult() =
default;
111 if (
this != &other) {
117QString WebHitTestResult::alternateText()
const
119 return d->mAlternateText;
122QRect WebHitTestResult::boundingRect()
const
124 return d->mBoundingRect;
127QUrl WebHitTestResult::imageUrl()
const
132bool WebHitTestResult::isContentEditable()
const
134 return d->mIsContentEditable;
137bool WebHitTestResult::isContentSelected()
const
139 return d->mIsContentSelected;
142bool WebHitTestResult::isNull()
const
147QString WebHitTestResult::linkTitle()
const
149 return d->mLinkTitle;
152QUrl WebHitTestResult::linkUrl()
const
157QUrl WebHitTestResult::mediaUrl()
const
162bool WebHitTestResult::mediaPaused()
const
164 return d->mMediaPaused;
167bool WebHitTestResult::mediaMuted()
const
169 return d->mMediaMuted;
172QPoint WebHitTestResult::pos()
const
177QString WebHitTestResult::tagName()
const
182QUrl WebHitTestResult::pageUrl()
const
The WebHitTestResult class.
QFuture< void > map(Iterator begin, Iterator end, MapFunctor &&function)
bool isEmpty() const const
QUrl resolved(const QUrl &relative) const const