// tskint.idl : IDL source for HSM engine task interface
//

// This file will be processed by the MIDL tool to
// produce the type library (task.tlb) and marshalling code.

interface IHsmFsaTskMgr;
interface IHsmWorkQueue;
interface IHsmWorkItem;
interface IFsaPostIt;

import "oaidl.idl";
import "wsbint.idl";
import "jobdef.idl";
import "jobint.idl";
import "tskdef.idl";

    [
        object,
        uuid(14F73FCB-517D-4503-B15D-2D40B3E9CD21),
        helpstring("IHsmFsaTskMgr Interface"),
        pointer_default(unique)
    ]
    interface IHsmFsaTskMgr : IHsmSystemState
    {
    HRESULT ContactOk( void );
    HRESULT DoFsaWork([in] IFsaPostIt *fsaWorkItem);
    HRESULT Init( [in] IUnknown *pServer);
    HRESULT WorkQueueDone([in] IHsmSession *pSession, HSM_WORK_QUEUE_TYPE type, GUID *mediaId);
    };

    [
        object,
        uuid(39A35CB0-C56B-11d0-B16F-00A0C916F120),
        helpstring("IHsmWorkQueue Interface"),
        pointer_default(unique)
    ]
    interface IHsmWorkQueue : IHsmSystemState
    {
    HRESULT Add( [in] IFsaPostIt *pFsaWorkItem);
    HRESULT Init( [in] IUnknown *pServer, [in] IHsmSession *pSession, [in] IHsmFsaTskMgr *pTskMgr, [in] HSM_WORK_QUEUE_TYPE type);
    HRESULT Start( void );
    HRESULT Stop( void );
    HRESULT ContactOk( void );
    HRESULT GetCurrentSessionId([out] GUID *pSessionId);
    HRESULT GetNumWorkItems([out] ULONG *pNumWorkItems);
    };

    [
        object,
        uuid(BF8BBCD0-C596-11d0-B16F-00A0C916F120),
        helpstring("IHsmWorkItem Interface"),
        pointer_default(unique)
    ]
    interface IHsmWorkItem : IUnknown
    {
    HRESULT CompareToIHsmWorkItem([in] IHsmWorkItem* pWorkItem, [out] SHORT* pResult);
    HRESULT GetFsaPostIt([out] IFsaPostIt  **ppFsaPostIt);
    HRESULT GetFsaResource([out] IFsaResource  **ppFsaResource);
    HRESULT GetId([out] GUID  *pId);
    HRESULT GetMediaInfo([out] GUID *pMediaId, [out] FILETIME *pMediaLastUpdate,
                         [out] HRESULT *pMediaLastError, [out] BOOL *pMediaRecallOnly,
                         [out] LONGLONG *pMediaFreeBytes, [out] short *pMediaRemoteDataSet);
    HRESULT GetResult([out] HRESULT  *pHr);
    HRESULT GetWorkType([out] HSM_WORK_ITEM_TYPE *pWorkType);
    HRESULT SetFsaPostIt([in] IFsaPostIt  *pFsaPostIt);
    HRESULT SetFsaResource([in] IFsaResource  *pFsaResource);
    HRESULT SetMediaInfo([in] GUID mediaId, [in] FILETIME mediaLastUpdate,
                         [in] HRESULT mediaLastError, [in] BOOL mediaRecallOnly,
                         [in] LONGLONG mediaFreeBytes, [in] short mediaRemoteDataSet);
    HRESULT SetResult([in] HRESULT  hr);
    HRESULT SetWorkType([in] HSM_WORK_ITEM_TYPE workType);
    };

    [
        object,
        uuid(E3A35E06-4263-4505-B77B-196B22ACC94b),
        helpstring("IHsmRecallItem Interface"),
        pointer_default(unique)
    ]
    interface IHsmRecallQueue : IHsmSystemState
    {
    HRESULT Add( [in] IFsaPostIt *pFsaWorkItem, [in] GUID *pBagId, [in] LONGLONG dataSetStart);
    HRESULT Init( [in] IUnknown *pServer, [in] IHsmFsaTskMgr *pTskMgr);
    HRESULT Start( void );
    HRESULT Stop( void );
    HRESULT ContactOk( void );
    HRESULT GetMediaId([out] GUID *mediaId);
    HRESULT SetMediaId([in]  GUID *mediaId);
    HRESULT IsEmpty(void);
    };

    [
        object,
        uuid(B287C709-f4AD-467C-811D-1D56021D68AD),
        helpstring("IHsmRecallItem Interface"),
        pointer_default(unique)
    ]
    interface IHsmRecallItem : IUnknown
    {
    HRESULT CompareToIHsmRecallItem([in] IHsmRecallItem* pWorkItem, [out] SHORT* pResult);
    HRESULT GetFsaPostIt([out] IFsaPostIt  **ppFsaPostIt);
    HRESULT GetFsaResource([out] IFsaResource  **ppFsaResource);
    HRESULT GetId([out] GUID  *pId);
    HRESULT GetMediaInfo([out] GUID *pMediaId, [out] FILETIME *pMediaLastUpdate,
                         [out] HRESULT *pMediaLastError, [out] BOOL *pMediaRecallOnly,
                         [out] LONGLONG *pMediaFreeBytes, [out] short *pMediaRemoteDataSet);
    HRESULT GetResult([out] HRESULT  *pHr);
    HRESULT GetWorkType([out] HSM_WORK_ITEM_TYPE *pWorkType);
    HRESULT GetEventCookie([out] DWORD *pEventCookie);
    HRESULT GetStateCookie([out] DWORD *pStateCookie);
    HRESULT GetJobState([out] HSM_JOB_STATE *pJobState);
    HRESULT GetJobPhase([out] HSM_JOB_PHASE *pJobPhase);
    HRESULT GetSeekOffset([out] LONGLONG *pJobPhase);
    HRESULT GetBagId([out] GUID *pBagId);
    HRESULT GetDataSetStart([out] LONGLONG *pDataSetStart);
    HRESULT SetFsaPostIt([in] IFsaPostIt  *pFsaPostIt);
    HRESULT SetFsaResource([in] IFsaResource  *pFsaResource);
    HRESULT SetMediaInfo([in] GUID mediaId, [in] FILETIME mediaLastUpdate,
                         [in] HRESULT mediaLastError, [in] BOOL mediaRecallOnly,
                         [in] LONGLONG mediaFreeBytes, [in] short mediaRemoteDataSet);
    HRESULT SetResult([in] HRESULT  hr);
    HRESULT SetWorkType([in] HSM_WORK_ITEM_TYPE workType);
    HRESULT SetEventCookie([in] DWORD eventCookie);
    HRESULT SetStateCookie([in] DWORD stateCookie);
    HRESULT SetJobState([in] HSM_JOB_STATE jobState);
    HRESULT SetJobPhase([in] HSM_JOB_PHASE jobPhase);
    HRESULT SetSeekOffset([in] LONGLONG seekOffset);
    HRESULT SetBagId([in] GUID *bagId);
    HRESULT SetDataSetStart([in] LONGLONG dataSetStart);
    };
