1 | /** @file
|
---|
2 | *
|
---|
3 | * VBox frontends: Qt GUI ("VirtualBox"):
|
---|
4 | * UIMachineWindow class declaration
|
---|
5 | */
|
---|
6 |
|
---|
7 | /*
|
---|
8 | * Copyright (C) 2010 Sun Microsystems, Inc.
|
---|
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 | * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
|
---|
19 | * Clara, CA 95054 USA or visit http://www.sun.com if you need
|
---|
20 | * additional information or have any questions.
|
---|
21 | */
|
---|
22 |
|
---|
23 | #ifndef __UIMachineWindow_h__
|
---|
24 | #define __UIMachineWindow_h__
|
---|
25 |
|
---|
26 | /* Local includes */
|
---|
27 | #include "COMDefs.h"
|
---|
28 | #include "UIMachineDefs.h"
|
---|
29 |
|
---|
30 | /* Global forwards */
|
---|
31 | class QWidget;
|
---|
32 | class QCloseEvent;
|
---|
33 |
|
---|
34 | /* Local forwards */
|
---|
35 | class UIMachineLogic;
|
---|
36 | class UIMachineView;
|
---|
37 |
|
---|
38 | class UIMachineWindow
|
---|
39 | {
|
---|
40 | public:
|
---|
41 |
|
---|
42 | /* Factory function to create required machine window child: */
|
---|
43 | static UIMachineWindow* create(UIMachineLogic *pMachineLogic, UIVisualStateType visualStateType);
|
---|
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() { return m_pMachineLogic; }
|
---|
51 | virtual QWidget* machineWindow() { return m_pMachineWindow; }
|
---|
52 | virtual UIMachineView* machineView() { return m_pMachineView; }
|
---|
53 |
|
---|
54 | protected:
|
---|
55 |
|
---|
56 | /* Machine window constructor/destructor: */
|
---|
57 | UIMachineWindow(UIMachineLogic *pMachineLogic);
|
---|
58 | virtual ~UIMachineWindow();
|
---|
59 |
|
---|
60 | /* Protected getters: */
|
---|
61 | CSession session();
|
---|
62 | const QString& defaultWindowTitle() const { return m_strWindowTitlePrefix; }
|
---|
63 |
|
---|
64 | /* Translate routine: */
|
---|
65 | virtual void retranslateUi();
|
---|
66 |
|
---|
67 | /* Common machine window event handlers: */
|
---|
68 | void closeEvent(QCloseEvent *pEvent);
|
---|
69 |
|
---|
70 | /* Prepare helpers: */
|
---|
71 | virtual void prepareWindowIcon();
|
---|
72 | virtual void prepareConsoleConnections();
|
---|
73 | virtual void loadWindowSettings();
|
---|
74 |
|
---|
75 | /* Cleanup helpers: */
|
---|
76 | virtual void saveWindowSettings() {}
|
---|
77 | virtual void cleanupConsoleConnections() {}
|
---|
78 | virtual void cleanupWindowIcon() {}
|
---|
79 |
|
---|
80 | /* Update routines: */
|
---|
81 | virtual void updateAppearanceOf(int iElement);
|
---|
82 |
|
---|
83 | /* Protected slots: */
|
---|
84 | void sltMachineStateChanged(KMachineState machineState);
|
---|
85 | void sltPrepareMenuMachine();
|
---|
86 | void sltPrepareMenuDevices();
|
---|
87 | #ifdef VBOX_WITH_DEBUGGER_GUI
|
---|
88 | void sltPrepareMenuDebug();
|
---|
89 | #endif
|
---|
90 |
|
---|
91 | /* Protected variables: */
|
---|
92 | UIMachineLogic *m_pMachineLogic;
|
---|
93 | QWidget *m_pMachineWindow;
|
---|
94 | UIMachineView *m_pMachineView;
|
---|
95 | QString m_strWindowTitlePrefix;
|
---|
96 |
|
---|
97 | friend class UIMachineLogic;
|
---|
98 | };
|
---|
99 |
|
---|
100 | #endif // __UIMachineWindow_h__
|
---|
101 |
|
---|