ScriptEditor.h 657 B

1234567891011121314151617181920212223242526272829303132333435
  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(DeprecatedString);
  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. DeprecatedString const& path() const { return m_path; }
  20. private:
  21. ScriptEditor();
  22. DeprecatedString m_path;
  23. };
  24. }