1 | /** @file
|
---|
2 | *
|
---|
3 | * VBox frontends: Qt GUI ("VirtualBox"):
|
---|
4 | * UIActionsPool 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 __UIActionsPool_h__
|
---|
20 | #define __UIActionsPool_h__
|
---|
21 |
|
---|
22 | /* Global includes */
|
---|
23 | #include <QAction>
|
---|
24 |
|
---|
25 | /* Local includes */
|
---|
26 | #include "QIWithRetranslateUI.h"
|
---|
27 |
|
---|
28 | enum UIActionType
|
---|
29 | {
|
---|
30 | UIActionType_Simple,
|
---|
31 | UIActionType_Toggle,
|
---|
32 | UIActionType_Menu
|
---|
33 | };
|
---|
34 |
|
---|
35 | class UIAction : public QIWithRetranslateUI3<QAction>
|
---|
36 | {
|
---|
37 | Q_OBJECT;
|
---|
38 |
|
---|
39 | public:
|
---|
40 |
|
---|
41 | UIAction(QObject *pParent, UIActionType type);
|
---|
42 |
|
---|
43 | UIActionType type() const;
|
---|
44 |
|
---|
45 | private:
|
---|
46 |
|
---|
47 | UIActionType m_type;
|
---|
48 | };
|
---|
49 |
|
---|
50 | enum UIActionIndex
|
---|
51 | {
|
---|
52 | /* "Machine" menu actions: */
|
---|
53 | UIActionIndex_Menu_Machine,
|
---|
54 | UIActionIndex_Toggle_Fullscreen,
|
---|
55 | UIActionIndex_Toggle_Seamless,
|
---|
56 | UIActionIndex_Toggle_Scale,
|
---|
57 | UIActionIndex_Toggle_GuestAutoresize,
|
---|
58 | UIActionIndex_Simple_AdjustWindow,
|
---|
59 | UIActionIndex_Menu_MouseIntegration,
|
---|
60 | UIActionIndex_Toggle_MouseIntegration,
|
---|
61 | UIActionIndex_Simple_TypeCAD,
|
---|
62 | #ifdef Q_WS_X11
|
---|
63 | UIActionIndex_Simple_TypeCABS,
|
---|
64 | #endif
|
---|
65 | UIActionIndex_Simple_TakeSnapshot,
|
---|
66 | UIActionIndex_Simple_InformationDialog,
|
---|
67 | UIActionIndex_Toggle_Pause,
|
---|
68 | UIActionIndex_Simple_Reset,
|
---|
69 | UIActionIndex_Simple_Shutdown,
|
---|
70 | UIActionIndex_Simple_Close,
|
---|
71 |
|
---|
72 | /* "View" menu actions: */
|
---|
73 | UIActionIndex_Menu_View,
|
---|
74 |
|
---|
75 | /* "Devices" menu actions: */
|
---|
76 | UIActionIndex_Menu_Devices,
|
---|
77 | UIActionIndex_Menu_OpticalDevices,
|
---|
78 | UIActionIndex_Menu_FloppyDevices,
|
---|
79 | UIActionIndex_Menu_USBDevices,
|
---|
80 | UIActionIndex_Menu_NetworkAdapters,
|
---|
81 | UIActionIndex_Simple_NetworkAdaptersDialog,
|
---|
82 | UIActionIndex_Menu_SharedFolders,
|
---|
83 | UIActionIndex_Simple_SharedFoldersDialog,
|
---|
84 | UIActionIndex_Toggle_VRDEServer,
|
---|
85 | UIActionIndex_Simple_InstallGuestTools,
|
---|
86 |
|
---|
87 | #ifdef VBOX_WITH_DEBUGGER_GUI
|
---|
88 | /* "Debugger" menu actions: */
|
---|
89 | UIActionIndex_Menu_Debug,
|
---|
90 | UIActionIndex_Simple_Statistics,
|
---|
91 | UIActionIndex_Simple_CommandLine,
|
---|
92 | UIActionIndex_Toggle_Logging,
|
---|
93 | #endif
|
---|
94 |
|
---|
95 | /* "Help" menu actions: */
|
---|
96 | UIActionIndex_Menu_Help,
|
---|
97 | UIActionIndex_Simple_Help,
|
---|
98 | UIActionIndex_Simple_Web,
|
---|
99 | UIActionIndex_Simple_ResetWarnings,
|
---|
100 | #ifdef VBOX_WITH_REGISTRATION
|
---|
101 | UIActionIndex_Simple_Register,
|
---|
102 | #endif /* VBOX_WITH_REGISTRATION */
|
---|
103 | UIActionIndex_Simple_Update,
|
---|
104 | UIActionIndex_Simple_About,
|
---|
105 |
|
---|
106 | #ifdef Q_WS_MAC
|
---|
107 | UIActionIndex_Menu_Dock,
|
---|
108 | UIActionIndex_Menu_DockSettings,
|
---|
109 | UIActionIndex_Toggle_DockPreviewMonitor,
|
---|
110 | UIActionIndex_Toggle_DockDisableMonitor,
|
---|
111 | #endif /* Q_WS_MAC */
|
---|
112 |
|
---|
113 | UIActionIndex_End
|
---|
114 | };
|
---|
115 |
|
---|
116 | class UIActionsPool : public QObject
|
---|
117 | {
|
---|
118 | Q_OBJECT;
|
---|
119 |
|
---|
120 | public:
|
---|
121 |
|
---|
122 | UIActionsPool(QObject *pParent);
|
---|
123 | virtual ~UIActionsPool();
|
---|
124 |
|
---|
125 | UIAction* action(UIActionIndex index) const;
|
---|
126 |
|
---|
127 | void createMenus();
|
---|
128 | bool processHotKey(const QKeySequence &key);
|
---|
129 |
|
---|
130 |
|
---|
131 | protected:
|
---|
132 |
|
---|
133 | bool event(QEvent *pEvent);
|
---|
134 |
|
---|
135 | private:
|
---|
136 |
|
---|
137 | QVector<UIAction*> m_actionsPool;
|
---|
138 | };
|
---|
139 |
|
---|
140 | #endif // __UIActionsPool_h__
|
---|
141 |
|
---|