File indexing completed on 2025-01-26 04:57:26
0001 /* 0002 SPDX-FileCopyrightText: 2016-2024 Laurent Montel <montel@kde.org> 0003 0004 SPDX-License-Identifier: LGPL-2.0-or-later 0005 */ 0006 0007 /* ============================================================ 0008 * QupZilla - QtWebEngine based browser 0009 * SPDX-FileCopyrightText: 2015 David Rosca <nowrep@gmail.com> 0010 * 0011 * This program is free software: you can redistribute it and/or modify 0012 * it under the terms of the GNU General Public License as published by 0013 * the Free Software Foundation, either version 3 of the License, or 0014 * (at your option) any later version. 0015 * 0016 * This program is distributed in the hope that it will be useful, 0017 * but WITHOUT ANY WARRANTY; without even the implied warranty of 0018 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 0019 * GNU General Public License for more details. 0020 * 0021 * You should have received a copy of the GNU General Public License 0022 * along with this program. If not, see <https://www.gnu.org/licenses/>. 0023 * ============================================================ */ 0024 #pragma once 0025 0026 #include "webengineviewer_export.h" 0027 #include <QRect> 0028 #include <QString> 0029 #include <QUrl> 0030 #include <QVariant> 0031 #include <memory> 0032 0033 namespace WebEngineViewer 0034 { 0035 class WebHitTestResultPrivate; 0036 /** 0037 * @brief The WebHitTestResult class 0038 */ 0039 class WEBENGINEVIEWER_EXPORT WebHitTestResult 0040 { 0041 public: 0042 WebHitTestResult(); 0043 WebHitTestResult(const QPoint &pos, const QUrl &pageUrl, const QVariant &result); 0044 WebHitTestResult(const WebHitTestResult &other); 0045 ~WebHitTestResult(); 0046 0047 [[nodiscard]] QString alternateText() const; 0048 [[nodiscard]] QRect boundingRect() const; 0049 [[nodiscard]] QUrl imageUrl() const; 0050 [[nodiscard]] bool isContentEditable() const; 0051 [[nodiscard]] bool isContentSelected() const; 0052 [[nodiscard]] bool isNull() const; 0053 [[nodiscard]] QString linkTitle() const; 0054 [[nodiscard]] QUrl linkUrl() const; 0055 [[nodiscard]] QUrl mediaUrl() const; 0056 [[nodiscard]] bool mediaPaused() const; 0057 [[nodiscard]] bool mediaMuted() const; 0058 [[nodiscard]] QPoint pos() const; 0059 [[nodiscard]] QString tagName() const; 0060 [[nodiscard]] QUrl pageUrl() const; 0061 0062 WebHitTestResult &operator=(const WebHitTestResult &webHit); 0063 0064 private: 0065 std::unique_ptr<WebHitTestResultPrivate> const d; 0066 }; 0067 } 0068 Q_DECLARE_METATYPE(WebEngineViewer::WebHitTestResult)