VirtualBox

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

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

FE/Qt: Multi-screen support: Using own setMask implementation again, it will fix few seamless-related issues.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 3.8 KB
Line 
1/** @file
2 *
3 * VBox frontends: Qt GUI ("VirtualBox"):
4 * UIMachineWindow class declaration
5 */
6
7/*
8 * Copyright (C) 2010-2013 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/* Qt includes: */
23#include <QMainWindow>
24
25/* GUI includes: */
26#include "QIWithRetranslateUI.h"
27#include "UIMachineDefs.h"
28
29/* COM includes: */
30#include "COMEnums.h"
31#include "CMachine.h"
32
33/* Forward declarations: */
34class QGridLayout;
35class QSpacerItem;
36class QCloseEvent;
37class CSession;
38class UISession;
39class UIMachineLogic;
40class UIMachineView;
41
42/* Machine-window interface: */
43class UIMachineWindow : public QIWithRetranslateUI2<QMainWindow>
44{
45 Q_OBJECT;
46
47public:
48
49 /* Factory functions to create/destroy machine-window: */
50 static UIMachineWindow* create(UIMachineLogic *pMachineLogic, ulong uScreenId = 0);
51 static void destroy(UIMachineWindow *pWhichWindow);
52
53 /* Prepare/cleanup machine-window: */
54 void prepare();
55 void cleanup();
56
57 /* Public getters: */
58 UIMachineView* machineView() const { return m_pMachineView; }
59 UIMachineLogic* machineLogic() const { return m_pMachineLogic; }
60 UISession* uisession() const;
61 CSession& session() const;
62 CMachine machine() const;
63
64 /* Virtual caller for base class setMask: */
65 virtual void setMask(const QRegion &region);
66
67protected slots:
68
69 /* Session event-handlers: */
70 virtual void sltMachineStateChanged();
71
72protected:
73
74 /* Constructor: */
75 UIMachineWindow(UIMachineLogic *pMachineLogic, ulong uScreenId);
76
77 /* Show stuff: */
78 virtual void showInNecessaryMode() = 0;
79
80 /* Translate stuff: */
81 void retranslateUi();
82
83 /* Event handlers: */
84#ifdef Q_WS_X11
85 bool x11Event(XEvent *pEvent);
86#endif /* Q_WS_X11 */
87 void closeEvent(QCloseEvent *pEvent);
88
89 /* Prepare helpers: */
90 virtual void prepareSessionConnections();
91 virtual void prepareMainLayout();
92 virtual void prepareMenu() {}
93 virtual void prepareStatusBar() {}
94 virtual void prepareMachineView();
95 virtual void prepareVisualState() {}
96 virtual void prepareHandlers();
97 virtual void loadSettings() {}
98
99 /* Cleanup helpers: */
100 virtual void saveSettings() {}
101 virtual void cleanupHandlers();
102 virtual void cleanupVisualState() {}
103 virtual void cleanupMachineView();
104 virtual void cleanupStatusBar() {}
105 virtual void cleanupMenu() {}
106 virtual void cleanupMainLayout() {}
107 virtual void cleanupSessionConnections() {}
108
109 /* Visibility stuff: */
110 void handleScreenCountChange();
111
112 /* Update stuff: */
113 virtual void updateAppearanceOf(int iElement);
114#ifdef VBOX_WITH_DEBUGGER_GUI
115 void updateDbgWindows();
116#endif /* VBOX_WITH_DEBUGGER_GUI */
117
118 /* Helpers: */
119 const QString& defaultWindowTitle() const { return m_strWindowTitlePrefix; }
120 static Qt::WindowFlags windowFlags(UIVisualStateType visualStateType);
121 static Qt::Alignment viewAlignment(UIVisualStateType visualStateType);
122
123 /* Variables: */
124 UIMachineLogic *m_pMachineLogic;
125 UIMachineView *m_pMachineView;
126 QString m_strWindowTitlePrefix;
127 ulong m_uScreenId;
128 QGridLayout *m_pMainLayout;
129 QSpacerItem *m_pTopSpacer;
130 QSpacerItem *m_pBottomSpacer;
131 QSpacerItem *m_pLeftSpacer;
132 QSpacerItem *m_pRightSpacer;
133
134 /* Friend classes: */
135 friend class UIMachineLogic;
136 friend class UIMachineLogicFullscreen;
137 friend class UIMachineLogicSeamless;
138};
139
140#endif // __UIMachineWindow_h__
141
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