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

#include <IPreflightManager.h>

Inheritance diagram for IPreflightManager:
IPMUnknown

Public Types

enum  { kDefaultIID = IID_IPREFLIGHTMANAGER }
 
enum  NewOpenMode { kNewOpenOff, kNewOpenNormal, kNewOpenBook }
 

Public Member Functions

virtual void Startup ()=0
 
virtual void Shutdown ()=0
 
virtual IPreflightProfileManagerQueryProfileManager (IDocument *iDoc) const =0
 
virtual IPreflightProfileManagerQueryProfileManager (IDataBase *db) const =0
 
virtual IPreflightObjectModelQueryObjectModel () const =0
 
virtual IPreflightProcessManagerQueryProcessManager () const =0
 
virtual IPreflightRuleManagerQueryRuleManager () const =0
 
virtual PreflightDocumentID GetDocumentID (const IDocument *iDoc) const =0
 
virtual PreflightDocumentID GetDocumentID (const IDataBase *iDB) const =0
 
virtual IDocumentQueryDocument (PreflightDocumentID docID, bool forceLoadDocument=kFalse) const =0
 
virtual IDataBaseGetDataBase (PreflightDocumentID docID, bool forceLoad=kFalse) const =0
 
virtual IDFile GetFile (PreflightDocumentID docID) const =0
 
virtual void SetNewOpenMode (NewOpenMode newMode)=0
 
virtual NewOpenMode GetNewOpenMode () const =0
 
virtual void OnOpenDocument (IDocument *iDoc)=0
 
virtual void OnOpenDocumentFromBook (IDocument *iDoc)=0
 
virtual void OnNewDocument (IDocument *iDoc)=0
 
virtual void OnSaveDocument (IDocument *iDoc)=0
 
virtual void OnSaveAsDocument (IDocument *iDoc)=0
 
virtual void OnCloseDocument (IDocument *iDoc)=0
 
virtual void OnCloseBook (IBook *iBook)=0
 
virtual void OnSettingsChange (const IPreflightSettingsChangeInfo *iInfo)=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 manager is the "top level" interface for everything related to preflight. It sits on the session, or you can get to it more safely by

InterfacePtr<IPreflightManager> iMgr(Utils<IPreflightUtils>()->QueryPreflightManager());

Mostly it (a) serves up other interesting interfaces, (b) implements a document/DB/file map for relating results to a particular document (even if that document has been closed), and (c) implements various bottlenecks related to document open/close/save/etc to maintain that map.

Member Enumeration Documentation

Enumerator
kNewOpenOff 

Disable all open/new behaviors.

kNewOpenNormal 

Apply normal behaviors, according to application default preferences.

kNewOpenBook 

Apply behaviors appropriate for opening a document from a book command. If the book is in preflight mode we inherit the book's preflight settings, not the standard ones.

Member Function Documentation

virtual IDataBase* IPreflightManager::GetDataBase (PreflightDocumentID docID,
bool forceLoad = kFalse 
) const
pure virtual

Given a document ID, obtain an IDataBase for it, optionally forcing the document to be reopened if it's not in memory.

Parameters
docIDIN The ID of the document you need access to.
Returns
A NON-refcounted IDataBase interface, or nil if the document is not in memory or the ID is invalid.
virtual PreflightDocumentID IPreflightManager::GetDocumentID (const IDocumentiDoc) const
pure virtual

Document ID database. There will be cases, in particular for book preflight, where we are going to need to record results for documents that are not open at the moment. So we can't just record a database with the preflight objects; we need some way of remembering which database/document an object was associated with so we can reopen it later (and/or associate it with a re-opened document). Thus this simple database, which just accumulates a list of the documents we visit. As observers note new, opened, and saved documents, this database is updated automatically.Given a document in memory, obtain its corresponding ID.

Note
This is a TEMPORARY ID useful only during the current application launch. The ID will track the document even if it is closed and reopened later, as long as the file name hasn't changed in the meantime.
Parameters
iDocIN The document you're interested in.
Returns
The ID of the corresponding document.
virtual PreflightDocumentID IPreflightManager::GetDocumentID (const IDataBaseiDB) const
pure virtual

Given a document database in memory, obtain its corresponding ID.

Note
This is a TEMPORARY ID useful only during the current application launch. The ID will track the document even if it is closed and reopened later, as long as the file name hasn't changed in the meantime.
Parameters
iDBIN The database of the document you're interested in.
Returns
The ID of the corresponding document.
virtual IDFile IPreflightManager::GetFile (PreflightDocumentID docID) const
pure virtual

Given a document ID, obtain a path to it, whether or not the document is currently open.

Note
New documents that have not been saved will not have a path.
Parameters
docIDIN The ID of the document you need access to.
Returns
The file.
virtual NewOpenMode IPreflightManager::GetNewOpenMode () const
pure virtual

Set the behavior that should apply for new/open commands.

Returns
The mode.
virtual void IPreflightManager::OnCloseBook (IBookiBook)
pure virtual

Called when a book is closed. If there's an active preflight on the book then we need to notify all the affected processes.

Parameters
iDocThe document being closed.
virtual void IPreflightManager::OnCloseDocument (IDocumentiDoc)
pure virtual

Called when a document is opened, as determined by a document list observer. In general you shouldn't need to call this. The manager responds by removing any observers, updating the document database, and deleting anything that might reference the document, such as processes, tasks, and caches. It also notifies all of the object model services in case they have any caches that need to be flushed.

Parameters
iDocThe document being closed.
virtual void IPreflightManager::OnNewDocument (IDocumentiDoc)
pure virtual

Called when a document is opened, as determined by a document list observer. In general you shouldn't need to call this. The manager responds by creating a preflight process if applicable; it also updates the document database (see above).

Parameters
iDocThe document just opened.
virtual void IPreflightManager::OnOpenDocument (IDocumentiDoc)
pure virtual

Called when a document is opened, as determined by a document list observer. In general you shouldn't need to call this. The manager responds by determining what action should be taken, such as automatically creating a preflight process.

Parameters
iDocThe document just opened.
virtual void IPreflightManager::OnOpenDocumentFromBook (IDocumentiDoc)
pure virtual

Called when a document is opened via the book panel, as determined by a document list observer. In general you shouldn't need to call this. The manager responds by configuring preflight for the document if the book has an active preflight configured.

Parameters
iDocThe document just opened.
virtual void IPreflightManager::OnSaveAsDocument (IDocumentiDoc)
pure virtual

Called when a document is saved-as, as determined by a document list observer. In general you shouldn't need to call this. The manager responds by updating its internal document database (see above).

Parameters
iDocThe document saved.
virtual void IPreflightManager::OnSaveDocument (IDocumentiDoc)
pure virtual

Called when a document is saved, as determined by a document list observer. In general you shouldn't need to call this. Currently the manager doesn't do anything but it may in the future.

Parameters
iDocThe document saved.
virtual void IPreflightManager::OnSettingsChange (const IPreflightSettingsChangeInfo * iInfo)
pure virtual

Called when a settings change is broadcast on the global settings-change digest subject. This information is then distributed to the managers that might want to respond.

Parameters
iInfoIN The settings change info.
virtual IDocument* IPreflightManager::QueryDocument (PreflightDocumentID docID,
bool forceLoadDocument = kFalse 
) const
pure virtual

Given a document ID, obtain an IDocument for it, optionally forcing the document to be reopened if it's not in memory.

Parameters
docIDIN The ID of the document you need access to.
Returns
A refcounted IDocument interface, or nil if the document is not in memory or the ID is invalid.
virtual IPreflightObjectModel* IPreflightManager::QueryObjectModel () const
pure virtual

Get the object model (a singleton for now). The preflight object model is responsible for building parallel versions of the document for preflight purposes.

Returns
A refcounted preflight object model interface. This should never fail except in truly dire circumstances.
virtual IPreflightProcessManager* IPreflightManager::QueryProcessManager () const
pure virtual

Get the process manager (a singleton for now). The process manager maintains the list of active preflight processes (document inspections).

Returns
A refcounted IPreflightProcessManager interface. This should never fail except in truly dire circumstances.
virtual IPreflightProfileManager* IPreflightManager::QueryProfileManager (IDocumentiDoc) const
pure virtual

Obtain a profile manager for the provided document. The profile manager maintains the list of profiles in the document (or application defaults if iDoc is nil).

Parameters
iDocIN The document you're interested in, or nil for the application defaults.
Returns
A refcounted preflight profile manager interface or nil if there was a problem.
virtual IPreflightProfileManager* IPreflightManager::QueryProfileManager (IDataBasedb) const
pure virtual

Obtain a profile manager for the provided database. The profile manager maintains the list of profiles in the document (or application defaults if db is nil).

Parameters
dbIN The database you're interested in, or nil for the application defaults.
Returns
A refcounted preflight profile manager interface or nil if there was a problem.
virtual IPreflightRuleManager* IPreflightManager::QueryRuleManager () const
pure virtual

Get the rule manager (a singleton for now). The rule manager maintains the rule ID to service mapping along with anything we care to cache about rules.

Returns
A refcounted IPreflightProcessManager interface. This should never fail except in truly dire circumstances.
virtual void IPreflightManager::SetNewOpenMode (NewOpenMode newMode)
pure virtual

Set the behavior that should apply for new/open commands. This defaults to kNewOpenNormal and shouldn't be changed except temporarily. Currently used by the book-doc open command to override the standard behaviors.

Parameters
newModeIN The new mode.
virtual void IPreflightManager::Shutdown ()
pure virtual

Called by the global startup/shutdown mechanism; you should never need to call this.

virtual void IPreflightManager::Startup ()
pure virtual

Called by the global startup/shutdown mechanism; you should never need to call this.