ApplianceImpl.h revision 2c1d8cd8efdd4c486ff681135035d24111b03af8
8184f68cdef3c26869cdebc6a18829c854d0d17dvboxsync/* $Id$ */
8184f68cdef3c26869cdebc6a18829c854d0d17dvboxsync
8184f68cdef3c26869cdebc6a18829c854d0d17dvboxsync/** @file
8184f68cdef3c26869cdebc6a18829c854d0d17dvboxsync *
8184f68cdef3c26869cdebc6a18829c854d0d17dvboxsync * VirtualBox COM class implementation
8184f68cdef3c26869cdebc6a18829c854d0d17dvboxsync */
8184f68cdef3c26869cdebc6a18829c854d0d17dvboxsync
8184f68cdef3c26869cdebc6a18829c854d0d17dvboxsync/*
8184f68cdef3c26869cdebc6a18829c854d0d17dvboxsync * Copyright (C) 2006-2009 Sun Microsystems, Inc.
8184f68cdef3c26869cdebc6a18829c854d0d17dvboxsync *
8184f68cdef3c26869cdebc6a18829c854d0d17dvboxsync * This file is part of VirtualBox Open Source Edition (OSE), as
8184f68cdef3c26869cdebc6a18829c854d0d17dvboxsync * available from http://www.virtualbox.org. This file is free software;
8184f68cdef3c26869cdebc6a18829c854d0d17dvboxsync * you can redistribute it and/or modify it under the terms of the GNU
8184f68cdef3c26869cdebc6a18829c854d0d17dvboxsync * General Public License (GPL) as published by the Free Software
8184f68cdef3c26869cdebc6a18829c854d0d17dvboxsync * Foundation, in version 2 as it comes in the "COPYING" file of the
8184f68cdef3c26869cdebc6a18829c854d0d17dvboxsync * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
8184f68cdef3c26869cdebc6a18829c854d0d17dvboxsync * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
8184f68cdef3c26869cdebc6a18829c854d0d17dvboxsync *
8184f68cdef3c26869cdebc6a18829c854d0d17dvboxsync * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
8184f68cdef3c26869cdebc6a18829c854d0d17dvboxsync * Clara, CA 95054 USA or visit http://www.sun.com if you need
8184f68cdef3c26869cdebc6a18829c854d0d17dvboxsync * additional information or have any questions.
8184f68cdef3c26869cdebc6a18829c854d0d17dvboxsync */
8184f68cdef3c26869cdebc6a18829c854d0d17dvboxsync
8184f68cdef3c26869cdebc6a18829c854d0d17dvboxsync#ifndef ____H_APPLIANCEIMPL
8184f68cdef3c26869cdebc6a18829c854d0d17dvboxsync#define ____H_APPLIANCEIMPL
8184f68cdef3c26869cdebc6a18829c854d0d17dvboxsync
b8ae33177906f4130b85b7c861cae0e78ed4859bvboxsync/* VBox includes */
8184f68cdef3c26869cdebc6a18829c854d0d17dvboxsync#include "VirtualBoxBase.h"
8184f68cdef3c26869cdebc6a18829c854d0d17dvboxsync
b8ae33177906f4130b85b7c861cae0e78ed4859bvboxsync/* VBox forward declarations */
50453af238fcec34bf98f91cc4c32bf57f738bd3vboxsyncclass Progress;
f2490dbf97c8247439446844458461b00e50beb0vboxsyncclass VirtualSystemDescription;
35d8d2372afb180daa0ba01af33a1922511d6b07vboxsyncstruct VirtualSystemDescriptionEntry;
482a222498aae619afda0255a7edf4ebda97268cvboxsync
d5bf937d132098565e18a0d1fc408fb777c5e5b6vboxsyncnamespace ovf
d5bf937d132098565e18a0d1fc408fb777c5e5b6vboxsync{
d5bf937d132098565e18a0d1fc408fb777c5e5b6vboxsync struct HardDiskController;
21293ca6a2967f796ed30a6c8492911619476a48vboxsync struct VirtualSystem;
d5bf937d132098565e18a0d1fc408fb777c5e5b6vboxsync class OVFReader;
35d8d2372afb180daa0ba01af33a1922511d6b07vboxsync struct DiskImage;
d5bf937d132098565e18a0d1fc408fb777c5e5b6vboxsync}
d5bf937d132098565e18a0d1fc408fb777c5e5b6vboxsync
d5bf937d132098565e18a0d1fc408fb777c5e5b6vboxsyncnamespace xml
d5bf937d132098565e18a0d1fc408fb777c5e5b6vboxsync{
d5bf937d132098565e18a0d1fc408fb777c5e5b6vboxsync class ElementNode;
d5bf937d132098565e18a0d1fc408fb777c5e5b6vboxsync}
d5bf937d132098565e18a0d1fc408fb777c5e5b6vboxsync
f7c0f913c4c22ee18059ff97055442566d0f14a1vboxsyncnamespace settings
f7c0f913c4c22ee18059ff97055442566d0f14a1vboxsync{
f7c0f913c4c22ee18059ff97055442566d0f14a1vboxsync class MachineConfigFile;
f7c0f913c4c22ee18059ff97055442566d0f14a1vboxsync}
f7c0f913c4c22ee18059ff97055442566d0f14a1vboxsync
8184f68cdef3c26869cdebc6a18829c854d0d17dvboxsyncclass ATL_NO_VTABLE Appliance :
eeb2d581c99b451fb1a26a5870af65981dc9cd5dvboxsync public VirtualBoxBase,
f32de6c198a491c28ace2b4c53f8d04a79fd6d69vboxsync public VirtualBoxSupportErrorInfoImpl<Appliance, IAppliance>,
f32de6c198a491c28ace2b4c53f8d04a79fd6d69vboxsync public VirtualBoxSupportTranslation<Appliance>,
0ce6ae9d6efed5d54222a13bbdabce9e688e4447vboxsync VBOX_SCRIPTABLE_IMPL(IAppliance)
8184f68cdef3c26869cdebc6a18829c854d0d17dvboxsync{
8184f68cdef3c26869cdebc6a18829c854d0d17dvboxsyncpublic:
8184f68cdef3c26869cdebc6a18829c854d0d17dvboxsync VIRTUALBOXBASE_ADD_ERRORINFO_SUPPORT (Appliance)
8184f68cdef3c26869cdebc6a18829c854d0d17dvboxsync
8184f68cdef3c26869cdebc6a18829c854d0d17dvboxsync DECLARE_NOT_AGGREGATABLE(Appliance)
8184f68cdef3c26869cdebc6a18829c854d0d17dvboxsync
8184f68cdef3c26869cdebc6a18829c854d0d17dvboxsync DECLARE_PROTECT_FINAL_CONSTRUCT()
8184f68cdef3c26869cdebc6a18829c854d0d17dvboxsync
8184f68cdef3c26869cdebc6a18829c854d0d17dvboxsync BEGIN_COM_MAP(Appliance)
8184f68cdef3c26869cdebc6a18829c854d0d17dvboxsync COM_INTERFACE_ENTRY(ISupportErrorInfo)
8184f68cdef3c26869cdebc6a18829c854d0d17dvboxsync COM_INTERFACE_ENTRY(IAppliance)
57b49c1557a310ee615bc0ee79dd2a2e92319a1bvboxsync COM_INTERFACE_ENTRY(IDispatch)
8184f68cdef3c26869cdebc6a18829c854d0d17dvboxsync END_COM_MAP()
8184f68cdef3c26869cdebc6a18829c854d0d17dvboxsync
8184f68cdef3c26869cdebc6a18829c854d0d17dvboxsync DECLARE_EMPTY_CTOR_DTOR (Appliance)
8184f68cdef3c26869cdebc6a18829c854d0d17dvboxsync
f2490dbf97c8247439446844458461b00e50beb0vboxsync enum OVFFormat
f2490dbf97c8247439446844458461b00e50beb0vboxsync {
f2490dbf97c8247439446844458461b00e50beb0vboxsync unspecified,
f2490dbf97c8247439446844458461b00e50beb0vboxsync OVF_0_9,
f2490dbf97c8247439446844458461b00e50beb0vboxsync OVF_1_0
f2490dbf97c8247439446844458461b00e50beb0vboxsync };
f2490dbf97c8247439446844458461b00e50beb0vboxsync
8184f68cdef3c26869cdebc6a18829c854d0d17dvboxsync // public initializer/uninitializer for internal purposes only
8184f68cdef3c26869cdebc6a18829c854d0d17dvboxsync HRESULT FinalConstruct() { return S_OK; }
8184f68cdef3c26869cdebc6a18829c854d0d17dvboxsync void FinalRelease() { uninit(); }
8184f68cdef3c26869cdebc6a18829c854d0d17dvboxsync
e52c9984c4f6b8ea141bc50a3bdaf31941d8cd7dvboxsync HRESULT init(VirtualBox *aVirtualBox);
8184f68cdef3c26869cdebc6a18829c854d0d17dvboxsync void uninit();
8184f68cdef3c26869cdebc6a18829c854d0d17dvboxsync
8184f68cdef3c26869cdebc6a18829c854d0d17dvboxsync // for VirtualBoxSupportErrorInfoImpl
8184f68cdef3c26869cdebc6a18829c854d0d17dvboxsync static const wchar_t *getComponentName() { return L"Appliance"; }
8184f68cdef3c26869cdebc6a18829c854d0d17dvboxsync
8184f68cdef3c26869cdebc6a18829c854d0d17dvboxsync /* IAppliance properties */
ee5869bb73f07de9c139dc6a608836a7b5767933vboxsync STDMETHOD(COMGETTER(Path))(BSTR *aPath);
f6dde23cd488aee26203b38ec67220270f5c4273vboxsync STDMETHOD(COMGETTER(Disks))(ComSafeArrayOut(BSTR, aDisks));
f6dde23cd488aee26203b38ec67220270f5c4273vboxsync STDMETHOD(COMGETTER(VirtualSystemDescriptions))(ComSafeArrayOut(IVirtualSystemDescription*, aVirtualSystemDescriptions));
8184f68cdef3c26869cdebc6a18829c854d0d17dvboxsync
8184f68cdef3c26869cdebc6a18829c854d0d17dvboxsync /* IAppliance methods */
dc311b529996345ea65d51c87b60b6849642d894vboxsync /* Import methods */
b8ae33177906f4130b85b7c861cae0e78ed4859bvboxsync STDMETHOD(Read)(IN_BSTR path, IProgress **aProgress);
ee5869bb73f07de9c139dc6a608836a7b5767933vboxsync STDMETHOD(Interpret)(void);
e52c9984c4f6b8ea141bc50a3bdaf31941d8cd7dvboxsync STDMETHOD(ImportMachines)(IProgress **aProgress);
dc311b529996345ea65d51c87b60b6849642d894vboxsync /* Export methods */
dc311b529996345ea65d51c87b60b6849642d894vboxsync STDMETHOD(CreateVFSExplorer)(IN_BSTR aURI, IVFSExplorer **aExplorer);
0a3eb63419e41ef10cd135aeb66dcd6bd6f87cdcvboxsync STDMETHOD(Write)(IN_BSTR format, IN_BSTR path, IProgress **aProgress);
dc311b529996345ea65d51c87b60b6849642d894vboxsync
c4d6c81bd0de216d0f42db2e477b1d788fbaefb4vboxsync STDMETHOD(GetWarnings)(ComSafeArrayOut(BSTR, aWarnings));
c4d6c81bd0de216d0f42db2e477b1d788fbaefb4vboxsync
8184f68cdef3c26869cdebc6a18829c854d0d17dvboxsync /* public methods only for internal purposes */
8184f68cdef3c26869cdebc6a18829c854d0d17dvboxsync
8184f68cdef3c26869cdebc6a18829c854d0d17dvboxsync /* private instance data */
8184f68cdef3c26869cdebc6a18829c854d0d17dvboxsyncprivate:
482a222498aae619afda0255a7edf4ebda97268cvboxsync /** weak VirtualBox parent */
d19316699d7f91959d88c850fd7e0d64840f39a7vboxsync VirtualBox* const mVirtualBox;
482a222498aae619afda0255a7edf4ebda97268cvboxsync
d020036eb167a2f97f5010276fda5daa3f4773b3vboxsync struct Data; // opaque, defined in ApplianceImpl.cpp
8184f68cdef3c26869cdebc6a18829c854d0d17dvboxsync Data *m;
8184f68cdef3c26869cdebc6a18829c854d0d17dvboxsync
25c5ce7baf4b227ea80250c46d427d0e9fdab4c1vboxsync bool isApplianceIdle() const;
25c5ce7baf4b227ea80250c46d427d0e9fdab4c1vboxsync
d91dc86210d602f51a4701762488a5e696c80a45vboxsync HRESULT searchUniqueVMName(Utf8Str& aName) const;
d91dc86210d602f51a4701762488a5e696c80a45vboxsync HRESULT searchUniqueDiskImageFilePath(Utf8Str& aName) const;
2c1d8cd8efdd4c486ff681135035d24111b03af8vboxsync HRESULT getDefaultHardDiskFolder(Utf8Str &str) const;
59d96bafa78f7257869e30b88f2f98142ef5928evboxsync void waitForAsyncProgress(ComObjPtr<Progress> &pProgressThis, ComPtr<IProgress> &pProgressAsync);
c4d6c81bd0de216d0f42db2e477b1d788fbaefb4vboxsync void addWarning(const char* aWarning, ...);
a96ed55e8e1b248965a3d29d6e4c3116979e887bvboxsync
35d8d2372afb180daa0ba01af33a1922511d6b07vboxsync void disksWeight();
35d8d2372afb180daa0ba01af33a1922511d6b07vboxsync enum SetUpProgressMode { Regular, ImportS3, WriteS3 };
35d8d2372afb180daa0ba01af33a1922511d6b07vboxsync HRESULT setUpProgress(ComObjPtr<Progress> &pProgress,
35d8d2372afb180daa0ba01af33a1922511d6b07vboxsync const Bstr &bstrDescription,
35d8d2372afb180daa0ba01af33a1922511d6b07vboxsync SetUpProgressMode mode);
b8ae33177906f4130b85b7c861cae0e78ed4859bvboxsync
b8ae33177906f4130b85b7c861cae0e78ed4859bvboxsync struct LocationInfo;
b8ae33177906f4130b85b7c861cae0e78ed4859bvboxsync void parseURI(Utf8Str strUri, LocationInfo &locInfo) const;
b8ae33177906f4130b85b7c861cae0e78ed4859bvboxsync void parseBucket(Utf8Str &aPath, Utf8Str &aBucket) const;
7a2986a2fdd00cd130bcda05a53575fb58874754vboxsync Utf8Str manifestFileName(Utf8Str aPath) const;
b8ae33177906f4130b85b7c861cae0e78ed4859bvboxsync
b8ae33177906f4130b85b7c861cae0e78ed4859bvboxsync HRESULT readImpl(const LocationInfo &aLocInfo, ComObjPtr<Progress> &aProgress);
b8ae33177906f4130b85b7c861cae0e78ed4859bvboxsync
b8ae33177906f4130b85b7c861cae0e78ed4859bvboxsync struct TaskOVF;
6b9316bfe743cc7d2ee00d925f4ab455bc224e86vboxsync static DECLCALLBACK(int) taskThreadImportOrExport(RTTHREAD aThread, void *pvUser);
b8ae33177906f4130b85b7c861cae0e78ed4859bvboxsync
6b9316bfe743cc7d2ee00d925f4ab455bc224e86vboxsync HRESULT readFS(const LocationInfo &locInfo);
6b9316bfe743cc7d2ee00d925f4ab455bc224e86vboxsync HRESULT readS3(TaskOVF *pTask);
b8ae33177906f4130b85b7c861cae0e78ed4859bvboxsync
d5bf937d132098565e18a0d1fc408fb777c5e5b6vboxsync void convertDiskAttachmentValues(const ovf::HardDiskController &hdc,
d76ca6cbea4e45aa218c74e33c784bde5e997ffcvboxsync uint32_t ulAddressOnParent,
d76ca6cbea4e45aa218c74e33c784bde5e997ffcvboxsync Bstr &controllerType,
d76ca6cbea4e45aa218c74e33c784bde5e997ffcvboxsync int32_t &lChannel,
d76ca6cbea4e45aa218c74e33c784bde5e997ffcvboxsync int32_t &lDevice);
d76ca6cbea4e45aa218c74e33c784bde5e997ffcvboxsync
7a71f66d53a7dcdf19a7a357e99e560fda812dc3vboxsync HRESULT importImpl(const LocationInfo &aLocInfo, ComObjPtr<Progress> &aProgress);
35d8d2372afb180daa0ba01af33a1922511d6b07vboxsync HRESULT manifestVerify(const LocationInfo &locInfo, const ovf::OVFReader &reader);
7a71f66d53a7dcdf19a7a357e99e560fda812dc3vboxsync
6b9316bfe743cc7d2ee00d925f4ab455bc224e86vboxsync HRESULT importFS(const LocationInfo &locInfo, ComObjPtr<Progress> &aProgress);
35d8d2372afb180daa0ba01af33a1922511d6b07vboxsync
21293ca6a2967f796ed30a6c8492911619476a48vboxsync struct ImportStack;
35d8d2372afb180daa0ba01af33a1922511d6b07vboxsync void importOneDiskImage(const ovf::DiskImage &di,
35d8d2372afb180daa0ba01af33a1922511d6b07vboxsync const Utf8Str &strTargetPath,
35d8d2372afb180daa0ba01af33a1922511d6b07vboxsync ComPtr<IMedium> &pTargetHD,
35d8d2372afb180daa0ba01af33a1922511d6b07vboxsync ImportStack &stack);
21293ca6a2967f796ed30a6c8492911619476a48vboxsync void importMachineGeneric(const ovf::VirtualSystem &vsysThis,
21293ca6a2967f796ed30a6c8492911619476a48vboxsync ComObjPtr<VirtualSystemDescription> &vsdescThis,
21293ca6a2967f796ed30a6c8492911619476a48vboxsync ComPtr<IMachine> &pNewMachine,
21293ca6a2967f796ed30a6c8492911619476a48vboxsync ImportStack &stack);
2c1d8cd8efdd4c486ff681135035d24111b03af8vboxsync void importVBoxMachine(ComObjPtr<VirtualSystemDescription> &vsdescThis,
35d8d2372afb180daa0ba01af33a1922511d6b07vboxsync ComPtr<IMachine> &pNewMachine,
35d8d2372afb180daa0ba01af33a1922511d6b07vboxsync ImportStack &stack);
35d8d2372afb180daa0ba01af33a1922511d6b07vboxsync
6b9316bfe743cc7d2ee00d925f4ab455bc224e86vboxsync HRESULT importS3(TaskOVF *pTask);
7a71f66d53a7dcdf19a7a357e99e560fda812dc3vboxsync
f2490dbf97c8247439446844458461b00e50beb0vboxsync HRESULT writeImpl(OVFFormat aFormat, const LocationInfo &aLocInfo, ComObjPtr<Progress> &aProgress);
d20e5d189feff7841cc3f40e5c9cca8c86b45eb5vboxsync
f2490dbf97c8247439446844458461b00e50beb0vboxsync struct XMLStack;
f2490dbf97c8247439446844458461b00e50beb0vboxsync void buildXMLForOneVirtualSystem(xml::ElementNode &elmToAddVirtualSystemsTo,
f2490dbf97c8247439446844458461b00e50beb0vboxsync ComObjPtr<VirtualSystemDescription> &vsdescThis,
f2490dbf97c8247439446844458461b00e50beb0vboxsync OVFFormat enFormat,
f2490dbf97c8247439446844458461b00e50beb0vboxsync XMLStack &stack);
f2490dbf97c8247439446844458461b00e50beb0vboxsync
6b9316bfe743cc7d2ee00d925f4ab455bc224e86vboxsync HRESULT writeFS(const LocationInfo &locInfo, const OVFFormat enFormat, ComObjPtr<Progress> &pProgress);
6b9316bfe743cc7d2ee00d925f4ab455bc224e86vboxsync HRESULT writeS3(TaskOVF *pTask);
db85b6b8ce514217c1fb35d04b0854a65dc299f3vboxsync
db85b6b8ce514217c1fb35d04b0854a65dc299f3vboxsync friend class Machine;
8184f68cdef3c26869cdebc6a18829c854d0d17dvboxsync};
8184f68cdef3c26869cdebc6a18829c854d0d17dvboxsync
8184f68cdef3c26869cdebc6a18829c854d0d17dvboxsyncstruct VirtualSystemDescriptionEntry
8184f68cdef3c26869cdebc6a18829c854d0d17dvboxsync{
4831e82ecaa3c813398d2f343e9d38ee34a3acf4vboxsync uint32_t ulIndex; // zero-based index of this entry within array
4831e82ecaa3c813398d2f343e9d38ee34a3acf4vboxsync VirtualSystemDescriptionType_T type; // type of this entry
4831e82ecaa3c813398d2f343e9d38ee34a3acf4vboxsync Utf8Str strRef; // reference number (hard disk controllers only)
40becad9511726726c5959a8ad8b62fb3e1c020cvboxsync Utf8Str strOvf; // original OVF value (type-dependent)
40becad9511726726c5959a8ad8b62fb3e1c020cvboxsync Utf8Str strVbox; // configuration value (type-dependent)
4831e82ecaa3c813398d2f343e9d38ee34a3acf4vboxsync Utf8Str strExtraConfig; // extra configuration key=value strings (type-dependent)
50453af238fcec34bf98f91cc4c32bf57f738bd3vboxsync
2c1d8cd8efdd4c486ff681135035d24111b03af8vboxsync uint32_t ulSizeMB; // hard disk images only: a copy of ovf::DiskImage::ulSuggestedSizeMB
8184f68cdef3c26869cdebc6a18829c854d0d17dvboxsync};
8184f68cdef3c26869cdebc6a18829c854d0d17dvboxsync
8184f68cdef3c26869cdebc6a18829c854d0d17dvboxsyncclass ATL_NO_VTABLE VirtualSystemDescription :
eeb2d581c99b451fb1a26a5870af65981dc9cd5dvboxsync public VirtualBoxBase,
f32de6c198a491c28ace2b4c53f8d04a79fd6d69vboxsync public VirtualBoxSupportErrorInfoImpl<VirtualSystemDescription, IVirtualSystemDescription>,
f32de6c198a491c28ace2b4c53f8d04a79fd6d69vboxsync public VirtualBoxSupportTranslation<VirtualSystemDescription>,
0ce6ae9d6efed5d54222a13bbdabce9e688e4447vboxsync VBOX_SCRIPTABLE_IMPL(IVirtualSystemDescription)
8184f68cdef3c26869cdebc6a18829c854d0d17dvboxsync{
8184f68cdef3c26869cdebc6a18829c854d0d17dvboxsync friend class Appliance;
c4d6c81bd0de216d0f42db2e477b1d788fbaefb4vboxsync
8184f68cdef3c26869cdebc6a18829c854d0d17dvboxsyncpublic:
8184f68cdef3c26869cdebc6a18829c854d0d17dvboxsync VIRTUALBOXBASE_ADD_ERRORINFO_SUPPORT (VirtualSystemDescription)
8184f68cdef3c26869cdebc6a18829c854d0d17dvboxsync
8184f68cdef3c26869cdebc6a18829c854d0d17dvboxsync DECLARE_NOT_AGGREGATABLE(VirtualSystemDescription)
8184f68cdef3c26869cdebc6a18829c854d0d17dvboxsync
8184f68cdef3c26869cdebc6a18829c854d0d17dvboxsync DECLARE_PROTECT_FINAL_CONSTRUCT()
8184f68cdef3c26869cdebc6a18829c854d0d17dvboxsync
8184f68cdef3c26869cdebc6a18829c854d0d17dvboxsync BEGIN_COM_MAP(VirtualSystemDescription)
8184f68cdef3c26869cdebc6a18829c854d0d17dvboxsync COM_INTERFACE_ENTRY(ISupportErrorInfo)
8184f68cdef3c26869cdebc6a18829c854d0d17dvboxsync COM_INTERFACE_ENTRY(IVirtualSystemDescription)
ea743ed8b8effc9f3647b76eb109c45788052fa0vboxsync COM_INTERFACE_ENTRY(IDispatch)
8184f68cdef3c26869cdebc6a18829c854d0d17dvboxsync END_COM_MAP()
8184f68cdef3c26869cdebc6a18829c854d0d17dvboxsync
8184f68cdef3c26869cdebc6a18829c854d0d17dvboxsync DECLARE_EMPTY_CTOR_DTOR (VirtualSystemDescription)
8184f68cdef3c26869cdebc6a18829c854d0d17dvboxsync
8184f68cdef3c26869cdebc6a18829c854d0d17dvboxsync // public initializer/uninitializer for internal purposes only
8184f68cdef3c26869cdebc6a18829c854d0d17dvboxsync HRESULT FinalConstruct() { return S_OK; }
8184f68cdef3c26869cdebc6a18829c854d0d17dvboxsync void FinalRelease() { uninit(); }
8184f68cdef3c26869cdebc6a18829c854d0d17dvboxsync
8184f68cdef3c26869cdebc6a18829c854d0d17dvboxsync HRESULT init();
8184f68cdef3c26869cdebc6a18829c854d0d17dvboxsync void uninit();
8184f68cdef3c26869cdebc6a18829c854d0d17dvboxsync
8184f68cdef3c26869cdebc6a18829c854d0d17dvboxsync // for VirtualBoxSupportErrorInfoImpl
8184f68cdef3c26869cdebc6a18829c854d0d17dvboxsync static const wchar_t *getComponentName() { return L"VirtualSystemDescription"; }
8184f68cdef3c26869cdebc6a18829c854d0d17dvboxsync
8184f68cdef3c26869cdebc6a18829c854d0d17dvboxsync /* IVirtualSystemDescription properties */
23ab2e25f17cdd6af9c0448ee70905a8c1c82896vboxsync STDMETHOD(COMGETTER(Count))(ULONG *aCount);
8184f68cdef3c26869cdebc6a18829c854d0d17dvboxsync
8184f68cdef3c26869cdebc6a18829c854d0d17dvboxsync /* IVirtualSystemDescription methods */
f6dde23cd488aee26203b38ec67220270f5c4273vboxsync STDMETHOD(GetDescription)(ComSafeArrayOut(VirtualSystemDescriptionType_T, aTypes),
4831e82ecaa3c813398d2f343e9d38ee34a3acf4vboxsync ComSafeArrayOut(BSTR, aRefs),
40becad9511726726c5959a8ad8b62fb3e1c020cvboxsync ComSafeArrayOut(BSTR, aOvfValues),
40becad9511726726c5959a8ad8b62fb3e1c020cvboxsync ComSafeArrayOut(BSTR, aVboxValues),
43e9355f77c0463e7ace350984bb5a09fb8c50a1vboxsync ComSafeArrayOut(BSTR, aExtraConfigValues));
611af5c9fc04865215e86b6e4906c9dfdfb6a381vboxsync
d07e901177d22a8f66c66f155c423a524ac07776vboxsync STDMETHOD(GetDescriptionByType)(VirtualSystemDescriptionType_T aType,
d07e901177d22a8f66c66f155c423a524ac07776vboxsync ComSafeArrayOut(VirtualSystemDescriptionType_T, aTypes),
d07e901177d22a8f66c66f155c423a524ac07776vboxsync ComSafeArrayOut(BSTR, aRefs),
d07e901177d22a8f66c66f155c423a524ac07776vboxsync ComSafeArrayOut(BSTR, aOvfValues),
d07e901177d22a8f66c66f155c423a524ac07776vboxsync ComSafeArrayOut(BSTR, aVboxValues),
d07e901177d22a8f66c66f155c423a524ac07776vboxsync ComSafeArrayOut(BSTR, aExtraConfigValues));
d07e901177d22a8f66c66f155c423a524ac07776vboxsync
f48fe310f85f13db0140bef980de1f56c2007957vboxsync STDMETHOD(GetValuesByType)(VirtualSystemDescriptionType_T aType,
f48fe310f85f13db0140bef980de1f56c2007957vboxsync VirtualSystemDescriptionValueType_T aWhich,
f48fe310f85f13db0140bef980de1f56c2007957vboxsync ComSafeArrayOut(BSTR, aValues));
f48fe310f85f13db0140bef980de1f56c2007957vboxsync
1b186b95b77faa977d3651bbfc13afb3f13e0225vboxsync STDMETHOD(SetFinalValues)(ComSafeArrayIn(BOOL, aEnabled),
40becad9511726726c5959a8ad8b62fb3e1c020cvboxsync ComSafeArrayIn(IN_BSTR, aVboxValues),
0b10203d41681eb80716c97a34ed6c3b6d5318ccvboxsync ComSafeArrayIn(IN_BSTR, aExtraConfigValues));
611af5c9fc04865215e86b6e4906c9dfdfb6a381vboxsync
d4f7483a46e1c44ae5fcc4195be291545ae720a4vboxsync STDMETHOD(AddDescription)(VirtualSystemDescriptionType_T aType,
d4f7483a46e1c44ae5fcc4195be291545ae720a4vboxsync IN_BSTR aVboxValue,
d4f7483a46e1c44ae5fcc4195be291545ae720a4vboxsync IN_BSTR aExtraConfigValue);
d4f7483a46e1c44ae5fcc4195be291545ae720a4vboxsync
8184f68cdef3c26869cdebc6a18829c854d0d17dvboxsync /* public methods only for internal purposes */
8184f68cdef3c26869cdebc6a18829c854d0d17dvboxsync
f9cac318205d74ee5b35dabcf2bd39118f6293d7vboxsync void addEntry(VirtualSystemDescriptionType_T aType,
4831e82ecaa3c813398d2f343e9d38ee34a3acf4vboxsync const Utf8Str &strRef,
d91dc86210d602f51a4701762488a5e696c80a45vboxsync const Utf8Str &aOrigValue,
4831e82ecaa3c813398d2f343e9d38ee34a3acf4vboxsync const Utf8Str &aAutoValue,
50453af238fcec34bf98f91cc4c32bf57f738bd3vboxsync uint32_t ulSizeMB = 0,
4831e82ecaa3c813398d2f343e9d38ee34a3acf4vboxsync const Utf8Str &strExtraConfig = "");
f9cac318205d74ee5b35dabcf2bd39118f6293d7vboxsync
f9cac318205d74ee5b35dabcf2bd39118f6293d7vboxsync std::list<VirtualSystemDescriptionEntry*> findByType(VirtualSystemDescriptionType_T aType);
4831e82ecaa3c813398d2f343e9d38ee34a3acf4vboxsync const VirtualSystemDescriptionEntry* findControllerFromID(uint32_t id);
8184f68cdef3c26869cdebc6a18829c854d0d17dvboxsync
f7c0f913c4c22ee18059ff97055442566d0f14a1vboxsync void importVboxMachineXML(const xml::ElementNode &elmMachine);
f7c0f913c4c22ee18059ff97055442566d0f14a1vboxsync const settings::MachineConfigFile* getMachineConfig() const;
f7c0f913c4c22ee18059ff97055442566d0f14a1vboxsync
db85b6b8ce514217c1fb35d04b0854a65dc299f3vboxsync /* private instance data */
db85b6b8ce514217c1fb35d04b0854a65dc299f3vboxsyncprivate:
8184f68cdef3c26869cdebc6a18829c854d0d17dvboxsync struct Data;
8184f68cdef3c26869cdebc6a18829c854d0d17dvboxsync Data *m;
3221ae1f7bf53d9cccdd578099f55f782dba1447vboxsync
3221ae1f7bf53d9cccdd578099f55f782dba1447vboxsync friend class Machine;
8184f68cdef3c26869cdebc6a18829c854d0d17dvboxsync};
8184f68cdef3c26869cdebc6a18829c854d0d17dvboxsync
8184f68cdef3c26869cdebc6a18829c854d0d17dvboxsync#endif // ____H_APPLIANCEIMPL
5e3a885d489b1c99d79d576813f8f321bae46927vboxsync/* vi: set tabstop=4 shiftwidth=4 expandtab: */