summaryrefslogtreecommitdiff
path: root/Userland/DevTools/HackStudio/Debugger/EvaluateExpressionDialog.h
blob: d33873c3bba39d992a086a5989b71e69a5565f27 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
/*
 * Copyright (c) 2021, Hunter Salyer <thefalsehonesty@gmail.com>
 *
 * SPDX-License-Identifier: BSD-2-Clause
 */

#pragma once

#include <LibGUI/Dialog.h>
#include <LibWeb/InProcessWebView.h>

namespace HackStudio {

class EvaluateExpressionDialog : public GUI::Dialog {
    C_OBJECT(EvaluateExpressionDialog);

private:
    explicit EvaluateExpressionDialog(Window* parent_window);

    void build(Window* parent_window);
    void handle_evaluation(const String& expression);
    void set_output(StringView html);

    NonnullOwnPtr<JS::Interpreter> m_interpreter;
    RefPtr<GUI::TextBox> m_text_editor;
    RefPtr<Web::InProcessWebView> m_output_view;
    RefPtr<Web::DOM::Element> m_output_container;
    RefPtr<GUI::Button> m_evaluate_button;
    RefPtr<GUI::Button> m_close_button;
};

}