4 #include <wx/wfstream.h>
5 #include <wx/fileconf.h>
6 #include "pipedprocess.h"
10 class QemuVM
: public wxEvtHandler
{
12 QemuVM(const wxString
& configfile
);
15 void SetTitle(const wxString
&);
16 wxString
GetCmdline();
17 wxString
GetCmdlineArguments();
18 void SetCmdlineArguments(const wxString
&);
21 * returns the associated config file of this vm
23 wxString
GetConfigFile();
25 void SaveConfig(const wxString
& configfile
);
45 wxString
GetHd(const int hd
);
46 void SetHd(const int hd
,const wxString
& image
);
48 void SetCdRom(const wxString
& image
);
49 wxString
GetFd(const int fd
);
50 void SetFd(const int fd
,const wxString
& image
);
52 void SetMemory(const int memory
);
54 void SetSmp(const int);
56 void SetSMB(const wxString
&);
58 void SetTFTP(const wxString
&);
60 void SetBoot(const wxString
& boot
);
62 void SetWin2kHack(bool);
64 void SetLocalTime(bool);
69 bool GetSnapshotMode();
70 void SetSnapshotMode(bool);
71 wxString
GetKeyboardLayout();
72 void SetKeyboardLayout(const wxString
&);
73 int GetCurrentMonitorPort();
75 void SetMonitorPort(const int port
);
76 /* get the vncdisplay which is currently used by the vm */
77 int GetCurrentVNCDisplay();
78 /* get the vncdisplay as stored in the config file */
80 void SetVNCDisplay(const int display
);
82 void ConnectCdRom(bool state
);
83 bool IsCdRomConnected();
87 * Returns the asociated qemu process or creates it
89 PipedProcess
*GetProcess();
90 MonitorSocket
*GetSocket();
92 * Adds an eventhandler to the underling PipedProcess
93 * the passed eventhandler will therefore receive
94 * process termination events and so on.
96 void AddEventHandler(wxEvtHandler
*handler
);
97 wxString
SendCommand(const wxString
& cmd
,bool block
= false);
98 void SendKey(const wxString
& key
);
101 * Is connected to the termination event of the associated process
103 void OnProcessTermination(wxCommandEvent
& WXUNUSED(event
));
106 wxFileConfig
*config
;
107 PipedProcess
*process
;
109 MonitorSocket
*socket
;
111 static int vncdisplays
;
113 static int monitorports
;
118 VM_STATE_POWERED_OFF
,
124 DECLARE_EVENT_TABLE()