File indexing completed on 2025-02-23 05:00:21

0001 /*
0002    SPDX-FileCopyrightText: 2016-2024 Laurent Montel <montel@kde.org>
0003 
0004    SPDX-License-Identifier: LGPL-2.0-or-later
0005 */
0006 
0007 #pragma once
0008 
0009 #include "webengineviewer_export.h"
0010 #include <QObject>
0011 #include <memory>
0012 
0013 class KActionCollection;
0014 class QWheelEvent;
0015 class QResizeEvent;
0016 class QKeyEvent;
0017 class QWebEngineView;
0018 namespace WebEngineViewer
0019 {
0020 class WebEngineAccessKeyPrivate;
0021 /**
0022  * @brief The WebEngineAccessKey class
0023  * @author Laurent Montel <montel@kde.org>
0024  */
0025 class WEBENGINEVIEWER_EXPORT WebEngineAccessKey : public QObject
0026 {
0027     Q_OBJECT
0028 public:
0029     explicit WebEngineAccessKey(QWebEngineView *webEngine, QObject *parent = nullptr);
0030     ~WebEngineAccessKey() override;
0031 
0032     void setActionCollection(KActionCollection *ac);
0033 
0034     void wheelEvent(QWheelEvent *e);
0035     void resizeEvent(QResizeEvent *);
0036     void keyPressEvent(QKeyEvent *e);
0037     void keyReleaseEvent(QKeyEvent *e);
0038 
0039     void showAccessKeys();
0040     void hideAccessKeys();
0041 
0042 Q_SIGNALS:
0043     void openUrl(const QUrl &url);
0044 
0045 private:
0046     WEBENGINEVIEWER_NO_EXPORT void handleSearchAccessKey(const QVariant &res);
0047     std::unique_ptr<WebEngineAccessKeyPrivate> const d;
0048 };
0049 }