[382] | 1 | /** @file
|
---|
| 2 | *
|
---|
| 3 | * VBox frontends: Qt GUI ("VirtualBox"):
|
---|
[26637] | 4 | * UIMachineWindow class declaration
|
---|
[382] | 5 | */
|
---|
| 6 |
|
---|
| 7 | /*
|
---|
[28800] | 8 | * Copyright (C) 2010 Oracle Corporation
|
---|
[382] | 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
|
---|
[5999] | 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.
|
---|
[382] | 17 | */
|
---|
| 18 |
|
---|
[26637] | 19 | #ifndef __UIMachineWindow_h__
|
---|
| 20 | #define __UIMachineWindow_h__
|
---|
[382] | 21 |
|
---|
[23723] | 22 | /* Local includes */
|
---|
[26637] | 23 | #include "UIMachineDefs.h"
|
---|
[12010] | 24 |
|
---|
[23723] | 25 | /* Global forwards */
|
---|
[26637] | 26 | class QWidget;
|
---|
[26878] | 27 | class QGridLayout;
|
---|
| 28 | class QSpacerItem;
|
---|
[26691] | 29 | class QCloseEvent;
|
---|
[382] | 30 |
|
---|
[23723] | 31 | /* Local forwards */
|
---|
[26815] | 32 | class CSession;
|
---|
| 33 | class UISession;
|
---|
[26637] | 34 | class UIMachineLogic;
|
---|
| 35 | class UIMachineView;
|
---|
[20047] | 36 |
|
---|
[26637] | 37 | class UIMachineWindow
|
---|
[16319] | 38 | {
|
---|
| 39 | public:
|
---|
| 40 |
|
---|
[26637] | 41 | /* Factory function to create required machine window child: */
|
---|
[26921] | 42 | static UIMachineWindow* create(UIMachineLogic *pMachineLogic, UIVisualStateType visualStateType, ulong uScreenId = 0);
|
---|
[26656] | 43 | static void destroy(UIMachineWindow *pWhichWindow);
|
---|
[382] | 44 |
|
---|
[26637] | 45 | /* Abstract slot to close machine window: */
|
---|
[26691] | 46 | virtual void sltTryClose();
|
---|
[3674] | 47 |
|
---|
[26637] | 48 | /* Public getters: */
|
---|
[27044] | 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;
|
---|
[23723] | 54 |
|
---|
[27424] | 55 | /* Public members: */
|
---|
[27335] | 56 | virtual void reshow() {}
|
---|
[30636] | 57 | virtual void setMask(const QRegion ®ion);
|
---|
[27335] | 58 |
|
---|
[382] | 59 | protected:
|
---|
| 60 |
|
---|
[26773] | 61 | /* Machine window constructor/destructor: */
|
---|
[26921] | 62 | UIMachineWindow(UIMachineLogic *pMachineLogic, ulong uScreenId);
|
---|
[26637] | 63 | virtual ~UIMachineWindow();
|
---|
[8946] | 64 |
|
---|
[26773] | 65 | /* Protected getters: */
|
---|
| 66 | const QString& defaultWindowTitle() const { return m_strWindowTitlePrefix; }
|
---|
| 67 |
|
---|
[26637] | 68 | /* Translate routine: */
|
---|
[26656] | 69 | virtual void retranslateUi();
|
---|
[8946] | 70 |
|
---|
[26773] | 71 | /* Common machine window event handlers: */
|
---|
[30213] | 72 | #ifdef Q_WS_X11
|
---|
| 73 | bool x11Event(XEvent *pEvent);
|
---|
| 74 | #endif
|
---|
[26773] | 75 | void closeEvent(QCloseEvent *pEvent);
|
---|
[382] | 76 |
|
---|
[26656] | 77 | /* Prepare helpers: */
|
---|
| 78 | virtual void prepareWindowIcon();
|
---|
[26691] | 79 | virtual void prepareConsoleConnections();
|
---|
[26878] | 80 | virtual void prepareMachineViewContainer();
|
---|
[26815] | 81 | //virtual void loadWindowSettings() {}
|
---|
[30542] | 82 | virtual void prepareHandlers();
|
---|
[26656] | 83 |
|
---|
| 84 | /* Cleanup helpers: */
|
---|
[30542] | 85 | virtual void cleanupHandlers();
|
---|
[26800] | 86 | //virtual void saveWindowSettings() {}
|
---|
[26878] | 87 | //virtual void cleanupMachineViewContainer() {}
|
---|
[26800] | 88 | //virtual void cleanupConsoleConnections() {}
|
---|
| 89 | //virtual void cleanupWindowIcon() {}
|
---|
[26656] | 90 |
|
---|
[26773] | 91 | /* Update routines: */
|
---|
| 92 | virtual void updateAppearanceOf(int iElement);
|
---|
[28389] | 93 | #ifdef VBOX_WITH_DEBUGGER_GUI
|
---|
| 94 | virtual void updateDbgWindows();
|
---|
| 95 | #endif /* VBOX_WITH_DEBUGGER_GUI */
|
---|
[382] | 96 |
|
---|
[26773] | 97 | /* Protected slots: */
|
---|
[26815] | 98 | virtual void sltMachineStateChanged();
|
---|
[26691] | 99 |
|
---|
[26637] | 100 | /* Protected variables: */
|
---|
[26656] | 101 | UIMachineLogic *m_pMachineLogic;
|
---|
[26637] | 102 | QWidget *m_pMachineWindow;
|
---|
[26878] | 103 |
|
---|
[26921] | 104 | /* Virtual screen number: */
|
---|
| 105 | ulong m_uScreenId;
|
---|
| 106 |
|
---|
[26878] | 107 | QGridLayout *m_pMachineViewContainer;
|
---|
| 108 | QSpacerItem *m_pTopSpacer;
|
---|
| 109 | QSpacerItem *m_pBottomSpacer;
|
---|
| 110 | QSpacerItem *m_pLeftSpacer;
|
---|
| 111 | QSpacerItem *m_pRightSpacer;
|
---|
| 112 |
|
---|
[26637] | 113 | UIMachineView *m_pMachineView;
|
---|
[26656] | 114 | QString m_strWindowTitlePrefix;
|
---|
[382] | 115 |
|
---|
[26656] | 116 | friend class UIMachineLogic;
|
---|
[23723] | 117 | };
|
---|
[382] | 118 |
|
---|
[26637] | 119 | #endif // __UIMachineWindow_h__
|
---|
[26709] | 120 |
|
---|