2022-12-18 00:50:53 +00:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2022, MacDue <macdue@dueutil.tech>
|
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
|
|
*/
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
2023-01-12 20:22:14 +00:00
|
|
|
#include "WebContentView.h"
|
2023-12-05 21:58:26 +00:00
|
|
|
#include <LibGfx/Point.h>
|
2023-11-24 01:04:54 +00:00
|
|
|
#include <LibWebView/Forward.h>
|
2022-12-18 00:50:53 +00:00
|
|
|
#include <QWidget>
|
|
|
|
|
2023-12-05 21:58:26 +00:00
|
|
|
class QAction;
|
|
|
|
class QMenu;
|
|
|
|
|
2022-12-18 00:50:53 +00:00
|
|
|
namespace Ladybird {
|
|
|
|
|
2023-11-24 01:04:54 +00:00
|
|
|
class WebContentView;
|
|
|
|
|
2022-12-18 00:50:53 +00:00
|
|
|
class InspectorWidget final : public QWidget {
|
|
|
|
Q_OBJECT
|
|
|
|
|
2023-11-24 01:04:54 +00:00
|
|
|
public:
|
2023-12-04 16:03:40 +00:00
|
|
|
InspectorWidget(QWidget* tab, WebContentView& content_view);
|
2023-11-24 01:04:54 +00:00
|
|
|
virtual ~InspectorWidget() override;
|
2023-05-08 20:15:35 +00:00
|
|
|
|
2023-11-24 01:04:54 +00:00
|
|
|
void inspect();
|
|
|
|
void reset();
|
2023-05-08 20:15:35 +00:00
|
|
|
|
2023-11-24 01:04:54 +00:00
|
|
|
void select_hovered_node();
|
2023-05-08 20:15:35 +00:00
|
|
|
void select_default_node();
|
|
|
|
|
2023-11-24 01:04:54 +00:00
|
|
|
private:
|
2022-12-18 00:50:53 +00:00
|
|
|
void closeEvent(QCloseEvent*) override;
|
|
|
|
|
2023-12-05 21:58:26 +00:00
|
|
|
QPoint to_widget_position(Gfx::IntPoint) const;
|
|
|
|
|
2023-12-04 14:39:22 +00:00
|
|
|
WebContentView* m_inspector_view;
|
2023-11-24 01:04:54 +00:00
|
|
|
OwnPtr<WebView::InspectorClient> m_inspector_client;
|
2023-12-05 21:58:26 +00:00
|
|
|
|
|
|
|
QMenu* m_dom_node_text_context_menu { nullptr };
|
|
|
|
QMenu* m_dom_node_tag_context_menu { nullptr };
|
|
|
|
QMenu* m_dom_node_attribute_context_menu { nullptr };
|
|
|
|
|
|
|
|
QAction* m_edit_node_action { nullptr };
|
|
|
|
QAction* m_delete_node_action { nullptr };
|
|
|
|
QAction* m_add_attribute_action { nullptr };
|
|
|
|
QAction* m_remove_attribute_action { nullptr };
|
2022-12-18 00:50:53 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|