settings.h revision aa0632eb844172ced4bef7b3afdbb216c8462fb2
/** @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>
{
}
{
////////////////////////////////////////////////////////////////////////////////
//
// Helper classes
//
////////////////////////////////////////////////////////////////////////////////
// ExtraDataItem (used by both VirtualBox.xml and machines XML)
struct USBDeviceFilter;
/**
* 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 USBDeviceFilter
{
: fActive(false),
{}
bool fActive;
};
struct Host
{
};
struct SystemProperties
{
: ulLogHistoryCount(3)
{}
};
struct Medium;
struct Medium
{
// the following are for hard disks only:
bool fAutoReset; // optional, only for diffs, default is false
};
struct MachineRegistryEntry
{
};
struct DHCPServer
{
bool fEnabled;
};
{
const Medium &m,
};
////////////////////////////////////////////////////////////////////////////////
//
// Machine XML structures
//
////////////////////////////////////////////////////////////////////////////////
struct VRDPSettings
{
: fEnabled(true),
ulAuthTimeout(5000),
fAllowMultiConnection(false),
fReuseSingleConnection(false)
{}
bool fEnabled;
bool fAllowMultiConnection,
};
struct BIOSSettings
{
: fACPIEnabled(true),
fIOAPICEnabled(false),
fLogoFadeIn(true),
fLogoFadeOut(false),
fPXEDebugEnabled(false),
llTimeOffset(0)
{}
bool fACPIEnabled,
bool fPXEDebugEnabled;
};
struct USBController
{
: fEnabled(false),
fEnabledEHCI(false)
{}
bool fEnabled;
bool fEnabledEHCI;
};
struct 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 SerialPort
{
: fEnabled(false),
ulIOBase(0),
ulIRQ(0),
fServer(false)
{}
bool fEnabled;
bool fServer;
};
struct ParallelPort
{
: fEnabled(false),
ulIOBase(0),
ulIRQ(0)
{}
bool fEnabled;
};
struct AudioAdapter
{
: fEnabled(true),
{}
bool fEnabled;
};
struct SharedFolder
{
: fWritable(false)
{}
bool fWritable;
};
struct GuestProperty
{
: timestamp(0)
{};
};
struct Hardware
{
Hardware();
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....
};
/**
* A device attached to a storage controller. This can either be a
* hard disk or a DVD drive or a floppy drive and also specifies
* which medium is "in" the drive; as a result, this is a combination
* of the Main IMedium and IMediumAttachment interfaces.
*/
struct AttachedDevice
{
fPassThrough(false),
lPort(0),
lDevice(0)
{}
// DVDs can be in pass-through mode:
bool fPassThrough;
// if an image file is attached to the device (ISO, RAW, or hard disk image such as VDI),
// this is its UUID; it depends on deviceType which media registry this then needs to
// be looked up in. If no image file (only permitted for DVDs and floppies), then the UUID is NULL
// for DVDs and floppies, the attachment can also be a host device:
};
struct 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 Storage
{
};
struct Snapshot;
struct Snapshot
{
strDescription; // optional
};
{
void readStorageControllerAttributes(const xml::ElementNode &elmStorageController, StorageController &sctl);
void bumpSettingsVersionIfNeeded();
bool fNameSync;
bool fLiveMigrationTarget;
bool fCurrentStateModified; // optional, default is true
bool fAborted; // optional, default is false
};
} // namespace settings
#endif /* ___VBox_settings_h */