VirtualBox

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

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

1758: Implement Shared Folders UI

Shared Folders List Dialog now can be invoked from working console menu. This dialog shows the list of Shared Folders available for current VM/Console and allows add/remove transient shared folders.

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