/* * Copyright (c) 2018-2020, Andreas Kling * * SPDX-License-Identifier: BSD-2-Clause */ #pragma once #include "HexEditor.h" #include #include #include #include #include #include #include class HexEditor; class HexEditorWidget final : public GUI::Widget { C_OBJECT(HexEditorWidget) public: virtual ~HexEditorWidget() override; void open_file(const String& path); void initialize_menubar(GUI::Menubar&); bool request_close(); private: HexEditorWidget(); void set_path(const LexicalPath& file); void update_title(); RefPtr m_editor; String m_path; String m_name; String m_extension; String m_search_text; ByteBuffer m_search_buffer; int last_found_index() const { return m_last_found_index == -1 ? 0 : m_last_found_index; } int m_last_found_index { -1 }; RefPtr m_new_action; RefPtr m_open_action; RefPtr m_save_action; RefPtr m_save_as_action; RefPtr m_goto_decimal_offset_action; RefPtr m_goto_hex_offset_action; GUI::ActionGroup m_bytes_per_row_actions; RefPtr m_statusbar; bool m_document_dirty { false }; };