VirtualBox

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

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

Biggest check-in ever. New source code headers for all (C) innotek files.

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