VirtualBox

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

Last change on this file since 3330 was 3277, checked in by vboxsync, 18 years ago

FE/Qt: Spelling.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 7.6 KB
Line 
1/** @file
2 *
3 * VBox frontends: Qt GUI ("VirtualBox"):
4 * VBoxConsoleWnd class declaration
5 */
6
7/*
8 * Copyright (C) 2006-2007 innotek GmbH
9 *
10 * This file is part of VirtualBox Open Source Edition (OSE), as
11 * available from http://www.215389.xyz. 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#include <qdialog.h>
34
35#ifdef VBOX_WITH_DEBUGGER_GUI
36# include <VBox/dbggui.h>
37#endif
38#ifdef Q_WS_MAC
39# undef PAGE_SIZE
40# undef PAGE_SHIFT
41# include <Carbon/Carbon.h>
42#endif
43
44class QAction;
45class QActionGroup;
46class QHBox;
47class QLabel;
48
49class VBoxConsoleView;
50class QIStateIndicator;
51
52class VBoxUSBMenu;
53class VBoxSwitchMenu;
54class VBoxUSBLedTip;
55class VBoxNetworkLedTip;
56
57class VBoxConsoleWnd : public QMainWindow
58{
59 Q_OBJECT
60
61public:
62
63 VBoxConsoleWnd (VBoxConsoleWnd **aSelf,
64 QWidget* aParent = 0, const char* aName = 0,
65 WFlags aFlags = WType_TopLevel);
66 virtual ~VBoxConsoleWnd();
67
68 bool openView (const CSession &session);
69 void closeView();
70
71 void refreshView();
72
73 bool isTrueFullscreen() const { return full_screen; }
74
75 void setMouseIntegrationLocked (bool);
76
77public slots:
78
79protected:
80
81 // events
82 bool event (QEvent *e);
83 void closeEvent (QCloseEvent *e);
84#if defined(Q_WS_X11)
85 bool x11Event (XEvent *event);
86#endif
87#ifdef VBOX_WITH_DEBUGGER_GUI
88 bool dbgCreated();
89 void dbgDestroy();
90 void dbgAdjustRelativePos();
91#endif
92
93protected slots:
94
95private:
96
97 enum /* Stuff */
98 {
99 FloppyStuff = 0x01,
100 DVDStuff = 0x02,
101 HardDiskStuff = 0x04,
102 PauseAction = 0x08,
103 NetworkStuff = 0x10,
104 DisableMouseIntegrAction = 0x20,
105 Caption = 0x40,
106 USBStuff = 0x80,
107 VRDPStuff = 0x100,
108 AllStuff = 0xFF,
109 };
110
111 void languageChange();
112
113 void updateAppearanceOf (int element);
114
115private slots:
116
117 void finalizeOpenView();
118
119 void activateUICustomizations();
120
121 void vmFullscreen (bool on);
122 void vmAutoresizeGuest (bool on);
123 void vmAdjustWindow();
124
125 void vmTypeCAD();
126 void vmTypeCABS();
127 void vmReset();
128 void vmPause(bool);
129 void vmACPIShutdown();
130 void vmClose();
131 void vmTakeSnapshot();
132 void vmDisableMouseIntegr (bool);
133
134 void devicesMountFloppyImage();
135 void devicesUnmountFloppy();
136 void devicesMountDVDImage();
137 void devicesUnmountDVD();
138 void devicesSwitchVrdp (bool);
139 void devicesToggleSFDialog (bool);
140 void devicesInstallGuestAdditions();
141
142 void prepareFloppyMenu();
143 void prepareDVDMenu();
144 void prepareNetworkMenu();
145
146 void setDynamicMenuItemStatusTip (int aId);
147
148 void captureFloppy (int aId);
149 void captureDVD (int aId);
150 void activateNetworkMenu (int aId);
151 void switchUSB (int aId);
152 void activateSFMenu();
153
154 void statusTipChanged (const QString &);
155 void clearStatusBar();
156
157 void showIndicatorContextMenu (QIStateIndicator *ind, QContextMenuEvent *e);
158
159 void updateDeviceLights();
160 void updateMachineState (CEnums::MachineState state);
161
162 void updateMouseState (int state);
163
164 void updateAdditionsState (const QString&, bool);
165
166 void tryClose();
167
168 void processGlobalSettingChange (const char *publicName, const char *name);
169
170 void dbgShowStatistics();
171 void dbgShowCommandLine();
172
173private:
174
175 QActionGroup *runningActions;
176
177 // VM actions
178 QAction *vmFullscreenAction;
179 QAction *vmAutoresizeGuestAction;
180 QAction *vmAdjustWindowAction;
181 QAction *vmTypeCADAction;
182#if defined(Q_WS_X11)
183 QAction *vmTypeCABSAction;
184#endif
185 QAction *vmResetAction;
186 QAction *vmPauseAction;
187 QAction *vmACPIShutdownAction;
188 QAction *vmCloseAction;
189 QAction *vmTakeSnapshotAction;
190 QAction *vmDisableMouseIntegrAction;
191
192 // VM popup menus
193 VBoxSwitchMenu *vmAutoresizeMenu;
194 VBoxSwitchMenu *vmDisMouseIntegrMenu;
195
196 // Devices actions
197 QAction *devicesMountFloppyImageAction;
198 QAction *devicesUnmountFloppyAction;
199 QAction *devicesMountDVDImageAction;
200 QAction *devicesUnmountDVDAction;
201 QAction *devicesSwitchVrdpAction;
202 QAction *devicesSFDialogAction;
203 QAction *devicesInstallGuestToolsAction;
204
205#ifdef VBOX_WITH_DEBUGGER_GUI
206 // Debugger actions
207 QAction *dbgStatisticsAction;
208 QAction *dbgCommandLineAction;
209#endif
210
211 // Help actions
212 QAction *helpWebAction;
213 QAction *helpAboutAction;
214 QAction *helpResetMessagesAction;
215
216 // Devices popup menus
217 QPopupMenu *devicesMenu;
218 QPopupMenu *devicesMountFloppyMenu;
219 QPopupMenu *devicesMountDVDMenu;
220 QPopupMenu *devicesSharedFolders;
221 QPopupMenu *devicesNetworkMenu;
222 VBoxUSBMenu *devicesUSBMenu;
223 VBoxSwitchMenu *devicesVRDPMenu;
224
225 int devicesUSBMenuSeparatorId;
226 int devicesVRDPMenuSeparatorId;
227 int devicesSFMenuSeparatorId;
228
229 bool waitForStatusBarChange;
230 bool statusBarChangedInside;
231
232#ifdef VBOX_WITH_DEBUGGER_GUI
233 // Debugger popup menu
234 QPopupMenu *dbgMenu;
235#endif
236
237 // Menu identifiers
238 enum {
239 vmMenuId = 1,
240 devicesMenuId,
241 devicesMountFloppyMenuId,
242 devicesMountDVDMenuId,
243 devicesUSBMenuId,
244 devicesNetworkMenuId,
245#ifdef VBOX_WITH_DEBUGGER_GUI
246 dbgMenuId,
247#endif
248 helpMenuId,
249 };
250
251 CSession csession;
252
253 // widgets
254 VBoxConsoleView *console;
255 QIStateIndicator *hd_light, *cd_light, *fd_light, *net_light, *usb_light;
256 QIStateIndicator *mouse_state, *hostkey_state;
257 QIStateIndicator *autoresize_state;
258 QIStateIndicator *vrdp_state;
259 QIStateIndicator *sf_state;
260 QHBox *hostkey_hbox;
261 QLabel *hostkey_name;
262
263 VBoxUSBLedTip *mUsbLedTip;
264 VBoxNetworkLedTip *mNetworkLedTip;
265
266 QTimer *idle_timer;
267 CEnums::MachineState machine_state;
268 QString caption_prefix;
269
270 bool no_auto_close : 1;
271
272 QMap <int, CHostDVDDrive> hostDVDMap;
273 QMap <int, CHostFloppyDrive> hostFloppyMap;
274
275 QPoint normal_pos;
276 QSize normal_size;
277 QSize prev_min_size;
278
279 // variables for dealing with true fullscreen
280 bool full_screen : 1;
281 int normal_wflags;
282 bool was_max : 1;
283 QObjectList hidden_children;
284 int console_style;
285 QColor erase_color;
286
287 bool mIsFirstTimeStarted : 1;
288
289#ifdef VBOX_WITH_DEBUGGER_GUI
290 // Debugger GUI
291 PDBGGUI dbg_gui;
292#endif
293
294#ifdef Q_WS_MAC
295 // Dock images.
296 CGImageRef dockImgStateRunning;
297 CGImageRef dockImgStatePaused;
298 CGImageRef dockImgStateSaving;
299 CGImageRef dockImgStateRestoring;
300 CGImageRef dockImgBack75x75;
301 CGImageRef dockImgBack100x75;
302 CGImageRef dockImgOS;
303#endif
304};
305
306
307class VBoxSharedFoldersSettings;
308class VBoxSFDialog : public QDialog
309{
310 Q_OBJECT
311
312public:
313
314 VBoxSFDialog (QWidget*, CSession&, QAction*);
315 ~VBoxSFDialog();
316
317protected slots:
318
319 virtual void accept();
320 virtual void suicide (bool);
321
322protected:
323
324 void showEvent (QShowEvent*);
325
326private:
327
328 VBoxSharedFoldersSettings *mSettings;
329 CSession &mSession;
330 QAction *mAction;
331};
332
333
334#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