VirtualBox

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

Last change on this file since 2753 was 2736, checked in by vboxsync, 18 years ago
  1. Messages for “your additions are outdated” and “there is a newer additions version” moved into ProblemReporter class.
  2. AutoResize event class replaced with zero-single-shot timer with the required slot for the exiting from full-screen and maximized modes.
  3. mIsAutoresizeEnabled flag replaced with mIsAdditionsActive which reflects the guest additions status and might be useful in different places to point up are additions activated or not. Currently it is used in "auto-resize mode active possibility" determination.
  4. Linux SDL Full-screen mode entering issue (screen is not refreshed in case of there is no changes on the screen and auto-resize mode is off) fixed.
  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 7.5 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#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
75public slots:
76
77protected:
78
79 // events
80 bool event (QEvent *e);
81 void closeEvent (QCloseEvent *e);
82#if defined(Q_WS_X11)
83 bool x11Event (XEvent *event);
84#endif
85#ifdef VBOX_WITH_DEBUGGER_GUI
86 bool dbgCreated();
87 void dbgDestroy();
88 void dbgAdjustRelativePos();
89#endif
90
91protected slots:
92
93private:
94
95 enum /* Stuff */
96 {
97 FloppyStuff = 0x01,
98 DVDStuff = 0x02,
99 HardDiskStuff = 0x04,
100 PauseAction = 0x08,
101 NetworkStuff = 0x10,
102 DisableMouseIntegrAction = 0x20,
103 Caption = 0x40,
104 USBStuff = 0x80,
105 VRDPStuff = 0x100,
106 AllStuff = 0xFF,
107 };
108
109 void languageChange();
110
111 void updateAppearanceOf (int element);
112
113private slots:
114
115 void finalizeOpenView();
116
117 void loadGuiCustomizations();
118
119 void vmFullscreen (bool on);
120 void vmAutoresizeGuest (bool on);
121 void vmAdjustWindow();
122
123 void vmTypeCAD();
124 void vmTypeCABS();
125 void vmReset();
126 void vmPause(bool);
127 void vmACPIShutdown();
128 void vmClose();
129 void vmTakeSnapshot();
130 void vmDisableMouseIntegr (bool);
131
132 void devicesMountFloppyImage();
133 void devicesUnmountFloppy();
134 void devicesMountDVDImage();
135 void devicesUnmountDVD();
136 void devicesSwitchVrdp (bool);
137 void devicesToggleSFDialog (bool);
138 void devicesInstallGuestAdditions();
139
140 void prepareFloppyMenu();
141 void prepareDVDMenu();
142 void prepareNetworkMenu();
143
144 void setDynamicMenuItemStatusTip (int aId);
145
146 void captureFloppy (int aId);
147 void captureDVD (int aId);
148 void activateNetworkMenu (int aId);
149 void switchUSB (int aId);
150 void activateSFMenu();
151
152 void statusTipChanged (const QString &);
153 void clearStatusBar();
154
155 void showIndicatorContextMenu (QIStateIndicator *ind, QContextMenuEvent *e);
156
157 void updateDeviceLights();
158 void updateMachineState (CEnums::MachineState state);
159
160 void updateMouseState (int state);
161
162 void updateAdditionsState (const QString&, bool);
163
164 void tryClose();
165
166 void processGlobalSettingChange (const char *publicName, const char *name);
167
168 void dbgShowStatistics();
169 void dbgShowCommandLine();
170
171private:
172
173 QActionGroup *runningActions;
174
175 // VM actions
176 QAction *vmFullscreenAction;
177 QAction *vmAutoresizeGuestAction;
178 QAction *vmAdjustWindowAction;
179 QAction *vmTypeCADAction;
180#if defined(Q_WS_X11)
181 QAction *vmTypeCABSAction;
182#endif
183 QAction *vmResetAction;
184 QAction *vmPauseAction;
185 QAction *vmACPIShutdownAction;
186 QAction *vmCloseAction;
187 QAction *vmTakeSnapshotAction;
188 QAction *vmDisableMouseIntegrAction;
189
190 // VM popup menus
191 VBoxSwitchMenu *vmAutoresizeMenu;
192 VBoxSwitchMenu *vmDisMouseIntegrMenu;
193
194 // Devices actions
195 QAction *devicesMountFloppyImageAction;
196 QAction *devicesUnmountFloppyAction;
197 QAction *devicesMountDVDImageAction;
198 QAction *devicesUnmountDVDAction;
199 QAction *devicesSwitchVrdpAction;
200 QAction *devicesSFDialogAction;
201 QAction *devicesInstallGuestToolsAction;
202
203#ifdef VBOX_WITH_DEBUGGER_GUI
204 // Debugger actions
205 QAction *dbgStatisticsAction;
206 QAction *dbgCommandLineAction;
207#endif
208
209 // Help actions
210 QAction *helpWebAction;
211 QAction *helpAboutAction;
212 QAction *helpResetMessagesAction;
213
214 // Devices popup menus
215 QPopupMenu *devicesMenu;
216 QPopupMenu *devicesMountFloppyMenu;
217 QPopupMenu *devicesMountDVDMenu;
218 QPopupMenu *devicesSharedFolders;
219 QPopupMenu *devicesNetworkMenu;
220 VBoxUSBMenu *devicesUSBMenu;
221 VBoxSwitchMenu *devicesVRDPMenu;
222
223 int devicesUSBMenuSeparatorId;
224 int devicesVRDPMenuSeparatorId;
225 int devicesSFMenuSeparatorId;
226
227 bool waitForStatusBarChange;
228 bool statusBarChangedInside;
229
230#ifdef VBOX_WITH_DEBUGGER_GUI
231 // Debugger popup menu
232 QPopupMenu *dbgMenu;
233#endif
234
235 // Menu identifiers
236 enum {
237 vmMenuId = 1,
238 devicesMenuId,
239 devicesMountFloppyMenuId,
240 devicesMountDVDMenuId,
241 devicesUSBMenuId,
242 devicesNetworkMenuId,
243#ifdef VBOX_WITH_DEBUGGER_GUI
244 dbgMenuId,
245#endif
246 helpMenuId,
247 };
248
249 CSession csession;
250
251 // widgets
252 VBoxConsoleView *console;
253 QIStateIndicator *hd_light, *cd_light, *fd_light, *net_light, *usb_light;
254 QIStateIndicator *mouse_state, *hostkey_state;
255 QIStateIndicator *autoresize_state;
256 QIStateIndicator *vrdp_state;
257 QIStateIndicator *sf_state;
258 QHBox *hostkey_hbox;
259 QLabel *hostkey_name;
260
261 VBoxUSBLedTip *mUsbLedTip;
262 VBoxNetworkLedTip *mNetworkLedTip;
263
264 QTimer *idle_timer;
265 CEnums::MachineState machine_state;
266 QString caption_prefix;
267
268 bool no_auto_close : 1;
269
270 QMap <int, CHostDVDDrive> hostDVDMap;
271 QMap <int, CHostFloppyDrive> hostFloppyMap;
272
273 QPoint normal_pos;
274 QSize normal_size;
275
276 // variables for dealing with true fullscreen
277 bool full_screen : 1;
278 int normal_wflags;
279 bool was_max : 1;
280 QObjectList hidden_children;
281 int console_style;
282 QColor erase_color;
283
284#ifdef VBOX_WITH_DEBUGGER_GUI
285 // Debugger GUI
286 PDBGGUI dbg_gui;
287#endif
288
289#ifdef Q_WS_MAC
290 // Dock images.
291 CGImageRef dockImgStateRunning;
292 CGImageRef dockImgStatePaused;
293 CGImageRef dockImgStateSaving;
294 CGImageRef dockImgStateRestoring;
295 CGImageRef dockImgBack75x75;
296 CGImageRef dockImgBack100x75;
297 CGImageRef dockImgOS;
298#endif
299};
300
301
302class VBoxSharedFoldersSettings;
303class VBoxSFDialog : public QDialog
304{
305 Q_OBJECT
306
307public:
308
309 VBoxSFDialog (QWidget*, CSession&, QAction*);
310 ~VBoxSFDialog();
311
312protected slots:
313
314 virtual void accept();
315 virtual void suicide (bool);
316
317protected:
318
319 void showEvent (QShowEvent*);
320
321private:
322
323 VBoxSharedFoldersSettings *mSettings;
324 CSession &mSession;
325 QAction *mAction;
326};
327
328
329#endif // __VBoxConsoleWnd_h__
Note: See TracBrowser for help on using the repository browser.

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