7189dad3705d42e9874af1e1c8a8c7e5cceee9f7vboxsync/* $Id$ */
7189dad3705d42e9874af1e1c8a8c7e5cceee9f7vboxsync
7189dad3705d42e9874af1e1c8a8c7e5cceee9f7vboxsync/** @file
7189dad3705d42e9874af1e1c8a8c7e5cceee9f7vboxsync *
7189dad3705d42e9874af1e1c8a8c7e5cceee9f7vboxsync * VBox StorageController COM Class declaration.
7189dad3705d42e9874af1e1c8a8c7e5cceee9f7vboxsync */
7189dad3705d42e9874af1e1c8a8c7e5cceee9f7vboxsync
7189dad3705d42e9874af1e1c8a8c7e5cceee9f7vboxsync/*
7b01db654c23d4e432465aebc1a1853e8d6b3194vboxsync * Copyright (C) 2008-2013 Oracle Corporation
7189dad3705d42e9874af1e1c8a8c7e5cceee9f7vboxsync *
7189dad3705d42e9874af1e1c8a8c7e5cceee9f7vboxsync * This file is part of VirtualBox Open Source Edition (OSE), as
7189dad3705d42e9874af1e1c8a8c7e5cceee9f7vboxsync * available from http://www.virtualbox.org. This file is free software;
7189dad3705d42e9874af1e1c8a8c7e5cceee9f7vboxsync * you can redistribute it and/or modify it under the terms of the GNU
7189dad3705d42e9874af1e1c8a8c7e5cceee9f7vboxsync * General Public License (GPL) as published by the Free Software
7189dad3705d42e9874af1e1c8a8c7e5cceee9f7vboxsync * Foundation, in version 2 as it comes in the "COPYING" file of the
7189dad3705d42e9874af1e1c8a8c7e5cceee9f7vboxsync * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
7189dad3705d42e9874af1e1c8a8c7e5cceee9f7vboxsync * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
7189dad3705d42e9874af1e1c8a8c7e5cceee9f7vboxsync */
7189dad3705d42e9874af1e1c8a8c7e5cceee9f7vboxsync
7189dad3705d42e9874af1e1c8a8c7e5cceee9f7vboxsync#ifndef ____H_STORAGECONTROLLERIMPL
7189dad3705d42e9874af1e1c8a8c7e5cceee9f7vboxsync#define ____H_STORAGECONTROLLERIMPL
7b01db654c23d4e432465aebc1a1853e8d6b3194vboxsync#include "StorageControllerWrap.h"
7189dad3705d42e9874af1e1c8a8c7e5cceee9f7vboxsync
7189dad3705d42e9874af1e1c8a8c7e5cceee9f7vboxsyncclass ATL_NO_VTABLE StorageController :
7b01db654c23d4e432465aebc1a1853e8d6b3194vboxsync public StorageControllerWrap
7189dad3705d42e9874af1e1c8a8c7e5cceee9f7vboxsync{
7189dad3705d42e9874af1e1c8a8c7e5cceee9f7vboxsyncpublic:
7189dad3705d42e9874af1e1c8a8c7e5cceee9f7vboxsync
7b01db654c23d4e432465aebc1a1853e8d6b3194vboxsync DECLARE_EMPTY_CTOR_DTOR(StorageController)
7189dad3705d42e9874af1e1c8a8c7e5cceee9f7vboxsync
7189dad3705d42e9874af1e1c8a8c7e5cceee9f7vboxsync HRESULT FinalConstruct();
7189dad3705d42e9874af1e1c8a8c7e5cceee9f7vboxsync void FinalRelease();
7189dad3705d42e9874af1e1c8a8c7e5cceee9f7vboxsync
7189dad3705d42e9874af1e1c8a8c7e5cceee9f7vboxsync // public initializer/uninitializer for internal purposes only
fe06619ae576367ff3568e6abd99fb8ad28cc73avboxsync HRESULT init(Machine *aParent,
fe06619ae576367ff3568e6abd99fb8ad28cc73avboxsync const Utf8Str &aName,
c8faf7a704e698dec3679d7df43ae55b1bab3eadvboxsync StorageBus_T aBus,
bf88068260ded16af90b7da4867240fbdd9c8017vboxsync ULONG aInstance,
bf88068260ded16af90b7da4867240fbdd9c8017vboxsync bool fBootable);
fe06619ae576367ff3568e6abd99fb8ad28cc73avboxsync HRESULT init(Machine *aParent,
fe06619ae576367ff3568e6abd99fb8ad28cc73avboxsync StorageController *aThat,
fe06619ae576367ff3568e6abd99fb8ad28cc73avboxsync bool aReshare = false);
fe06619ae576367ff3568e6abd99fb8ad28cc73avboxsync HRESULT initCopy(Machine *aParent,
fe06619ae576367ff3568e6abd99fb8ad28cc73avboxsync StorageController *aThat);
7189dad3705d42e9874af1e1c8a8c7e5cceee9f7vboxsync void uninit();
7189dad3705d42e9874af1e1c8a8c7e5cceee9f7vboxsync
7189dad3705d42e9874af1e1c8a8c7e5cceee9f7vboxsync // public methods only for internal purposes
7b01db654c23d4e432465aebc1a1853e8d6b3194vboxsync const Utf8Str &i_getName() const;
7b01db654c23d4e432465aebc1a1853e8d6b3194vboxsync StorageControllerType_T i_getControllerType() const;
7b01db654c23d4e432465aebc1a1853e8d6b3194vboxsync StorageBus_T i_getStorageBus() const;
7b01db654c23d4e432465aebc1a1853e8d6b3194vboxsync ULONG i_getInstance() const;
7b01db654c23d4e432465aebc1a1853e8d6b3194vboxsync bool i_getBootable() const;
7b01db654c23d4e432465aebc1a1853e8d6b3194vboxsync HRESULT i_checkPortAndDeviceValid(LONG aControllerPort,
7b01db654c23d4e432465aebc1a1853e8d6b3194vboxsync LONG aDevice);
7b01db654c23d4e432465aebc1a1853e8d6b3194vboxsync void i_setBootable(BOOL fBootable);
7b01db654c23d4e432465aebc1a1853e8d6b3194vboxsync void i_rollback();
7b01db654c23d4e432465aebc1a1853e8d6b3194vboxsync void i_commit();
7b01db654c23d4e432465aebc1a1853e8d6b3194vboxsync HRESULT i_getIDEEmulationPort (LONG DevicePosition, LONG *aPortNumber);
7b01db654c23d4e432465aebc1a1853e8d6b3194vboxsync HRESULT i_setIDEEmulationPort (LONG DevicePosition, LONG aPortNumber);
7189dad3705d42e9874af1e1c8a8c7e5cceee9f7vboxsync
7189dad3705d42e9874af1e1c8a8c7e5cceee9f7vboxsync // public methods for internal purposes only
7189dad3705d42e9874af1e1c8a8c7e5cceee9f7vboxsync // (ensure there is a caller and a read lock before calling them!)
7189dad3705d42e9874af1e1c8a8c7e5cceee9f7vboxsync
7b01db654c23d4e432465aebc1a1853e8d6b3194vboxsync void i_unshare();
7189dad3705d42e9874af1e1c8a8c7e5cceee9f7vboxsync
7189dad3705d42e9874af1e1c8a8c7e5cceee9f7vboxsync /** @note this doesn't require a read lock since mParent is constant. */
7b01db654c23d4e432465aebc1a1853e8d6b3194vboxsync Machine* i_getMachine();
7b01db654c23d4e432465aebc1a1853e8d6b3194vboxsync ComObjPtr<StorageController> i_getPeer();
7189dad3705d42e9874af1e1c8a8c7e5cceee9f7vboxsync
7189dad3705d42e9874af1e1c8a8c7e5cceee9f7vboxsyncprivate:
7189dad3705d42e9874af1e1c8a8c7e5cceee9f7vboxsync
7b01db654c23d4e432465aebc1a1853e8d6b3194vboxsync // Wrapped IStorageController properties
7b01db654c23d4e432465aebc1a1853e8d6b3194vboxsync HRESULT getName(com::Utf8Str &aName);
7b01db654c23d4e432465aebc1a1853e8d6b3194vboxsync HRESULT getMaxDevicesPerPortCount(ULONG *aMaxDevicesPerPortCount);
7b01db654c23d4e432465aebc1a1853e8d6b3194vboxsync HRESULT getMinPortCount(ULONG *aMinPortCount);
7b01db654c23d4e432465aebc1a1853e8d6b3194vboxsync HRESULT getMaxPortCount(ULONG *aMaxPortCount);
7b01db654c23d4e432465aebc1a1853e8d6b3194vboxsync HRESULT getInstance(ULONG *aInstance);
7b01db654c23d4e432465aebc1a1853e8d6b3194vboxsync HRESULT setInstance(ULONG aInstance);
7b01db654c23d4e432465aebc1a1853e8d6b3194vboxsync HRESULT getPortCount(ULONG *aPortCount);
7b01db654c23d4e432465aebc1a1853e8d6b3194vboxsync HRESULT setPortCount(ULONG aPortCount);
7b01db654c23d4e432465aebc1a1853e8d6b3194vboxsync HRESULT getBus(StorageBus_T *aBus);
7b01db654c23d4e432465aebc1a1853e8d6b3194vboxsync HRESULT getControllerType(StorageControllerType_T *aControllerType);
7b01db654c23d4e432465aebc1a1853e8d6b3194vboxsync HRESULT setControllerType(StorageControllerType_T aControllerType);
7b01db654c23d4e432465aebc1a1853e8d6b3194vboxsync HRESULT getUseHostIOCache(BOOL *aUseHostIOCache);
7b01db654c23d4e432465aebc1a1853e8d6b3194vboxsync HRESULT setUseHostIOCache(BOOL aUseHostIOCache);
7b01db654c23d4e432465aebc1a1853e8d6b3194vboxsync HRESULT getBootable(BOOL *aBootable);
7b01db654c23d4e432465aebc1a1853e8d6b3194vboxsync
7b01db654c23d4e432465aebc1a1853e8d6b3194vboxsync void i_printList();
7189dad3705d42e9874af1e1c8a8c7e5cceee9f7vboxsync
4182d14dc02dba6587c15e358b87e5c9a6e60d15vboxsync struct Data;
4182d14dc02dba6587c15e358b87e5c9a6e60d15vboxsync Data *m;
7189dad3705d42e9874af1e1c8a8c7e5cceee9f7vboxsync};
7189dad3705d42e9874af1e1c8a8c7e5cceee9f7vboxsync
7189dad3705d42e9874af1e1c8a8c7e5cceee9f7vboxsync#endif //!____H_STORAGECONTROLLERIMPL
7189dad3705d42e9874af1e1c8a8c7e5cceee9f7vboxsync/* vi: set tabstop=4 shiftwidth=4 expandtab: */