VirtualBox

Changeset 49951 in vbox for trunk/src/VBox/Main/include


Ignore:
Timestamp:
Dec 17, 2013 11:44:22 AM (11 years ago)
Author:
vboxsync
Message:

6813 - stage 5 - Make use of server side API wrapper code in all interfaces

Location:
trunk/src/VBox/Main/include
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/include/NetworkAdapterImpl.h

    r48989 r49951  
    77
    88/*
    9  * Copyright (C) 2006-2012 Oracle Corporation
     9 * Copyright (C) 2006-2013 Oracle Corporation
    1010 *
    1111 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    2121#define ____H_NETWORKADAPTER
    2222
    23 #include "VirtualBoxBase.h"
    24 #include "NATEngineImpl.h"
    25 #include "BandwidthGroupImpl.h"
     23#include "NetworkAdapterWrap.h"
    2624
    2725class GuestOSType;
     26class BandwidthControl;
     27class BandwidthGroup;
     28class NATEngine;
    2829
    2930namespace settings
     
    3334
    3435class ATL_NO_VTABLE NetworkAdapter :
    35     public VirtualBoxBase,
    36     VBOX_SCRIPTABLE_IMPL(INetworkAdapter)
     36    public NetworkAdapterWrap
    3737{
    3838public:
     39
     40    DECLARE_EMPTY_CTOR_DTOR(NetworkAdapter)
     41
     42    HRESULT FinalConstruct();
     43    void FinalRelease();
     44
     45    // public initializer/uninitializer for internal purposes only
     46    HRESULT init(Machine *aParent, ULONG aSlot);
     47    HRESULT init(Machine *aParent, NetworkAdapter *aThat, bool aReshare = false);
     48    HRESULT initCopy(Machine *aParent, NetworkAdapter *aThat);
     49    void uninit();
     50
     51    // public methods only for internal purposes
     52    HRESULT i_loadSettings(BandwidthControl *bwctl, const settings::NetworkAdapter &data);
     53    HRESULT i_saveSettings(settings::NetworkAdapter &data);
     54
     55    bool i_isModified();
     56    void i_rollback();
     57    void i_commit();
     58    void i_copyFrom(NetworkAdapter *aThat);
     59    void i_applyDefaults(GuestOSType *aOsType);
     60
     61    ComObjPtr<NetworkAdapter> i_getPeer();
     62
     63private:
     64
     65    // wrapped INetworkAdapter properties
     66    HRESULT getAdapterType(NetworkAdapterType_T *aAdapterType);
     67    HRESULT setAdapterType(NetworkAdapterType_T aAdapterType);
     68    HRESULT getSlot(ULONG *aSlot);
     69    HRESULT getEnabled(BOOL *aEnabled);
     70    HRESULT setEnabled(BOOL aEnabled);
     71    HRESULT getMACAddress(com::Utf8Str &aMACAddress);
     72    HRESULT setMACAddress(const com::Utf8Str &aMACAddress);
     73    HRESULT getAttachmentType(NetworkAttachmentType_T *aAttachmentType);
     74    HRESULT setAttachmentType(NetworkAttachmentType_T aAttachmentType);
     75    HRESULT getBridgedInterface(com::Utf8Str &aBridgedInterface);
     76    HRESULT setBridgedInterface(const com::Utf8Str &aBridgedInterface);
     77    HRESULT getHostOnlyInterface(com::Utf8Str &aHostOnlyInterface);
     78    HRESULT setHostOnlyInterface(const com::Utf8Str &aHostOnlyInterface);
     79    HRESULT getInternalNetwork(com::Utf8Str &aInternalNetwork);
     80    HRESULT setInternalNetwork(const com::Utf8Str &aInternalNetwork);
     81    HRESULT getNATNetwork(com::Utf8Str &aNATNetwork);
     82    HRESULT setNATNetwork(const com::Utf8Str &aNATNetwork);
     83    HRESULT getGenericDriver(com::Utf8Str &aGenericDriver);
     84    HRESULT setGenericDriver(const com::Utf8Str &aGenericDriver);
     85    HRESULT getCableConnected(BOOL *aCableConnected);
     86    HRESULT setCableConnected(BOOL aCableConnected);
     87    HRESULT getLineSpeed(ULONG *aLineSpeed);
     88    HRESULT setLineSpeed(ULONG aLineSpeed);
     89    HRESULT getPromiscModePolicy(NetworkAdapterPromiscModePolicy_T *aPromiscModePolicy);
     90    HRESULT setPromiscModePolicy(NetworkAdapterPromiscModePolicy_T aPromiscModePolicy);
     91    HRESULT getTraceEnabled(BOOL *aTraceEnabled);
     92    HRESULT setTraceEnabled(BOOL aTraceEnabled);
     93    HRESULT getTraceFile(com::Utf8Str &aTraceFile);
     94    HRESULT setTraceFile(const com::Utf8Str &aTraceFile);
     95    HRESULT getNATEngine(ComPtr<INATEngine> &aNATEngine);
     96    HRESULT getBootPriority(ULONG *aBootPriority);
     97    HRESULT setBootPriority(ULONG aBootPriority);
     98    HRESULT getBandwidthGroup(ComPtr<IBandwidthGroup> &aBandwidthGroup);
     99    HRESULT setBandwidthGroup(const ComPtr<IBandwidthGroup> &aBandwidthGroup);
     100
     101    // wrapped INetworkAdapter methods
     102    HRESULT getProperty(const com::Utf8Str &aKey,
     103                        com::Utf8Str &aValue);
     104    HRESULT setProperty(const com::Utf8Str &aKey,
     105                        const com::Utf8Str &aValue);
     106    HRESULT getProperties(const com::Utf8Str &aNames,
     107                          std::vector<com::Utf8Str> &aReturnNames,
     108                          std::vector<com::Utf8Str> &aReturnValues);
     109    // Misc.
     110    void i_generateMACAddress();
     111    HRESULT i_updateMacAddress(Utf8Str aMacAddress);
     112    void i_updateBandwidthGroup(BandwidthGroup *aBwGroup);
     113    HRESULT i_checkAndSwitchFromNatNetworking(com::Utf8Str networkName);
     114    HRESULT i_switchToNatNetworking(const com::Utf8Str &aNatNetworkName);
     115
     116    typedef std::map<com::Utf8Str, com::Utf8Str> StringsMap;
    39117
    40118    struct Data
     
    56134        ULONG mSlot;
    57135        BOOL mEnabled;
    58         Bstr mMACAddress;
     136        com::Utf8Str mMACAddress;
    59137        NetworkAttachmentType_T mAttachmentType;
    60138        BOOL mCableConnected;
     
    62140        NetworkAdapterPromiscModePolicy_T mPromiscModePolicy;
    63141        BOOL mTraceEnabled;
    64         Bstr mTraceFile;
    65         Bstr mBridgedInterface;
    66         Bstr mHostOnlyInterface;
    67         Bstr mInternalNetwork;
    68         Bstr mNATNetwork;
    69         Bstr mGenericDriver;
    70         settings::StringsMap mGenericProperties;
     142        com::Utf8Str mTraceFile;
     143        com::Utf8Str mBridgedInterface;
     144        com::Utf8Str mHostOnlyInterface;
     145        com::Utf8Str mInternalNetwork;
     146        com::Utf8Str mNATNetwork;
     147        com::Utf8Str mGenericDriver;
     148        StringsMap mGenericProperties;
    71149        ULONG mBootPriority;
    72         Utf8Str mBandwidthGroup;
     150        com::Utf8Str mBandwidthGroup;
    73151    };
    74 
    75     VIRTUALBOXBASE_ADD_ERRORINFO_SUPPORT(NetworkAdapter, INetworkAdapter)
    76 
    77     DECLARE_NOT_AGGREGATABLE(NetworkAdapter)
    78 
    79     DECLARE_PROTECT_FINAL_CONSTRUCT()
    80 
    81     BEGIN_COM_MAP(NetworkAdapter)
    82         VBOX_DEFAULT_INTERFACE_ENTRIES(INetworkAdapter)
    83     END_COM_MAP()
    84 
    85     DECLARE_EMPTY_CTOR_DTOR(NetworkAdapter)
    86 
    87     HRESULT FinalConstruct();
    88     void FinalRelease();
    89 
    90     // public initializer/uninitializer for internal purposes only
    91     HRESULT init(Machine *aParent, ULONG aSlot);
    92     HRESULT init(Machine *aParent, NetworkAdapter *aThat, bool aReshare = false);
    93     HRESULT initCopy(Machine *aParent, NetworkAdapter *aThat);
    94     void uninit();
    95 
    96     // INetworkAdapter properties
    97     STDMETHOD(COMGETTER(AdapterType))(NetworkAdapterType_T *aAdapterType);
    98     STDMETHOD(COMSETTER(AdapterType))(NetworkAdapterType_T aAdapterType);
    99     STDMETHOD(COMGETTER(Slot))(ULONG *aSlot);
    100     STDMETHOD(COMGETTER(Enabled))(BOOL *aEnabled);
    101     STDMETHOD(COMSETTER(Enabled))(BOOL aEnabled);
    102     STDMETHOD(COMGETTER(MACAddress))(BSTR *aMACAddress);
    103     STDMETHOD(COMSETTER(MACAddress))(IN_BSTR aMACAddress);
    104     STDMETHOD(COMGETTER(AttachmentType))(NetworkAttachmentType_T *aAttachmentType);
    105     STDMETHOD(COMSETTER(AttachmentType))(NetworkAttachmentType_T aAttachmentType);
    106     STDMETHOD(COMGETTER(BridgedInterface))(BSTR *aBridgedInterface);
    107     STDMETHOD(COMSETTER(BridgedInterface))(IN_BSTR aBridgedInterface);
    108     STDMETHOD(COMGETTER(HostOnlyInterface))(BSTR *aHostOnlyInterface);
    109     STDMETHOD(COMSETTER(HostOnlyInterface))(IN_BSTR aHostOnlyInterface);
    110     STDMETHOD(COMGETTER(InternalNetwork))(BSTR *aInternalNetwork);
    111     STDMETHOD(COMSETTER(InternalNetwork))(IN_BSTR aInternalNetwork);
    112     STDMETHOD(COMGETTER(NATNetwork))(BSTR *aNATNetwork);
    113     STDMETHOD(COMSETTER(NATNetwork))(IN_BSTR aNATNetwork);
    114     STDMETHOD(COMGETTER(GenericDriver))(BSTR *aGenericDriver);
    115     STDMETHOD(COMSETTER(GenericDriver))(IN_BSTR aGenericDriver);
    116     STDMETHOD(COMGETTER(CableConnected))(BOOL *aConnected);
    117     STDMETHOD(COMSETTER(CableConnected))(BOOL aConnected);
    118     STDMETHOD(COMGETTER(TraceEnabled))(BOOL *aEnabled);
    119     STDMETHOD(COMSETTER(TraceEnabled))(BOOL aEnabled);
    120     STDMETHOD(COMGETTER(LineSpeed))(ULONG *aSpeed);
    121     STDMETHOD(COMSETTER(LineSpeed))(ULONG aSpeed);
    122     STDMETHOD(COMGETTER(PromiscModePolicy))(NetworkAdapterPromiscModePolicy_T *aPromiscModePolicy);
    123     STDMETHOD(COMSETTER(PromiscModePolicy))(NetworkAdapterPromiscModePolicy_T aPromiscModePolicy);
    124     STDMETHOD(COMGETTER(TraceFile))(BSTR *aTraceFile);
    125     STDMETHOD(COMSETTER(TraceFile))(IN_BSTR aTraceFile);
    126     STDMETHOD(COMGETTER(NATEngine))(INATEngine **aNATEngine);
    127     STDMETHOD(COMGETTER(BootPriority))(ULONG *aBootPriority);
    128     STDMETHOD(COMSETTER(BootPriority))(ULONG aBootPriority);
    129     STDMETHOD(COMGETTER(BandwidthGroup))(IBandwidthGroup **aBwGroup);
    130     STDMETHOD(COMSETTER(BandwidthGroup))(IBandwidthGroup *aBwGroup);
    131 
    132     // INetworkAdapter methods
    133     STDMETHOD(GetProperty)(IN_BSTR aName, BSTR *aValue);
    134     STDMETHOD(SetProperty)(IN_BSTR aName, IN_BSTR aValue);
    135     STDMETHOD(GetProperties)(IN_BSTR aNames,
    136                              ComSafeArrayOut(BSTR, aReturnNames),
    137                              ComSafeArrayOut(BSTR, aReturnValues));
    138 
    139     // public methods only for internal purposes
    140 
    141     HRESULT loadSettings(BandwidthControl *bwctl, const settings::NetworkAdapter &data);
    142     HRESULT saveSettings(settings::NetworkAdapter &data);
    143 
    144     bool isModified();
    145     void rollback();
    146     void commit();
    147     void copyFrom(NetworkAdapter *aThat);
    148     void applyDefaults(GuestOSType *aOsType);
    149 
    150     ComObjPtr<NetworkAdapter> getPeer();
    151 
    152 private:
    153 
    154     void generateMACAddress();
    155     HRESULT updateMacAddress(Utf8Str aMacAddress);
    156     void updateBandwidthGroup(BandwidthGroup *aBwGroup);
    157     HRESULT checkAndSwitchFromNatNetworking(IN_BSTR aNatNetworkName);
    158     HRESULT switchToNatNetworking(IN_BSTR aNatNetworkName);
    159152
    160153    Machine * const     mParent;
  • trunk/src/VBox/Main/include/SystemPropertiesImpl.h

    r47991 r49951  
    2121#define ____H_SYSTEMPROPERTIESIMPL
    2222
    23 #include "VirtualBoxBase.h"
    2423#include "MediumFormatImpl.h"
     24#include "SystemPropertiesWrap.h"
    2525
    26 #include <VBox/com/array.h>
    27 
    28 #include <list>
    2926
    3027namespace settings
     
    3431
    3532class ATL_NO_VTABLE SystemProperties :
    36     public VirtualBoxBase,
    37     VBOX_SCRIPTABLE_IMPL(ISystemProperties)
     33    public SystemPropertiesWrap
    3834{
    3935public:
    40 
    41     VIRTUALBOXBASE_ADD_ERRORINFO_SUPPORT(SystemProperties, ISystemProperties)
    42 
    43     DECLARE_NOT_AGGREGATABLE(SystemProperties)
    44 
    45     DECLARE_PROTECT_FINAL_CONSTRUCT()
    46 
    47     BEGIN_COM_MAP(SystemProperties)
    48         VBOX_DEFAULT_INTERFACE_ENTRIES(ISystemProperties)
    49     END_COM_MAP()
     36    typedef std::list<ComObjPtr<MediumFormat> > MediumFormatList;
    5037
    5138    DECLARE_EMPTY_CTOR_DTOR(SystemProperties)
     
    5845    void uninit();
    5946
    60     // ISystemProperties properties
    61     STDMETHOD(COMGETTER(MinGuestRAM))(ULONG *minRAM);
    62     STDMETHOD(COMGETTER(MaxGuestRAM))(ULONG *maxRAM);
    63     STDMETHOD(COMGETTER(MinGuestVRAM))(ULONG *minVRAM);
    64     STDMETHOD(COMGETTER(MaxGuestVRAM))(ULONG *maxVRAM);
    65     STDMETHOD(COMGETTER(MinGuestCPUCount))(ULONG *minCPUCount);
    66     STDMETHOD(COMGETTER(MaxGuestCPUCount))(ULONG *maxCPUCount);
    67     STDMETHOD(COMGETTER(MaxGuestMonitors))(ULONG *maxMonitors);
    68     STDMETHOD(COMGETTER(InfoVDSize))(LONG64 *infoVDSize);
    69     STDMETHOD(COMGETTER(SerialPortCount))(ULONG *count);
    70     STDMETHOD(COMGETTER(ParallelPortCount))(ULONG *count);
    71     STDMETHOD(COMGETTER(MaxBootPosition))(ULONG *aMaxBootPosition);
    72     STDMETHOD(COMGETTER(ExclusiveHwVirt))(BOOL *aExclusiveHwVirt);
    73     STDMETHOD(COMSETTER(ExclusiveHwVirt))(BOOL aExclusiveHwVirt);
    74     STDMETHOD(COMGETTER(LoggingLevel))(BSTR *aLoggingLevel);
    75     STDMETHOD(COMSETTER(LoggingLevel))(IN_BSTR aLoggingLevel);
    76     STDMETHOD(COMGETTER(DefaultMachineFolder))(BSTR *aDefaultMachineFolder);
    77     STDMETHOD(COMSETTER(DefaultMachineFolder))(IN_BSTR aDefaultMachineFolder);
    78     STDMETHOD(COMGETTER(MediumFormats))(ComSafeArrayOut(IMediumFormat *, aMediumFormats));
    79     STDMETHOD(COMGETTER(DefaultHardDiskFormat))(BSTR *aDefaultHardDiskFormat);
    80     STDMETHOD(COMSETTER(DefaultHardDiskFormat))(IN_BSTR aDefaultHardDiskFormat);
    81     STDMETHOD(COMGETTER(FreeDiskSpaceWarning))(LONG64 *aFreeDiskSpace);
    82     STDMETHOD(COMSETTER(FreeDiskSpaceWarning))(LONG64 aFreeDiskSpace);
    83     STDMETHOD(COMGETTER(FreeDiskSpacePercentWarning))(ULONG *aFreeDiskSpacePercent);
    84     STDMETHOD(COMSETTER(FreeDiskSpacePercentWarning))(ULONG aFreeDiskSpacePercent);
    85     STDMETHOD(COMGETTER(FreeDiskSpaceError))(LONG64 *aFreeDiskSpace);
    86     STDMETHOD(COMSETTER(FreeDiskSpaceError))(LONG64 aFreeDiskSpace);
    87     STDMETHOD(COMGETTER(FreeDiskSpacePercentError))(ULONG *aFreeDiskSpacePercent);
    88     STDMETHOD(COMSETTER(FreeDiskSpacePercentError))(ULONG aFreeDiskSpacePercent);
    89     STDMETHOD(COMGETTER(VRDEAuthLibrary))(BSTR *aVRDEAuthLibrary);
    90     STDMETHOD(COMSETTER(VRDEAuthLibrary))(IN_BSTR aVRDEAuthLibrary);
    91     STDMETHOD(COMGETTER(WebServiceAuthLibrary))(BSTR *aWebServiceAuthLibrary);
    92     STDMETHOD(COMSETTER(WebServiceAuthLibrary))(IN_BSTR aWebServiceAuthLibrary);
    93     STDMETHOD(COMGETTER(DefaultVRDEExtPack))(BSTR *aExtPack);
    94     STDMETHOD(COMSETTER(DefaultVRDEExtPack))(IN_BSTR aExtPack);
    95     STDMETHOD(COMGETTER(LogHistoryCount))(ULONG *count);
    96     STDMETHOD(COMSETTER(LogHistoryCount))(ULONG count);
    97     STDMETHOD(COMGETTER(DefaultAudioDriver))(AudioDriverType_T *aAudioDriver);
    98     STDMETHOD(COMGETTER(AutostartDatabasePath))(BSTR *aAutostartDbPath);
    99     STDMETHOD(COMSETTER(AutostartDatabasePath))(IN_BSTR aAutostartDbPath);
    100     STDMETHOD(COMGETTER(DefaultAdditionsISO))(BSTR *aDefaultAdditionsISO);
    101     STDMETHOD(COMSETTER(DefaultAdditionsISO))(IN_BSTR aDefaultAdditionsISO);
    102     STDMETHOD(COMGETTER(DefaultFrontend))(BSTR *aDefaultFrontend);
    103     STDMETHOD(COMSETTER(DefaultFrontend))(IN_BSTR aDefaultFrontend);
    104 
    105     STDMETHOD(GetMaxNetworkAdapters)(ChipsetType_T aChipset, ULONG *aMaxInstances);
    106     STDMETHOD(GetMaxNetworkAdaptersOfType)(ChipsetType_T aChipset, NetworkAttachmentType_T aType, ULONG *aMaxInstances);
    107     STDMETHOD(GetMaxDevicesPerPortForStorageBus)(StorageBus_T aBus, ULONG *aMaxDevicesPerPort);
    108     STDMETHOD(GetMinPortCountForStorageBus)(StorageBus_T aBus, ULONG *aMinPortCount);
    109     STDMETHOD(GetMaxPortCountForStorageBus)(StorageBus_T aBus, ULONG *aMaxPortCount);
    110     STDMETHOD(GetMaxInstancesOfStorageBus)(ChipsetType_T aChipset, StorageBus_T aBus, ULONG *aMaxInstances);
    111     STDMETHOD(GetDeviceTypesForStorageBus)(StorageBus_T aBus, ComSafeArrayOut(DeviceType_T, aDeviceTypes));
    112     STDMETHOD(GetDefaultIoCacheSettingForStorageController)(StorageControllerType_T aControllerType, BOOL *aEnabled);
    113     STDMETHOD(GetMaxInstancesOfUSBControllerType)(ChipsetType_T aChipset, USBControllerType_T aType, ULONG *aMaxInstances);
    114 
    115     // public methods only for internal purposes
    116 
    117     HRESULT loadSettings(const settings::SystemProperties &data);
    118     HRESULT saveSettings(settings::SystemProperties &data);
    119 
    120     ComObjPtr<MediumFormat> mediumFormat(const Utf8Str &aFormat);
    121     ComObjPtr<MediumFormat> mediumFormatFromExtension(const Utf8Str &aExt);
    122 
    12347    // public methods for internal purposes only
    12448    // (ensure there is a caller and a read lock before calling them!)
     49    HRESULT i_loadSettings(const settings::SystemProperties &data);
     50    HRESULT i_saveSettings(settings::SystemProperties &data);
     51
     52    ComObjPtr<MediumFormat> i_mediumFormat(const Utf8Str &aFormat);
     53    ComObjPtr<MediumFormat> i_mediumFormatFromExtension(const Utf8Str &aExt);
    12554
    12655private:
    12756
    128     typedef std::list<ComObjPtr<MediumFormat> > MediumFormatList;
     57    // wrapped ISystemProperties properties
     58    HRESULT getMinGuestRAM(ULONG *aMinGuestRAM);
     59    HRESULT getMaxGuestRAM(ULONG *aMaxGuestRAM);
     60    HRESULT getMinGuestVRAM(ULONG *aMinGuestVRAM);
     61    HRESULT getMaxGuestVRAM(ULONG *aMaxGuestVRAM);
     62    HRESULT getMinGuestCPUCount(ULONG *aMinGuestCPUCount);
     63    HRESULT getMaxGuestCPUCount(ULONG *aMaxGuestCPUCount);
     64    HRESULT getMaxGuestMonitors(ULONG *aMaxGuestMonitors);
     65    HRESULT getInfoVDSize(LONG64 *aInfoVDSize);
     66    HRESULT getSerialPortCount(ULONG *aSerialPortCount);
     67    HRESULT getParallelPortCount(ULONG *aParallelPortCount);
     68    HRESULT getMaxBootPosition(ULONG *aMaxBootPosition);
     69    HRESULT getExclusiveHwVirt(BOOL *aExclusiveHwVirt);
     70    HRESULT setExclusiveHwVirt(BOOL aExclusiveHwVirt);
     71    HRESULT getDefaultMachineFolder(com::Utf8Str &aDefaultMachineFolder);
     72    HRESULT setDefaultMachineFolder(const com::Utf8Str &aDefaultMachineFolder);
     73    HRESULT getLoggingLevel(com::Utf8Str &aLoggingLevel);
     74    HRESULT setLoggingLevel(const com::Utf8Str &aLoggingLevel);
     75    HRESULT getMediumFormats(std::vector<ComPtr<IMediumFormat> > &aMediumFormats);
     76    HRESULT getDefaultHardDiskFormat(com::Utf8Str &aDefaultHardDiskFormat);
     77    HRESULT setDefaultHardDiskFormat(const com::Utf8Str &aDefaultHardDiskFormat);
     78    HRESULT getFreeDiskSpaceWarning(LONG64 *aFreeDiskSpaceWarning);
     79    HRESULT setFreeDiskSpaceWarning(LONG64 aFreeDiskSpaceWarning);
     80    HRESULT getFreeDiskSpacePercentWarning(ULONG *aFreeDiskSpacePercentWarning);
     81    HRESULT setFreeDiskSpacePercentWarning(ULONG aFreeDiskSpacePercentWarning);
     82    HRESULT getFreeDiskSpaceError(LONG64 *aFreeDiskSpaceError);
     83    HRESULT setFreeDiskSpaceError(LONG64 aFreeDiskSpaceError);
     84    HRESULT getFreeDiskSpacePercentError(ULONG *aFreeDiskSpacePercentError);
     85    HRESULT setFreeDiskSpacePercentError(ULONG aFreeDiskSpacePercentError);
     86    HRESULT getVRDEAuthLibrary(com::Utf8Str &aVRDEAuthLibrary);
     87    HRESULT setVRDEAuthLibrary(const com::Utf8Str &aVRDEAuthLibrary);
     88    HRESULT getWebServiceAuthLibrary(com::Utf8Str &aWebServiceAuthLibrary);
     89    HRESULT setWebServiceAuthLibrary(const com::Utf8Str &aWebServiceAuthLibrary);
     90    HRESULT getDefaultVRDEExtPack(com::Utf8Str &aDefaultVRDEExtPack);
     91    HRESULT setDefaultVRDEExtPack(const com::Utf8Str &aDefaultVRDEExtPack);
     92    HRESULT getLogHistoryCount(ULONG *aLogHistoryCount);
     93    HRESULT setLogHistoryCount(ULONG aLogHistoryCount);
     94    HRESULT getDefaultAudioDriver(AudioDriverType_T *aDefaultAudioDriver);
     95    HRESULT getAutostartDatabasePath(com::Utf8Str &aAutostartDatabasePath);
     96    HRESULT setAutostartDatabasePath(const com::Utf8Str &aAutostartDatabasePath);
     97    HRESULT getDefaultAdditionsISO(com::Utf8Str &aDefaultAdditionsISO);
     98    HRESULT setDefaultAdditionsISO(const com::Utf8Str &aDefaultAdditionsISO);
     99    HRESULT getDefaultFrontend(com::Utf8Str &aDefaultFrontend);
     100    HRESULT setDefaultFrontend(const com::Utf8Str &aDefaultFrontend);
    129101
    130     HRESULT getUserHomeDirectory(Utf8Str &strPath);
    131     HRESULT setDefaultMachineFolder(const Utf8Str &aPath);
    132     HRESULT setLoggingLevel(const Utf8Str &aLoggingLevel);
    133     HRESULT setDefaultHardDiskFormat(const Utf8Str &aFormat);
     102    // wrapped ISystemProperties methods
     103    HRESULT getMaxNetworkAdapters(ChipsetType_T aChipset,
     104                                  ULONG *aMaxNetworkAdapters);
     105    HRESULT getMaxNetworkAdaptersOfType(ChipsetType_T aChipset,
     106                                        NetworkAttachmentType_T aType,
     107                                        ULONG *aMaxNetworkAdapters);
     108    HRESULT getMaxDevicesPerPortForStorageBus(StorageBus_T aBus,
     109                                              ULONG *aMaxDevicesPerPort);
     110    HRESULT getMinPortCountForStorageBus(StorageBus_T aBus,
     111                                         ULONG *aMinPortCount);
     112    HRESULT getMaxPortCountForStorageBus(StorageBus_T aBus,
     113                                         ULONG *aMaxPortCount);
     114    HRESULT getMaxInstancesOfStorageBus(ChipsetType_T aChipset,
     115                                        StorageBus_T aBus,
     116                                        ULONG *aMaxInstances);
     117    HRESULT getDeviceTypesForStorageBus(StorageBus_T aBus,
     118                                        std::vector<DeviceType_T> &aDeviceTypes);
     119    HRESULT getDefaultIoCacheSettingForStorageController(StorageControllerType_T aControllerType,
     120                                                         BOOL *aEnabled);
     121    HRESULT getMaxInstancesOfUSBControllerType(ChipsetType_T aChipset,
     122                                               USBControllerType_T aType,
     123                                               ULONG *aMaxInstances);
    134124
    135     HRESULT setVRDEAuthLibrary(const Utf8Str &aPath);
    136     HRESULT setWebServiceAuthLibrary(const Utf8Str &aPath);
    137     HRESULT setDefaultVRDEExtPack(const Utf8Str &aPath);
    138     HRESULT setAutostartDatabasePath(const Utf8Str &aPath);
    139     HRESULT setDefaultAdditionsISO(const Utf8Str &aPath);
    140     HRESULT setDefaultFrontend(const Utf8Str &aPath);
     125    HRESULT i_getUserHomeDirectory(Utf8Str &strPath);
     126    HRESULT i_setDefaultMachineFolder(const Utf8Str &strPath);
     127    HRESULT i_setLoggingLevel(const com::Utf8Str &aLoggingLevel);
     128    HRESULT i_setDefaultHardDiskFormat(const com::Utf8Str &aFormat);
     129    HRESULT i_setVRDEAuthLibrary(const com::Utf8Str &aPath);
     130
     131    HRESULT i_setWebServiceAuthLibrary(const com::Utf8Str &aPath);
     132    HRESULT i_setDefaultVRDEExtPack(const com::Utf8Str &aExtPack);
     133    HRESULT i_setAutostartDatabasePath(const com::Utf8Str &aPath);
     134    HRESULT i_setDefaultAdditionsISO(const com::Utf8Str &aPath);
     135    HRESULT i_setDefaultFrontend(const com::Utf8Str &aDefaultFrontend);
    141136
    142137    VirtualBox * const  mParent;
     
    144139    settings::SystemProperties *m;
    145140
    146     MediumFormatList    m_llMediumFormats;
     141    MediumFormatList m_llMediumFormats;
    147142
    148143    friend class VirtualBox;
  • trunk/src/VBox/Main/include/USBDeviceFilterImpl.h

    r47376 r49951  
    55
    66/*
    7  * Copyright (C) 2006-2011 Oracle Corporation
     7 * Copyright (C) 2006-2013 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    1919#define ____H_USBDEVICEFILTERIMPL
    2020
    21 #include "VirtualBoxBase.h"
    22 
    2321#include "Matching.h"
    2422#include <VBox/usbfilter.h>
     23#include "USBDeviceFilterWrap.h"
    2524
    2625class USBDeviceFilters;
     
    3534
    3635class ATL_NO_VTABLE USBDeviceFilter :
    37     public VirtualBoxBase,
    38     VBOX_SCRIPTABLE_IMPL(IUSBDeviceFilter)
     36    public USBDeviceFilterWrap
    3937{
    4038public:
     
    6765    };
    6866
    69     VIRTUALBOXBASE_ADD_ERRORINFO_SUPPORT(USBDeviceFilter, IUSBDeviceFilter)
    70 
    71     DECLARE_NOT_AGGREGATABLE(USBDeviceFilter)
    72 
    73     DECLARE_PROTECT_FINAL_CONSTRUCT()
    74 
    75     BEGIN_COM_MAP(USBDeviceFilter)
    76         VBOX_DEFAULT_INTERFACE_ENTRIES  (IUSBDeviceFilter)
    77     END_COM_MAP()
    78 
    79     DECLARE_EMPTY_CTOR_DTOR (USBDeviceFilter)
     67    DECLARE_EMPTY_CTOR_DTOR(USBDeviceFilter)
    8068
    8169    HRESULT FinalConstruct();
     
    9179    void uninit();
    9280
    93     // IUSBDeviceFilter properties
    94     STDMETHOD(COMGETTER(Name)) (BSTR *aName);
    95     STDMETHOD(COMSETTER(Name)) (IN_BSTR aName);
    96     STDMETHOD(COMGETTER(Active)) (BOOL *aActive);
    97     STDMETHOD(COMSETTER(Active)) (BOOL aActive);
    98     STDMETHOD(COMGETTER(VendorId)) (BSTR *aVendorId);
    99     STDMETHOD(COMSETTER(VendorId)) (IN_BSTR aVendorId);
    100     STDMETHOD(COMGETTER(ProductId)) (BSTR *aProductId);
    101     STDMETHOD(COMSETTER(ProductId)) (IN_BSTR aProductId);
    102     STDMETHOD(COMGETTER(Revision)) (BSTR *aRevision);
    103     STDMETHOD(COMSETTER(Revision)) (IN_BSTR aRevision);
    104     STDMETHOD(COMGETTER(Manufacturer)) (BSTR *aManufacturer);
    105     STDMETHOD(COMSETTER(Manufacturer)) (IN_BSTR aManufacturer);
    106     STDMETHOD(COMGETTER(Product)) (BSTR *aProduct);
    107     STDMETHOD(COMSETTER(Product)) (IN_BSTR aProduct);
    108     STDMETHOD(COMGETTER(SerialNumber)) (BSTR *aSerialNumber);
    109     STDMETHOD(COMSETTER(SerialNumber)) (IN_BSTR aSerialNumber);
    110     STDMETHOD(COMGETTER(Port)) (BSTR *aPort);
    111     STDMETHOD(COMSETTER(Port)) (IN_BSTR aPort);
    112     STDMETHOD(COMGETTER(Remote)) (BSTR *aRemote);
    113     STDMETHOD(COMSETTER(Remote)) (IN_BSTR aRemote);
    114     STDMETHOD(COMGETTER(MaskedInterfaces)) (ULONG *aMaskedIfs);
    115     STDMETHOD(COMSETTER(MaskedInterfaces)) (ULONG aMaskedIfs);
    116 
    11781    // public methods only for internal purposes
    118     bool isModified();
    119     void rollback();
    120     void commit();
     82    bool i_isModified();
     83    void i_rollback();
     84    void i_commit();
    12185
    12286    void unshare();
     
    12488    // public methods for internal purposes only
    12589    // (ensure there is a caller and a read lock before calling them!)
    126 
    127     void *& getId() { return mData.data()->mId; }
    128 
    129     const Data& getData() { return *mData.data(); }
    130     ComObjPtr<USBDeviceFilter> peer() { return mPeer; }
     90    void *& i_getId() { return mData.data()->mId; }
     91    const Data& i_getData() { return *mData.data(); }
     92    ComObjPtr<USBDeviceFilter> i_peer() { return mPeer; }
    13193
    13294    // tr() wants to belong to a class it seems, thus this one here.
    133     static HRESULT usbFilterFieldFromString(PUSBFILTER aFilter,
    134                                             USBFILTERIDX aIdx,
    135                                             const Utf8Str &aValue,
    136                                             Utf8Str &aErrStr);
    137 
    138     static const char* describeUSBFilterIdx(USBFILTERIDX aIdx);
     95    static HRESULT i_usbFilterFieldFromString(PUSBFILTER aFilter,
     96                                              USBFILTERIDX aIdx,
     97                                              const Utf8Str &aValue,
     98                                              Utf8Str &aErrStr);
     99
     100    static const char* i_describeUSBFilterIdx(USBFILTERIDX aIdx);
    139101
    140102private:
    141     HRESULT usbFilterFieldGetter(USBFILTERIDX aIdx, BSTR *aStr);
    142     HRESULT usbFilterFieldSetter(USBFILTERIDX aIdx, IN_BSTR aStr);
    143     HRESULT usbFilterFieldSetter(USBFILTERIDX aIdx, const Utf8Str &strNew);
     103
     104    // wrapped IUSBDeviceFilter properties
     105    HRESULT getName(com::Utf8Str &aName);
     106    HRESULT setName(const com::Utf8Str &aName);
     107    HRESULT getActive(BOOL *aActive);
     108    HRESULT setActive(BOOL aActive);
     109    HRESULT getVendorId(com::Utf8Str &aVendorId);
     110    HRESULT setVendorId(const com::Utf8Str &aVendorId);
     111    HRESULT getProductId(com::Utf8Str &aProductId);
     112    HRESULT setProductId(const com::Utf8Str &aProductId);
     113    HRESULT getRevision(com::Utf8Str &aRevision);
     114    HRESULT setRevision(const com::Utf8Str &aRevision);
     115    HRESULT getManufacturer(com::Utf8Str &aManufacturer);
     116    HRESULT setManufacturer(const com::Utf8Str &aManufacturer);
     117    HRESULT getProduct(com::Utf8Str &aProduct);
     118    HRESULT setProduct(const com::Utf8Str &aProduct);
     119    HRESULT getSerialNumber(com::Utf8Str &aSerialNumber);
     120    HRESULT setSerialNumber(const com::Utf8Str &aSerialNumber);
     121    HRESULT getPort(com::Utf8Str &aPort);
     122    HRESULT setPort(const com::Utf8Str &aPort);
     123    HRESULT getRemote(com::Utf8Str &aRemote);
     124    HRESULT setRemote(const com::Utf8Str &aRemote);
     125    HRESULT getMaskedInterfaces(ULONG *aMaskedInterfaces);
     126    HRESULT setMaskedInterfaces(ULONG aMaskedInterfaces);
     127
     128    // wrapped IUSBDeviceFilter methods
     129    HRESULT i_usbFilterFieldGetter(USBFILTERIDX aIdx, com::Utf8Str &aStr);
     130    HRESULT i_usbFilterFieldSetter(USBFILTERIDX aIdx, const com::Utf8Str &strNew);
    144131
    145132    USBDeviceFilters * const     mParent;
     
    156143    friend class USBDeviceFilters;
    157144};
     145#include "HostUSBDeviceFilterWrap.h"
    158146
    159147// HostUSBDeviceFilter
     
    161149
    162150class ATL_NO_VTABLE HostUSBDeviceFilter :
    163     public VirtualBoxBase,
    164     VBOX_SCRIPTABLE_IMPL(IHostUSBDeviceFilter)
     151    public HostUSBDeviceFilterWrap
    165152{
    166153public:
     
    170157        Data() {}
    171158    };
    172 
    173     VIRTUALBOXBASE_ADD_ERRORINFO_SUPPORT(HostUSBDeviceFilter, IHostUSBDeviceFilter)
    174 
    175     DECLARE_NOT_AGGREGATABLE(HostUSBDeviceFilter)
    176 
    177     DECLARE_PROTECT_FINAL_CONSTRUCT()
    178 
    179     BEGIN_COM_MAP(HostUSBDeviceFilter)
    180         COM_INTERFACE_ENTRY(IUSBDeviceFilter)
    181         VBOX_DEFAULT_INTERFACE_ENTRIES(IHostUSBDeviceFilter)
    182     END_COM_MAP()
    183159
    184160    DECLARE_EMPTY_CTOR_DTOR (HostUSBDeviceFilter)
     
    193169    void uninit();
    194170
    195     // IUSBDeviceFilter properties
    196     STDMETHOD(COMGETTER(Name)) (BSTR *aName);
    197     STDMETHOD(COMSETTER(Name)) (IN_BSTR aName);
    198     STDMETHOD(COMGETTER(Active)) (BOOL *aActive);
    199     STDMETHOD(COMSETTER(Active)) (BOOL aActive);
    200     STDMETHOD(COMGETTER(VendorId)) (BSTR *aVendorId);
    201     STDMETHOD(COMSETTER(VendorId)) (IN_BSTR aVendorId);
    202     STDMETHOD(COMGETTER(ProductId)) (BSTR *aProductId);
    203     STDMETHOD(COMSETTER(ProductId)) (IN_BSTR aProductId);
    204     STDMETHOD(COMGETTER(Revision)) (BSTR *aRevision);
    205     STDMETHOD(COMSETTER(Revision)) (IN_BSTR aRevision);
    206     STDMETHOD(COMGETTER(Manufacturer)) (BSTR *aManufacturer);
    207     STDMETHOD(COMSETTER(Manufacturer)) (IN_BSTR aManufacturer);
    208     STDMETHOD(COMGETTER(Product)) (BSTR *aProduct);
    209     STDMETHOD(COMSETTER(Product)) (IN_BSTR aProduct);
    210     STDMETHOD(COMGETTER(SerialNumber)) (BSTR *aSerialNumber);
    211     STDMETHOD(COMSETTER(SerialNumber)) (IN_BSTR aSerialNumber);
    212     STDMETHOD(COMGETTER(Port)) (BSTR *aPort);
    213     STDMETHOD(COMSETTER(Port)) (IN_BSTR aPort);
    214     STDMETHOD(COMGETTER(Remote)) (BSTR *aRemote);
    215     STDMETHOD(COMSETTER(Remote)) (IN_BSTR aRemote);
    216     STDMETHOD(COMGETTER(MaskedInterfaces)) (ULONG *aMaskedIfs);
    217     STDMETHOD(COMSETTER(MaskedInterfaces)) (ULONG aMaskedIfs);
    218 
    219     // IHostUSBDeviceFilter properties
    220     STDMETHOD(COMGETTER(Action)) (USBDeviceFilterAction_T *aAction);
    221     STDMETHOD(COMSETTER(Action)) (USBDeviceFilterAction_T aAction);
    222 
    223171    // public methods for internal purposes only
    224172    // (ensure there is a caller and a read lock before calling them!)
    225     void saveSettings(settings::USBDeviceFilter &data);
    226 
    227     void*& getId() { return mData.data()->mId; }
    228 
    229     const Data& getData() { return *mData.data(); }
     173    void i_saveSettings(settings::USBDeviceFilter &data);
     174
     175    void*& i_getId() { return mData.data()->mId; }
     176
     177    const Data& i_getData() { return *mData.data(); }
    230178
    231179    // util::Lockable interface
    232     RWLockHandle *lockHandle() const;
     180    RWLockHandle *i_lockHandle() const;
    233181
    234182private:
    235     HRESULT usbFilterFieldGetter(USBFILTERIDX aIdx, BSTR *aStr);
    236     HRESULT usbFilterFieldSetter(USBFILTERIDX aIdx, Bstr aStr);
     183
     184    // wrapped IHostUSBDeviceFilter properties
     185    HRESULT getName(com::Utf8Str &aName);
     186    HRESULT setName(const com::Utf8Str &aName);
     187    HRESULT getActive(BOOL *aActive);
     188    HRESULT setActive(BOOL aActive);
     189    HRESULT getVendorId(com::Utf8Str &aVendorId);
     190    HRESULT setVendorId(const com::Utf8Str &aVendorId);
     191    HRESULT getProductId(com::Utf8Str &aProductId);
     192    HRESULT setProductId(const com::Utf8Str &aProductId);
     193    HRESULT getRevision(com::Utf8Str &aRevision);
     194    HRESULT setRevision(const com::Utf8Str &aRevision);
     195    HRESULT getManufacturer(com::Utf8Str &aManufacturer);
     196    HRESULT setManufacturer(const com::Utf8Str &aManufacturer);
     197    HRESULT getProduct(com::Utf8Str &aProduct);
     198    HRESULT setProduct(const com::Utf8Str &aProduct);
     199    HRESULT getSerialNumber(com::Utf8Str &aSerialNumber);
     200    HRESULT setSerialNumber(const com::Utf8Str &aSerialNumber);
     201    HRESULT getPort(com::Utf8Str &aPort);
     202    HRESULT setPort(const com::Utf8Str &aPort);
     203    HRESULT getRemote(com::Utf8Str &aRemote);
     204    HRESULT setRemote(const com::Utf8Str &aRemote);
     205    HRESULT getMaskedInterfaces(ULONG *aMaskedInterfaces);
     206    HRESULT setMaskedInterfaces(ULONG aMaskedInterfaces);
     207
     208    // wrapped IHostUSBDeviceFilter properties
     209    HRESULT getAction(USBDeviceFilterAction_T *aAction);
     210    HRESULT setAction(USBDeviceFilterAction_T aAction);
     211
     212    HRESULT i_usbFilterFieldGetter(USBFILTERIDX aIdx, com::Utf8Str &aStr);
     213    HRESULT i_usbFilterFieldSetter(USBFILTERIDX aIdx, const com::Utf8Str &aStr);
    237214
    238215    Host * const        mParent;
  • trunk/src/VBox/Main/include/USBDeviceFiltersImpl.h

    r47401 r49951  
    2121#define ____H_USBDEVICEFILTERSIMPL
    2222
    23 #include "VirtualBoxBase.h"
     23#include "USBDeviceFiltersWrap.h"
    2424
    2525class HostUSBDevice;
     
    3232
    3333class ATL_NO_VTABLE USBDeviceFilters :
    34     public VirtualBoxBase,
    35     VBOX_SCRIPTABLE_IMPL(IUSBDeviceFilters)
     34    public USBDeviceFiltersWrap
    3635{
    3736public:
    38     VIRTUALBOXBASE_ADD_ERRORINFO_SUPPORT(USBDeviceFilters, IUSBDeviceFilters)
    39 
    40     DECLARE_NOT_AGGREGATABLE(USBDeviceFilters)
    41 
    42     DECLARE_PROTECT_FINAL_CONSTRUCT()
    43 
    44     BEGIN_COM_MAP(USBDeviceFilters)
    45         VBOX_DEFAULT_INTERFACE_ENTRIES(IUSBDeviceFilters)
    46     END_COM_MAP()
    4737
    4838    DECLARE_EMPTY_CTOR_DTOR(USBDeviceFilters)
     
    5747    void uninit();
    5848
    59     // IUSBDeviceFilters attributes
    60     STDMETHOD(COMGETTER(DeviceFilters))(ComSafeArrayOut(IUSBDeviceFilter *, aDevicesFilters));
     49    // public methods only for internal purposes
     50    HRESULT i_loadSettings(const settings::USB &data);
     51    HRESULT i_saveSettings(settings::USB &data);
    6152
    62     // IUSBDeviceFilters methods
    63     STDMETHOD(CreateDeviceFilter)(IN_BSTR aName, IUSBDeviceFilter **aFilter);
    64     STDMETHOD(InsertDeviceFilter)(ULONG aPosition, IUSBDeviceFilter *aFilter);
    65     STDMETHOD(RemoveDeviceFilter)(ULONG aPosition, IUSBDeviceFilter **aFilter);
    66 
    67     // public methods only for internal purposes
    68 
    69     HRESULT loadSettings(const settings::USB &data);
    70     HRESULT saveSettings(settings::USB &data);
    71 
    72     void rollback();
    73     void commit();
    74     void copyFrom(USBDeviceFilters *aThat);
     53    void i_rollback();
     54    void i_commit();
     55    void i_copyFrom(USBDeviceFilters *aThat);
    7556
    7657#ifdef VBOX_WITH_USB
    77     HRESULT onDeviceFilterChange(USBDeviceFilter *aFilter,
    78                                  BOOL aActiveChanged = FALSE);
    79 
    80     bool hasMatchingFilter(const ComObjPtr<HostUSBDevice> &aDevice, ULONG *aMaskedIfs);
    81     bool hasMatchingFilter(IUSBDevice *aUSBDevice, ULONG *aMaskedIfs);
    82 
    83     HRESULT notifyProxy(bool aInsertFilters);
     58    HRESULT i_onDeviceFilterChange(USBDeviceFilter *aFilter,
     59                                   BOOL aActiveChanged = FALSE);
     60    bool i_hasMatchingFilter(const ComObjPtr<HostUSBDevice> &aDevice, ULONG *aMaskedIfs);
     61    bool i_hasMatchingFilter(IUSBDevice *aUSBDevice, ULONG *aMaskedIfs);
     62    HRESULT i_notifyProxy(bool aInsertFilters);
    8463#endif /* VBOX_WITH_USB */
    8564
    8665    // public methods for internal purposes only
    8766    // (ensure there is a caller and a read lock before calling them!)
    88     Machine* getMachine();
     67    Machine* i_getMachine();
    8968
    9069private:
    9170
    92     void printList();
     71    // Wrapped IUSBDeviceFilters attributes
     72    HRESULT getDeviceFilters(std::vector<ComPtr<IUSBDeviceFilter> > &aDeviceFilters);
    9373
     74    // wrapped IUSBDeviceFilters methods
     75    HRESULT createDeviceFilter(const com::Utf8Str &aName,
     76                               ComPtr<IUSBDeviceFilter> &aFilter);
     77    HRESULT insertDeviceFilter(ULONG aPosition,
     78                               const ComPtr<IUSBDeviceFilter> &aFilter);
     79    HRESULT removeDeviceFilter(ULONG aPosition,
     80                               ComPtr<IUSBDeviceFilter> &aFilter);
    9481    struct Data;
    9582    Data *m;
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette