[26637] | 1 | /** @file
|
---|
| 2 | *
|
---|
| 3 | * VBox frontends: Qt GUI ("VirtualBox"):
|
---|
| 4 | * UIActionsPool class declaration
|
---|
| 5 | */
|
---|
| 6 |
|
---|
| 7 | /*
|
---|
[28800] | 8 | * Copyright (C) 2010 Oracle Corporation
|
---|
[26637] | 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,
|
---|
[26707] | 32 | UIActionType_Menu
|
---|
[26637] | 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,
|
---|
[30753] | 56 | UIActionIndex_Toggle_Scale,
|
---|
[26637] | 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,
|
---|
[26691] | 67 | UIActionIndex_Toggle_Pause,
|
---|
[26637] | 68 | UIActionIndex_Simple_Reset,
|
---|
| 69 | UIActionIndex_Simple_Shutdown,
|
---|
| 70 | UIActionIndex_Simple_Close,
|
---|
| 71 |
|
---|
[27335] | 72 | /* "View" menu actions: */
|
---|
| 73 | UIActionIndex_Menu_View,
|
---|
| 74 |
|
---|
[26637] | 75 | /* "Devices" menu actions: */
|
---|
| 76 | UIActionIndex_Menu_Devices,
|
---|
| 77 | UIActionIndex_Menu_OpticalDevices,
|
---|
| 78 | UIActionIndex_Menu_FloppyDevices,
|
---|
[26691] | 79 | UIActionIndex_Menu_USBDevices,
|
---|
[26637] | 80 | UIActionIndex_Menu_NetworkAdapters,
|
---|
| 81 | UIActionIndex_Simple_NetworkAdaptersDialog,
|
---|
| 82 | UIActionIndex_Menu_SharedFolders,
|
---|
| 83 | UIActionIndex_Simple_SharedFoldersDialog,
|
---|
[33386] | 84 | UIActionIndex_Toggle_VRDEServer,
|
---|
[26637] | 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 |
|
---|
[26820] | 95 | /* "Help" menu actions: */
|
---|
| 96 | UIActionIndex_Menu_Help,
|
---|
| 97 | UIActionIndex_Simple_Help,
|
---|
| 98 | UIActionIndex_Simple_Web,
|
---|
| 99 | UIActionIndex_Simple_ResetWarnings,
|
---|
[27599] | 100 | #ifdef VBOX_WITH_REGISTRATION
|
---|
[26820] | 101 | UIActionIndex_Simple_Register,
|
---|
[27599] | 102 | #endif /* VBOX_WITH_REGISTRATION */
|
---|
[26820] | 103 | UIActionIndex_Simple_Update,
|
---|
| 104 | UIActionIndex_Simple_About,
|
---|
| 105 |
|
---|
[27132] | 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 |
|
---|
[26707] | 113 | UIActionIndex_End
|
---|
[26637] | 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 |
|
---|
[26919] | 127 | void createMenus();
|
---|
[26790] | 128 | bool processHotKey(const QKeySequence &key);
|
---|
| 129 |
|
---|
[26919] | 130 |
|
---|
[26790] | 131 | protected:
|
---|
| 132 |
|
---|
| 133 | bool event(QEvent *pEvent);
|
---|
| 134 |
|
---|
[26637] | 135 | private:
|
---|
| 136 |
|
---|
| 137 | QVector<UIAction*> m_actionsPool;
|
---|
| 138 | };
|
---|
| 139 |
|
---|
| 140 | #endif // __UIActionsPool_h__
|
---|
[26709] | 141 |
|
---|