UIActionPoolRuntime.h revision 4429cc47d1e3ca88d6237e5ee7a876dc409cdc24
/** @file
* VBox Qt GUI - UIActionPoolRuntime class declaration.
*/
/*
* Copyright (C) 2010-2014 Oracle Corporation
*
* This file is part of VirtualBox Open Source Edition (OSE), as
* available from http://www.virtualbox.org. This file is free software;
* General Public License (GPL) as published by the Free Software
* Foundation, in version 2 as it comes in the "COPYING" file of the
* VirtualBox OSE distribution. VirtualBox OSE is distributed in the
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*/
#ifndef ___UIActionPoolRuntime_h___
#define ___UIActionPoolRuntime_h___
/* Qt includes: */
#include <QMap>
#include <QList>
/* GUI includes: */
#include "UIActionPool.h"
#include "UIExtraDataDefs.h"
/** Runtime action-pool index enum.
* Naming convention is following:
* 1. Every menu index prepended with 'M',
* 2. Every simple-action index prepended with 'S',
* 3. Every toggle-action index presended with 'T',
* 4. Every polymorphic-action index presended with 'P',
* 5. Every sub-index contains full parent-index name. */
enum UIActionIndexRT
{
/* 'Machine' menu actions: */
#ifdef Q_WS_X11
#endif /* Q_WS_X11 */
/* 'View' menu actions: */
/* 'Devices' menu actions: */
#ifdef VBOX_WITH_DEBUGGER_GUI
/* 'Debugger' menu actions: */
#endif /* VBOX_WITH_DEBUGGER_GUI */
#ifdef Q_WS_MAC
/* 'Dock' menu actions: */
#endif /* Q_WS_MAC */
/* Maximum index: */
};
/** UIActionPool extension
* representing action-pool singleton for Runtime UI. */
{
/** Notifies about 'View' : 'Resize' menu action trigger. */
/** Returns whether the menu with passed @a type is allowed in menu-bar. */
/** Defines menu-bar @a restriction for passed @a level. */
#ifdef Q_WS_MAC
/** Returns whether the action with passed @a type is allowed in the 'Application' menu. */
/** Defines 'Application' menu @a restriction for passed @a level. */
void setRestrictionForMenuApplication(UIActionRestrictionLevel level, RuntimeMenuApplicationActionType restriction);
#endif /* Q_WS_MAC */
/** Returns whether the action with passed @a type is allowed in the 'Machine' menu. */
/** Defines 'Machine' menu @a restriction for passed @a level. */
void setRestrictionForMenuMachine(UIActionRestrictionLevel level, RuntimeMenuMachineActionType restriction);
/** Returns whether the action with passed @a type is allowed in the 'View' menu. */
/** Defines 'View' menu @a restriction for passed @a level. */
void setRestrictionForMenuView(UIActionRestrictionLevel level, RuntimeMenuViewActionType restriction);
/** Returns whether the action with passed @a type is allowed in the 'Devices' menu. */
/** Defines 'Devices' menu @a restriction for passed @a level. */
void setRestrictionForMenuDevices(UIActionRestrictionLevel level, RuntimeMenuDevicesActionType restriction);
#ifdef VBOX_WITH_DEBUGGER_GUI
/** Returns whether the action with passed @a type is allowed in the 'Debug' menu. */
/** Defines 'Debug' menu @a restriction for passed @a level. */
void setRestrictionForMenuDebugger(UIActionRestrictionLevel level, RuntimeMenuDebuggerActionType restriction);
#endif /* VBOX_WITH_DEBUGGER_GUI */
/** Returns whether the action with passed @a type is allowed in the 'Help' menu. */
/** Defines 'Help' menu @a restriction for passed @a level. */
void setRestrictionForMenuHelp(UIActionRestrictionLevel level, RuntimeMenuHelpActionType restriction);
/** Defines current frame-buffer sizes
* for menus which uses such arguments to build content. */
/** Prepare 'View' : 'Resize' menu routine. */
void sltPrepareMenuViewResize();
/** Handles 'View' : 'Resize' menu @a pAction trigger. */
/** Constructor,
* @param fTemporary is used to determine whether this action-pool is temporary,
* which can be created to re-initialize shortcuts-pool. */
UIActionPoolRuntime(bool fTemporary = false);
/** Prepare pool routine. */
virtual void preparePool();
/** Prepare connections routine. */
virtual void prepareConnections();
/** Update configuration routine. */
virtual void updateConfiguration();
/** Update menus routine. */
void updateMenus();
/** Update 'Machine' menu routine. */
void updateMenuMachine();
/** Update 'View' menu routine. */
void updateMenuView();
/** Update 'View' : 'Popup' menu routine. */
void updateMenuViewPopup();
/** Update 'View' : 'Status Bar' menu routine. */
void updateMenuViewStatusBar();
/** Update 'View' : 'Resize' @a pMenu routine. */
/** Update 'Devices' menu routine. */
void updateMenuDevices();
/** Update 'Devices' : 'Hard Drives' menu routine. */
void updateMenuDevicesHardDrives();
/** Update 'Devices' : 'USB' menu routine. */
void updateMenuDevicesUSBDevices();
/** Update 'Devices' : 'Network' menu routine. */
void updateMenuDevicesNetwork();
/** Update 'Devices' : 'Shared Folders' menu routine. */
void updateMenuDevicesSharedFolders();
/** Update 'Devices' : 'Video Capture' menu routine. */
void updateMenuDevicesVideoCapture();
#ifdef VBOX_WITH_DEBUGGER_GUI
/** Update 'Debug' menu routine. */
void updateMenuDebug();
#endif /* VBOX_WITH_DEBUGGER_GUI */
/** Update 'Help' menu routine. */
void updateMenuHelp();
/** Translation handler. */
virtual void retranslateUi();
/** Returns extra-data ID to save keyboard shortcuts under. */
/** Returns the list of Runtime UI main menus. */
/** Holds the list of main-menus. */
/** Holds restricted menus. */
#ifdef Q_WS_MAC
/** Holds restricted actions of the Application menu. */
QMap<UIActionRestrictionLevel, RuntimeMenuApplicationActionType> m_restrictedActionsMenuApplication;
#endif /* Q_WS_MAC */
/** Holds restricted actions of the Machine menu. */
/** Holds restricted actions of the View menu. */
/** Holds restricted actions of the Devices menu. */
#ifdef VBOX_WITH_DEBUGGER_GUI
/** Holds restricted actions of the Debugger menu. */
#endif /* VBOX_WITH_DEBUGGER_GUI */
/** Holds restricted actions of the Help menu. */
/** Defines current frame-buffer sizes
* for menus which uses such arguments to build content. */
/* Enable factory in base-class: */
};
#endif /* !___UIActionPoolRuntime_h___ */