InDesign SDK  20.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
IAssetMonitor Class Referenceabstract

#include <IAssetMonitor.h>

Inheritance diagram for IAssetMonitor:
IPMUnknown

Public Types

enum  { kDefaultIID = IID_IASSETMONITOR }
 

Public Member Functions

virtual bool16 AssetHasMoved (IManageableAsset *asset)=0
 
virtual bool16 StartUp ()=0
 
virtual bool16 ShutDown ()=0
 
virtual bool16 CanMonitor (const IDFile &file)=0
 
virtual bool16 CanMonitor (IManageableAsset *asset)=0
 
virtual ICommandGetHandleChangesCommand ()=0
 
virtual IManagedStatusGetNextPendingStatus ()=0
 
virtual bool16 IsStatusPending (IManageableAsset *asset)=0
 
virtual uint32 DoBackgroundTasks ()=0
 
virtual ErrorCode StartMonitoring (UIDRef assetRef)=0
 
virtual ErrorCode StopMonitoring (UIDRef assetRef)=0
 
virtual bool16 IsMonitoring (UIDRef assetRef)=0
 
- Public Member Functions inherited from IPMUnknown
virtual IPMUnknownQueryInterface (PMIID interfaceID) const =0
 
virtual void AddRef () const =0
 
virtual void Release () const =0
 

Detailed Description

The IAssetMonitor interface is responsible for monitoring status changes for assets. An asset monitor is enabled simply by returning its instance on the IAMSystemProvider::GetAssetMonitor() method. Each asset monitor is automatically called by the AssetMonitorIdleTask, which has a loop that calls two IAssetMonitor methods. The first call, to IAssetMonitor::GetHandleChangesCommand(), gets an ICommand to schedule for processing status changes. A command rather than a direct call is used in the event that a modal dialog is necessary for informing the end user of a status change (the idle loop should never be interrupted with a modal dialog). The second call, which is made to IAssetMonitor::DoBackgroundTasks(), gives the IAssetMonitor implementation time to perform non-UI status processing or other tasks.

Developer hint: the design details of the HandleChangesCommand is left up to the implementation; however, the command should have a processing loop that calls IAssetMonitor::GetNextPendingStatus() for the next IManagedStatus that needs processing. This is the technique used to process Version Cue status changes.

See Also
IAMSystemProvider.
IManagedStatus.

Member Function Documentation

virtual bool16 IAssetMonitor::AssetHasMoved (IManageableAssetasset)
pure virtual

This method tests if an asset has moved or has been renamed.

Parameters
assetis a valid pointer to a bound IManageableAsset instance.
Returns
kTrue if the asset has been moved or rename; kFalse otherwise.
virtual bool16 IAssetMonitor::CanMonitor (const IDFilefile)
pure virtual

This method tests if the asset monitor is able to monitor a file for status changes.

Parameters
fileis an IDFile with a path to an existing file.
Returns
kTrue if the file can be monitored; kFalse otherwise.
virtual bool16 IAssetMonitor::CanMonitor (IManageableAssetasset)
pure virtual

This method tests if the asset monitor is able to monitor an IManageableAsset for status changes.

Parameters
assetis a valid pointer to an IManageableAsset instance.
Returns
kTrue if the asset can be monitored; kFalse otherwise.
virtual uint32 IAssetMonitor::DoBackgroundTasks ()
pure virtual

This method is called from the idle task in order to give the asset monitor implementation processing time. This method should not display UI or otherwise interrupt the idle loop processing.

Returns
the callback interval (for future use).
See Also
IIdleTask::RunTask.
virtual ICommand* IAssetMonitor::GetHandleChangesCommand ()
pure virtual

This method provides an ICommand that can be scheduled to process asset status changes. May return nil if there are no pending changes to process. An ICommand should be used to process status changes if the status processing displays modal dialogs (such as for alerts).

Returns
a valid pointer to an ICommand object or nil if there are no changes to process.
virtual IManagedStatus* IAssetMonitor::GetNextPendingStatus ()
pure virtual

This method retrieves the next pending IManagedStatus instance to process.

Returns
a valid pointer to an IManagedStatus instance or nil if there are no remaining instances to process.
virtual bool16 IAssetMonitor::IsMonitoring (UIDRef assetRef)
pure virtual

This method tests if an asset is currently being monitored for status changes.

Parameters
assetRefis the UIDRef of a bound IManageableAsset.
Returns
kTrue if the asset is being monitored; kFalse otherwise.
virtual bool16 IAssetMonitor::IsStatusPending (IManageableAssetasset)
pure virtual

This method tests if an asset has a pending status that has not yet been processed. The StartWatching() method must be called for the asset before this method is called.

Parameters
assetis an IManageableAsset that is being monitored.
Returns
kTrue if the asset has unprocessed status pending; kFalse otherwise.
virtual bool16 IAssetMonitor::ShutDown ()
pure virtual

This method performs any termination needed after monitoring ends. This method is called once during app shutdown.

Returns
kTrue if shutdown succeeded; kFalse if there was an error.
virtual ErrorCode IAssetMonitor::StartMonitoring (UIDRef assetRef)
pure virtual

This method starts monitoring for status changes for an asset. Changes to IManagedStatus and IAMLockable states are typically monitored.

Parameters
assetRefis the UIDRef of a bound IManageableAsset.
Returns
kSuccess if monitoring the asset has started; otherwise returns a failure ErrorCode.
virtual bool16 IAssetMonitor::StartUp ()
pure virtual

This method does any initialization needed before monitoring begins. This method is called once during app startup.

Returns
kTrue if the asset monitor is OK for use; kFalse if it may not be used.
virtual ErrorCode IAssetMonitor::StopMonitoring (UIDRef assetRef)
pure virtual

This method stops monitoring for status changes for an asset.

Parameters
assetRefis the UIDRef of a bound IManageableAsset.
Returns
kSuccess if monitoring the asset has stopped; otherwise returns a failure ErrorCode.