2011-10-29 12:24:12 +02:00
|
|
|
/* ============================================================
|
2017-08-25 17:11:29 +02:00
|
|
|
* Falkon - Qt web browser
|
2017-01-21 17:59:54 +01:00
|
|
|
* Copyright (C) 2010-2017 David Rosca <nowrep@gmail.com>
|
2011-10-29 12:24:12 +02:00
|
|
|
*
|
|
|
|
* This program is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation, either version 3 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
* ============================================================ */
|
2011-10-14 20:14:57 +02:00
|
|
|
#ifndef WEBINSPECTORDOCKWIDGET_H
|
|
|
|
#define WEBINSPECTORDOCKWIDGET_H
|
|
|
|
|
2015-08-30 14:44:00 +02:00
|
|
|
#include <QWebEngineView>
|
2012-01-29 14:05:57 +01:00
|
|
|
|
2014-02-26 20:03:20 +01:00
|
|
|
#include "qzcommon.h"
|
2012-02-29 18:33:50 +01:00
|
|
|
|
2014-03-31 17:46:59 +02:00
|
|
|
class ToolButton;
|
2011-10-14 20:14:57 +02:00
|
|
|
|
2017-08-25 17:11:29 +02:00
|
|
|
class FALKON_EXPORT WebInspector : public QWebEngineView
|
2011-10-14 20:14:57 +02:00
|
|
|
{
|
|
|
|
Q_OBJECT
|
2012-03-16 16:57:24 +01:00
|
|
|
|
2014-03-31 17:46:59 +02:00
|
|
|
public:
|
2015-08-30 14:44:00 +02:00
|
|
|
explicit WebInspector(QWidget *parent = Q_NULLPTR);
|
|
|
|
~WebInspector();
|
|
|
|
|
|
|
|
void setView(QWebEngineView *view);
|
2015-10-15 17:19:16 +02:00
|
|
|
void inspectElement();
|
2015-08-30 14:44:00 +02:00
|
|
|
|
2016-02-20 15:07:36 +01:00
|
|
|
static bool isEnabled();
|
2015-08-30 14:44:00 +02:00
|
|
|
static void pushView(QWebEngineView *view);
|
|
|
|
static void registerView(QWebEngineView *view);
|
|
|
|
static void unregisterView(QWebEngineView *view);
|
2011-10-14 20:14:57 +02:00
|
|
|
|
2014-03-31 17:46:59 +02:00
|
|
|
private slots:
|
2015-10-15 17:19:16 +02:00
|
|
|
void loadFinished();
|
2011-10-14 20:14:57 +02:00
|
|
|
|
|
|
|
private:
|
2017-01-21 17:59:54 +01:00
|
|
|
QSize sizeHint() const override;
|
2015-10-04 19:44:25 +02:00
|
|
|
void keyPressEvent(QKeyEvent *event) Q_DECL_OVERRIDE;
|
|
|
|
void keyReleaseEvent(QKeyEvent *event) Q_DECL_OVERRIDE;
|
|
|
|
|
2015-08-30 14:44:00 +02:00
|
|
|
static QList<QWebEngineView*> s_views;
|
2015-10-15 17:19:16 +02:00
|
|
|
|
2017-01-21 17:59:54 +01:00
|
|
|
int m_height;
|
2017-01-22 14:50:15 +01:00
|
|
|
QSize m_windowSize;
|
2016-12-27 20:17:07 +01:00
|
|
|
bool m_inspectElement = false;
|
2015-10-15 17:19:16 +02:00
|
|
|
QWebEngineView *m_view;
|
2011-10-14 20:14:57 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // WEBINSPECTORDOCKWIDGET_H
|