HardDiskFormatImpl.h revision f13f1ed69a96abc07232826cd40e8b08ae66afea
a3f3701cea1ba388e7c877955252bb7375eedebdvboxsync/* $Id$ */
a3f3701cea1ba388e7c877955252bb7375eedebdvboxsync
a3f3701cea1ba388e7c877955252bb7375eedebdvboxsync/** @file
a3f3701cea1ba388e7c877955252bb7375eedebdvboxsync *
a3f3701cea1ba388e7c877955252bb7375eedebdvboxsync * VirtualBox COM class implementation
a3f3701cea1ba388e7c877955252bb7375eedebdvboxsync */
a3f3701cea1ba388e7c877955252bb7375eedebdvboxsync
a3f3701cea1ba388e7c877955252bb7375eedebdvboxsync/*
a3f3701cea1ba388e7c877955252bb7375eedebdvboxsync * Copyright (C) 2008 Sun Microsystems, Inc.
a3f3701cea1ba388e7c877955252bb7375eedebdvboxsync *
a3f3701cea1ba388e7c877955252bb7375eedebdvboxsync * This file is part of VirtualBox Open Source Edition (OSE), as
a3f3701cea1ba388e7c877955252bb7375eedebdvboxsync * available from http://www.virtualbox.org. This file is free software;
a3f3701cea1ba388e7c877955252bb7375eedebdvboxsync * you can redistribute it and/or modify it under the terms of the GNU
a3f3701cea1ba388e7c877955252bb7375eedebdvboxsync * General Public License (GPL) as published by the Free Software
a3f3701cea1ba388e7c877955252bb7375eedebdvboxsync * Foundation, in version 2 as it comes in the "COPYING" file of the
a3f3701cea1ba388e7c877955252bb7375eedebdvboxsync * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
a3f3701cea1ba388e7c877955252bb7375eedebdvboxsync * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
a3f3701cea1ba388e7c877955252bb7375eedebdvboxsync *
a3f3701cea1ba388e7c877955252bb7375eedebdvboxsync * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
a3f3701cea1ba388e7c877955252bb7375eedebdvboxsync * Clara, CA 95054 USA or visit http://www.sun.com if you need
a3f3701cea1ba388e7c877955252bb7375eedebdvboxsync * additional information or have any questions.
a3f3701cea1ba388e7c877955252bb7375eedebdvboxsync */
a3f3701cea1ba388e7c877955252bb7375eedebdvboxsync
a3f3701cea1ba388e7c877955252bb7375eedebdvboxsync#ifndef ____H_HARDDISKFORMAT
a3f3701cea1ba388e7c877955252bb7375eedebdvboxsync#define ____H_HARDDISKFORMAT
a3f3701cea1ba388e7c877955252bb7375eedebdvboxsync
a3f3701cea1ba388e7c877955252bb7375eedebdvboxsync#include "VirtualBoxBase.h"
a3f3701cea1ba388e7c877955252bb7375eedebdvboxsync
a3f3701cea1ba388e7c877955252bb7375eedebdvboxsync#include <VBox/com/array.h>
a3f3701cea1ba388e7c877955252bb7375eedebdvboxsync
a3f3701cea1ba388e7c877955252bb7375eedebdvboxsync#include <list>
a3f3701cea1ba388e7c877955252bb7375eedebdvboxsync
a3f3701cea1ba388e7c877955252bb7375eedebdvboxsyncstruct VDBACKENDINFO;
a3f3701cea1ba388e7c877955252bb7375eedebdvboxsync
a3f3701cea1ba388e7c877955252bb7375eedebdvboxsyncclass ATL_NO_VTABLE HardDiskFormat :
a3f3701cea1ba388e7c877955252bb7375eedebdvboxsync public VirtualBoxBaseNEXT,
public VirtualBoxSupportErrorInfoImpl <HardDiskFormat, IHardDiskFormat>,
public VirtualBoxSupportTranslation <HardDiskFormat>,
public IHardDiskFormat
{
public:
VIRTUALBOXBASE_ADD_ERRORINFO_SUPPORT (HardDiskFormat)
DECLARE_NOT_AGGREGATABLE (HardDiskFormat)
DECLARE_PROTECT_FINAL_CONSTRUCT()
BEGIN_COM_MAP(HardDiskFormat)
COM_INTERFACE_ENTRY (ISupportErrorInfo)
COM_INTERFACE_ENTRY (IHardDiskFormat)
END_COM_MAP()
NS_DECL_ISUPPORTS
DECLARE_EMPTY_CTOR_DTOR (HardDiskFormat)
HRESULT FinalConstruct();
void FinalRelease();
// public initializer/uninitializer for internal purposes only
HRESULT init (const VDBACKENDINFO *aVDInfo);
void uninit();
// IHardDiskFormat properties
STDMETHOD(COMGETTER(Id)) (BSTR *aId);
STDMETHOD(COMGETTER(Name)) (BSTR *aName);
STDMETHOD(COMGETTER(FileExtensions)) (ComSafeArrayOut (BSTR, aFileExtensions));
STDMETHOD(COMGETTER(Capabilities)) (ULONG *aCaps);
// IHardDiskFormat methods
STDMETHOD(DescribeProperties) (ComSafeArrayOut (BSTR, aNames),
ComSafeArrayOut (BSTR, aDescriptions),
ComSafeArrayOut (DataType_T, aTypes),
ComSafeArrayOut (ULONG, aFlags),
ComSafeArrayOut (BSTR, aDefaults));
// public methods only for internal purposes
// public methods for internal purposes only
// (ensure there is a caller and a read lock before calling them!)
// for VirtualBoxSupportErrorInfoImpl
static const wchar_t *getComponentName() { return L"HardDiskFormat"; }
private:
typedef std::list <Bstr> BstrList;
struct Property
{
Bstr name;
Bstr description;
DataType_T type;
ULONG flags;
Bstr defaultValue;
};
typedef std::list <Property> PropertyList;
struct Data
{
Data() : capabilities (0) {}
const Bstr id;
const Bstr name;
const BstrList fileExtensions;
const uint64_t capabilities;
const PropertyList properties;
};
Data mData;
};
#endif // ____H_HARDDISKFORMAT