VirtualBox

source: vbox/trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineWindow.h@ 41051

Last change on this file since 41051 was 41051, checked in by vboxsync, 12 years ago

FE/Qt: 5820: Show/hide VM windows when the count changes within the guest.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 3.5 KB
Line 
1/** @file
2 *
3 * VBox frontends: Qt GUI ("VirtualBox"):
4 * UIMachineWindow class declaration
5 */
6
7/*
8 * Copyright (C) 2010 Oracle Corporation
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 (GPL) as published by the Free Software
14 * Foundation, in version 2 as it comes in the "COPYING" file of the
15 * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
16 * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
17 */
18
19#ifndef __UIMachineWindow_h__
20#define __UIMachineWindow_h__
21
22/* Local includes */
23#include "UIMachineDefs.h"
24#include "COMDefs.h"
25
26/* Global forwards */
27class QWidget;
28class QGridLayout;
29class QSpacerItem;
30class QCloseEvent;
31
32/* Local forwards */
33class CSession;
34class UISession;
35class UIMachineLogic;
36class UIMachineView;
37
38class UIMachineWindow
39{
40public:
41
42 /* Factory function to create required machine window child: */
43 static UIMachineWindow* create(UIMachineLogic *pMachineLogic, UIVisualStateType visualStateType, ulong uScreenId = 0);
44 static void destroy(UIMachineWindow *pWhichWindow);
45
46 /* Abstract slot to close machine window: */
47 virtual void sltTryClose();
48
49 /* Public getters: */
50 virtual UIMachineLogic* machineLogic() const { return m_pMachineLogic; }
51 virtual QWidget* machineWindow() const { return m_pMachineWindow; }
52 virtual UIMachineView* machineView() const { return m_pMachineView; }
53 UISession* uisession() const;
54 CSession& session() const;
55
56 /* Public members: */
57 virtual void reshow() {}
58 virtual void setMask(const QRegion &region);
59
60protected:
61
62 /* Machine window constructor/destructor: */
63 UIMachineWindow(UIMachineLogic *pMachineLogic, ulong uScreenId);
64 virtual ~UIMachineWindow();
65
66 /* Protected getters: */
67 const QString& defaultWindowTitle() const { return m_strWindowTitlePrefix; }
68
69 /* Translate routine: */
70 virtual void retranslateUi();
71
72 /* Common machine window event handlers: */
73#ifdef Q_WS_X11
74 bool x11Event(XEvent *pEvent);
75#endif
76 void closeEvent(QCloseEvent *pEvent);
77
78 /* Prepare helpers: */
79 virtual void prepareWindowIcon();
80 virtual void prepareConsoleConnections();
81 virtual void prepareMachineViewContainer();
82 //virtual void loadWindowSettings() {}
83 virtual void prepareHandlers();
84
85 /* Cleanup helpers: */
86 virtual void cleanupHandlers();
87 //virtual void saveWindowSettings() {}
88 //virtual void cleanupMachineViewContainer() {}
89 //virtual void cleanupConsoleConnections() {}
90 //virtual void cleanupWindowIcon() {}
91
92 /* Update routines: */
93 virtual void updateAppearanceOf(int iElement);
94#ifdef VBOX_WITH_DEBUGGER_GUI
95 virtual void updateDbgWindows();
96#endif /* VBOX_WITH_DEBUGGER_GUI */
97
98 /* Protected slots: */
99 virtual void sltMachineStateChanged();
100 virtual void sltGuestMonitorChange(KGuestMonitorChangedEventType changeType, ulong uScreenId, QRect screenGeo);
101
102 /* Show routine: */
103 virtual void showInNecessaryMode() = 0;
104
105 /* Protected variables: */
106 UIMachineLogic *m_pMachineLogic;
107 QWidget *m_pMachineWindow;
108
109 /* Virtual screen number: */
110 ulong m_uScreenId;
111
112 QGridLayout *m_pMachineViewContainer;
113 QSpacerItem *m_pTopSpacer;
114 QSpacerItem *m_pBottomSpacer;
115 QSpacerItem *m_pLeftSpacer;
116 QSpacerItem *m_pRightSpacer;
117
118 UIMachineView *m_pMachineView;
119 QString m_strWindowTitlePrefix;
120
121 friend class UIMachineLogic;
122};
123
124#endif // __UIMachineWindow_h__
125
Note: See TracBrowser for help on using the repository browser.

© 2023 Oracle
ContactPrivacy policyTerms of Use