#pragma once #include #include #include #include #include #include class GButton; class GTextBox; class GTextEditor; class GStatusBar; class TextEditorWidget final : public GWidget { C_OBJECT(TextEditorWidget) public: virtual ~TextEditorWidget() override; void open_sesame(const String& path); bool request_close(); GTextEditor& editor() { return *m_editor; } private: TextEditorWidget(); void set_path(const FileSystemPath& file); void update_title(); virtual void drop_event(GDropEvent&) override; RefPtr m_editor; String m_path; String m_name; String m_extension; RefPtr m_new_action; RefPtr m_open_action; RefPtr m_save_action; RefPtr m_save_as_action; RefPtr m_find_action; RefPtr m_line_wrapping_setting_action; RefPtr m_find_next_action; RefPtr m_find_previous_action; RefPtr m_statusbar; RefPtr m_find_textbox; GButton* m_find_previous_button { nullptr }; GButton* m_find_next_button { nullptr }; RefPtr m_find_widget; bool m_document_dirty { false }; bool m_document_opening { false }; };