VirtualBox

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

Last change on this file since 35740 was 30636, checked in by vboxsync, 14 years ago

FE/Qt: New running VM core: Just some cosmetics.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 3.3 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
25/* Global forwards */
26class QWidget;
27class QGridLayout;
28class QSpacerItem;
29class QCloseEvent;
30
31/* Local forwards */
32class CSession;
33class UISession;
34class UIMachineLogic;
35class UIMachineView;
36
37class UIMachineWindow
38{
39public:
40
41 /* Factory function to create required machine window child: */
42 static UIMachineWindow* create(UIMachineLogic *pMachineLogic, UIVisualStateType visualStateType, ulong uScreenId = 0);
43 static void destroy(UIMachineWindow *pWhichWindow);
44
45 /* Abstract slot to close machine window: */
46 virtual void sltTryClose();
47
48 /* Public getters: */
49 virtual UIMachineLogic* machineLogic() const { return m_pMachineLogic; }
50 virtual QWidget* machineWindow() const { return m_pMachineWindow; }
51 virtual UIMachineView* machineView() const { return m_pMachineView; }
52 UISession* uisession() const;
53 CSession& session() const;
54
55 /* Public members: */
56 virtual void reshow() {}
57 virtual void setMask(const QRegion &region);
58
59protected:
60
61 /* Machine window constructor/destructor: */
62 UIMachineWindow(UIMachineLogic *pMachineLogic, ulong uScreenId);
63 virtual ~UIMachineWindow();
64
65 /* Protected getters: */
66 const QString& defaultWindowTitle() const { return m_strWindowTitlePrefix; }
67
68 /* Translate routine: */
69 virtual void retranslateUi();
70
71 /* Common machine window event handlers: */
72#ifdef Q_WS_X11
73 bool x11Event(XEvent *pEvent);
74#endif
75 void closeEvent(QCloseEvent *pEvent);
76
77 /* Prepare helpers: */
78 virtual void prepareWindowIcon();
79 virtual void prepareConsoleConnections();
80 virtual void prepareMachineViewContainer();
81 //virtual void loadWindowSettings() {}
82 virtual void prepareHandlers();
83
84 /* Cleanup helpers: */
85 virtual void cleanupHandlers();
86 //virtual void saveWindowSettings() {}
87 //virtual void cleanupMachineViewContainer() {}
88 //virtual void cleanupConsoleConnections() {}
89 //virtual void cleanupWindowIcon() {}
90
91 /* Update routines: */
92 virtual void updateAppearanceOf(int iElement);
93#ifdef VBOX_WITH_DEBUGGER_GUI
94 virtual void updateDbgWindows();
95#endif /* VBOX_WITH_DEBUGGER_GUI */
96
97 /* Protected slots: */
98 virtual void sltMachineStateChanged();
99
100 /* Protected variables: */
101 UIMachineLogic *m_pMachineLogic;
102 QWidget *m_pMachineWindow;
103
104 /* Virtual screen number: */
105 ulong m_uScreenId;
106
107 QGridLayout *m_pMachineViewContainer;
108 QSpacerItem *m_pTopSpacer;
109 QSpacerItem *m_pBottomSpacer;
110 QSpacerItem *m_pLeftSpacer;
111 QSpacerItem *m_pRightSpacer;
112
113 UIMachineView *m_pMachineView;
114 QString m_strWindowTitlePrefix;
115
116 friend class UIMachineLogic;
117};
118
119#endif // __UIMachineWindow_h__
120
Note: See TracBrowser for help on using the repository browser.

© 2023 Oracle
ContactPrivacy policyTerms of Use