TextEditorWidget.h 919 B

12345678910111213141516171819202122232425262728293031323334353637
  1. #pragma once
  2. #include <AK/FileSystemPath.h>
  3. #include <AK/Function.h>
  4. #include <LibGUI/GApplication.h>
  5. #include <LibGUI/GTextEditor.h>
  6. #include <LibGUI/GWidget.h>
  7. #include <LibGUI/GWindow.h>
  8. class GButton;
  9. class GTextBox;
  10. class GTextEditor;
  11. class TextEditorWidget final : public GWidget {
  12. public:
  13. TextEditorWidget();
  14. virtual ~TextEditorWidget() override;
  15. void open_sesame(const String& path);
  16. private:
  17. void set_path(const FileSystemPath& file);
  18. GTextEditor* m_editor { nullptr };
  19. String m_path;
  20. String m_name;
  21. String m_extension;
  22. RefPtr<GAction> m_new_action;
  23. RefPtr<GAction> m_open_action;
  24. RefPtr<GAction> m_save_action;
  25. RefPtr<GAction> m_save_as_action;
  26. RefPtr<GAction> m_find_action;
  27. GTextBox* m_find_textbox { nullptr };
  28. GButton* m_find_prev_button { nullptr };
  29. GButton* m_find_next_button { nullptr };
  30. GWidget* m_find_widget { nullptr };
  31. };