ScriptEditor.h 576 B

123456789101112131415161718192021222324252627282930313233
  1. /*
  2. * Copyright (c) 2022, Dylan Katz <dykatz@uw.edu>
  3. *
  4. * SPDX-License-Identifier: BSD-2-Clause
  5. */
  6. #pragma once
  7. #include <AK/LexicalPath.h>
  8. #include <LibGUI/TextEditor.h>
  9. namespace SQLStudio {
  10. class ScriptEditor : public GUI::TextEditor {
  11. C_OBJECT(ScriptEditor)
  12. public:
  13. virtual ~ScriptEditor() = default;
  14. void new_script_with_temp_name(String);
  15. ErrorOr<void> open_script_from_file(LexicalPath const&);
  16. ErrorOr<bool> save();
  17. ErrorOr<bool> save_as();
  18. ErrorOr<bool> attempt_to_close();
  19. private:
  20. ScriptEditor();
  21. String m_path;
  22. };
  23. }