// jobintf.idl : IDL source for Jobs.dll
//

interface IHsmAction;
interface IHsmActionOnResource;
interface IHsmActionOnResourcePost;
interface IHsmActionOnResourcePre;
interface IHsmActionOnResourcePreScan;
interface IHsmCriteria;
interface IHsmDirectedAction;
interface IHsmJob;
interface IHsmJobContext;
interface IHsmJobDef;
interface IHsmJobSinkEverySession;
interface IHsmJobWorkItem;
interface IHsmPhase;
interface IHsmPolicy;
interface IHsmRelativeCriteria;
interface IHsmRelocateAction;
interface IHsmRule;
interface IHsmRuleStack;
interface IHsmScanner;
interface IHsmSession;
interface IHsmSessionSinkEveryItem;
interface IHsmSessionSinkEveryState;
interface IHsmSessionSinkSomeItems;
interface IHsmSessionTotals;
 
// This file will be processed by the MIDL tool to
// produce the type library (Jobs.tlb) and marshalling code.

import "oaidl.idl";
import "ocidl.idl";
import "wsbint.idl";
import "fsadef.idl";
import "jobdef.idl";
import "fsaint.idl";
import "hsmeng.idl";

[
    object,
    uuid(AD402351-00FC-11D0-819C-00A0C91180F2),
    helpstring("IHsmAction Interface"),
    pointer_default(unique)
]
interface IHsmAction : IUnknown
{
    HRESULT GetName([in, out, string] OLECHAR** pName, [in] ULONG bufferSize);
    HRESULT Do([in] IFsaScanItem* pScanItem);
};

[
    object,
    uuid(D9E04213-14D7-11d1-9938-0060976A546D),
    helpstring("IHsmActionOnResource Interface"),
    pointer_default(unique)
]
interface IHsmActionOnResource : IUnknown
{
    HRESULT GetName([in, out, string] OLECHAR** pName, [in] ULONG bufferSize);
};

[
    object,
    uuid(0AD613D1-18BE-11d1-9939-0060976A546D),
    helpstring("IHsmActionOnResourcePost Interface"),
    pointer_default(unique)
]
interface IHsmActionOnResourcePost : IUnknown
{
    HRESULT Do([in] IHsmJobWorkItem* pWorkItem, [in] HSM_JOB_STATE state);
};

[
    object,
    uuid(FD8D709C-47DD-4D68-BBD5-817EDD934E4B),
    helpstring("IHsmActionOnResourcePre Interface"),
    pointer_default(unique)
]
interface IHsmActionOnResourcePre : IUnknown
{
    HRESULT Do([in] IHsmJobWorkItem* pWorkItem, [in] IHsmJobDef* pJobDef);
};

[
    object,
    uuid(D7619DB3-265E-4796-A98C-F6F28C2A618C),
    helpstring("IHsmActionOnResourcePreScan Interface"),
    pointer_default(unique)
]
interface IHsmActionOnResourcePreScan : IUnknown
{
    HRESULT Do([in] IFsaResource* pResource, [in] IHsmSession* pSession);
};

[
    object,
    uuid(AD40235B-00FC-11D0-819C-00A0C91180F2),
    helpstring("IHsmCriteria Interface"),
    pointer_default(unique)
]
interface IHsmCriteria : IUnknown
{
    HRESULT GetName([in, out, string] OLECHAR** pName, [in] ULONG bufferSize);
    HRESULT IsIgnored(void);
    HRESULT IsNegated(void);
    HRESULT SetIsIgnored([in] BOOL isIgnored);
    HRESULT SetIsNegated([in] BOOL isNegated);
    HRESULT ShouldDo([in] IFsaScanItem* pScanItem, [in] USHORT scale);
    HRESULT Value([in] IFsaScanItem* pScanItem, [out, string] OLECHAR** value, [in] ULONG bufferSize);
};


[
    object,
    uuid(2B382EA1-16EA-11D0-81AE-00A0C91180F2),
    helpstring("IHsmRelativeCriteria Interface"),
    pointer_default(unique)
]
interface IHsmRelativeCriteria : IUnknown
{
    typedef [v1_enum] enum _HSM_CRITERIACOMPARATOR {HSM_CRITERIACOMPARATOR_NOTSET   = 0,
             HSM_CRITERIACOMPARATOR_LT      = 1,
             HSM_CRITERIACOMPARATOR_LTE     = 2,
             HSM_CRITERIACOMPARATOR_EQL     = 3,
             HSM_CRITERIACOMPARATOR_NEQL    = 4,
             HSM_CRITERIACOMPARATOR_GTE     = 5,
             HSM_CRITERIACOMPARATOR_GT      = 6,
             HSM_CRITERIACOMPARATOR_BETWEEN = 7,
             HSM_CRITERIACOMPARATOR_OUTSIDE = 8,
             HSM_CRITERIACOMPARATOR_MEMBEROF = 9
    } HSM_CRITERIACOMPARATOR;

    HRESULT ComparatorAsString([in, out, string] OLECHAR** pCompString, [in] ULONG bufferSize);
    HRESULT ComparatorIsBinary(void);
    HRESULT GetArg1([in, out, string] OLECHAR** pArg, [in] ULONG bufferSize);
    HRESULT GetArg2([in, out, string] OLECHAR** pArg, [in] ULONG bufferSize);
    HRESULT GetComparator([out] HSM_CRITERIACOMPARATOR* pComparator);
    HRESULT SetArg1([in, string] OLECHAR* arg);
    HRESULT SetArg2([in, string] OLECHAR* arg);
    HRESULT SetComparator([in] HSM_CRITERIACOMPARATOR comparator);
};


[
    object,
    uuid(C7A01572-187A-11D0-81B0-00A0C91180F2),
    helpstring("IHsmDirectedAction Interface"),
    pointer_default(unique)
]
interface IHsmDirectedAction : IUnknown
{
    HRESULT GetStoragePoolId([out] GUID* pId);
    HRESULT SetStoragePoolId([in] GUID id);
};


[
    object,
    uuid(2A87C7E2-DB24-11d2-AFA2-00104B9A3758),
    helpstring("IHsmJob Interface"),
    pointer_default(unique)
]
interface IHsmJob : IUnknown
{
    HRESULT Cancel([in] HSM_JOB_PHASE phase);
    HRESULT DidFinish(void);
    HRESULT DidFinishOk(void);
    HRESULT EnumWorkItems([out] IWsbEnum** ppEnum);
    HRESULT FindWorkItem([in] IHsmSession* pSession, [out] IHsmJobWorkItem** ppWorkItem);
    HRESULT GetContext([out] IHsmJobContext** ppContext);
    HRESULT GetDef([out] IHsmJobDef** ppDef);
    HRESULT GetHsmId([out] GUID* pId);
    HRESULT GetIdentifier([out] GUID* pId);
    HRESULT GetMaxActiveSessions([out] ULONG* pMaxActiveSessions);
    HRESULT GetName([in, out, string] OLECHAR** pName, [in] ULONG bufferSize);
    HRESULT GetRunId([out] ULONG* pId);
    HRESULT GetState([out] HSM_JOB_STATE* pState);
    HRESULT InitAs([in, string] OLECHAR* name, [in] IHsmJobDef* pDef, [in] HSM_JOB_DEF_TYPE type, [in] GUID storagePool, [in] IHsmServer* pServer, [in] BOOL isUserDefined, [in] IFsaResource* pResource);
    HRESULT IsActive(void);
    HRESULT IsUserDefined(void);
    HRESULT Pause([in] HSM_JOB_PHASE phase);
    HRESULT Restart(void);
    HRESULT Resume([in] HSM_JOB_PHASE phase);
    HRESULT SetContext([in] IHsmJobContext* pContext);
    HRESULT SetDef([in] IHsmJobDef* pDef);
    HRESULT SetHsmId([in] GUID id);
    HRESULT SetIsUserDefined([in] BOOL isUserDefined);
    HRESULT SetName([in, string] OLECHAR* name);
    HRESULT Start(void);
    HRESULT Suspend([in] HSM_JOB_PHASE phase);
    HRESULT WaitUntilDone(void);
};


[
    object,
    uuid(AD402360-00FC-11D0-819C-00A0C91180F2),
    helpstring("IHsmJobContext Interface"),
    pointer_default(unique)
]
interface IHsmJobContext : IUnknown
{
    HRESULT EnumResources([out] IWsbEnum** ppEnum);
    HRESULT Resources([out] IWsbCollection** ppResources);
    HRESULT SetUsesAllManaged([in] BOOL usesAllManaged);
    HRESULT UsesAllManaged(void);
};


[
    object,
    uuid(2FA5166A-D28B-49D4-B5F8-B12B3201C1C4),
    helpstring("IHsmJobDef Interface"),
    pointer_default(unique)
]
interface IHsmJobDef : IUnknown
{
    HRESULT EnumPolicies([out] IWsbEnum** ppEnum);
    HRESULT GetIdentifier([out] GUID* pId);
    HRESULT GetName([in, out, string] OLECHAR** pName, [in] ULONG bufferSize);
    HRESULT GetPostActionOnResource([out] IHsmActionOnResourcePost** ppAction);
    HRESULT GetPreActionOnResource([out] IHsmActionOnResourcePre** ppAction);
    HRESULT GetPreScanActionOnResource([out] IHsmActionOnResourcePreScan** ppAction);
    HRESULT InitAs([in, string] OLECHAR* name, [in] HSM_JOB_DEF_TYPE type, [in] GUID storagePool, [in] IHsmServer* pServer, [in] BOOL isUserDefined);
    HRESULT Policies([out] IWsbCollection** ppPolicies);
    HRESULT SetName([in, string] OLECHAR* name);
    HRESULT SetPostActionOnResource([in] IHsmActionOnResourcePost* pAction);
    HRESULT SetPreActionOnResource([in] IHsmActionOnResourcePre* pAction);
    HRESULT SetPreScanActionOnResource([in] IHsmActionOnResourcePreScan* pAction);
    HRESULT SetSkipHiddenItems([in] BOOL shouldSkip);
    HRESULT SetSkipSystemItems([in] BOOL shouldSkip);
    HRESULT SetUseRPIndex([in] BOOL useIndex);
    HRESULT SetUseDbIndex([in] BOOL useIndex);
    HRESULT SkipHiddenItems(void);
    HRESULT SkipSystemItems(void);
    HRESULT UseRPIndex(void);
    HRESULT UseDbIndex(void);
};


[
    object,
    uuid(4250BAA0-811D-11d0-81E4-00A0C91180F2),
    helpstring("IHsmJobSinkEverySession Interface"),
    pointer_default(unique)
]
interface IHsmJobSinkEverySession : IUnknown
{
    HRESULT ProcessJobSession([in] IHsmSession* pSession, [in] IHsmPhase* pPhase, [in, string] OLECHAR* currentPath);
};


[
    object,
    uuid(B8E1CD20-81D3-11d0-81E4-00A0C91180F2),
    helpstring("IHsmJobWorkItem Interface"),
    pointer_default(unique)
]
interface IHsmJobWorkItem : IUnknown
{
    HRESULT CompareToResourceId([in] GUID id, [out] SHORT* pResult);
    HRESULT CompareToIWorkItem([in] IHsmJobWorkItem* pWorkItem, [out] SHORT* pResult);
    HRESULT DoPostScan(void);
    HRESULT DoPreScan(void);
    HRESULT EnumPhases([out] IWsbEnum** ppEnum);
    HRESULT EnumTotals([out] IWsbEnum** ppEnum);
    HRESULT GetCurrentPath([in, out, string] OLECHAR** pString, [in] ULONG bufferSize);
    HRESULT GetFinishTime([out] FILETIME* pTime);
    HRESULT GetResourceId([out] GUID* pId);
    HRESULT GetSession([out] IHsmSession** ppSession);
    HRESULT GetStartingPath([in, out, string] OLECHAR** pString, [in] ULONG bufferSize);
    HRESULT GetStartTime([out] FILETIME* pTime);
    HRESULT GetState([out] HSM_JOB_STATE* pState);
    HRESULT GetStateAsString([in, out, string] OLECHAR** pName, [in] ULONG bufferSize);
    HRESULT GetSubRunId([out] ULONG* pId);
};


[
    object,
    uuid(35035914-0D1C-11d2-9B0C-00104B9A2869),
    helpstring("IHsmPhase Interface"),
    pointer_default(unique)
]
interface IHsmPhase : IUnknown
{
    HRESULT Clone([out] IHsmPhase** ppPhase);
    HRESULT CopyTo([in] IHsmPhase* pPhase);
    HRESULT GetElapsedTime([out] ULONG* pDays, [out] USHORT* pHours, [out] USHORT* pMinutes, [out] USHORT* pSeconds);
    HRESULT GetMediaState([out] HSM_JOB_MEDIA_STATE* pState);
    HRESULT GetMediaStateAsString([in, out, string] OLECHAR** pName, [in] ULONG bufferSize);
    HRESULT GetName([in, out, string] OLECHAR** pName, [in] ULONG bufferSize);
    HRESULT GetPhase([out] HSM_JOB_PHASE* pPhase);
    HRESULT GetPriority([out] HSM_JOB_PRIORITY* pPriority);
    HRESULT GetPriorityAsString([in, out, string] OLECHAR** pName, [in] ULONG bufferSize);
    HRESULT GetState([out] HSM_JOB_STATE* pState);
    HRESULT GetStateAsString([in, out, string] OLECHAR** pName, [in] ULONG bufferSize);
    HRESULT GetStats([out] LONGLONG* items, [out] LONGLONG* size, [out] LONGLONG* skippedItems, [out] LONGLONG* skippedSize, [out] LONGLONG* errorItems, [out] LONGLONG* errorSize);
    HRESULT GetStartTime([out] FILETIME* pTime);
    HRESULT GetStopTime([out] FILETIME* pTime);
};


[
    object,
    uuid(AD40234C-00FC-11D0-819C-00A0C91180F2),
    helpstring("IHsmPolicy Interface"),
    pointer_default(unique)
]
interface IHsmPolicy : IUnknown
{
    HRESULT EnumRules([out] IWsbEnum** ppEnum);
    HRESULT GetAction([out] IHsmAction** ppAction);
    HRESULT GetIdentifier([out] GUID* pId);
    HRESULT GetName([in, out, string] OLECHAR** pName, [in] ULONG bufferSize);
    HRESULT GetScale([out] USHORT* pScale);
    HRESULT Rules([out] IWsbCollection** ppWsbCollection);
    HRESULT SetAction([in] IHsmAction* pAction);
    HRESULT SetName([in, string] OLECHAR* name);
    HRESULT SetScale([in] USHORT scale);
    HRESULT SetUsesDefaultRules([in] BOOL usesDefaults);
    HRESULT UsesDefaultRules(void);
};


[
    object,
    uuid(C7A01571-187A-11D0-81B0-00A0C91180F2),
    helpstring("IHsmRelocateAction Interface"),
    pointer_default(unique)
]
interface IHsmRelocateAction : IUnknown
{
    HRESULT GetDestination([in, out, string] OLECHAR** pDest, [in] ULONG bufferSize);
    HRESULT ExpandPlaceholders(void);
    HRESULT RetainHierarchy(void);
    HRESULT SetDestination([in, string] OLECHAR* dest);
    HRESULT SetExpandPlaceholders([in] BOOL expandPlaceholders);
    HRESULT SetRetainHierarchy([in] BOOL retainHierarchy);
};


[
    object,
    uuid(AD402356-00FC-11D0-819C-00A0C91180F2),
    helpstring("IHsmRule Interface"),
    pointer_default(unique)
]
interface IHsmRule : IUnknown
{
    HRESULT CompareToIRule([in] IHsmRule* pRule, [out] SHORT* pResult);
    HRESULT CompareToPathAndName([in, string] OLECHAR* path, [in, string] OLECHAR* name, [out] SHORT* pResult);
    HRESULT Criteria([out] IWsbCollection** ppWsbCollection);
    HRESULT EnumCriteria([out] IWsbEnum** ppEnum);
    HRESULT GetName([in, out, string] OLECHAR** pName, [in] ULONG bufferSize);
    HRESULT GetSearchName([in, out, string] OLECHAR** pName, [in] ULONG bufferSize);
    HRESULT GetPath([in, out, string] OLECHAR** pPath, [in] ULONG bufferSize);
    HRESULT IsInclude(void);
    HRESULT IsUserDefined(void);
    HRESULT IsUsedInSubDirs(void);
    HRESULT MatchesName([in, string] OLECHAR* name);
    HRESULT SetIsInclude([in] BOOL isInclude);
    HRESULT SetIsUserDefined([in] BOOL isUserDefined);
    HRESULT SetIsUsedInSubDirs([in] BOOL isUsed);
    HRESULT SetName([in, string] OLECHAR* name);
    HRESULT SetPath([in, string] OLECHAR* path);
};


[
    object,
    uuid(7B22FF21-1AD6-11D0-81B1-00A0C91180F2),
    helpstring("IHsmRuleStack Interface"),
    pointer_default(unique)
]
interface IHsmRuleStack : IUnknown
{
    HRESULT Do([in] IFsaScanItem* pScanItem);
    HRESULT DoesMatch([in] IFsaScanItem* pScanItem, BOOL* pShouldDo);
    HRESULT Init([in] IHsmPolicy* pPolicy, [in] IFsaResource* pResource);
    HRESULT Pop([in, string] OLECHAR* path);
    HRESULT Push([in, string] OLECHAR* path);
};


[
    object,
    uuid(BEA60F83-7EBA-11d0-81E4-00A0C91180F2),
    helpstring("IHsmScanner Interface"),
    pointer_default(unique)
]
interface IHsmScanner : IUnknown
{
    HRESULT Start([in] IHsmSession* pSession, [in, string] OLECHAR* path);  
};


[
    object,
    uuid(6E7196DC-7F9C-460D-9E97-845490B81D60),

    helpstring("IHsmSession Interface"),
    pointer_default(unique)
]
interface IHsmSession : IUnknown
{
    HRESULT Cancel([in] HSM_JOB_PHASE phase);  
    HRESULT EnumPhases([out] IWsbEnum** ppEnum);
    HRESULT EnumTotals([out] IWsbEnum** ppEnum);
    HRESULT GetAdviseInterval([out] LONGLONG* pFiletimeTicks);
    HRESULT GetHsmId([out] GUID* pId);
    HRESULT GetIdentifier([out] GUID* pId);
    HRESULT GetJob([out] IHsmJob** ppJob);
    HRESULT GetName([in, out, string] OLECHAR** pName, [in] ULONG bufferSize);
    HRESULT GetResource([out] IFsaResource** ppResource);
    HRESULT GetRunId([out] ULONG* pId);
    HRESULT GetSubRunId([out] ULONG* pId);
	HRESULT IsCanceling(void);
    HRESULT Pause([in] HSM_JOB_PHASE phase);  
    HRESULT ProcessEvent([in] HSM_JOB_PHASE phase, [in] HSM_JOB_EVENT event);
    HRESULT ProcessHr([in] HSM_JOB_PHASE phase, [in, string] CHAR* file, [in] ULONG line, [in] HRESULT hr);
    HRESULT ProcessItem([in] HSM_JOB_PHASE phase, [in] HSM_JOB_ACTION action, [in] IFsaScanItem* pScanItem, [in] HRESULT hrItem);  
    HRESULT ProcessMediaState([in] HSM_JOB_PHASE phase, [in] HSM_JOB_MEDIA_STATE state, [in, string] OLECHAR* mediaName, [in] HSM_JOB_MEDIA_TYPE mediaType, [in] ULONG time);
    HRESULT ProcessPriority([in] HSM_JOB_PHASE phase, [in] HSM_JOB_PRIORITY priority);
    HRESULT ProcessState([in] HSM_JOB_PHASE phase, [in] HSM_JOB_STATE state, [in, string] OLECHAR* currentPath, [in] BOOL bLog);
    HRESULT ProcessString([in] HSM_JOB_PHASE phase, [in, string] OLECHAR* string);
    HRESULT Resume([in] HSM_JOB_PHASE phase);  
    HRESULT SetAdviseInterval([in] LONGLONG filetimeTicks);
    HRESULT Start([in, string] OLECHAR* name, [in] ULONG logControl, [in] GUID hsmId, [in] IHsmJob* pJob, [in] IFsaResource* pResource, [in] ULONG runId, [in] ULONG subRunId);  
    HRESULT Suspend([in] HSM_JOB_PHASE phase);  
};


[
    object,
    uuid(F1AAA4E0-8385-11d0-81E4-00A0C91180F2),
    helpstring("IHsmSessionSinkEveryEvent Interface"),
    pointer_default(unique)
]
interface IHsmSessionSinkEveryEvent : IUnknown
{
    HRESULT ProcessSessionEvent([in] IHsmSession* pSession, [in] HSM_JOB_PHASE phase, [in] HSM_JOB_EVENT event);
};


[
    object,
    uuid(BEA60F85-7EBA-11d0-81E4-00A0C91180F2),
    helpstring("IHsmSessionSinkEveryItem Interface"),
    pointer_default(unique)
]
interface IHsmSessionSinkEveryItem : IUnknown
{
    HRESULT ProcessSessionItem([in] IHsmSession* pSession, [in] IHsmPhase* pPhase, [in] IFsaScanItem* pScanItem, [in] HRESULT hrItem, [in] IHsmSessionTotals* pSessionTotals);
};


[
    object,
    uuid(D5450542-A6C2-11d0-81E7-00A0C91180F2),
    helpstring("IHsmSessionSinkEveryMediaState Interface"),
    pointer_default(unique)
]
interface IHsmSessionSinkEveryMediaState : IUnknown
{
    HRESULT ProcessSessionMediaState([in] IHsmSession* pSession, [in] IHsmPhase* pPhase, [in] HSM_JOB_MEDIA_STATE state, [in, string] OLECHAR* mediaName, [in] HSM_JOB_MEDIA_TYPE mediaType, [in] ULONG time);
};


[
    object,
    uuid(D5450543-A6C2-11d0-81E7-00A0C91180F2),
    helpstring("IHsmSessionSinkEveryPriority Interface"),
    pointer_default(unique)
]
interface IHsmSessionSinkEveryPriority : IUnknown
{
    HRESULT ProcessSessionPriority([in] IHsmSession* pSession, [in] IHsmPhase* pPhase);
};


[
    object,
    uuid(BEA60F87-7EBA-11d0-81E4-00A0C91180F2),
    helpstring("IHsmSessionSinkEveryState Interface"),
    pointer_default(unique)
]
interface IHsmSessionSinkEveryState : IUnknown
{
    HRESULT ProcessSessionState([in] IHsmSession* pSession, [in] IHsmPhase* pPhase, [in, string] OLECHAR* currentPath);
};


[
    object,
    uuid(BEA60F88-7EBA-11d0-81E4-00A0C91180F2),
    helpstring("IHsmSessionSinkSomeItems Interface"),
    pointer_default(unique)
]
interface IHsmSessionSinkSomeItems : IUnknown
{
    HRESULT ProcessSessionItem([in] IHsmSession* pSession, [in] IHsmPhase* pPhase, [in] IFsaScanItem* pScanItem, [in] HRESULT hrItem, [in] IHsmSessionTotals* pSessionTotals);
};


[
    object,
    uuid(35035913-0D1C-11d2-9B0C-00104B9A2869),
    helpstring("IHsmSessionTotals Interface"),
    pointer_default(unique)
]
interface IHsmSessionTotals : IUnknown
{
    HRESULT Clone([out] IHsmSessionTotals** ppSessionTotals);
    HRESULT CopyTo([in] IHsmSessionTotals* pSessionTotals);
    HRESULT CompareToAction([in] HSM_JOB_ACTION action, [out] SHORT* pResult);
    HRESULT CompareToISessionTotals([in] IHsmSessionTotals* pTotals, [out] SHORT* pResult);
    HRESULT GetAction([out] HSM_JOB_ACTION* pAction);
    HRESULT GetName([in, out, string] OLECHAR** pName, [in] ULONG bufferSize);
    HRESULT GetStats([out] LONGLONG* items, [out] LONGLONG* size, [out] LONGLONG* skippedItems, [out] LONGLONG* skippedSize, [out] LONGLONG* errorItems, [out] LONGLONG* errorSize);
};


