settings.h revision 583e1de06ea86fea23b026fcb8aa2b0c281d7e54
/** @file
* Settings file data structures.
*
* These structures are created by the settings file loader and filled with values
* copied from the raw XML data. This allows us to finally make the XML reader
* version-independent and read VirtualBox XML files from earlier versions without
* requiring complicated, tedious and error-prone XSLT conversions.
*
* Note: Headers in Main code have been tweaked to only declare the structures
* defined here so that this header need only be included from code files that
* actually use these structures.
*/
/*
* Copyright (C) 2007-2009 Sun Microsystems, Inc.
*
* 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.
*
* The contents of this file may alternatively be used under the terms
* of the Common Development and Distribution License Version 1.0
* (CDDL) only, as it comes in the "COPYING.CDDL" file of the
* VirtualBox OSE distribution, in which case the provisions of the
* CDDL are applicable instead of those of the GPL.
*
* You may elect to license modified versions of this file under the
* terms and conditions of either the GPL or the CDDL or both.
*
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
* Clara, CA 95054 USA or visit http://www.sun.com if you need
* additional information or have any questions.
*/
#ifndef ___VBox_settings_h
#define ___VBox_settings_h
#include "VBox/com/VirtualBox.h"
#include <list>
#include <map>
#include <vector>
// #ifdef IN_VBOXXML_R3
// # define VBOXXML_CLASS DECLEXPORT_CLASS
// #else
// # define VBOXXML_CLASS DECLIMPORT_CLASS
// #endif
#define VBOXXML_CLASS
{
}
{
////////////////////////////////////////////////////////////////////////////////
//
// Helper classes
//
////////////////////////////////////////////////////////////////////////////////
// ExtraDataItem (used by both VirtualBox.xml and machines XML)
/**
* Common base class for both MainConfigFile and MachineConfigFile
* which contains some common logic for both.
*/
{
bool fileExists();
~ConfigFileBase();
void createStubDocument();
const USBDeviceFiltersList &ll,
bool fHostMode);
void clearDocument();
struct Data;
Data *m;
};
////////////////////////////////////////////////////////////////////////////////
//
// VirtualBox.xml structures
//
////////////////////////////////////////////////////////////////////////////////
struct VBOXXML_CLASS USBDeviceFilter
{
: fActive(false),
{}
bool fActive;
};
struct VBOXXML_CLASS Host
{
};
struct VBOXXML_CLASS SystemProperties
{
: ulLogHistoryCount(3)
{}
};
struct Medium;
struct VBOXXML_CLASS Medium
{
// the following are for hard disks only:
bool fAutoReset; // optional, only for diffs, default is false
};
{
};
struct VBOXXML_CLASS DHCPServer
{
bool fEnabled;
};
{
const Medium &m,
void write();
};
////////////////////////////////////////////////////////////////////////////////
//
// Machine XML structures
//
////////////////////////////////////////////////////////////////////////////////
struct VBOXXML_CLASS VRDPSettings
{
: fEnabled(true),
ulPort(0),
ulAuthTimeout(5000),
fAllowMultiConnection(false),
fReuseSingleConnection(false)
{}
bool fEnabled;
bool fAllowMultiConnection,
};
struct VBOXXML_CLASS BIOSSettings
{
: fACPIEnabled(true),
fIOAPICEnabled(false),
fLogoFadeIn(true),
fLogoFadeOut(false),
fPXEDebugEnabled(false),
llTimeOffset(0)
{}
bool fACPIEnabled,
bool fPXEDebugEnabled;
};
struct VBOXXML_CLASS DVDDrive
{
DVDDrive()
: fPassThrough(false)
{}
bool fPassThrough;
};
struct VBOXXML_CLASS FloppyDrive
{
: fEnabled(true)
{}
bool fEnabled; // optional, defaults to true
};
struct VBOXXML_CLASS USBController
{
: fEnabled(false),
fEnabledEHCI(false)
{}
bool fEnabled;
bool fEnabledEHCI;
};
struct VBOXXML_CLASS NetworkAdapter
{
: ulSlot(0),
fEnabled(false),
fCableConnected(false),
ulLineSpeed(0),
fTraceEnabled(false),
{}
bool fEnabled;
bool fCableConnected;
bool fTraceEnabled;
// with bridged: host interface or empty;
// otherwise: network name (required)
};
struct VBOXXML_CLASS SerialPort
{
: fEnabled(false),
ulIOBase(0),
ulIRQ(0),
fServer(false)
{}
bool fEnabled;
bool fServer;
};
struct VBOXXML_CLASS ParallelPort
{
: fEnabled(false),
ulIOBase(0),
ulIRQ(0)
{}
bool fEnabled;
};
struct VBOXXML_CLASS AudioAdapter
{
: fEnabled(true),
{}
bool fEnabled;
};
struct VBOXXML_CLASS SharedFolder
{
: fWritable(false)
{}
bool fWritable;
};
struct VBOXXML_CLASS GuestProperty
{
: timestamp(0)
{};
};
struct VBOXXML_CLASS Hardware
{
Hardware()
: strVersion("2"),
fHardwareVirt(true),
fNestedPaging(false),
fVPID(false),
fPAE(false),
cCPUs(1),
ulVRAMSizeMB(8),
cMonitors(1),
fAccelerate3D(false),
fAccelerate2DVideo(false),
{
/* mBootOrder [0] = DeviceType_Floppy;
mBootOrder [1] = DeviceType_DVD;
mBootOrder [2] = DeviceType_HardDisk;
for (size_t i = 3; i < RT_ELEMENTS (mBootOrder); i++)
mBootOrder [i] = DeviceType_Null;*/
}
bool fHardwareVirt,
fPAE;
bool fAccelerate3D,
fAccelerate2DVideo; // requires settings version 1.8 (VirtualBox 3.1)
// technically these two have no business in the hardware section, but for some
// clever reason <Hardware> is where they are in the XML....
};
struct VBOXXML_CLASS AttachedDevice
{
lPort(0),
lDevice(0)
{}
};
struct VBOXXML_CLASS StorageController
{
ulPortCount(2),
{}
// only for when controllerType == StorageControllerType_IntelAhci:
};
// wrap the list into an extra struct so we can use the struct without
// having to define the typedef above in headers
struct VBOXXML_CLASS Storage
{
};
struct Snapshot;
struct VBOXXML_CLASS Snapshot
{
strDescription; // optional
};
{
bool fNameSync;
bool fCurrentStateModified; // optional, default is true
bool fAborted; // optional, default is false
};
} // namespace settings
#endif /* ___VBox_settings_h */