/*++

© 1998 Seagate Software, Inc.  All rights reserved

Module Name:

    MvrInt.idl

Abstract:

    IDL source for the Data Mover (Mover.dll)

    This file will be processed by the MIDL tool to produce the
    MVR Proxy/Stub marshaling code which is merged with Mover.dll.

Author:

    Brian Dodd          [brian]     01-Apr-1997

Revision History:

--*/

interface IRmsCartridge;

import "oaidl.idl";
import "ocidl.idl";
import "RmsInt.idl";

[
    object,
    uuid(54B6C009-C05A-4F16-AB55-716A1A1BE447),
    helpstring("IDataMover Interface"),
    pointer_default(unique)
]
interface IDataMover : IDispatch
{
    HRESULT GetObjectId([out] GUID *pObjectId);

    HRESULT BeginSession(
        [in, string] BSTR remoteSessionName,
        [in, string] BSTR remoteSessionDescription,
        [in] SHORT remoteDataSet,
        [in] DWORD options);

    HRESULT EndSession(void);

    HRESULT StoreData(
        [in, string] BSTR localName,
        [in] ULARGE_INTEGER localDataStart,
        [in] ULARGE_INTEGER localDataSize,
        [in] DWORD flags,
        [out] ULARGE_INTEGER *pRemoteDataSetStart,
        [out] ULARGE_INTEGER *pRemoteFileStart,
        [out] ULARGE_INTEGER *pRemoteFileSize,
        [out] ULARGE_INTEGER *pRemoteDataStart,
        [out] ULARGE_INTEGER *pRemoteDataSize,
        [out] DWORD *pRemoteVerificationType,
        [out] ULARGE_INTEGER *pRemoteVerificationData,
        [out] DWORD *pDatastreamCRCType,
        [out] ULARGE_INTEGER *pDatastreamCRC,
        [out] ULARGE_INTEGER *pUsn);
        // TODO: when localName is a dir, we'll need a connect point parameter
        // to return file and data info for each file copied.  Also, do we
        // add a progress routine callback or use connection point.

    HRESULT RecallData(
        [in, string] BSTR localName,
        [in] ULARGE_INTEGER localDataStart,
        [in] ULARGE_INTEGER localDataSize,
        [in] DWORD flags,
        [in, string] BSTR migratedSessionName,
        [in] ULARGE_INTEGER remoteDataSetStart,
        [in] ULARGE_INTEGER remoteFileStart,
        [in] ULARGE_INTEGER remoteFileSize,
        [in] ULARGE_INTEGER remoteDataStart,
        [in] ULARGE_INTEGER remoteDataSize,
        [in] DWORD remoteVerificationType,
        [in] ULARGE_INTEGER remoteVerificationData);
        // TODO: when localName is a dir, we'll need a connect point parameter
        // to return file and data info for each file copied.  Also, do we
        // add a progress routine callback or use connection point.

    HRESULT FormatLabel(
        [in, string] BSTR displayName,
        [in, out, string] BSTR *pLabel);

    HRESULT WriteLabel(
        [in, string] BSTR label);

    HRESULT ReadLabel(
        [in, out, string] BSTR *pLabel);

    HRESULT VerifyLabel(
        [in, string] BSTR label);

    HRESULT GetDeviceName(
        [in, out, string] BSTR *pName);

    HRESULT SetDeviceName(
        [in, string] BSTR name,
        [in, defaultvalue(NULL),string] BSTR volName);

    HRESULT GetLargestFreeSpace(
        [out] LONGLONG *freeSpace,
        [out] LONGLONG *capacity,
		[in, defaultvalue(0xFFFFFFFF)] ULONG defaultFreeSpaceLow,
		[in, defaultvalue(0xFFFFFFFF)] LONG defaultFreeSpaceHigh);

	HRESULT SetInitialOffset(
		[in] ULARGE_INTEGER initialOffset);

/*++

Method Name:

    GetLargestFreeSpace

Method Description:

    Returns the free space and capacity of a drive, in bytes.  A unit of media must be present.
    If the device cannot determine either the free space or capacity, an arbitrarily large value
    is returned.

Arguments:

    freeSpace   - Receives the remaining bytes available on the media, can be NULL.

    capacity    - Receives the total capacity, in bytes, on the media, can be NULL.

    defaultFreeSpaceLow  - Receives a default for free space in case that the device doesn't
	defaultFreeSpaceHigh   provide this information. 
						   Dedault value of 0xFFFFFFFF means that the caller has no default 
                           free space info. 
                           When 64-bit is supported by oleaut, these shoulb be changed to one
                           LONGLONG parameter with -1 default

Return Value:

    S_OK        - Success.
    RMS_E_RESOURCE_UNAVAILABLE  - The resource required to complete the operation is not available.

--*/

    HRESULT GetCartridge(
        [out] IRmsCartridge **ptr);

/*++

Method Name:

    GetCartridge

Method Description:

    Get cartridge

Arguments:

    ptr             - pointer to cartridge

Return Value:

    S_OK            - successful

--*/

    HRESULT SetCartridge(
        [in] IRmsCartridge *ptr);

/*++

Method Name:

    SetCartridge

Method Description:

    Set cartridge

Arguments:

    ptr         - pointer to cartridge 

Return Value:

    S_OK        - Success.

--*/

    HRESULT Cancel(void);
/*++

Method Name:

    Cancel

Method Description:

    Cancel (abort) any data movement that is in progress

Arguments:

    None

Return Value:

    S_OK        - Success.

--*/

    HRESULT CreateLocalStream(
        [in, string] BSTR name,
        [in] DWORD mode,
        [out] IStream **ppStream);

    HRESULT CreateRemoteStream(
        [in, string] BSTR name,
        [in] DWORD mode,
        [in, string] BSTR remoteSessionName,
        [in, string] BSTR remoteSessionDescription,
        [in] ULARGE_INTEGER remoteDataSetStart,
        [in] ULARGE_INTEGER remoteFileStart,
        [in] ULARGE_INTEGER remoteFileSize,
        [in] ULARGE_INTEGER remoteDataStart,
        [in] ULARGE_INTEGER remoteDataSize,
        [in] DWORD remoteVerificationType,
        [in] ULARGE_INTEGER remoteVerificationData,
        [out] IStream **ppStream);

    HRESULT CloseStream(void);

    HRESULT Duplicate(
        [in] IDataMover *pDestination,
        [in] DWORD options,
        [out] ULARGE_INTEGER *pBytesCopied,
        [out] ULARGE_INTEGER *pBytesReclaimed);

    HRESULT FlushBuffers(void);

    HRESULT Recover([out] BOOL *pDeleteFile);
};

[
    object,
    uuid(BD010A01-000B-11D0-D0DD-00A0C9190459),
    helpstring("IRemoteStoreItem Interface"),
    pointer_default(unique)
]
interface IRemoteStorageHint : IDispatch
{
    HRESULT Reset(void);

    HRESULT SetDataSetStart(
        [in] ULARGE_INTEGER dataSetStart);
    HRESULT SetFileStart(
        [in] ULARGE_INTEGER fileStart);
    HRESULT SetFileSize(
        [in] ULARGE_INTEGER fileSize);
    HRESULT SetDataStart(
        [in] ULARGE_INTEGER dataStart);
    HRESULT SetDataSize(
        [in] ULARGE_INTEGER dataSize);
    HRESULT SetVerificationData(
        [in] DWORD verificationType,
        [in] ULARGE_INTEGER verificationData);
    HRESULT SetDatastreamCRC(
        [in] DWORD dataStreamCRCType,
        [in] ULARGE_INTEGER dataStreamCRC);
    HRESULT SetFileUSN(
        [in] ULARGE_INTEGER fileUSN);

    HRESULT GetElementInformation(
        [out] ULARGE_INTEGER *pDataSetStart,
        [out] ULARGE_INTEGER *pFileStart,
        [out] ULARGE_INTEGER *pFileSize,
        [out] ULARGE_INTEGER *pDataStart,
        [out] ULARGE_INTEGER *pDataSize,
        [out] DWORD *pVerificationType,
        [out] ULARGE_INTEGER *pVerificationData,
        [out] DWORD *pDataStreamCRCType,
        [out] ULARGE_INTEGER *pDataStreamCRC,
        [out] ULARGE_INTEGER *pFileUSN);
};

[
    object,
    uuid(C48AD3C9-00D4-11D3-8FD1-0040339FD97B),
    helpstring("IRemoteStorage Interface"),
    pointer_default(unique)
]
interface IRemoteStorage : IDispatch
{
    HRESULT FormatLabel(
        [in, string] BSTR displayName,
        [in, out, string] BSTR *pLabel);

    HRESULT WriteLabel(
        [in, string] BSTR label);

    HRESULT ReadLabel(
        [in, out, string] BSTR *pLabel);

    HRESULT VerifyLabel(void);

    HRESULT GetDeviceName(
        [in, out, string] BSTR *pName);

    HRESULT SetDeviceName(
        [in, string] BSTR name,
        [in, defaultvalue(NULL),string] BSTR volName);

    HRESULT GetLargestFreeSpace(
        [out] LONGLONG *freeSpace,
        [out] LONGLONG *capacity);

    HRESULT GetCartridge(
        [out] IRmsCartridge **ptr);

    HRESULT SetCartridge(
        [in] IRmsCartridge *ptr);

    HRESULT CreateRemoteStream(
        [in, string] BSTR name,
        [in, string] BSTR description,
        [in] SHORT index,
        [in] DWORD options,
        [in] IRemoteStorageHint *pHint,
        [out] IStream ** ppStream);

    HRESULT CloseStream(void);
};

[
    object,
    uuid(BD010A03-000B-11D0-D0DD-00A0C9190459),
    helpstring("ILocalStorage Interface"),
    pointer_default(unique)
]
interface ILocalStorage : IDispatch
{
    HRESULT CreateLocalStream(
        [in, string] BSTR name,
        [in] DWORD mode,
        [out] IStream ** ppStream);

    HRESULT CloseStream(void);
};

[
    object,
    uuid(BD010A04-000B-11D0-D0DD-00A0C9190459),
    helpstring("IRemoteStream Interface"),
    pointer_default(unique)
]
interface IRemoteStream : IDispatch
{
    HRESULT CreateRemoteStream(
        [in, string] BSTR name,
        [in] DWORD mode,
        [out] IStream ** ppStream);

    HRESULT CloseStream(void);
};

[
    object,
    uuid(BD010A05-000B-11D0-D0DD-00A0C9190459),
    helpstring("ILocalStream Interface"),
    pointer_default(unique)
]
interface ILocalStream : IDispatch
{
    HRESULT CreateLocalStream(
        [in, string] BSTR name,
        [in] DWORD mode,
        [out] IStream ** ppStream);

    HRESULT CloseStream(void);

};
