2019-07-11 21:52:33 +03:00
|
|
|
#pragma once
|
|
|
|
|
2019-07-29 07:45:50 +03:00
|
|
|
#include <AK/FileSystemPath.h>
|
2019-07-11 21:52:33 +03:00
|
|
|
#include <AK/Function.h>
|
|
|
|
#include <LibGUI/GApplication.h>
|
|
|
|
#include <LibGUI/GTextEditor.h>
|
|
|
|
#include <LibGUI/GWidget.h>
|
|
|
|
#include <LibGUI/GWindow.h>
|
|
|
|
|
2019-08-21 22:30:20 +03:00
|
|
|
class GButton;
|
|
|
|
class GTextBox;
|
2019-07-11 21:52:33 +03:00
|
|
|
class GTextEditor;
|
|
|
|
|
|
|
|
class TextEditorWidget final : public GWidget {
|
|
|
|
public:
|
|
|
|
TextEditorWidget();
|
|
|
|
virtual ~TextEditorWidget() override;
|
|
|
|
void open_sesame(const String& path);
|
2019-08-27 21:37:41 +03:00
|
|
|
bool request_close();
|
2019-07-11 21:52:33 +03:00
|
|
|
|
|
|
|
private:
|
2019-07-29 07:45:50 +03:00
|
|
|
void set_path(const FileSystemPath& file);
|
2019-08-27 21:18:19 +03:00
|
|
|
void update_title();
|
2019-07-24 07:32:30 +03:00
|
|
|
|
2019-09-21 16:43:52 +03:00
|
|
|
ObjectPtr<GTextEditor> m_editor;
|
2019-07-14 03:58:04 +03:00
|
|
|
String m_path;
|
2019-07-29 07:45:50 +03:00
|
|
|
String m_name;
|
|
|
|
String m_extension;
|
2019-07-26 07:48:39 +03:00
|
|
|
RefPtr<GAction> m_new_action;
|
|
|
|
RefPtr<GAction> m_open_action;
|
|
|
|
RefPtr<GAction> m_save_action;
|
|
|
|
RefPtr<GAction> m_save_as_action;
|
2019-08-22 12:02:03 +03:00
|
|
|
RefPtr<GAction> m_find_action;
|
2019-08-25 13:23:34 +03:00
|
|
|
RefPtr<GAction> m_line_wrapping_setting_action;
|
2019-08-25 22:35:58 +03:00
|
|
|
RefPtr<GAction> m_find_next_action;
|
|
|
|
RefPtr<GAction> m_find_previous_action;
|
2019-08-21 22:30:20 +03:00
|
|
|
|
2019-09-21 16:43:52 +03:00
|
|
|
ObjectPtr<GTextBox> m_find_textbox;
|
2019-08-25 22:35:58 +03:00
|
|
|
GButton* m_find_previous_button { nullptr };
|
2019-08-24 21:09:35 +03:00
|
|
|
GButton* m_find_next_button { nullptr };
|
2019-08-22 12:09:25 +03:00
|
|
|
GWidget* m_find_widget { nullptr };
|
2019-08-27 21:18:19 +03:00
|
|
|
|
|
|
|
bool m_document_dirty { false };
|
2019-07-24 07:32:30 +03:00
|
|
|
};
|