VirtualBox

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


Ignore:
Timestamp:
May 9, 2007 4:38:24 PM (18 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
21034
Message:

Main & All Frontends: replaced the IGuestOSType IMachine::OSType property with the wstring IMachine::OSTypeId property (+ converted IGuest and IGuestOSType to VirtualBoxBaseNEXT semantics).

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

Legend:

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

    r1 r2567  
    2626#include "Collection.h"
    2727
     28#include <iprt/path.h>
     29
    2830class VirtualBox;
    2931
    3032class ATL_NO_VTABLE DVDImage :
     33    public VirtualBoxBaseNEXT,
    3134    public VirtualBoxSupportErrorInfoImpl <DVDImage, IDVDImage>,
    3235    public VirtualBoxSupportTranslation <DVDImage>,
    33     public VirtualBoxBase,
    3436    public IDVDImage
    3537{
    3638public:
    3739
    38     // to satisfy the ComObjPtr template (we have const members)
    39     DVDImage() {}
     40    VIRTUALBOXBASE_ADD_ERRORINFO_SUPPORT (DVDImage)
    4041
    4142    DECLARE_NOT_AGGREGATABLE(DVDImage)
     
    5051    NS_DECL_ISUPPORTS
    5152
     53    DECLARE_EMPTY_CTOR_DTOR (DVDImage)
     54
    5255    HRESULT FinalConstruct();
    5356    void FinalRelease();
    5457
    5558    // public initializer/uninitializer for internal purposes only
    56     HRESULT init (VirtualBox *parent, const BSTR filePath,
    57                   BOOL isRegistered, const Guid &id);
     59    HRESULT init (VirtualBox *aParent, const BSTR aFilePath,
     60                  BOOL aRegistered, const Guid &aId);
    5861    void uninit();
    5962
    6063    // IDVDImage properties
    61     STDMETHOD(COMGETTER(Id)) (GUIDPARAMOUT id);
    62     STDMETHOD(COMGETTER(FilePath)) (BSTR *filePath);
    63     STDMETHOD(COMGETTER(Accessible)) (BOOL *accessible);
    64     STDMETHOD(COMGETTER(Size)) (ULONG64 *size);
     64    STDMETHOD(COMGETTER(Id)) (GUIDPARAMOUT aId);
     65    STDMETHOD(COMGETTER(FilePath)) (BSTR *aFilePath);
     66    STDMETHOD(COMGETTER(Accessible)) (BOOL *aAccessible);
     67    STDMETHOD(COMGETTER(Size)) (ULONG64 *sSize);
    6568
    6669    // public methods for internal purposes only
     70    // (ensure there is a caller and a read lock before calling them!)
    6771
    6872    const Bstr &filePath() { return mImageFile; }
     
    7882
    7983    /** weak parent */
    80     ComObjPtr <VirtualBox, ComWeakRef> mParent;
     84    const ComObjPtr <VirtualBox, ComWeakRef> mParent;
    8185
    8286    BOOL mAccessible;
     
    8993COM_DECL_READONLY_ENUM_AND_COLLECTION_BEGIN (DVDImage)
    9094
    91     STDMETHOD(FindByPath) (INPTR BSTR path, IDVDImage **dvdImage)
     95    STDMETHOD(FindByPath) (INPTR BSTR aPath, IDVDImage **aDVDImage)
    9296    {
    93         if (!path)
     97        if (!aPath)
    9498            return E_INVALIDARG;
    95         if (!dvdImage)
     99        if (!aDVDImage)
    96100            return E_POINTER;
    97101
    98         *dvdImage = NULL;
     102        Utf8Str path = aPath;
     103        *aDVDImage = NULL;
    99104        Vector::value_type found;
    100105        Vector::iterator it = vec.begin();
     
    103108            Bstr filePath;
    104109            (*it)->COMGETTER(FilePath) (filePath.asOutParam());
    105             if (filePath == path)
     110            if (RTPathCompare (Utf8Str (filePath), path) == 0)
    106111                found = *it;
    107112            ++ it;
     
    110115        if (!found)
    111116            return setError (E_INVALIDARG, DVDImageCollection::tr (
    112                 "The DVD image named '%ls' could not be found"), path);
     117                "The DVD image named '%ls' could not be found"), aPath);
    113118
    114         return found.queryInterfaceTo (dvdImage);
     119        return found.queryInterfaceTo (aDVDImage);
    115120    }
    116121
  • trunk/src/VBox/Main/include/FloppyImageImpl.h

    r1 r2567  
    2626#include "Collection.h"
    2727
     28#include <iprt/path.h>
     29
    2830class VirtualBox;
    2931
    3032class ATL_NO_VTABLE FloppyImage :
     33    public VirtualBoxBaseNEXT,
    3134    public VirtualBoxSupportErrorInfoImpl <FloppyImage, IFloppyImage>,
    3235    public VirtualBoxSupportTranslation <FloppyImage>,
    33     public VirtualBoxBase,
    3436    public IFloppyImage
    3537{
    3638public:
    3739
    38     // to satisfy the ComObjPtr template (we have const members)
    39     FloppyImage() {}
     40    VIRTUALBOXBASE_ADD_ERRORINFO_SUPPORT (FloppyImage)
    4041
    4142    DECLARE_NOT_AGGREGATABLE(FloppyImage)
     
    5051    NS_DECL_ISUPPORTS
    5152
     53    DECLARE_EMPTY_CTOR_DTOR (FloppyImage)
     54
    5255    HRESULT FinalConstruct();
    5356    void FinalRelease();
    5457
    5558    // public initializer/uninitializer for internal purposes only
    56     HRESULT init (VirtualBox *parent, const BSTR filePath,
    57                   BOOL isRegistered, const Guid &id);
     59    HRESULT init (VirtualBox *aParent, const BSTR aFilePath,
     60                  BOOL aRegistered, const Guid &aId);
    5861    void uninit();
    5962
    6063    // IFloppyImage properties
    61     STDMETHOD(COMGETTER(Id)) (GUIDPARAMOUT id);
    62     STDMETHOD(COMGETTER(FilePath)) (BSTR *filePath);
    63     STDMETHOD(COMGETTER(Accessible)) (BOOL *accessible);
    64     STDMETHOD(COMGETTER(Size)) (ULONG *size);
     64    STDMETHOD(COMGETTER(Id)) (GUIDPARAMOUT aId);
     65    STDMETHOD(COMGETTER(FilePath)) (BSTR *aFilePath);
     66    STDMETHOD(COMGETTER(Accessible)) (BOOL *aAccessible);
     67    STDMETHOD(COMGETTER(Size)) (ULONG *aSize);
    6568
    6669    // public methods for internal purposes only
     70    // (ensure there is a caller and a read lock before calling them!)
    6771
    6872    const Bstr &filePath() { return mImageFile; }
     
    7882
    7983    /** weak parent */
    80     ComObjPtr <VirtualBox, ComWeakRef> mParent;
     84    const ComObjPtr <VirtualBox, ComWeakRef> mParent;
    8185
    8286    BOOL mAccessible;
     
    8993COM_DECL_READONLY_ENUM_AND_COLLECTION_BEGIN (FloppyImage)
    9094
    91     STDMETHOD(FindByPath) (INPTR BSTR path, IFloppyImage **floppyImage)
     95    STDMETHOD(FindByPath) (INPTR BSTR aPath, IFloppyImage **aFloppyImage)
    9296    {
    93         if (!path)
     97        if (!aPath)
    9498            return E_INVALIDARG;
    95         if (!floppyImage)
     99        if (!aFloppyImage)
    96100            return E_POINTER;
    97101
    98         *floppyImage = NULL;
     102        Utf8Str path = aPath;
     103        *aFloppyImage = NULL;
    99104        Vector::value_type found;
    100105        Vector::iterator it = vec.begin();
     
    103108            Bstr filePath;
    104109            (*it)->COMGETTER(FilePath) (filePath.asOutParam());
    105             if (filePath == path)
     110            if (RTPathCompare (Utf8Str (filePath), path) == 0)
    106111                found = *it;
    107112            ++ it;
     
    110115        if (!found)
    111116            return setError (E_INVALIDARG, FloppyImageCollection::tr (
    112                 "The floppy image named '%ls' could not be found"), path);
     117                "The floppy image named '%ls' could not be found"), aPath);
    113118
    114         return found.queryInterfaceTo (floppyImage);
     119        return found.queryInterfaceTo (aFloppyImage);
    115120    }
    116121
  • trunk/src/VBox/Main/include/GuestImpl.h

    r1 r2567  
    4646    NS_DECL_ISUPPORTS
    4747
     48    DECLARE_EMPTY_CTOR_DTOR (Guest)
     49
    4850    HRESULT FinalConstruct();
    4951    void FinalRelease();
     
    5456
    5557    // IGuest properties
    56     STDMETHOD(COMGETTER(OSType)) (IGuestOSType **aOSType);
     58    STDMETHOD(COMGETTER(OSTypeId)) (BSTR *aOSTypeId);
    5759    STDMETHOD(COMGETTER(AdditionsActive)) (BOOL *aAdditionsActive);
    5860    STDMETHOD(COMGETTER(AdditionsVersion)) (BSTR *aAdditionsVersion);
     
    6365
    6466    // public methods that are not in IDL
    65     void setAdditionsVersion(Bstr version);
     67    void setAdditionsVersion (Bstr aVersion);
    6668
    6769    // for VirtualBoxSupportErrorInfoImpl
     
    7476        Data() : mAdditionsActive (FALSE) {}
    7577
    76         ComPtr <IGuestOSType> mGuestOSType;
     78        Bstr mOSTypeId;
    7779        BOOL mAdditionsActive;
    7880        Bstr mAdditionsVersion;
     
    8082
    8183    ComObjPtr <Console, ComWeakRef> mParent;
    82     Shareable <Data> mData;
     84    Data mData;
    8385};
    8486
  • trunk/src/VBox/Main/include/GuestOSTypeImpl.h

    r1721 r2567  
    2929
    3030class ATL_NO_VTABLE GuestOSType :
     31    public VirtualBoxBaseNEXT,
    3132    public VirtualBoxSupportErrorInfoImpl <GuestOSType, IGuestOSType>,
    3233    public VirtualBoxSupportTranslation <GuestOSType>,
    33     public VirtualBoxBase,
    3434    public IGuestOSType
    3535{
    3636public:
    3737
    38     GuestOSType();
    39     virtual ~GuestOSType();
     38    VIRTUALBOXBASE_ADD_ERRORINFO_SUPPORT (DVDImage)
    4039
    4140    DECLARE_NOT_AGGREGATABLE(GuestOSType)
     
    5049    NS_DECL_ISUPPORTS
    5150
     51    DECLARE_EMPTY_CTOR_DTOR (GuestOSType)
     52
     53    HRESULT FinalConstruct();
     54    void FinalRelease();
     55
    5256    // public initializer/uninitializer for internal purposes only
    53     HRESULT init (const char *id, const char *description, OSType osType,
    54                   uint32_t ramSize, uint32_t vramSize, uint32_t hddSize);
     57    HRESULT init (const char *aId, const char *aDescription, OSType aOSType,
     58                  uint32_t aRAMSize, uint32_t aVRAMSize, uint32_t aHDDSize);
     59    void uninit();
    5560
    5661    // IGuestOSType properties
    57     STDMETHOD(COMGETTER(Id)) (BSTR *id);
    58     STDMETHOD(COMGETTER(Description)) (BSTR *description);
    59     STDMETHOD(COMGETTER(RecommendedRAM)) (ULONG *ramSize);
    60     STDMETHOD(COMGETTER(RecommendedVRAM)) (ULONG *ramSize);
    61     STDMETHOD(COMGETTER(RecommendedHDD)) (ULONG *hddSize);
     62    STDMETHOD(COMGETTER(Id)) (BSTR *aId);
     63    STDMETHOD(COMGETTER(Description)) (BSTR *aDescription);
     64    STDMETHOD(COMGETTER(RecommendedRAM)) (ULONG *aRAMSize);
     65    STDMETHOD(COMGETTER(RecommendedVRAM)) (ULONG *aVRAMSize);
     66    STDMETHOD(COMGETTER(RecommendedHDD)) (ULONG *aHDDSize);
    6267
    6368    // public methods only for internal purposes
     
    6974private:
    7075
    71     Bstr mID;
    72     Bstr mDescription;
    73     OSType mOSType;
    74     uint32_t mRAMSize;
    75     uint32_t mVRAMSize;
    76     uint32_t mHDDSize;
    77     uint32_t mMonitorCount;
     76    const Bstr mID;
     77    const Bstr mDescription;
     78    const OSType mOSType;
     79    const uint32_t mRAMSize;
     80    const uint32_t mVRAMSize;
     81    const uint32_t mHDDSize;
     82    const uint32_t mMonitorCount;
    7883};
    7984
  • trunk/src/VBox/Main/include/MachineImpl.h

    r2540 r2567  
    214214                    mNameSync == that.mNameSync &&
    215215                    mDescription == that.mDescription &&
    216                     mOSType.equalsTo (that.mOSType) &&
     216                    mOSTypeId == that.mOSTypeId &&
    217217                    mSnapshotFolderFull == that.mSnapshotFolderFull);
    218218        }
     
    221221        BOOL    mNameSync;
    222222        Bstr    mDescription;
    223         ComPtr <IGuestOSType> mOSType;
     223        Bstr    mOSTypeId;
    224224        Bstr    mSnapshotFolder;
    225225        Bstr    mSnapshotFolderFull;
     
    314314    STDMETHOD(COMSETTER(Description))(INPTR BSTR aDescription);
    315315    STDMETHOD(COMGETTER(Id))(GUIDPARAMOUT aId);
    316     STDMETHOD(COMGETTER(OSType)) (IGuestOSType **aOSType);
    317     STDMETHOD(COMSETTER(OSType)) (IGuestOSType *aOSType);
     316    STDMETHOD(COMGETTER(OSTypeId)) (BSTR *aOSTypeId);
     317    STDMETHOD(COMSETTER(OSTypeId)) (INPTR BSTR aOSTypeId);
    318318    STDMETHOD(COMGETTER(MemorySize))(ULONG *memorySize);
    319319    STDMETHOD(COMSETTER(MemorySize))(ULONG memorySize);
  • trunk/src/VBox/Main/include/VirtualBoxImpl.h

    r2463 r2567  
    166166    STDMETHOD(UnregisterFloppyImage) (INPTR GUIDPARAM aId, IFloppyImage **aFloppyImage);
    167167
    168     STDMETHOD(FindGuestOSType)(INPTR BSTR aId, IGuestOSType **aType);
    169     STDMETHOD(CreateSharedFolder)(INPTR BSTR aName, INPTR BSTR aHostPath);
    170     STDMETHOD(RemoveSharedFolder)(INPTR BSTR aName);
    171     STDMETHOD(GetNextExtraDataKey)(INPTR BSTR aKey, BSTR *aNextKey, BSTR *aNextValue);
    172     STDMETHOD(GetExtraData)(INPTR BSTR aKey, BSTR *aValue);
    173     STDMETHOD(SetExtraData)(INPTR BSTR aKey, INPTR BSTR aValue);
     168    STDMETHOD(GetGuestOSType) (INPTR BSTR aId, IGuestOSType **aType);
     169    STDMETHOD(CreateSharedFolder) (INPTR BSTR aName, INPTR BSTR aHostPath);
     170    STDMETHOD(RemoveSharedFolder) (INPTR BSTR aName);
     171    STDMETHOD(GetNextExtraDataKey) (INPTR BSTR aKey, BSTR *aNextKey, BSTR *aNextValue);
     172    STDMETHOD(GetExtraData) (INPTR BSTR aKey, BSTR *aValue);
     173    STDMETHOD(SetExtraData) (INPTR BSTR aKey, INPTR BSTR aValue);
    174174    STDMETHOD(OpenSession) (ISession *aSession, INPTR GUIDPARAM aMachineId);
    175175    STDMETHOD(OpenRemoteSession) (ISession *aSession, INPTR GUIDPARAM aMachineId,
    176176                                  INPTR BSTR aType, IProgress **aProgress);
    177177    STDMETHOD(OpenExistingSession) (ISession *aSession, INPTR GUIDPARAM aMachineId);
    178     STDMETHOD(RegisterCallback)(IVirtualBoxCallback *callback);
    179     STDMETHOD(UnregisterCallback)(IVirtualBoxCallback *callback);
     178    STDMETHOD(RegisterCallback) (IVirtualBoxCallback *callback);
     179    STDMETHOD(UnregisterCallback) (IVirtualBoxCallback *callback);
    180180
    181181    /* public methods only for internal purposes */
     
    209209    void onSnapshotChange (const Guid &aMachineId, const Guid &aSnapshotId);
    210210
    211     ComPtr <IGuestOSType> getUnknownOSType();
     211    ComObjPtr <GuestOSType> getUnknownOSType();
    212212
    213213    typedef std::vector <ComObjPtr <SessionMachine> > SessionMachineVector;
Note: See TracChangeset for help on using the changeset viewer.

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