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

#include <IPreflightProcessManager.h>

Inheritance diagram for IPreflightProcessManager:
IPMUnknown

Public Types

enum  { kDefaultIID = IID_IPREFLIGHTPROCESSMANAGER }
 

Public Member Functions

virtual void Startup ()=0
 
virtual void Shutdown ()=0
 
virtual void OnCloseDocument (IDocument *iDoc)=0
 
virtual void OnCloseBook (IBook *iBook)=0
 
virtual int32 GetProcessCount () const =0
 
virtual int32 GetActiveProcessCount () const =0
 
virtual IPreflightProcessQueryNthProcess (int32 n) const =0
 
virtual IPreflightProcessQueryProcessByUniqueID (uint32 uniqueID) const =0
 
virtual int32 FindProcess (IPreflightProcess *iProcess) const =0
 
virtual int32 FindProcess (uint32 uniqueID) const =0
 
virtual int32 FindProcess (ClassID selectorID, const PreflightDocumentID &docID) const =0
 
virtual bool GetProcessesForDocument (const IDocument *iDoc, K2Vector< int32 > *indices) const =0
 
virtual void RemoveNthProcess (int32 n)=0
 
virtual IPreflightProcessCreateProcess ()=0
 
virtual void AdvanceState (IdleTimer *timer, bool synchronous, uint32 *pNextCallback=nil)=0
 
virtual void AddTimeStandoff (double seconds, IDocument *iDoc=nil)=0
 
virtual void InvalidateObject (const PreflightObjectID &objID)=0
 
virtual void OnSettingsChange (const IPreflightSettingsChangeInfo *iInfo)=0
 
virtual uint32 NewProcessUniqueID ()=0
 
virtual uint32 NewProcessTaskUniqueID ()=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 preflight process manager keeps track of the active (and inactive) preflight processes. It sits on the session boss, but probably the best way is to get it from IPreflightManager or using IPreflightUtils::QueryProcessManager().

See Also
IPreflightManager
IPreflightUtils

Member Function Documentation

virtual void IPreflightProcessManager::AddTimeStandoff (double seconds,
IDocumentiDoc = nil 
)
pure virtual

This method adjusts the idle behavior to establish a "time standoff" window where the idle task will simple early-out (ie, exit without doing anything) until the time window is exhausted. This standoff is applied at key points, such as application switch-in (resume), new or open document, and invalidation, to avoid preflight being too aggressive. For example if you are nudging a page item or typing we don't want to jump in RIGHTAWAY and start checking again, as this can have a subtle effect on user responsiveness. Thus we wait a short while before resuming preflight.

Preflight maintains a per-document standoff and a global standoff. These are essentially wall-clock times when the "green light" comes on for a given document. A document must have its green light and the global green light to get preflight cycles.

Note that this standoff DOES NOT apply to synchronous preflight requests, ie AdvanceState when synchronous=true or timer=nil. It only applies to the idle/background preflight slices.

Parameters
secondsIN The number of seconds of standoff (from this moment) to wait before resuming preflight.
iDocIN The document to apply the standoff to, or nil to apply it globally (ie, it affects all documents).
virtual void IPreflightProcessManager::AdvanceState (IdleTimertimer,
bool synchronous,
uint32 * pNextCallback = nil 
)
pure virtual

Provide time for processes to work, normally during the idle callback.

Parameters
timerIN The timer function that lets the process manager know how much time remains. If nil, the process manager works until all tasks are completed, but that's kind of dangerous since no progress feedback is provided at this level.
synchronousIN Set this to true if you are calling this in a tight loop where (for example) the text composer will not be given any time to work; otherwise the process will never (or only extremely slowly) complete. When true, text composition will be forced synchronously prior to preflight expansion and visitation. Set this parameter to false if you're calling it from an idle loop where the text composer has a chance to operate efficiently.
pNextCallbackOUT If not nil, receives the number of milliseconds until the next desired callback, based on the priorities and states of all of the processes after it has distributed work to the list of processes.
virtual IPreflightProcess* IPreflightProcessManager::CreateProcess ()
pure virtual

Create a new process.

Parameters
docIDIN The document ID the process is bound to (
See Also
IPreflightManager)
Parameters
iOptionsIN The options to use for the process, or nil to leave them at ctor defaults.
iBookIN If not nil, the book this process is associated with.
Returns
A new process (with refcount = 2, one for being in the list, one for the caller).
virtual int32 IPreflightProcessManager::FindProcess (IPreflightProcessiProcess) const
pure virtual

Find a process in the list of processes.

Parameters
iProcessThe process you're looking for.
Returns
The index of the process in the list, or -1 if not found.
virtual int32 IPreflightProcessManager::FindProcess (uint32 uniqueID) const
pure virtual

Find a process in the list of processes by its unique ID.

Parameters
idThe ID of the process you're looking for.
Returns
The index of the process in the list, or -1 if not found.
virtual int32 IPreflightProcessManager::FindProcess (ClassID selectorID,
const PreflightDocumentID & docID 
) const
pure virtual

Find a process in the list of processes by its selector/database pair. These are used to 'tag' a process as important for a particular reason, such as the current profile for continuous preflight for a given document.

Parameters
selectorIDThe selector ID of the process you're looking for.
docIDThe document associated with the process.
Returns
The index of the process in the list, or -1 if not found.
virtual int32 IPreflightProcessManager::GetActiveProcessCount () const
pure virtual

Get the number of active processes (ie those with something to do).

Returns
Number of processes.
virtual int32 IPreflightProcessManager::GetProcessCount () const
pure virtual
Get the total number of processes, active and inactive.

Returns
Number of processes.
virtual bool IPreflightProcessManager::GetProcessesForDocument (const IDocumentiDoc,
K2Vector< int32 > * indices 
) const
pure virtual

Get the indices of the processes that are examining a particular document (if any). Can also be used to simply indicate whether there are any by passing nil for 'indices.'

Note
"Examining" simply means that there is a task with a root object that comes from the document. It doesn't matter what state the task is in.
Parameters
iDocIN The document you're interested in.
indicesOUT Receives the indices of the processes that are examining the document (note that these processes can also be examining other documents, if the tasks are set up that way). If nil, the only check is for the presence of an open process for the document (in the return value).
Returns
True if there are any processes examining the document.
virtual void IPreflightProcessManager::InvalidateObject (const PreflightObjectIDobjID)
pure virtual

Invalidation (this API will probably need to be more sophisticated eventually). This forwards the invalidation request to all applicable processes.

Parameters
objIDThe object needing invalidation.
virtual uint32 IPreflightProcessManager::NewProcessTaskUniqueID ()
pure virtual

Obtain a new process task unique ID.

virtual uint32 IPreflightProcessManager::NewProcessUniqueID ()
pure virtual

Obtain a new process unique ID.

virtual void IPreflightProcessManager::OnCloseBook (IBookiBook)
pure virtual

Called by the preflight manager; you shouldn't call this. Closes all the processes associated with the book preflight.

virtual void IPreflightProcessManager::OnCloseDocument (IDocumentiDoc)
pure virtual

Called by the preflight manager; you shouldn't call this. Deletes any processes that are still active on the document (if not preserved by being part of a book preflight).

virtual void IPreflightProcessManager::OnSettingsChange (const IPreflightSettingsChangeInfo * iInfo)
pure virtual

Change of settings, either at the app or doc levels. This is forwarded on to each process to determine whether that change affects that process.

Parameters
iInfoThe settings change info to respond to.
virtual IPreflightProcess* IPreflightProcessManager::QueryNthProcess (int32 n) const
pure virtual

Get a particular process for further inspection.

Parameters
nThe index of the process you're interested in, between 0 and GetProcessCont() - 1.
Returns
A refcounted interface to the preflight process.
virtual IPreflightProcess* IPreflightProcessManager::QueryProcessByUniqueID (uint32 uniqueID) const
pure virtual

Get a particular process for further inspection.

Parameters
uniqueIDThe unique ID of the process you're interested in.
Returns
A refcounted interface to the preflight process, or nil if the unique ID does not exist.
virtual void IPreflightProcessManager::RemoveNthProcess (int32 n)
pure virtual

Remove a process from the list. This dereferences the process, so if nobody else has a handle on it, it will delete the process. In any case, once the process manager doesn't know about the process, it won't get cycles via the master idle callback.

Parameters
nIN The index of the process you want to remove from the list.
virtual void IPreflightProcessManager::Shutdown ()
pure virtual

Called by the preflight manager at application shutdown; do not call.

virtual void IPreflightProcessManager::Startup ()
pure virtual

Called by the preflight manager at application startup; do not call.