VBoxGlobal.h revision 677833bc953b6cb418c701facbdcf4aa18d6c44e
/** @file
*
* VBox frontends: Qt GUI ("VirtualBox"):
* VBoxGlobal class declaration
*/
/*
* Copyright (C) 2006 InnoTek Systemberatung GmbH
*
* 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 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.
*
* If you received this file as part of a commercial VirtualBox
* distribution, then only the terms of your commercial VirtualBox
* license agreement apply instead of the previous paragraph.
*/
#ifndef __VBoxGlobal_h__
#define __VBoxGlobal_h__
#include "COMDefs.h"
#include "VMGlobalSettings.h"
#include <qapplication.h>
#include <qpixmap.h>
#include <qiconset.h>
#include <qcolor.h>
#include <quuid.h>
#include <qthread.h>
#include <qptrvector.h>
#include <qvaluevector.h>
#include <qvaluelist.h>
#include <qdict.h>
#include <qintdict.h>
// Auxiliary types
////////////////////////////////////////////////////////////////////////////////
/** Simple media descriptor type. */
struct VBoxMedia
{
};
// VirtualBox callback events
////////////////////////////////////////////////////////////////////////////////
{
{}
};
{
{}
};
{
{}
const bool registered;
};
{
{}
};
{
{}
const QUuid snapshotId;
};
// VBoxGlobal
////////////////////////////////////////////////////////////////////////////////
{
static VBoxGlobal &instance();
const char *vmRenderModeStr() const { return vm_render_mode_str; }
#ifdef VBOX_WITH_DEBUGGER_GUI
bool isDebuggerEnabled() const { return dbg_enabled; }
bool isDebuggerVisibleAtStartup() const { return dbg_visible_at_startup; }
#endif
QStringList vmGuestOSTypeDescriptions() const;
{
}
{
}
{
return machineStates [s];
}
{
return sessionStates [s];
}
{
return diskControllerTypes [t];
}
{
return diskTypes [t];
}
{
return diskStorageTypes [t];
}
/**
* Similar to toString (CEnums::HardDiskType), but returns 'Differencing'
* for normal hard disks that have a parent hard disk.
*/
{
{
}
}
{
return deviceTypes [t];
}
{
}
QStringList deviceTypeStrings() const;
{
return audioDriverTypes [t];
}
{
}
{
return networkAttachmentTypes [t];
}
{
}
{
}
// details generators
// VirtualBox helpers
void startEnumeratingMedia();
/** Returns a list of all currently enumerated media (it is empty if the
* enumeration has been finished or never been started). */
// various helpers
void languageChange();
void cleanup(); // made public for internal purposes
// public static stuff
const char *aDisabled = 0,
const char *aActive = 0);
const char *aDisabled = 0, const char *aSmallDisabled = 0,
const char *aActive = 0, const char *aSmallActive = 0);
bool aCanResize = true);
bool aCanResize = true);
static QString formatSize (unsigned long long);
/**
* Emitted during the enumeration process started
* by #startEnumeratingMedia(). */
/**
* Emitted at the end of the enumeration process started
* by #startEnumeratingMedia().
* @note #currentMediaList() will return an empty list
* when this signal is emitted, use the argument instead. */
// signals emitted when the VirtualBox callback is called by the server
// (not that currently these signals are emitted only when the application
// is the in the VM selector mode)
void machineStateChanged (const VBoxMachineStateChangeEvent &e);
void machineDataChanged (const VBoxMachineDataChangeEvent &e);
void machineRegistered (const VBoxMachineRegisteredEvent &e);
void sessionStateChanged (const VBoxSessionStateChangeEvent &e);
void snapshotChanged (const VBoxSnapshotEvent &e);
VBoxGlobal();
~VBoxGlobal() {}
void init();
bool valid;
const char * vm_render_mode_str;
#ifdef VBOX_WITH_DEBUGGER_GUI
bool dbg_enabled;
bool dbg_visible_at_startup;
#endif
#if defined (Q_WS_WIN32)
#endif
};
#endif // __VBoxGlobal_h__