/* * Copyright (c) 2020, Hunter Salyer * Copyright (c) 2021, Andreas Kling * Copyright (c) 2021, Sam Atkins * * SPDX-License-Identifier: BSD-2-Clause */ #pragma once #include "History.h" #include #include namespace Browser { class ConsoleWidget final : public GUI::Widget { C_OBJECT(ConsoleWidget) public: virtual ~ConsoleWidget(); void notify_about_new_console_message(i32 message_index); void handle_console_messages(i32 start_index, Vector const& message_types, Vector const& messages); void print_source_line(const StringView&); void print_html(const StringView&); void reset(); Function on_js_input; Function on_request_messages; private: ConsoleWidget(); void request_console_messages(); void clear_output(); RefPtr m_input; RefPtr m_output_view; i32 m_highest_notified_message_index { -1 }; i32 m_highest_received_message_index { -1 }; bool m_waiting_for_messages { false }; }; }