EvaluateExpressionDialog.h 797 B

1234567891011121314151617181920212223242526272829303132
  1. /*
  2. * Copyright (c) 2021, Hunter Salyer <thefalsehonesty@gmail.com>
  3. *
  4. * SPDX-License-Identifier: BSD-2-Clause
  5. */
  6. #pragma once
  7. #include <LibGUI/Dialog.h>
  8. #include <LibWeb/InProcessWebView.h>
  9. namespace HackStudio {
  10. class EvaluateExpressionDialog : public GUI::Dialog {
  11. C_OBJECT(EvaluateExpressionDialog);
  12. private:
  13. explicit EvaluateExpressionDialog(Window* parent_window);
  14. void build(Window* parent_window);
  15. void handle_evaluation(String const& expression);
  16. void set_output(StringView html);
  17. NonnullOwnPtr<JS::Interpreter> m_interpreter;
  18. RefPtr<GUI::TextBox> m_text_editor;
  19. RefPtr<Web::InProcessWebView> m_output_view;
  20. RefPtr<Web::DOM::Element> m_output_container;
  21. RefPtr<GUI::Button> m_evaluate_button;
  22. RefPtr<GUI::Button> m_close_button;
  23. };
  24. }