UIActionPool.h revision 667a27cac134814da3a83bf2e0a017833066518b
/** @file
*
* VBox frontends: Qt GUI ("VirtualBox"):
* UIActionPool class declaration
*/
/*
* Copyright (C) 2010-2013 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 __UIActionPool_h__
#define __UIActionPool_h__
/* Qt includes: */
#include <QAction>
#include <QMenu>
/* GUI includes: */
#include "QIWithRetranslateUI.h"
/* Forward declarations: */
/* Action pool types: */
enum UIActionPoolType
{
};
/* Action types: */
enum UIActionType
{
};
/* Action keys: */
enum UIActionIndex
{
/* Various dialog actions: */
/* 'Help' menu actions: */
/* Maximum index: */
};
/* Basic abstract QAction reimplemetation, extending interface: */
{
/* API: RTTI: */
/* API: Parent stuff: */
/* API: Update stuff: */
/* API: Cast stuff: */
/* API: Name stuff: */
/* API: Shortcut stuff: */
void showShortcut();
void hideShortcut();
/* Constructor: */
/* Protected API: Menu stuff: */
QString nameInMenu() const;
/* Helper: Text stuff: */
void updateText();
/* Variables: */
};
/* Basic QMenu reimplemetation, extending interface: */
{
/* Constructor: */
UIMenu();
/* API: Tool-tip stuff: */
bool isToolTipsShown() const { return m_fShowToolTips; }
/* Helper: Event stuff: */
/* Variables: */
bool m_fShowToolTips;
};
/* Abstract extention for UIAction, describing 'simple' action type: */
{
/* Constructors: */
};
/* Abstract extention for UIAction, describing 'state' action type: */
{
/* API: State stuff: */
/* Constructors: */
/* Variables: */
int m_iState;
};
/* Abstract extention for UIAction, describing 'toggle' action type: */
{
/* Constructors: */
const QString &strIconOn, const QString &strIconOff, const QString &strIconOnDis, const QString &strIconOffDis);
/* API reimplementation: Update stuff: */
/* Handler: Update stuff: */
void sltUpdate();
/* Helper: Prepare stuff: */
void init();
};
/* Abstract extention for UIAction, describing 'menu' action type: */
{
/* Constructors: */
};
/* Singleton action pool: */
{
/* API: Singleton stuff: */
static UIActionPool* instance();
static void destroy();
/* API: RTTI: */
/* API: Action stuff: */
/* API: Shortcuts stuff: */
/* API: Prepare stuff: */
void recreateMenus() { createMenus(); }
/* API: Hot-key handling stuff: */
/* Handler: Shortcuts stuff: */
void sltApplyShortcuts();
/* Constructor/destructor: */
~UIActionPool();
void prepare();
void cleanup();
virtual void createActions();
virtual void createMenus();
virtual void destroyPool();
/* Helper: Event stuff: */
/* Instance: */
static UIActionPool *m_pInstance;
/* Action pool type: */
/* Actions pool itself: */
};
#endif /* __UIActionPool_h__ */