36545c63b2aab948161e4a712913a4f2dce17d2fvboxsync/** @file
ea45fd67689d7a915b8a1b9f4ab2ba32652cf7b2vboxsync * VBox Qt GUI - UIActionPool class declaration.
36545c63b2aab948161e4a712913a4f2dce17d2fvboxsync */
36545c63b2aab948161e4a712913a4f2dce17d2fvboxsync
36545c63b2aab948161e4a712913a4f2dce17d2fvboxsync/*
ea45fd67689d7a915b8a1b9f4ab2ba32652cf7b2vboxsync * Copyright (C) 2010-2014 Oracle Corporation
36545c63b2aab948161e4a712913a4f2dce17d2fvboxsync *
36545c63b2aab948161e4a712913a4f2dce17d2fvboxsync * This file is part of VirtualBox Open Source Edition (OSE), as
36545c63b2aab948161e4a712913a4f2dce17d2fvboxsync * available from http://www.virtualbox.org. This file is free software;
36545c63b2aab948161e4a712913a4f2dce17d2fvboxsync * you can redistribute it and/or modify it under the terms of the GNU
36545c63b2aab948161e4a712913a4f2dce17d2fvboxsync * General Public License (GPL) as published by the Free Software
36545c63b2aab948161e4a712913a4f2dce17d2fvboxsync * Foundation, in version 2 as it comes in the "COPYING" file of the
36545c63b2aab948161e4a712913a4f2dce17d2fvboxsync * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
36545c63b2aab948161e4a712913a4f2dce17d2fvboxsync * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
36545c63b2aab948161e4a712913a4f2dce17d2fvboxsync */
36545c63b2aab948161e4a712913a4f2dce17d2fvboxsync
ea45fd67689d7a915b8a1b9f4ab2ba32652cf7b2vboxsync#ifndef ___UIActionPool_h___
ea45fd67689d7a915b8a1b9f4ab2ba32652cf7b2vboxsync#define ___UIActionPool_h___
36545c63b2aab948161e4a712913a4f2dce17d2fvboxsync
7b2222e6c060dfe168591f22543d3a80f96112b4vboxsync/* Qt includes: */
36545c63b2aab948161e4a712913a4f2dce17d2fvboxsync#include <QAction>
36545c63b2aab948161e4a712913a4f2dce17d2fvboxsync#include <QMenu>
36545c63b2aab948161e4a712913a4f2dce17d2fvboxsync
7b2222e6c060dfe168591f22543d3a80f96112b4vboxsync/* GUI includes: */
36545c63b2aab948161e4a712913a4f2dce17d2fvboxsync#include "QIWithRetranslateUI.h"
98e2c4b54b8f4f38a9c5a56c7e5d470a6bf8fccbvboxsync#include "UIExtraDataDefs.h"
36545c63b2aab948161e4a712913a4f2dce17d2fvboxsync
7b2222e6c060dfe168591f22543d3a80f96112b4vboxsync/* Forward declarations: */
ea45fd67689d7a915b8a1b9f4ab2ba32652cf7b2vboxsyncclass UIActionPolymorphic;
4322eab57b88f880a55e6a4ae0cb76b870167f06vboxsyncclass UIActionPool;
d22a253d4eb50a2e7341d28d7f7dde3b69b49b0cvboxsyncclass UIActionPoolRuntime;
d22a253d4eb50a2e7341d28d7f7dde3b69b49b0cvboxsyncclass UIActionPoolSelector;
4322eab57b88f880a55e6a4ae0cb76b870167f06vboxsync
ea45fd67689d7a915b8a1b9f4ab2ba32652cf7b2vboxsync
ea45fd67689d7a915b8a1b9f4ab2ba32652cf7b2vboxsync/** Action-pool types. */
4322eab57b88f880a55e6a4ae0cb76b870167f06vboxsyncenum UIActionPoolType
4322eab57b88f880a55e6a4ae0cb76b870167f06vboxsync{
4322eab57b88f880a55e6a4ae0cb76b870167f06vboxsync UIActionPoolType_Selector,
4322eab57b88f880a55e6a4ae0cb76b870167f06vboxsync UIActionPoolType_Runtime
4322eab57b88f880a55e6a4ae0cb76b870167f06vboxsync};
7b2222e6c060dfe168591f22543d3a80f96112b4vboxsync
ea45fd67689d7a915b8a1b9f4ab2ba32652cf7b2vboxsync/** Action types. */
36545c63b2aab948161e4a712913a4f2dce17d2fvboxsyncenum UIActionType
36545c63b2aab948161e4a712913a4f2dce17d2fvboxsync{
43ac5db20bd450cb619fb7bc76b4c369cee128c7vboxsync UIActionType_Menu,
36545c63b2aab948161e4a712913a4f2dce17d2fvboxsync UIActionType_Simple,
36545c63b2aab948161e4a712913a4f2dce17d2fvboxsync UIActionType_Toggle,
43ac5db20bd450cb619fb7bc76b4c369cee128c7vboxsync UIActionType_Polymorphic
36545c63b2aab948161e4a712913a4f2dce17d2fvboxsync};
36545c63b2aab948161e4a712913a4f2dce17d2fvboxsync
ea45fd67689d7a915b8a1b9f4ab2ba32652cf7b2vboxsync/** Action indexes. */
36545c63b2aab948161e4a712913a4f2dce17d2fvboxsyncenum UIActionIndex
36545c63b2aab948161e4a712913a4f2dce17d2fvboxsync{
1ae2aeb1d8bb1614cf94d8de9a5afed3a2510161vboxsync /* 'Application' menu actions: */
1ae2aeb1d8bb1614cf94d8de9a5afed3a2510161vboxsync UIActionIndex_M_Application,
2e76757ceed513b38c43d0f33cd24cc18baf3ffevboxsync#ifdef RT_OS_DARWIN
1ae2aeb1d8bb1614cf94d8de9a5afed3a2510161vboxsync UIActionIndex_M_Application_S_About,
2e76757ceed513b38c43d0f33cd24cc18baf3ffevboxsync#endif /* RT_OS_DARWIN */
1ae2aeb1d8bb1614cf94d8de9a5afed3a2510161vboxsync UIActionIndex_M_Application_S_Preferences,
2e76757ceed513b38c43d0f33cd24cc18baf3ffevboxsync#ifdef VBOX_GUI_WITH_NETWORK_MANAGER
2e76757ceed513b38c43d0f33cd24cc18baf3ffevboxsync UIActionIndex_M_Application_S_NetworkAccessManager,
2e76757ceed513b38c43d0f33cd24cc18baf3ffevboxsync UIActionIndex_M_Application_S_CheckForUpdates,
2e76757ceed513b38c43d0f33cd24cc18baf3ffevboxsync#endif /* VBOX_GUI_WITH_NETWORK_MANAGER */
2e76757ceed513b38c43d0f33cd24cc18baf3ffevboxsync UIActionIndex_M_Application_S_ResetWarnings,
1ae2aeb1d8bb1614cf94d8de9a5afed3a2510161vboxsync UIActionIndex_M_Application_S_Close,
f0821e819e51b95ecaf7b12c742da563b4ddf7e5vboxsync
2e76757ceed513b38c43d0f33cd24cc18baf3ffevboxsync#ifdef RT_OS_DARWIN
f0821e819e51b95ecaf7b12c742da563b4ddf7e5vboxsync /* 'Window' menu actions: */
f0821e819e51b95ecaf7b12c742da563b4ddf7e5vboxsync UIActionIndex_M_Window,
f0821e819e51b95ecaf7b12c742da563b4ddf7e5vboxsync UIActionIndex_M_Window_S_Minimize,
1ae2aeb1d8bb1614cf94d8de9a5afed3a2510161vboxsync#endif /* RT_OS_DARWIN */
1ae2aeb1d8bb1614cf94d8de9a5afed3a2510161vboxsync
36545c63b2aab948161e4a712913a4f2dce17d2fvboxsync /* 'Help' menu actions: */
36545c63b2aab948161e4a712913a4f2dce17d2fvboxsync UIActionIndex_Menu_Help,
cdaeb34871aa28b96c0d80b474f3c8f9805d0388vboxsync UIActionIndex_Simple_Contents,
cdaeb34871aa28b96c0d80b474f3c8f9805d0388vboxsync UIActionIndex_Simple_WebSite,
1ae2aeb1d8bb1614cf94d8de9a5afed3a2510161vboxsync#ifndef RT_OS_DARWIN
36545c63b2aab948161e4a712913a4f2dce17d2fvboxsync UIActionIndex_Simple_About,
1ae2aeb1d8bb1614cf94d8de9a5afed3a2510161vboxsync#endif /* !RT_OS_DARWIN */
36545c63b2aab948161e4a712913a4f2dce17d2fvboxsync
36545c63b2aab948161e4a712913a4f2dce17d2fvboxsync /* Maximum index: */
36545c63b2aab948161e4a712913a4f2dce17d2fvboxsync UIActionIndex_Max
36545c63b2aab948161e4a712913a4f2dce17d2fvboxsync};
36545c63b2aab948161e4a712913a4f2dce17d2fvboxsync
4429cc47d1e3ca88d6237e5ee7a876dc409cdc24vboxsync/** Restriction levels. */
4429cc47d1e3ca88d6237e5ee7a876dc409cdc24vboxsyncenum UIActionRestrictionLevel
4429cc47d1e3ca88d6237e5ee7a876dc409cdc24vboxsync{
4429cc47d1e3ca88d6237e5ee7a876dc409cdc24vboxsync UIActionRestrictionLevel_Base,
4429cc47d1e3ca88d6237e5ee7a876dc409cdc24vboxsync UIActionRestrictionLevel_Session,
4429cc47d1e3ca88d6237e5ee7a876dc409cdc24vboxsync UIActionRestrictionLevel_Logic
4429cc47d1e3ca88d6237e5ee7a876dc409cdc24vboxsync};
4429cc47d1e3ca88d6237e5ee7a876dc409cdc24vboxsync
ea45fd67689d7a915b8a1b9f4ab2ba32652cf7b2vboxsync
3a1f13012387ed050863b921493a86ce7d6cd4a0vboxsync/** QMenu extension. */
43ac5db20bd450cb619fb7bc76b4c369cee128c7vboxsyncclass UIMenu : public QMenu
43ac5db20bd450cb619fb7bc76b4c369cee128c7vboxsync{
43ac5db20bd450cb619fb7bc76b4c369cee128c7vboxsync Q_OBJECT;
43ac5db20bd450cb619fb7bc76b4c369cee128c7vboxsync
43ac5db20bd450cb619fb7bc76b4c369cee128c7vboxsyncpublic:
43ac5db20bd450cb619fb7bc76b4c369cee128c7vboxsync
43ac5db20bd450cb619fb7bc76b4c369cee128c7vboxsync /** Constructor. */
43ac5db20bd450cb619fb7bc76b4c369cee128c7vboxsync UIMenu();
43ac5db20bd450cb619fb7bc76b4c369cee128c7vboxsync
43ac5db20bd450cb619fb7bc76b4c369cee128c7vboxsync /** Defines whether tool-tip should be shown. */
43ac5db20bd450cb619fb7bc76b4c369cee128c7vboxsync void setShowToolTip(bool fShowToolTips) { m_fShowToolTip = fShowToolTips; }
43ac5db20bd450cb619fb7bc76b4c369cee128c7vboxsync
3a1f13012387ed050863b921493a86ce7d6cd4a0vboxsync#ifdef Q_WS_MAC
3a1f13012387ed050863b921493a86ce7d6cd4a0vboxsync /** Mac OS X: Returns whether this menu is consumable by the menu-bar. */
3a1f13012387ed050863b921493a86ce7d6cd4a0vboxsync bool isConsumable() const { return m_fConsumable; }
3a1f13012387ed050863b921493a86ce7d6cd4a0vboxsync /** Mac OS X: Defines whether this menu is @a fConsumable by the menu-bar. */
3a1f13012387ed050863b921493a86ce7d6cd4a0vboxsync void setConsumable(bool fConsumable) { m_fConsumable = fConsumable; }
3a1f13012387ed050863b921493a86ce7d6cd4a0vboxsync
3a1f13012387ed050863b921493a86ce7d6cd4a0vboxsync /** Mac OS X: Returns whether this menu is consumed by the menu-bar. */
3a1f13012387ed050863b921493a86ce7d6cd4a0vboxsync bool isConsumed() const { return m_fConsumed; }
3a1f13012387ed050863b921493a86ce7d6cd4a0vboxsync /** Mac OS X: Defines whether this menu is @a fConsumed by the menu-bar. */
3a1f13012387ed050863b921493a86ce7d6cd4a0vboxsync void setConsumed(bool fConsumed) { m_fConsumed = fConsumed; }
3a1f13012387ed050863b921493a86ce7d6cd4a0vboxsync#endif /* Q_WS_MAC */
3a1f13012387ed050863b921493a86ce7d6cd4a0vboxsync
43ac5db20bd450cb619fb7bc76b4c369cee128c7vboxsyncprotected:
43ac5db20bd450cb619fb7bc76b4c369cee128c7vboxsync
43ac5db20bd450cb619fb7bc76b4c369cee128c7vboxsync /** General event handler. */
43ac5db20bd450cb619fb7bc76b4c369cee128c7vboxsync virtual bool event(QEvent *pEvent);
43ac5db20bd450cb619fb7bc76b4c369cee128c7vboxsync
43ac5db20bd450cb619fb7bc76b4c369cee128c7vboxsyncprivate:
43ac5db20bd450cb619fb7bc76b4c369cee128c7vboxsync
43ac5db20bd450cb619fb7bc76b4c369cee128c7vboxsync /** Holds whether tool-tip should be shown. */
43ac5db20bd450cb619fb7bc76b4c369cee128c7vboxsync bool m_fShowToolTip;
3a1f13012387ed050863b921493a86ce7d6cd4a0vboxsync
3a1f13012387ed050863b921493a86ce7d6cd4a0vboxsync#ifdef Q_WS_MAC
3a1f13012387ed050863b921493a86ce7d6cd4a0vboxsync /** Mac OS X: Holds whether this menu can be consumed by the menu-bar. */
3a1f13012387ed050863b921493a86ce7d6cd4a0vboxsync bool m_fConsumable;
3a1f13012387ed050863b921493a86ce7d6cd4a0vboxsync /** Mac OS X: Holds whether this menu is consumed by the menu-bar. */
3a1f13012387ed050863b921493a86ce7d6cd4a0vboxsync bool m_fConsumed;
3a1f13012387ed050863b921493a86ce7d6cd4a0vboxsync#endif /* Q_WS_MAC */
43ac5db20bd450cb619fb7bc76b4c369cee128c7vboxsync};
43ac5db20bd450cb619fb7bc76b4c369cee128c7vboxsync
43ac5db20bd450cb619fb7bc76b4c369cee128c7vboxsync
ea45fd67689d7a915b8a1b9f4ab2ba32652cf7b2vboxsync/** Abstract QAction extension. */
66c0d2215120f37697a007dedc3e171837935d9fvboxsyncclass UIAction : public QAction
36545c63b2aab948161e4a712913a4f2dce17d2fvboxsync{
36545c63b2aab948161e4a712913a4f2dce17d2fvboxsync Q_OBJECT;
36545c63b2aab948161e4a712913a4f2dce17d2fvboxsync
36545c63b2aab948161e4a712913a4f2dce17d2fvboxsyncpublic:
36545c63b2aab948161e4a712913a4f2dce17d2fvboxsync
ea45fd67689d7a915b8a1b9f4ab2ba32652cf7b2vboxsync /** Returns action type. */
36545c63b2aab948161e4a712913a4f2dce17d2fvboxsync UIActionType type() const { return m_type; }
36545c63b2aab948161e4a712913a4f2dce17d2fvboxsync
3a1f13012387ed050863b921493a86ce7d6cd4a0vboxsync /** Returns menu contained by this action. */
3a1f13012387ed050863b921493a86ce7d6cd4a0vboxsync UIMenu* menu() const;
3a1f13012387ed050863b921493a86ce7d6cd4a0vboxsync
ea45fd67689d7a915b8a1b9f4ab2ba32652cf7b2vboxsync /** Returns action-pool this action belongs to. */
4322eab57b88f880a55e6a4ae0cb76b870167f06vboxsync UIActionPool* actionPool() const { return m_pActionPool; }
4322eab57b88f880a55e6a4ae0cb76b870167f06vboxsync
ea45fd67689d7a915b8a1b9f4ab2ba32652cf7b2vboxsync /** Casts action to polymorphic-action. */
ea45fd67689d7a915b8a1b9f4ab2ba32652cf7b2vboxsync UIActionPolymorphic* toActionPolymorphic();
7b2222e6c060dfe168591f22543d3a80f96112b4vboxsync
ea45fd67689d7a915b8a1b9f4ab2ba32652cf7b2vboxsync /** Returns current action name. */
4322eab57b88f880a55e6a4ae0cb76b870167f06vboxsync const QString& name() const { return m_strName; }
ea45fd67689d7a915b8a1b9f4ab2ba32652cf7b2vboxsync /** Defines current action name. */
4322eab57b88f880a55e6a4ae0cb76b870167f06vboxsync void setName(const QString &strName);
4322eab57b88f880a55e6a4ae0cb76b870167f06vboxsync
9027db91ee5567660f982f4fe1cbb25fe32f6c1evboxsync /** Returns action extra-data ID. */
9027db91ee5567660f982f4fe1cbb25fe32f6c1evboxsync virtual int extraDataID() const { return 0; }
9027db91ee5567660f982f4fe1cbb25fe32f6c1evboxsync /** Returns action extra-data key. */
9027db91ee5567660f982f4fe1cbb25fe32f6c1evboxsync virtual QString extraDataKey() const { return QString(); }
a21d362081e34d2937b7ce524dc2e2f635caeeb0vboxsync /** Returns whether action is allowed. */
a21d362081e34d2937b7ce524dc2e2f635caeeb0vboxsync virtual bool isAllowed() const { return true; }
9027db91ee5567660f982f4fe1cbb25fe32f6c1evboxsync
ea45fd67689d7a915b8a1b9f4ab2ba32652cf7b2vboxsync /** Returns extra-data ID to save keyboard shortcut under. */
4322eab57b88f880a55e6a4ae0cb76b870167f06vboxsync virtual QString shortcutExtraDataID() const { return QString(); }
ea45fd67689d7a915b8a1b9f4ab2ba32652cf7b2vboxsync /** Returns default keyboard shortcut for this action. */
4322eab57b88f880a55e6a4ae0cb76b870167f06vboxsync virtual QKeySequence defaultShortcut(UIActionPoolType) const { return QKeySequence(); }
ea45fd67689d7a915b8a1b9f4ab2ba32652cf7b2vboxsync
ea45fd67689d7a915b8a1b9f4ab2ba32652cf7b2vboxsync /** Defines current keyboard shortcut for this action. */
b7b0555d5885e8472bfeb1a1b9810f14a2a58177vboxsync void setShortcut(const QKeySequence &shortcut);
ea45fd67689d7a915b8a1b9f4ab2ba32652cf7b2vboxsync /** Make action show keyboard shortcut. */
07ddac0955239ed18e474aaea92b0583981ff778vboxsync void showShortcut();
ea45fd67689d7a915b8a1b9f4ab2ba32652cf7b2vboxsync /** Make action hide keyboard shortcut. */
07ddac0955239ed18e474aaea92b0583981ff778vboxsync void hideShortcut();
07ddac0955239ed18e474aaea92b0583981ff778vboxsync
ea45fd67689d7a915b8a1b9f4ab2ba32652cf7b2vboxsync /** Retranslates action. */
66c0d2215120f37697a007dedc3e171837935d9fvboxsync virtual void retranslateUi() = 0;
66c0d2215120f37697a007dedc3e171837935d9fvboxsync
36545c63b2aab948161e4a712913a4f2dce17d2fvboxsyncprotected:
36545c63b2aab948161e4a712913a4f2dce17d2fvboxsync
ea45fd67689d7a915b8a1b9f4ab2ba32652cf7b2vboxsync /** Constructor. */
4322eab57b88f880a55e6a4ae0cb76b870167f06vboxsync UIAction(UIActionPool *pParent, UIActionType type);
36545c63b2aab948161e4a712913a4f2dce17d2fvboxsync
ea45fd67689d7a915b8a1b9f4ab2ba32652cf7b2vboxsync /** Returns current action name in menu. */
4322eab57b88f880a55e6a4ae0cb76b870167f06vboxsync QString nameInMenu() const;
e8b6c391092b76836d83c32717155d5b323a2683vboxsync
b213dcb3794ee18b68ffb23498de697dbcbc7f07vboxsync /** Updates action text accordingly. */
b213dcb3794ee18b68ffb23498de697dbcbc7f07vboxsync virtual void updateText();
36545c63b2aab948161e4a712913a4f2dce17d2fvboxsync
b213dcb3794ee18b68ffb23498de697dbcbc7f07vboxsyncprivate:
4322eab57b88f880a55e6a4ae0cb76b870167f06vboxsync
ea45fd67689d7a915b8a1b9f4ab2ba32652cf7b2vboxsync /** Holds the action type. */
36545c63b2aab948161e4a712913a4f2dce17d2fvboxsync UIActionType m_type;
ea45fd67689d7a915b8a1b9f4ab2ba32652cf7b2vboxsync
ea45fd67689d7a915b8a1b9f4ab2ba32652cf7b2vboxsync /** Holds the reference to the action-pool this action belongs to. */
ea45fd67689d7a915b8a1b9f4ab2ba32652cf7b2vboxsync UIActionPool *m_pActionPool;
ea45fd67689d7a915b8a1b9f4ab2ba32652cf7b2vboxsync /** Holds the type of the action-pool this action belongs to. */
4322eab57b88f880a55e6a4ae0cb76b870167f06vboxsync UIActionPoolType m_actionPoolType;
ea45fd67689d7a915b8a1b9f4ab2ba32652cf7b2vboxsync
ea45fd67689d7a915b8a1b9f4ab2ba32652cf7b2vboxsync /** Holds the action name. */
4322eab57b88f880a55e6a4ae0cb76b870167f06vboxsync QString m_strName;
ea45fd67689d7a915b8a1b9f4ab2ba32652cf7b2vboxsync /** Holds the action shortcut. */
07ddac0955239ed18e474aaea92b0583981ff778vboxsync QKeySequence m_shortcut;
ea45fd67689d7a915b8a1b9f4ab2ba32652cf7b2vboxsync /** Holds whether action shortcut hidden. */
440fa1286371a6f0d2eabc0a026f5b04dcd5d9f8vboxsync bool m_fShortcutHidden;
36545c63b2aab948161e4a712913a4f2dce17d2fvboxsync};
36545c63b2aab948161e4a712913a4f2dce17d2fvboxsync
ea45fd67689d7a915b8a1b9f4ab2ba32652cf7b2vboxsync
43ac5db20bd450cb619fb7bc76b4c369cee128c7vboxsync/** Abstract UIAction extension for 'Menu' action type. */
43ac5db20bd450cb619fb7bc76b4c369cee128c7vboxsyncclass UIActionMenu : public UIAction
36545c63b2aab948161e4a712913a4f2dce17d2fvboxsync{
36545c63b2aab948161e4a712913a4f2dce17d2fvboxsync Q_OBJECT;
36545c63b2aab948161e4a712913a4f2dce17d2fvboxsync
43ac5db20bd450cb619fb7bc76b4c369cee128c7vboxsyncprotected:
36545c63b2aab948161e4a712913a4f2dce17d2fvboxsync
43ac5db20bd450cb619fb7bc76b4c369cee128c7vboxsync /** Constructor, taking normal icon name and name for disabled analog. */
43ac5db20bd450cb619fb7bc76b4c369cee128c7vboxsync UIActionMenu(UIActionPool *pParent,
43ac5db20bd450cb619fb7bc76b4c369cee128c7vboxsync const QString &strIcon = QString(), const QString &strIconDis = QString());
43ac5db20bd450cb619fb7bc76b4c369cee128c7vboxsync /** Constructor, taking copy of existing icon. */
43ac5db20bd450cb619fb7bc76b4c369cee128c7vboxsync UIActionMenu(UIActionPool *pParent,
43ac5db20bd450cb619fb7bc76b4c369cee128c7vboxsync const QIcon &icon);
36545c63b2aab948161e4a712913a4f2dce17d2fvboxsync
ea45fd67689d7a915b8a1b9f4ab2ba32652cf7b2vboxsync /** Defines whether tool-tip should be shown. */
43ac5db20bd450cb619fb7bc76b4c369cee128c7vboxsync void setShowToolTip(bool fShowToolTip);
36545c63b2aab948161e4a712913a4f2dce17d2fvboxsync
ea45fd67689d7a915b8a1b9f4ab2ba32652cf7b2vboxsyncprivate:
ea45fd67689d7a915b8a1b9f4ab2ba32652cf7b2vboxsync
74d2d156cc7889b043a3127ed710ef6d658ca337vboxsync /** Prepare routine. */
74d2d156cc7889b043a3127ed710ef6d658ca337vboxsync void prepare();
74d2d156cc7889b043a3127ed710ef6d658ca337vboxsync
43ac5db20bd450cb619fb7bc76b4c369cee128c7vboxsync /** Updates action text accordingly. */
43ac5db20bd450cb619fb7bc76b4c369cee128c7vboxsync virtual void updateText();
36545c63b2aab948161e4a712913a4f2dce17d2fvboxsync};
36545c63b2aab948161e4a712913a4f2dce17d2fvboxsync
ea45fd67689d7a915b8a1b9f4ab2ba32652cf7b2vboxsync
ea45fd67689d7a915b8a1b9f4ab2ba32652cf7b2vboxsync/** Abstract UIAction extension for 'Simple' action type. */
cdaeb34871aa28b96c0d80b474f3c8f9805d0388vboxsyncclass UIActionSimple : public UIAction
36545c63b2aab948161e4a712913a4f2dce17d2fvboxsync{
36545c63b2aab948161e4a712913a4f2dce17d2fvboxsync Q_OBJECT;
36545c63b2aab948161e4a712913a4f2dce17d2fvboxsync
36545c63b2aab948161e4a712913a4f2dce17d2fvboxsyncprotected:
36545c63b2aab948161e4a712913a4f2dce17d2fvboxsync
ea45fd67689d7a915b8a1b9f4ab2ba32652cf7b2vboxsync /** Constructor, taking normal icon name and name for disabled analog. */
4322eab57b88f880a55e6a4ae0cb76b870167f06vboxsync UIActionSimple(UIActionPool *pParent,
caf62c8b1a43cb2321f2b9d4e31588e643b89731vboxsync const QString &strIcon = QString(), const QString &strIconDisabled = QString());
ea45fd67689d7a915b8a1b9f4ab2ba32652cf7b2vboxsync /** Constructor, taking normal, small icon names and names for disabled analogs. */
4322eab57b88f880a55e6a4ae0cb76b870167f06vboxsync UIActionSimple(UIActionPool *pParent,
caf62c8b1a43cb2321f2b9d4e31588e643b89731vboxsync const QString &strIconNormal, const QString &strIconSmall,
caf62c8b1a43cb2321f2b9d4e31588e643b89731vboxsync const QString &strIconNormalDisabled, const QString &strIconSmallDisabled);
ea45fd67689d7a915b8a1b9f4ab2ba32652cf7b2vboxsync /** Constructor, taking copy of existing icon. */
4322eab57b88f880a55e6a4ae0cb76b870167f06vboxsync UIActionSimple(UIActionPool *pParent,
4322eab57b88f880a55e6a4ae0cb76b870167f06vboxsync const QIcon& icon);
36545c63b2aab948161e4a712913a4f2dce17d2fvboxsync};
36545c63b2aab948161e4a712913a4f2dce17d2fvboxsync
ea45fd67689d7a915b8a1b9f4ab2ba32652cf7b2vboxsync
ea45fd67689d7a915b8a1b9f4ab2ba32652cf7b2vboxsync/** Abstract UIAction extension for 'Toggle' action type. */
cdaeb34871aa28b96c0d80b474f3c8f9805d0388vboxsyncclass UIActionToggle : public UIAction
36545c63b2aab948161e4a712913a4f2dce17d2fvboxsync{
36545c63b2aab948161e4a712913a4f2dce17d2fvboxsync Q_OBJECT;
36545c63b2aab948161e4a712913a4f2dce17d2fvboxsync
36545c63b2aab948161e4a712913a4f2dce17d2fvboxsyncprotected:
36545c63b2aab948161e4a712913a4f2dce17d2fvboxsync
ea45fd67689d7a915b8a1b9f4ab2ba32652cf7b2vboxsync /** Constructor, taking normal icon name and name for disabled analog. */
4322eab57b88f880a55e6a4ae0cb76b870167f06vboxsync UIActionToggle(UIActionPool *pParent,
caf62c8b1a43cb2321f2b9d4e31588e643b89731vboxsync const QString &strIcon = QString(), const QString &strIconDisabled = QString());
ea45fd67689d7a915b8a1b9f4ab2ba32652cf7b2vboxsync /** Constructor, taking normal on/off icon names and names for disabled analogs. */
4322eab57b88f880a55e6a4ae0cb76b870167f06vboxsync UIActionToggle(UIActionPool *pParent,
caf62c8b1a43cb2321f2b9d4e31588e643b89731vboxsync const QString &strIconOn, const QString &strIconOff,
caf62c8b1a43cb2321f2b9d4e31588e643b89731vboxsync const QString &strIconOnDisabled, const QString &strIconOffDisabled);
ea45fd67689d7a915b8a1b9f4ab2ba32652cf7b2vboxsync /** Constructor, taking copy of existing icon. */
4322eab57b88f880a55e6a4ae0cb76b870167f06vboxsync UIActionToggle(UIActionPool *pParent,
4322eab57b88f880a55e6a4ae0cb76b870167f06vboxsync const QIcon &icon);
7b2222e6c060dfe168591f22543d3a80f96112b4vboxsync
36545c63b2aab948161e4a712913a4f2dce17d2fvboxsyncprivate:
36545c63b2aab948161e4a712913a4f2dce17d2fvboxsync
ea45fd67689d7a915b8a1b9f4ab2ba32652cf7b2vboxsync /** Prepare routine. */
ea45fd67689d7a915b8a1b9f4ab2ba32652cf7b2vboxsync void prepare();
36545c63b2aab948161e4a712913a4f2dce17d2fvboxsync};
36545c63b2aab948161e4a712913a4f2dce17d2fvboxsync
ea45fd67689d7a915b8a1b9f4ab2ba32652cf7b2vboxsync
43ac5db20bd450cb619fb7bc76b4c369cee128c7vboxsync/** Abstract UIAction extension for 'Polymorphic' action type. */
43ac5db20bd450cb619fb7bc76b4c369cee128c7vboxsyncclass UIActionPolymorphic : public UIAction
36545c63b2aab948161e4a712913a4f2dce17d2fvboxsync{
36545c63b2aab948161e4a712913a4f2dce17d2fvboxsync Q_OBJECT;
36545c63b2aab948161e4a712913a4f2dce17d2fvboxsync
43ac5db20bd450cb619fb7bc76b4c369cee128c7vboxsyncpublic:
43ac5db20bd450cb619fb7bc76b4c369cee128c7vboxsync
43ac5db20bd450cb619fb7bc76b4c369cee128c7vboxsync /** Returns current action state. */
43ac5db20bd450cb619fb7bc76b4c369cee128c7vboxsync int state() const { return m_iState; }
43ac5db20bd450cb619fb7bc76b4c369cee128c7vboxsync /** Defines current action state. */
43ac5db20bd450cb619fb7bc76b4c369cee128c7vboxsync void setState(int iState) { m_iState = iState; retranslateUi(); }
43ac5db20bd450cb619fb7bc76b4c369cee128c7vboxsync
36545c63b2aab948161e4a712913a4f2dce17d2fvboxsyncprotected:
36545c63b2aab948161e4a712913a4f2dce17d2fvboxsync
ea45fd67689d7a915b8a1b9f4ab2ba32652cf7b2vboxsync /** Constructor, taking normal icon name and name for disabled analog. */
43ac5db20bd450cb619fb7bc76b4c369cee128c7vboxsync UIActionPolymorphic(UIActionPool *pParent,
43ac5db20bd450cb619fb7bc76b4c369cee128c7vboxsync const QString &strIcon = QString(), const QString &strIconDisabled = QString());
43ac5db20bd450cb619fb7bc76b4c369cee128c7vboxsync /** Constructor, taking normal, small icon names and names for disabled analogs. */
43ac5db20bd450cb619fb7bc76b4c369cee128c7vboxsync UIActionPolymorphic(UIActionPool *pParent,
43ac5db20bd450cb619fb7bc76b4c369cee128c7vboxsync const QString &strIconNormal, const QString &strIconSmall,
43ac5db20bd450cb619fb7bc76b4c369cee128c7vboxsync const QString &strIconNormalDisabled, const QString &strIconSmallDisabled);
ea45fd67689d7a915b8a1b9f4ab2ba32652cf7b2vboxsync /** Constructor, taking copy of existing icon. */
43ac5db20bd450cb619fb7bc76b4c369cee128c7vboxsync UIActionPolymorphic(UIActionPool *pParent,
43ac5db20bd450cb619fb7bc76b4c369cee128c7vboxsync const QIcon& icon);
ea45fd67689d7a915b8a1b9f4ab2ba32652cf7b2vboxsync
ea45fd67689d7a915b8a1b9f4ab2ba32652cf7b2vboxsyncprivate:
ea45fd67689d7a915b8a1b9f4ab2ba32652cf7b2vboxsync
43ac5db20bd450cb619fb7bc76b4c369cee128c7vboxsync /** Holds current action state. */
43ac5db20bd450cb619fb7bc76b4c369cee128c7vboxsync int m_iState;
a191ab87779e39bb47804d5055c3f0f2dde104fevboxsync};
a191ab87779e39bb47804d5055c3f0f2dde104fevboxsync
ea45fd67689d7a915b8a1b9f4ab2ba32652cf7b2vboxsync
ea45fd67689d7a915b8a1b9f4ab2ba32652cf7b2vboxsync/** Abstract QObject extension
4429cc47d1e3ca88d6237e5ee7a876dc409cdc24vboxsync * representing action-pool interface and factory. */
66c0d2215120f37697a007dedc3e171837935d9fvboxsyncclass UIActionPool : public QIWithRetranslateUI3<QObject>
36545c63b2aab948161e4a712913a4f2dce17d2fvboxsync{
36545c63b2aab948161e4a712913a4f2dce17d2fvboxsync Q_OBJECT;
36545c63b2aab948161e4a712913a4f2dce17d2fvboxsync
74d2d156cc7889b043a3127ed710ef6d658ca337vboxsync /** Pointer to menu update-handler for this class. */
74d2d156cc7889b043a3127ed710ef6d658ca337vboxsync typedef void (UIActionPool::*PTFActionPool)();
74d2d156cc7889b043a3127ed710ef6d658ca337vboxsync /** Pointer to menu update-handler for Runtime sub-class. */
74d2d156cc7889b043a3127ed710ef6d658ca337vboxsync typedef void (UIActionPoolRuntime::*PTFActionPoolRuntime)();
74d2d156cc7889b043a3127ed710ef6d658ca337vboxsync /** Union for two defines above. */
74d2d156cc7889b043a3127ed710ef6d658ca337vboxsync union PointerToFunction
74d2d156cc7889b043a3127ed710ef6d658ca337vboxsync {
74d2d156cc7889b043a3127ed710ef6d658ca337vboxsync PTFActionPool ptf;
74d2d156cc7889b043a3127ed710ef6d658ca337vboxsync PTFActionPoolRuntime ptfr;
74d2d156cc7889b043a3127ed710ef6d658ca337vboxsync };
74d2d156cc7889b043a3127ed710ef6d658ca337vboxsync
74d2d156cc7889b043a3127ed710ef6d658ca337vboxsyncsignals:
74d2d156cc7889b043a3127ed710ef6d658ca337vboxsync
74d2d156cc7889b043a3127ed710ef6d658ca337vboxsync /** Notifies about menu prepare. */
74d2d156cc7889b043a3127ed710ef6d658ca337vboxsync void sigNotifyAboutMenuPrepare(int iIndex, QMenu *pMenu);
74d2d156cc7889b043a3127ed710ef6d658ca337vboxsync
36545c63b2aab948161e4a712913a4f2dce17d2fvboxsyncpublic:
36545c63b2aab948161e4a712913a4f2dce17d2fvboxsync
ea45fd67689d7a915b8a1b9f4ab2ba32652cf7b2vboxsync /** Static factory constructor. */
4429cc47d1e3ca88d6237e5ee7a876dc409cdc24vboxsync static UIActionPool* create(UIActionPoolType type);
ea45fd67689d7a915b8a1b9f4ab2ba32652cf7b2vboxsync /** Static factory destructor. */
4429cc47d1e3ca88d6237e5ee7a876dc409cdc24vboxsync static void destroy(UIActionPool *pActionPool);
36545c63b2aab948161e4a712913a4f2dce17d2fvboxsync
ea45fd67689d7a915b8a1b9f4ab2ba32652cf7b2vboxsync /** Static factory constructor (temporary),
ea45fd67689d7a915b8a1b9f4ab2ba32652cf7b2vboxsync * used to initialize shortcuts-pool from action-pool of passed @a type. */
0190d8632849255f4e53d0010485f6109565513cvboxsync static void createTemporary(UIActionPoolType type);
0190d8632849255f4e53d0010485f6109565513cvboxsync
d22a253d4eb50a2e7341d28d7f7dde3b69b49b0cvboxsync /** Cast action-pool to Runtime one. */
d22a253d4eb50a2e7341d28d7f7dde3b69b49b0cvboxsync UIActionPoolRuntime* toRuntime();
d22a253d4eb50a2e7341d28d7f7dde3b69b49b0cvboxsync /** Cast action-pool to Selector one. */
d22a253d4eb50a2e7341d28d7f7dde3b69b49b0cvboxsync UIActionPoolSelector* toSelector();
d22a253d4eb50a2e7341d28d7f7dde3b69b49b0cvboxsync
ea45fd67689d7a915b8a1b9f4ab2ba32652cf7b2vboxsync /** Returns action-pool type. */
7b2222e6c060dfe168591f22543d3a80f96112b4vboxsync UIActionPoolType type() const { return m_type; }
36545c63b2aab948161e4a712913a4f2dce17d2fvboxsync
ea45fd67689d7a915b8a1b9f4ab2ba32652cf7b2vboxsync /** Returns the action for the passed @a iIndex. */
ea45fd67689d7a915b8a1b9f4ab2ba32652cf7b2vboxsync UIAction* action(int iIndex) const { return m_pool.value(iIndex); }
ea45fd67689d7a915b8a1b9f4ab2ba32652cf7b2vboxsync /** Returns all the actions action-pool contains. */
4322eab57b88f880a55e6a4ae0cb76b870167f06vboxsync QList<UIAction*> actions() const { return m_pool.values(); }
4322eab57b88f880a55e6a4ae0cb76b870167f06vboxsync
492de26ad701185b6f6cf63eb346b34a4440268dvboxsync /** Returns whether the menu with passed @a type is allowed in menu-bar. */
492de26ad701185b6f6cf63eb346b34a4440268dvboxsync bool isAllowedInMenuBar(UIExtraDataMetaDefs::MenuType type) const;
492de26ad701185b6f6cf63eb346b34a4440268dvboxsync /** Defines menu-bar @a restriction for passed @a level. */
492de26ad701185b6f6cf63eb346b34a4440268dvboxsync void setRestrictionForMenuBar(UIActionRestrictionLevel level, UIExtraDataMetaDefs::MenuType restriction);
98e2c4b54b8f4f38a9c5a56c7e5d470a6bf8fccbvboxsync
74d2d156cc7889b043a3127ed710ef6d658ca337vboxsync /** Returns whether the action with passed @a type is allowed in the 'Application' menu. */
326456b8d1aba5e9371d8ede11afd67ab132f2eavboxsync bool isAllowedInMenuApplication(UIExtraDataMetaDefs::MenuApplicationActionType type) const;
74d2d156cc7889b043a3127ed710ef6d658ca337vboxsync /** Defines 'Application' menu @a restriction for passed @a level. */
326456b8d1aba5e9371d8ede11afd67ab132f2eavboxsync void setRestrictionForMenuApplication(UIActionRestrictionLevel level, UIExtraDataMetaDefs::MenuApplicationActionType restriction);
f0821e819e51b95ecaf7b12c742da563b4ddf7e5vboxsync
2e76757ceed513b38c43d0f33cd24cc18baf3ffevboxsync#ifdef Q_WS_MAC
2e76757ceed513b38c43d0f33cd24cc18baf3ffevboxsync /** Mac OS X: Returns whether the action with passed @a type is allowed in the 'Window' menu. */
f0821e819e51b95ecaf7b12c742da563b4ddf7e5vboxsync bool isAllowedInMenuWindow(UIExtraDataMetaDefs::MenuWindowActionType type) const;
2e76757ceed513b38c43d0f33cd24cc18baf3ffevboxsync /** Mac OS X: Defines 'Window' menu @a restriction for passed @a level. */
f0821e819e51b95ecaf7b12c742da563b4ddf7e5vboxsync void setRestrictionForMenuWindow(UIActionRestrictionLevel level, UIExtraDataMetaDefs::MenuWindowActionType restriction);
74d2d156cc7889b043a3127ed710ef6d658ca337vboxsync#endif /* Q_WS_MAC */
74d2d156cc7889b043a3127ed710ef6d658ca337vboxsync
492de26ad701185b6f6cf63eb346b34a4440268dvboxsync /** Returns whether the action with passed @a type is allowed in the 'Help' menu. */
492de26ad701185b6f6cf63eb346b34a4440268dvboxsync bool isAllowedInMenuHelp(UIExtraDataMetaDefs::MenuHelpActionType type) const;
492de26ad701185b6f6cf63eb346b34a4440268dvboxsync /** Defines 'Help' menu @a restriction for passed @a level. */
492de26ad701185b6f6cf63eb346b34a4440268dvboxsync void setRestrictionForMenuHelp(UIActionRestrictionLevel level, UIExtraDataMetaDefs::MenuHelpActionType restriction);
492de26ad701185b6f6cf63eb346b34a4440268dvboxsync
d22a253d4eb50a2e7341d28d7f7dde3b69b49b0cvboxsync /** Hot-key processing delegate. */
d22a253d4eb50a2e7341d28d7f7dde3b69b49b0cvboxsync bool processHotKey(const QKeySequence &key);
d22a253d4eb50a2e7341d28d7f7dde3b69b49b0cvboxsync
ea45fd67689d7a915b8a1b9f4ab2ba32652cf7b2vboxsync /** Returns extra-data ID to save keyboard shortcuts under. */
4322eab57b88f880a55e6a4ae0cb76b870167f06vboxsync virtual QString shortcutsExtraDataID() const = 0;
36545c63b2aab948161e4a712913a4f2dce17d2fvboxsync
236f71c54929e835b07c91ace8d7009beb6bf4bdvboxsync /** Returns the list of main menus. */
236f71c54929e835b07c91ace8d7009beb6bf4bdvboxsync virtual QList<QMenu*> menus() const = 0;
36545c63b2aab948161e4a712913a4f2dce17d2fvboxsync
667a27cac134814da3a83bf2e0a017833066518bvboxsyncprotected slots:
667a27cac134814da3a83bf2e0a017833066518bvboxsync
74d2d156cc7889b043a3127ed710ef6d658ca337vboxsync /** Handles menu prepare. */
74d2d156cc7889b043a3127ed710ef6d658ca337vboxsync void sltHandleMenuPrepare();
74d2d156cc7889b043a3127ed710ef6d658ca337vboxsync
ea45fd67689d7a915b8a1b9f4ab2ba32652cf7b2vboxsync /** Loads keyboard shortcuts of action-pool into shortcuts-pool. */
4429cc47d1e3ca88d6237e5ee7a876dc409cdc24vboxsync void sltApplyShortcuts() { updateShortcuts(); }
667a27cac134814da3a83bf2e0a017833066518bvboxsync
36545c63b2aab948161e4a712913a4f2dce17d2fvboxsyncprotected:
36545c63b2aab948161e4a712913a4f2dce17d2fvboxsync
ea45fd67689d7a915b8a1b9f4ab2ba32652cf7b2vboxsync /** Constructor of the action-pool of passed @a type. */
4429cc47d1e3ca88d6237e5ee7a876dc409cdc24vboxsync UIActionPool(UIActionPoolType type, bool fTemporary = false);
7b2222e6c060dfe168591f22543d3a80f96112b4vboxsync
ea45fd67689d7a915b8a1b9f4ab2ba32652cf7b2vboxsync /** Prepare routine. */
7b2222e6c060dfe168591f22543d3a80f96112b4vboxsync void prepare();
236f71c54929e835b07c91ace8d7009beb6bf4bdvboxsync /** Prepare pool routine. */
236f71c54929e835b07c91ace8d7009beb6bf4bdvboxsync virtual void preparePool();
236f71c54929e835b07c91ace8d7009beb6bf4bdvboxsync /** Prepare connections routine. */
5efb197999eb081a7afade4a39f820983e3bc2cavboxsync virtual void prepareConnections();
236f71c54929e835b07c91ace8d7009beb6bf4bdvboxsync /** Cleanup connections routine. */
236f71c54929e835b07c91ace8d7009beb6bf4bdvboxsync virtual void cleanupConnections() {}
236f71c54929e835b07c91ace8d7009beb6bf4bdvboxsync /** Cleanup pool routine. */
236f71c54929e835b07c91ace8d7009beb6bf4bdvboxsync virtual void cleanupPool();
ea45fd67689d7a915b8a1b9f4ab2ba32652cf7b2vboxsync /** Cleanup routine. */
7b2222e6c060dfe168591f22543d3a80f96112b4vboxsync void cleanup();
7b2222e6c060dfe168591f22543d3a80f96112b4vboxsync
236f71c54929e835b07c91ace8d7009beb6bf4bdvboxsync /** Update configuration routine. */
98e2c4b54b8f4f38a9c5a56c7e5d470a6bf8fccbvboxsync virtual void updateConfiguration();
98e2c4b54b8f4f38a9c5a56c7e5d470a6bf8fccbvboxsync
74d2d156cc7889b043a3127ed710ef6d658ca337vboxsync /** Update menu routine. */
74d2d156cc7889b043a3127ed710ef6d658ca337vboxsync virtual void updateMenu(int iIndex);
98e2c4b54b8f4f38a9c5a56c7e5d470a6bf8fccbvboxsync /** Update menus routine. */
98e2c4b54b8f4f38a9c5a56c7e5d470a6bf8fccbvboxsync virtual void updateMenus() = 0;
1ae2aeb1d8bb1614cf94d8de9a5afed3a2510161vboxsync /** Update 'Application' menu routine. */
1ae2aeb1d8bb1614cf94d8de9a5afed3a2510161vboxsync virtual void updateMenuApplication();
2e76757ceed513b38c43d0f33cd24cc18baf3ffevboxsync#ifdef RT_OS_DARWIN
2e76757ceed513b38c43d0f33cd24cc18baf3ffevboxsync /** Mac OS X: Update 'Window' menu routine. */
f0821e819e51b95ecaf7b12c742da563b4ddf7e5vboxsync virtual void updateMenuWindow();
1ae2aeb1d8bb1614cf94d8de9a5afed3a2510161vboxsync#endif /* RT_OS_DARWIN */
98e2c4b54b8f4f38a9c5a56c7e5d470a6bf8fccbvboxsync /** Update 'Help' menu routine. */
98e2c4b54b8f4f38a9c5a56c7e5d470a6bf8fccbvboxsync virtual void updateMenuHelp();
98e2c4b54b8f4f38a9c5a56c7e5d470a6bf8fccbvboxsync
4429cc47d1e3ca88d6237e5ee7a876dc409cdc24vboxsync /** Update shortcuts. */
4429cc47d1e3ca88d6237e5ee7a876dc409cdc24vboxsync virtual void updateShortcuts();
36545c63b2aab948161e4a712913a4f2dce17d2fvboxsync
98e2c4b54b8f4f38a9c5a56c7e5d470a6bf8fccbvboxsync /** Translation handler. */
98e2c4b54b8f4f38a9c5a56c7e5d470a6bf8fccbvboxsync virtual void retranslateUi();
98e2c4b54b8f4f38a9c5a56c7e5d470a6bf8fccbvboxsync
ea45fd67689d7a915b8a1b9f4ab2ba32652cf7b2vboxsync /** General event handler. */
ea45fd67689d7a915b8a1b9f4ab2ba32652cf7b2vboxsync virtual bool event(QEvent *pEvent);
36545c63b2aab948161e4a712913a4f2dce17d2fvboxsync
a21d362081e34d2937b7ce524dc2e2f635caeeb0vboxsync /** Adds action into corresponding menu. */
a21d362081e34d2937b7ce524dc2e2f635caeeb0vboxsync bool addAction(UIMenu *pMenu, UIAction *pAction, bool fReallyAdd = true);
a21d362081e34d2937b7ce524dc2e2f635caeeb0vboxsync /** Adds action's menu into corresponding menu list. */
a21d362081e34d2937b7ce524dc2e2f635caeeb0vboxsync bool addMenu(QList<QMenu*> &menuList, UIAction *pAction, bool fReallyAdd = true);
a21d362081e34d2937b7ce524dc2e2f635caeeb0vboxsync
ea45fd67689d7a915b8a1b9f4ab2ba32652cf7b2vboxsync /** Holds the action-pool type. */
4429cc47d1e3ca88d6237e5ee7a876dc409cdc24vboxsync const UIActionPoolType m_type;
4429cc47d1e3ca88d6237e5ee7a876dc409cdc24vboxsync /** Holds whether this action-pool is temporary. */
4429cc47d1e3ca88d6237e5ee7a876dc409cdc24vboxsync const bool m_fTemporary;
74d2d156cc7889b043a3127ed710ef6d658ca337vboxsync
74d2d156cc7889b043a3127ed710ef6d658ca337vboxsync /** Holds the map of actions. */
cdaeb34871aa28b96c0d80b474f3c8f9805d0388vboxsync QMap<int, UIAction*> m_pool;
74d2d156cc7889b043a3127ed710ef6d658ca337vboxsync /** Holds the map of validation handlers. */
74d2d156cc7889b043a3127ed710ef6d658ca337vboxsync QMap<int, PointerToFunction> m_menuUpdateHandlers;
74d2d156cc7889b043a3127ed710ef6d658ca337vboxsync /** Holds the set of invalidated action indexes. */
74d2d156cc7889b043a3127ed710ef6d658ca337vboxsync QSet<int> m_invalidations;
98e2c4b54b8f4f38a9c5a56c7e5d470a6bf8fccbvboxsync
492de26ad701185b6f6cf63eb346b34a4440268dvboxsync /** Holds restricted menu types. */
492de26ad701185b6f6cf63eb346b34a4440268dvboxsync QMap<UIActionRestrictionLevel, UIExtraDataMetaDefs::MenuType> m_restrictedMenus;
f0821e819e51b95ecaf7b12c742da563b4ddf7e5vboxsync /** Holds restricted action types of the 'Application' menu. */
326456b8d1aba5e9371d8ede11afd67ab132f2eavboxsync QMap<UIActionRestrictionLevel, UIExtraDataMetaDefs::MenuApplicationActionType> m_restrictedActionsMenuApplication;
2e76757ceed513b38c43d0f33cd24cc18baf3ffevboxsync#ifdef Q_WS_MAC
2e76757ceed513b38c43d0f33cd24cc18baf3ffevboxsync /** Mac OS X: Holds restricted action types of the 'Window' menu. */
f0821e819e51b95ecaf7b12c742da563b4ddf7e5vboxsync QMap<UIActionRestrictionLevel, UIExtraDataMetaDefs::MenuWindowActionType> m_restrictedActionsMenuWindow;
74d2d156cc7889b043a3127ed710ef6d658ca337vboxsync#endif /* Q_WS_MAC */
492de26ad701185b6f6cf63eb346b34a4440268dvboxsync /** Holds restricted action types of the Help menu. */
492de26ad701185b6f6cf63eb346b34a4440268dvboxsync QMap<UIActionRestrictionLevel, UIExtraDataMetaDefs::MenuHelpActionType> m_restrictedActionsMenuHelp;
36545c63b2aab948161e4a712913a4f2dce17d2fvboxsync};
36545c63b2aab948161e4a712913a4f2dce17d2fvboxsync
ea45fd67689d7a915b8a1b9f4ab2ba32652cf7b2vboxsync#endif /* !___UIActionPool_h___ */