#include <IPreflightProcessManager.h>
|
| enum | { kDefaultIID = IID_IPREFLIGHTPROCESSMANAGER } |
| |
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
| virtual void IPreflightProcessManager::AddTimeStandoff | ( | double | seconds, | | | IDocument * | iDoc = 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
| seconds | IN The number of seconds of standoff (from this moment) to wait before resuming preflight. |
| iDoc | IN The document to apply the standoff to, or nil to apply it globally (ie, it affects all documents). |
| virtual void IPreflightProcessManager::AdvanceState | ( | IdleTimer * | timer, | | | bool | synchronous, | | | uint32 * | pNextCallback = nil | | ) | | |
| pure virtual |
Provide time for processes to work, normally during the idle callback.
- Parameters
| timer | IN 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. |
| synchronous | IN 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. |
| pNextCallback | OUT 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. |
Create a new process.
- Parameters
| docID | IN The document ID the process is bound to ( |
- See Also
- IPreflightManager)
- Parameters
| iOptions | IN The options to use for the process, or nil to leave them at ctor defaults. |
| iBook | IN 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 | ( | IPreflightProcess * | iProcess | ) | const |
| pure virtual |
Find a process in the list of processes.
- Parameters
| iProcess | The 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
| id | The 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
| selectorID | The selector ID of the process you're looking for. |
| docID | The 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 IDocument * | iDoc, | | | 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
| iDoc | IN The document you're interested in. |
| indices | OUT 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 PreflightObjectID & | objID | ) | |
| pure virtual |
Invalidation (this API will probably need to be more sophisticated eventually). This forwards the invalidation request to all applicable processes.
- Parameters
| objID | The 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 | ( | IBook * | iBook | ) | |
| 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 | ( | IDocument * | iDoc | ) | |
| 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
| iInfo | The settings change info to respond to. |
Get a particular process for further inspection.
- Parameters
| n | The 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
| uniqueID | The 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
| n | IN 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.