VirtualBox

source: vbox/trunk/src/VBox/Frontends/VirtualBox/include/VBoxConsoleWnd.h@ 491

Last change on this file since 491 was 382, checked in by vboxsync, 18 years ago

export to OSE again

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 5.8 KB
Line 
1/** @file
2 *
3 * VBox frontends: Qt GUI ("VirtualBox"):
4 * VBoxConsoleWnd class declaration
5 */
6
7/*
8 * Copyright (C) 2006 InnoTek Systemberatung GmbH
9 *
10 * This file is part of VirtualBox Open Source Edition (OSE), as
11 * available from http://www.virtualbox.org. This file is free software;
12 * you can redistribute it and/or modify it under the terms of the GNU
13 * General Public License as published by the Free Software Foundation,
14 * in version 2 as it comes in the "COPYING" file of the VirtualBox OSE
15 * distribution. VirtualBox OSE is distributed in the hope that it will
16 * be useful, but WITHOUT ANY WARRANTY of any kind.
17 *
18 * If you received this file as part of a commercial VirtualBox
19 * distribution, then only the terms of your commercial VirtualBox
20 * license agreement apply instead of the previous paragraph.
21 */
22
23#ifndef __VBoxConsoleWnd_h__
24#define __VBoxConsoleWnd_h__
25
26#include "COMDefs.h"
27
28#include <qmainwindow.h>
29
30#include <qmap.h>
31#include <qobjectlist.h>
32#include <qcolor.h>
33
34#ifdef VBOX_WITH_DEBUGGER_GUI
35#include <VBox/dbggui.h>
36#endif
37
38class QAction;
39class QActionGroup;
40class QHBox;
41class QLabel;
42
43class VBoxConsoleView;
44class QIStateIndicator;
45
46class VBoxUSBLedTip;
47
48class VBoxConsoleWnd : public QMainWindow
49{
50 Q_OBJECT
51
52public:
53
54 VBoxConsoleWnd (VBoxConsoleWnd **aSelf,
55 QWidget* aParent = 0, const char* aName = 0,
56 WFlags aFlags = WType_TopLevel);
57 virtual ~VBoxConsoleWnd();
58
59 bool openView (const CSession &session);
60 void closeView();
61
62 void refreshView();
63
64 bool isTrueFullscreen() const { return full_screen; }
65
66public slots:
67
68protected:
69
70 // events
71 bool event (QEvent *e);
72 void closeEvent (QCloseEvent *e);
73#if defined(Q_WS_X11)
74 bool x11Event (XEvent *event);
75#endif
76#ifdef VBOX_WITH_DEBUGGER_GUI
77 bool dbgCreated();
78 void dbgDestroy();
79 void dbgAdjustRelativePos();
80#endif
81
82protected slots:
83
84private:
85
86 enum /* Stuff */
87 {
88 FloppyStuff = 0x01,
89 DVDStuff = 0x02,
90 HardDiskStuff = 0x04,
91 PauseAction = 0x08,
92 NetworkStuff = 0x10,
93 DisableMouseIntegrAction = 0x20,
94 Caption = 0x40,
95 USBStuff = 0x80,
96 AllStuff = 0xFF,
97 };
98
99 void languageChange();
100
101 void updateAppearanceOf (int element);
102
103private slots:
104
105 void finalizeOpenView();
106
107 void vmFullscreen (bool on);
108 void vmAutoresizeGuest (bool on);
109 void vmAdjustWindow();
110
111 void vmTypeCAD();
112 void vmTypeCABS();
113 void vmReset();
114 void vmPause(bool);
115 void vmACPIShutdown();
116 void vmClose();
117 void vmTakeSnapshot();
118 void vmDisableMouseIntegr();
119
120 void devicesMountFloppyImage();
121 void devicesUnmountFloppy();
122 void devicesMountDVDImage();
123 void devicesUnmountDVD();
124 void devicesInstallGuestAdditions();
125
126 void prepareFloppyMenu();
127 void prepareDVDMenu();
128 void prepareUSBMenu();
129
130 void captureFloppy (int id);
131 void captureDVD (int id);
132 void switchUSB (int id);
133 void makeUSBToolTip (int id);
134
135 void showIndicatorContextMenu (QIStateIndicator *ind, QContextMenuEvent *e);
136
137 void updateDeviceLights();
138 void updateMachineState (CEnums::MachineState state);
139
140 void updateMouseState (int state);
141
142 void tryClose();
143
144 void processGlobalSettingChange (const char *publicName, const char *name);
145
146 void dbgShowStatistics();
147 void dbgShowCommandLine();
148
149private:
150
151 QActionGroup *runningActions;
152
153 // VM actions
154 QAction *vmFullscreenAction;
155 QAction *vmAutoresizeGuestAction;
156 QAction *vmAdjustWindowAction;
157 QAction *vmTypeCADAction;
158#if defined(Q_WS_X11)
159 QAction *vmTypeCABSAction;
160#endif
161 QAction *vmResetAction;
162 QAction *vmPauseAction;
163 QAction *vmACPIShutdownAction;
164 QAction *vmCloseAction;
165 QAction *vmTakeSnapshotAction;
166 QAction *vmDisableMouseIntegrAction;
167
168 // Devices actions
169 QAction *devicesMountFloppyImageAction;
170 QAction *devicesUnmountFloppyAction;
171 QAction *devicesMountDVDImageAction;
172 QAction *devicesUnmountDVDAction;
173 QAction *devicesInstallGuestToolsAction;
174
175#ifdef VBOX_WITH_DEBUGGER_GUI
176 // Debugger actions
177 QAction *dbgStatisticsAction;
178 QAction *dbgCommandLineAction;
179#endif
180
181 // Help actions
182 QAction *helpWebAction;
183 QAction *helpAboutAction;
184 QAction *helpResetMessagesAction;
185
186 // Devices popup menus
187 QPopupMenu *devicesMenu;
188 QPopupMenu *devicesMountFloppyMenu;
189 QPopupMenu *devicesMountDVDMenu;
190 QPopupMenu *devicesUSBMenu;
191
192#ifdef VBOX_WITH_DEBUGGER_GUI
193 // Debugger popup menu
194 QPopupMenu *dbgMenu;
195#endif
196
197 // Menu identifiers
198 enum {
199 vmMenuId = 1,
200 devicesMenuId,
201 devicesMountFloppyMenuId,
202 devicesMountDVDMenuId,
203 devicesUSBMenuId,
204 devicesUSBMenuNoDevicesId,
205#ifdef VBOX_WITH_DEBUGGER_GUI
206 dbgMenuId,
207#endif
208 helpMenuId,
209 };
210
211 CSession csession;
212
213 // widgets
214 VBoxConsoleView *console;
215 QIStateIndicator *hd_light, *cd_light, *fd_light, *net_light, *usb_light;
216 QIStateIndicator *mouse_state, *hostkey_state;
217 QHBox *hostkey_hbox;
218 QLabel *hostkey_name;
219
220 VBoxUSBLedTip *mUsbLedTip;
221
222 QTimer *idle_timer;
223 CEnums::MachineState machine_state;
224 QString caption_prefix;
225
226 bool no_auto_close : 1;
227
228 QMap <int, CHostDVDDrive> hostDVDMap;
229 QMap <int, CHostFloppyDrive> hostFloppyMap;
230 QMap <int, CUSBDevice> hostUSBMap;
231
232 QPoint normal_pos;
233 QSize normal_size;
234
235 // variables for dealing with true fullscreen
236 bool full_screen : 1;
237 int normal_wflags;
238 bool was_max : 1;
239 QObjectList hidden_children;
240 int console_style;
241 QColor erase_color;
242
243#ifdef VBOX_WITH_DEBUGGER_GUI
244 // Debugger GUI
245 PDBGGUI dbg_gui;
246#endif
247};
248
249#endif // __VBoxConsoleWnd_h__
Note: See TracBrowser for help on using the repository browser.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette