Use new vnc syntax (with a colon).
[qemu-gui.git] / console.h
blobb00fdec9b2ee92deda6c1d8bc73ced41e4a5da24
1 #ifndef QEMU_GUI_CONSOLE_H
2 #define QEMU_GUI_CONSOLE_H
4 #include <wx/textctrl.h>
5 #include "notebook.h"
7 class wxTextCtrl;
8 class wxProcessEvent;
9 class wxInputStream;
10 class wxOutputStream;
11 class wxBoxSizer;
13 class QemuVM;
14 class MonitorSocket;
15 class PipedProcess;
16 class InputTextCtrl;
18 class ConsolePanel : public wxPanel {
19 public:
20 /**
21 * Creates a new ConsolePanel.
23 * @param parent The wxWindow parent.
25 ConsolePanel(wxWindow *parent, QemuVM *vm);
27 /**
28 * Destructs this ConsolePanel.
30 ~ConsolePanel();
32 /**
33 * Gets called if new input is entered, if the return value
34 * evaluates to true then the input box is cleared otherwhise
35 * not.
37 bool Notify(const wxString&);
39 /**
40 * Set the process whose output should be captured
42 void SetProcess(PipedProcess *process);
44 /**
45 * Enable/Disables the input box
47 void SetState(bool);
48 void ScrollToEnd();
49 private:
50 /**
51 * Text control which displays the console output
53 wxTextCtrl* console;
55 /**
56 * Text control which takes the input
58 InputTextCtrl* input;
60 /**
61 * Sizer to control the size of the widgets
63 wxBoxSizer* sizer;
65 QemuVM *vm;
66 MonitorSocket *socket;
68 PipedProcess *process;
69 wxOutputStream *out;
70 wxInputStream *in;
71 wxInputStream *err;
73 /**
74 * adds the text to the console when the user has pressed
75 * enter and sends it to the associated process
77 void AppendConsoleInput(const wxString&);
78 /**
79 * displays whatever the captured process sends to its
80 * stdout/stderr
81 */
82 void AppendConsoleOutput(const wxString&);
83 void AppendConsoleError(const wxString&);
84 /**
85 * event handlers which are connected to the piped process
87 void HandleConsoleInput(wxCommandEvent&);
88 void HandleConsoleOutput(wxCommandEvent&);
89 void HandleProcessCreation(wxCommandEvent&);
90 void HandleProcessTermination(wxCommandEvent&);
92 DECLARE_EVENT_TABLE()
95 class InputTextCtrl : public wxTextCtrl
97 public:
98 InputTextCtrl(ConsolePanel *parent);
99 void OnKeyDown(wxKeyEvent& event);
100 private:
101 DECLARE_EVENT_TABLE()
104 #endif