VBoxGlobal.h revision 42c3a43fe0633a05ce009eb9a1e3653ddee65f00
/** @file
*
* VBox frontends: Qt GUI ("VirtualBox"):
* VBoxGlobal class declaration
*/
/*
* Copyright (C) 2006-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 __VBoxGlobal_h__
#define __VBoxGlobal_h__
/* Qt includes: */
#include <QApplication>
#include <QLayout>
#include <QMenu>
#include <QStyle>
#include <QHash>
#include <QFileIconProvider>
#ifdef Q_WS_MAC
# include <QSet>
#endif /* Q_WS_MAC */
/* GUI includes: */
#include "UIDefs.h"
#include "VBoxGlobalSettings.h"
#include "UIMedium.h"
/* COM includes: */
#include "CHost.h"
#include "CVirtualBox.h"
#include "CSession.h"
#include "CGuestOSType.h"
/* Forward declarations: */
// VBoxGlobal class
////////////////////////////////////////////////////////////////////////////////
{
static VBoxGlobal &instance();
static QString qtRTVersionString();
static uint qtRTVersion();
static QString qtCTVersionString();
static uint qtCTVersion();
QString vboxVersionString() const;
QString vboxVersionStringNormalized() const;
bool isBeta() const;
/* VM stuff: */
bool is3DAvailable() const { return m3DAvailable; }
#ifdef VBOX_GUI_WITH_PIDFILE
void createPidfile();
void deletePidfile();
#endif
/* branding */
bool brandingIsActive (bool aForce = false);
bool processArgs();
bool showStartVMErrors() const { return mShowStartVMErrors; }
const char *vmRenderModeStr() const { return vm_render_mode_str; }
bool isKWinManaged() const { return mIsKWinManaged; }
bool isPatmDisabled() const { return mDisablePatm; }
bool isCsamDisabled() const { return mDisableCsam; }
bool isSupervisorCodeExecedRecompiled() const { return mRecompileSupervisor; }
bool isUserCodeExecedRecompiled() const { return mRecompileUser; }
#ifdef VBOX_WITH_DEBUGGER_GUI
bool isStartPausedEnabled() const { return mStartPaused; }
#else
bool isStartPausedEnabled() const { return false; }
#endif
{
}
{
}
{
}
{
}
{
}
{
}
/**
* Similar to toString (KMediumType), but returns 'Differencing' for
* normal hard disks that have a parent.
*/
QStringList COMPortNames() const;
QStringList LPTPortNames() const;
{
}
{
return true;
return false;
}
/* details generators */
/* VirtualBox helpers */
/** Shortcut to openSession (aId, true). */
void startEnumeratingMedia();
void reloadProxySettings();
/**
* Returns a list of all currently registered media. This list is used to
* globally track the accessibility state of all media on a dedicated thread.
*
* Note that the media list is initially empty (i.e. before the enumeration
* process is started for the first time using #startEnumeratingMedia()).
* See #startEnumeratingMedia() for more information about how meida are
* sorted in the returned list.
*/
/** Returns true if the media enumeration is in progress. */
void updateMedium (const UIMedium &);
/** Compact version of #findMediumTo(). Asserts if not found. */
{
AssertFailed();
return medium;
}
int mainWindowCount();
/* various helpers */
QString languageName() const;
QString languageCountry() const;
QString languageNameEnglish() const;
QString languageCountryEnglish() const;
QString languageTranslators() const;
void retranslateUi();
/** @internal made public for internal purposes */
void cleanup();
/* public static stuff */
static QString languageId();
bool aCanResize = true);
bool aCanResize = true);
bool aCanResize = true);
static QChar decimalSep();
static QString sizeRegexp();
static QString systemLanguageId();
const char *aClassName = NULL,
bool aRecursive = false);
/* Qt 4.2.0 support function */
{
#if QT_VERSION < 0x040300
/* Deprecated since > 4.2 */
#else
/* New since > 4.2 */
#endif
}
static QString documentsPath();
#ifdef VBOX_WITH_VIDEOHWACCEL
static bool isAcceleration2DVideoAvailable();
/** additional video memory required for the best 2D support performance
* total amount of VRAM required is thus calculated as requiredVideoMemory + required2DOffscreenVideoMemory */
static quint64 required2DOffscreenVideoMemory();
#endif
#ifdef VBOX_WITH_CRHGSMI
static quint64 required3DWddmOffscreenVideoMemory(const QString &strGuestOSTypeId, int cMonitors = 1);
#endif /* VBOX_WITH_CRHGSMI */
/* Returns full medium-format name for the given base medium-format name: */
/* Extra-data settings stuff: */
bool fIncludingMachineGeneralCheck = false,
bool fIncludingMachineStateCheck = false);
bool fIncludingMachineGeneralCheck = false);
#ifdef RT_OS_LINUX
static void checkForWrongUSBMounted();
#endif /* RT_OS_LINUX */
/**
* Emitted at the beginning of the enumeration process started by
* #startEnumeratingMedia().
*/
void mediumEnumStarted();
/**
* Emitted when a new medium item from the list has updated its
* accessibility state.
*/
/**
* Emitted at the end of the enumeration process started by
* #startEnumeratingMedia(). The @a aList argument is passed for
* convenience, it is exactly the same as returned by #currentMediaList().
*/
/** Emitted when a new media is added using #addMedia(). */
void mediumAdded (const UIMedium &);
/** Emitted when the media is updated using #updateMedia(). */
void mediumUpdated (const UIMedium &);
/** Emitted when the media is removed using #removeMedia(). */
void sltProcessGlobalSettingChange();
VBoxGlobal();
~VBoxGlobal();
void init();
#ifdef VBOX_WITH_DEBUGGER_GUI
void initDebuggerVar(int *piDbgCfgVar, const char *pszEnvVar, const char *pszExtraDataName, bool fDefault = false);
#endif
bool mValid;
/** Whether to show error message boxes for VM start errors. */
bool mShowStartVMErrors;
const char * vm_render_mode_str;
bool mIsKWinManaged;
/** The --disable-patm option. */
bool mDisablePatm;
/** The --disable-csam option. */
bool mDisableCsam;
/** The --recompile-supervisor option. */
bool mRecompileSupervisor;
/** The --recompile-user option. */
bool mRecompileUser;
/** The --warp-factor option value. */
#ifdef VBOX_WITH_DEBUGGER_GUI
/** Whether the debugger should be accessible or not.
* Use --dbg, the env.var. VBOX_GUI_DBG_ENABLED, --debug or the env.var.
* VBOX_GUI_DBG_AUTO_SHOW to enable. */
int mDbgEnabled;
/** Whether to show the debugger automatically with the console.
* Use --debug or the env.var. VBOX_GUI_DBG_AUTO_SHOW to enable. */
int mDbgAutoShow;
/** Whether to show the command line window when mDbgAutoShow is set. */
/** Whether to show the statistics window when mDbgAutoShow is set. */
/** VBoxDbg module handle. */
/** Whether to start the VM in paused state or not. */
bool mStartPaused;
#endif
#if defined (Q_WS_WIN32)
#endif
int m3DAvailable;
#ifdef VBOX_GUI_WITH_PIDFILE
#endif
char mSettingsPw[256];
bool mSettingsPwSet;
};
#endif /* __VBoxGlobal_h__ */