1 #ifndef QEMU_GUI_MAINFRAME_H
2 #define QEMU_GUI_MAINFRAME_H
4 #include <wx/splitter.h>
5 #include <wx/notebook.h>
6 #include <wx/dynarray.h>
15 class QemuUINotebookPage
;
16 class QemuUIStatusBar
;
18 class wxScrolledWindow
;
21 WX_DEFINE_ARRAY_PTR(QemuVM
*,VMArray
);
23 class QemuMainFrame
: public wxFrame
26 QemuMainFrame(const wxString
& title
);
29 * shows the homepage by selecting the corresponding tab
30 * or calls CreateHomepage() to create a new one.
34 * returns the currently active vm tab or NULL if the homepage
37 QemuUINotebookPage
* GetCurrentVMTab();
39 * returns the currently active virtual machine or NULL
41 QemuVM
* GetCurrentVM();
44 * opens a vm, creates a new tab and updates the vms array,
45 * returns false if the vm is already open.
47 bool OpenVM(QemuVM
*vm
);
48 void OpenVM(const wxString
& config
);
49 //void CloseVM(QemuVM *vm);
51 void SaveFileHistory(wxConfigBase
*);
52 void LoadFileHistory(wxConfigBase
*);
55 * enables / disables the toolbar buttons and the statusbar
56 * according to the vm state
62 * gets called when a radio item from the windows menu is selected
63 * has to be public because the event handler is dynamically added
66 void OnChangeWindow(wxCommandEvent
&);
68 /* various event handlers */
69 void OnNewVM(wxCommandEvent
&event
);
70 void OnOpenVM(wxCommandEvent
&event
);
71 void OnQuitCommandEvent(wxCommandEvent
& event
);
73 * quit's the application, checks if there are still vm running
74 * and if so asks the user what to do.
76 void OnQuit(wxCloseEvent
& event
);
78 void OnShowHomepage(wxCommandEvent
& event
);
79 void OnFullScreen(wxCommandEvent
& event
);
80 void OnToggleToolBar(wxCommandEvent
& event
);
81 void OnToolBarSettingChange(wxCommandEvent
& event
);
82 void OnToggleStatusBar(wxCommandEvent
& event
);
84 void OnVMSettings(wxCommandEvent
& event
);
85 void OnVMSendCtrlAltDel(wxCommandEvent
& event
);
87 void OnPowerOnVM(wxCommandEvent
& event
);
88 void OnPowerOffVM(wxCommandEvent
& event
);
89 void OnPauseVM(wxCommandEvent
& event
);
90 void OnResetVM(wxCommandEvent
& event
);
91 void OnKillVM(wxCommandEvent
& event
);
93 void OnSnapshot(wxCommandEvent
& event
);
94 void OnRevertSnapshot(wxCommandEvent
& event
);
96 void OnToggleDisplay(wxCommandEvent
& event
);
98 void OnSendCommandToVM(wxCommandEvent
& event
);
100 void OnNextWindow(wxCommandEvent
&);
101 void OnPrevWindow(wxCommandEvent
&);
103 * notebook related event handlers
105 void OnNotebookPageChanged(wxNotebookEvent
& event
);
106 void OnNotebookPageClosed(wxCommandEvent
&);
107 void CloseNotebookPage(const int pos
);
109 void OnConnectCdRom(wxCommandEvent
&);
112 * creates the homepage tab and prepends an entry to the
115 void CreateHomepage();
118 * gets called from the filehistory menu items
120 void OnReOpenVM(wxCommandEvent
& event
);
122 void OnOpenQemuDoc(wxCommandEvent
& event
);
123 void OnAbout(wxCommandEvent
& event
);
126 * Sets up some sizers which make sure that the notebook
127 * widget takes all available space.
131 QemuUIMenuBar
*menubar
;
132 QemuUIToolBar
*toolbar
;
133 QemuUIStatusBar
*statusbar
;
135 wxScrolledWindow
*mainwindow
;
136 QemuUINotebook
*notebook
;
138 wxFileHistory
*filehistory
;
140 // holds all currently opened vm's
142 // used to store the current toolbar style before toogling
145 DECLARE_EVENT_TABLE()