Falkon Develop
Cross-platform Qt-based web browser
pluginproxy.h
Go to the documentation of this file.
1/* ============================================================
2* Falkon - Qt web browser
3* Copyright (C) 2010-2018 David Rosca <nowrep@gmail.com>
4*
5* This program is free software: you can redistribute it and/or modify
6* it under the terms of the GNU General Public License as published by
7* the Free Software Foundation, either version 3 of the License, or
8* (at your option) any later version.
9*
10* This program is distributed in the hope that it will be useful,
11* but WITHOUT ANY WARRANTY; without even the implied warranty of
12* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13* GNU General Public License for more details.
14*
15* You should have received a copy of the GNU General Public License
16* along with this program. If not, see <http://www.gnu.org/licenses/>.
17* ============================================================ */
18#ifndef PLUGINPROXY_H
19#define PLUGINPROXY_H
20
21#include "plugins.h"
22#include "qzcommon.h"
23
24#include <QWebEnginePage>
25
26class WebPage;
27class BrowserWindow;
28
30{
31 Q_OBJECT
32public:
33 enum EventHandlerType { MouseDoubleClickHandler, MousePressHandler, MouseReleaseHandler,
34 MouseMoveHandler, KeyPressHandler, KeyReleaseHandler,
35 WheelEventHandler
36 };
37
38 explicit PluginProxy(QObject *parent = nullptr);
39
40 void registerAppEventHandler(EventHandlerType type, PluginInterface* obj);
41
42 void populateWebViewMenu(QMenu* menu, WebView* view, const WebHitTestResult &r);
43 void populateExtensionsMenu(QMenu *menu);
44
45 bool processMouseDoubleClick(Qz::ObjectName type, QObject* obj, QMouseEvent* event);
46 bool processMousePress(Qz::ObjectName type, QObject* obj, QMouseEvent* event);
47 bool processMouseRelease(Qz::ObjectName type, QObject* obj, QMouseEvent* event);
48 bool processMouseMove(Qz::ObjectName type, QObject* obj, QMouseEvent* event);
49
50 bool processWheelEvent(Qz::ObjectName type, QObject* obj, QWheelEvent* event);
51
52 bool processKeyPress(Qz::ObjectName type, QObject* obj, QKeyEvent* event);
53 bool processKeyRelease(Qz::ObjectName type, QObject* obj, QKeyEvent* event);
54
55 bool acceptNavigationRequest(WebPage *page, const QUrl &url, QWebEnginePage::NavigationType type, bool isMainFrame);
56
57 void emitWebPageCreated(WebPage* page);
58 void emitWebPageDeleted(WebPage* page);
59
60 void emitMainWindowCreated(BrowserWindow* window);
61 void emitMainWindowDeleted(BrowserWindow* window);
62
63Q_SIGNALS:
66
69
70private Q_SLOTS:
71 void pluginUnloaded(PluginInterface* plugin);
72
73private:
74 QList<PluginInterface*> m_mouseDoubleClickHandlers;
75 QList<PluginInterface*> m_mousePressHandlers;
76 QList<PluginInterface*> m_mouseReleaseHandlers;
77 QList<PluginInterface*> m_mouseMoveHandlers;
78
79 QList<PluginInterface*> m_wheelEventHandlers;
80
81 QList<PluginInterface*> m_keyPressHandlers;
82 QList<PluginInterface*> m_keyReleaseHandlers;
83};
84
85#endif // PLUGINPROXY_H
void webPageCreated(WebPage *page)
void mainWindowDeleted(BrowserWindow *window)
void mainWindowCreated(BrowserWindow *window)
void webPageDeleted(WebPage *page)
void pluginUnloaded(PluginInterface *plugin)
ObjectName
Definition: qzcommon.h:89
#define FALKON_EXPORT
Definition: qzcommon.h:28