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

#include <IPreflightUtils.h>

Inheritance diagram for IPreflightUtils:
IPMUnknown

Classes

class  AutoShapeGroup
 

Public Types

enum  { kDefaultIID = IID_IPREFLIGHTUTILS }
 

Public Member Functions

virtual IPreflightManagerQueryPreflightManager () const =0
 
virtual IPreflightObjectModelQueryObjectModel () const =0
 
virtual IPreflightRuleManagerQueryRuleManager () const =0
 
virtual IPreflightProcessManagerQueryProcessManager () const =0
 
virtual IPreflightProfileManagerQueryProfileManager (IDocument *iDoc) const =0
 
virtual IPreflightProfileManagerQueryProfileManager (IDataBase *iDataBase) const =0
 
virtual ISubjectQueryAppMessageSubject () const =0
 
virtual ISubjectQueryDocumentSubject (IDataBase *iDB) const =0
 
virtual IPreflightOptionsQueryPreflightOptions (IDataBase *iDB) const =0
 
virtual IPreflightProcessQueryProcessForDocument (IDataBase *iDocDB) const =0
 
virtual void ApplyOptionsToDocument (IDataBase *iDocDB, const IPreflightOptions *iNewOptions) const =0
 
virtual IPreflightProfileQueryEmbeddedProfile (IDataBase *iDocDB) const =0
 
virtual IPreflightProfileQueryWorkingProfile () const =0
 
virtual IPreflightProfileQueryDefaultProfile () const =0
 
virtual void BeginShapeGroup (IGraphicsPort *iPort, UID itemUID, ClassID subpartID) const =0
 
virtual void EndShapeGroup (IGraphicsPort *iPort, UID itemUID, ClassID subpartID) const =0
 
virtual bool SelectPageItem (const UIDRef &itemRef) const =0
 
virtual PMString GetPageDescription (IShape *iPageShape) const =0
 
virtual PMString GetSpreadDescription (ISpread *iSpread) const =0
 
virtual ErrorCode NewProfile (IDataBase *iTargetDB, const PMString &profileName, const PMString &profileDesc, bool prepopulateRules, UID *pNewProfileUID)=0
 
virtual ErrorCode CopyProfileData (const UIDRef &dstProfileRef, const IPreflightProfile *iSrcProfile)=0
 
virtual ErrorCode SetProfileStrings (const UIDRef &dstProfileRef, bool setName, const PMString &newName, bool setDesc, const PMString &newDesc)=0
 
virtual const
IPreflightBookOptions
QueryBookOptions (IDataBase *iBookDB) const =0
 
virtual const
IPreflightBookOptions
QueryActiveBookOptions (IDataBase *iBookDB) const =0
 
virtual IPreflightBookOptionsCloneBookOptions (const IPreflightBookOptions *iSrc=nil) const =0
 
virtual ErrorCode SetPreflightBookOptions (IDataBase *iBookDB, const IPreflightBookOptions *iOptions)=0
 
virtual ErrorCode SetActivePreflightBookOptions (IDataBase *iBookDB, const IPreflightBookOptions *iOptions)=0
 
virtual const IPreflightOptionsQueryOptions (IDataBase *iDocumentDB) const =0
 
virtual IPreflightOptionsCloneOptions (const IPreflightOptions *iSrc=nil) const =0
 
virtual ErrorCode UpdateActivePreflightOptions (IDataBase *iDataBase, const IPreflightOptions *iOptions)=0
 
virtual ErrorCode SetPreflightOptions (IDataBase *iDataBase, const IPreflightOptions *iOptions)=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

General (application-wide) preflight utilities. Note that there are other utility files such as IPreflightProfileUtils which address specific kinds of objects.

You normally get one of these via

Utils<IPreflightUtils> iPreflightUtils;

or if you just need a one-off call:

Utils<IPreflightUtils()->QueryPreflightManager();

Member Function Documentation

virtual void IPreflightUtils::ApplyOptionsToDocument (IDataBaseiDocDB,
const IPreflightOptionsiNewOptions 
) const
pure virtual

Apply the given options to the document. This is a bit different from simply copying the options: The method analyzes the current and new options and determines what changes if any need to be made to the active processes. For example if the new setting is preflight-off and there is an active preflight process, that process is removed; if the profile name and/or embeddedness changes the process is modified accordingly.

In addition to the above the method also copies all of the options to the doc's preflight settings, but not via a command.

Parameters
iDocDBIN The doucment you want to apply the settings to.
iNewOptionsIN The new options to apply.
skipDeltaAnalysisIN True to not consider the current settings (other than reusing an existing process) but rather impose the new ones as if the old ones were in a not-necessarily accurate state. This should only be passed when setting up options for a newly opened document, because otherwise the current status should be up to date.
virtual void IPreflightUtils::BeginShapeGroup (IGraphicsPortiPort,
UID itemUID,
ClassID subpartID 
) const
pure virtual

Start a group in the port that marks the scope of a part of an item (eg stroke, fill).

Parameters
iPortIN The port into which to begin the group.
itemUIDIN The UID of the shape object.
subpartIDIN The subpart identifier.
virtual IPreflightBookOptions* IPreflightUtils::CloneBookOptions (const IPreflightBookOptionsiSrc = nil) const
pure virtual

This is a utility method designed to compliment SetPreflightBookOptions. If you want to change the options for a book, you can first make a copy of them using this method, modify the copy, and set it in via SetPreflightBookOptions. Or, if you want to specify all of the settings you can pass nil for the iSrc and you'll get a fully default set of options.

Parameters
iSrcIN The source interface to copy from, or nil to create a fully default set.
Returns
A refcounted in-memory (nonpersistent) options interface. When this is fully dereferenced, it simply disappears.
virtual IPreflightOptions* IPreflightUtils::CloneOptions (const IPreflightOptionsiSrc = nil) const
pure virtual

This is a utility method designed to compliment UpdateActivePreflightOptions and SetPreflightOptions. If you want to change the options for a document, you can first make a copy of them using this method, modify the copy, and set it in via UpdateActivePreflightOptions or SetPreflightOptions. Or, if you want to specify all of the settings you can pass nil for the iSrc and you'll get a fully default set of options.

Parameters
iSrcIN The source interface to copy from, or nil to create a fully default set.
Returns
A refcounted in-memory (nonpersistent) options interface. When this is fully dereferenced, it simply disappears.
virtual ErrorCode IPreflightUtils::CopyProfileData (const UIDRefdstProfileRef,
const IPreflightProfileiSrcProfile 
)
pure virtual

Update one profile by copying all parameters from another profile. This includes everything that is a property of a profile: name, description, the list of rules and their settings, and so on. It does not change the relationship of the destination profile to its parent profile manager (if any).

The source profile doesn't need to be in a database, but the destination does since this is a command based method. (The data is copied from the source profile into the command, which is why the source profile can be memory-based.) The use of UIDRef for the destination profile is meant to reinforce this restriction.

See Also
IPreflightProfileUtils::CopyProfileData for a utility that can be used to copy data to an in-memory profile (of course this is not done through a command).
Parameters
dstProfileRefis the UIDRef of the destination profile to which parameters will be copied.
iSrcProfileis the source profile from which parameters will be copied. This profile can be in memory or in a database.
Returns
kSuccess or an error code from the command.
virtual void IPreflightUtils::EndShapeGroup (IGraphicsPortiPort,
UID itemUID,
ClassID subpartID 
) const
pure virtual

End a group in the port that marks the scope of a part of an item (eg stroke, fill).

Parameters
iPortIN The port into which to begin the group.
itemUIDIN The UID of the shape object.
subpartIDIN The subpart identifier.
virtual PMString IPreflightUtils::GetPageDescription (IShapeiPageShape) const
pure virtual

Gets a description of a page (eg "1" for page 1) via IPageList.

Parameters
iPageShapeIN The page shape.
Returns
A string for the description.
virtual PMString IPreflightUtils::GetSpreadDescription (ISpreadiSpread) const
pure virtual

Gets a description of a spread (eg "2-3" for spread 2/3) via IPageList.

Parameters
iSpreadIN The spread.
Returns
A string for the description.
virtual ErrorCode IPreflightUtils::NewProfile (IDataBaseiTargetDB,
const PMStringprofileName,
const PMStringprofileDesc,
bool prepopulateRules,
UIDpNewProfileUID 
)
pure virtual

Get the bounding box of the pages of the spread. This function duplicates exactly: r = iSpread->GetPagesBounds( coordSpace) Use that instead.

Parameters
iSpreadIN The spread you're interested in.
coordSpaceIN The space you want the coords in.
rOUT Receives the bounding box.Create a new preflight profile in the specified database. This differs from the one in IPreflightFacade in that this method takes a target database.
iTargetDBIN the database to create the profile in.
profileNameIN The name to use for the new profile.
See Also
IPreflightProfileManager::GetUniqueProfileName to ensure a unique name.
Parameters
profileDescIN The longer description of the profile.
prepopulateRulesIN kTrue if you want to prepopulate the rule list for the new profile with all rules registered with the rule manager; the rules will be disabled but present with default settings. If kFalse, the profile will not have any rules and will need to be added 'manually.'
newProfileUIDreceives the UID of new profile. If profile is not created, kInvalidUID is returned.
Returns
kSuccess or an error code from the command.
virtual const IPreflightBookOptions* IPreflightUtils::QueryActiveBookOptions (IDataBaseiBookDB) const
pure virtual

Given a book database, obtain its active book options, if there are any. The active book options are those assigned to the active book preflight. These represent a (possibly modified) version of those that exist at the book level (

See Also
QueryBookOptions). Will be nil if there is no active preflight on the book.
Parameters
iBookDBIN The database corresponding to the book.
Returns
A refcounted book options interface.
virtual ISubject* IPreflightUtils::QueryAppMessageSubject () const
pure virtual

Obtain the global preflight nonpersistent subject, ie changes that are messages rather than model changes. The following interfaces/messages broadcast on this subject.

IID_IPREFLIGHTPROCESSMANAGER:

    kPreflightProcessUpdateMsg - Something about a process changed

    kPreflightProcessListChangedMsg - The list of processes changed

IID_IPREFLIGHTEVENTWATCHER

    kPreflightEventAppResume - Application gained focus

Returns
The refcounted ISubject interface, or nil if unsuccessful.
virtual const IPreflightBookOptions* IPreflightUtils::QueryBookOptions (IDataBaseiBookDB) const
pure virtual

Given a book database, obtain its persistent book options. Returned interface is const to reflect the fact that one should not change it except via a command (ie SetPreflightBookOptions). These options are the ones that populate the book preflight options dialog by default.

Parameters
iBookDBIN The database corresponding to the book.
Returns
A refcounted book options interface.
virtual IPreflightProfile* IPreflightUtils::QueryDefaultProfile () const
pure virtual

Get the application-level default profile. This is the one called "Default Profile". This method simply asks the application profile manager to get the profile with that name and return it.

Returns
A refcounted interface. Should be nil iff an error occurs.
virtual ISubject* IPreflightUtils::QueryDocumentSubject (IDataBaseiDB) const
pure virtual

Obtain the preflight document-level (or app-level) subject related to persistent data. This subject hosts the following interested-in interfaces: IID_IPREFLIGHTPROFILEMANAGER (changes to the profile list) IID_IPREFLIGHTPROFILE (changes to individual profile) IID_IPREFLIGHTOPTIONS (changes to the preflight options) IID_IPREFLIGHTSETTINGSCHANGEINFO (app only;

See Also
IPreflightSettingsChangeInfo)
Parameters
iDBThe database of the document, or nil to query the app-level subject.
Returns
The refcounted ISubject interface, or nil if unsuccessful.
virtual IPreflightProfile* IPreflightUtils::QueryEmbeddedProfile (IDataBaseiDocDB) const
pure virtual

Get the document's embedded profile, if any. Currently this is just the 0th entry in the document's profile manager list, because a document either has zero or one profile. But in the future this might be more elaborate, with multiple embedded profiles possible; thus this utility method.

Parameters
iDocDBIN The doc you want the profile for.
Returns
A refcounted interface, or nil if the document has no embedded profile.
virtual IPreflightObjectModel* IPreflightUtils::QueryObjectModel () const
pure virtual

Obtain the application-wide object model information interface.

Returns
The refcounted interface.
virtual const IPreflightOptions* IPreflightUtils::QueryOptions (IDataBaseiDocumentDB) const
pure virtual

Given a document or application database, obtain its active options. Returned interface is const to reflect the fact that one should not change it except via a command (ie UpdateActivePreflightOptions).

Parameters
iDocumentDBIN The database corresponding to the document. If nil, this obtains the options defined at the application level.
Returns
A refcounted preflight options interface.
virtual IPreflightManager* IPreflightUtils::QueryPreflightManager () const
pure virtual

Obtain the application-wide preflight manager interface.

Returns
The refcounted interface.
virtual IPreflightOptions* IPreflightUtils::QueryPreflightOptions (IDataBaseiDB) const
pure virtual

Obtain the preflight options for the specified database.

Parameters
iDataBaseIN The database to use; or if nil, the application-level preflight options is returned.
Returns
The refcounted preflight options interface, or nil if unsuccessful.
virtual IPreflightProcess* IPreflightUtils::QueryProcessForDocument (IDataBaseiDocDB) const
pure virtual

Given a document, look for an active preflight process and return it. Note that this ONLY finds processes that use the kPreflightContinuousProcessSelectorID selector.

Parameters
iDocDBIN The document in which you're interested.
Returns
A refcounted preflight process, or nil if there is no active process.
virtual IPreflightProcessManager* IPreflightUtils::QueryProcessManager () const
pure virtual

Obtain the application-wide process manager interface.

Returns
The refcounted interface.
virtual IPreflightProfileManager* IPreflightUtils::QueryProfileManager (IDocumentiDoc) const
pure virtual

Obtain the preflight profile manager for the application-level or document-level profiles.

Parameters
iDocIN The document to use; or if nil, the application-level manager is returned.
Returns
The refcounted preflight manager interface, or nil if unsuccessful.
virtual IPreflightProfileManager* IPreflightUtils::QueryProfileManager (IDataBaseiDataBase) const
pure virtual

Obtain the preflight profile manager for the application-level or document-level profiles. This version takes a database pointer and will automatically query the document from there. (Unless the passed-in pointer is nil, in which case it will always get application-level.)

Parameters
iDataBaseIN The database to use; or if nil, the application-level manager is returned.
Returns
The refcounted preflight manager interface, or nil if unsuccessful.
virtual IPreflightRuleManager* IPreflightUtils::QueryRuleManager () const
pure virtual

Obtain the application-wide rule manager interface.

Returns
The refcounted interface.
virtual IPreflightProfile* IPreflightUtils::QueryWorkingProfile () const
pure virtual

Get the application-level working profile. Note that this may or may not match the default profile, ie the undeletable one called "Default".

Returns
A refcounted interface. Should be nil iff an error occurs.
virtual bool IPreflightUtils::SelectPageItem (const UIDRefitemRef) const
pure virtual

Selects the page item. This should probably be in some other util, but..

Parameters
itemRefIN The UIDRef of the item to select.
Returns
True if successful, false otherwise.
virtual ErrorCode IPreflightUtils::SetActivePreflightBookOptions (IDataBaseiBookDB,
const IPreflightBookOptionsiOptions 
)
pure virtual

Set the active preflight options for a book. There must be an active preflight on the book for this to be successful. Note that changing the active options will potentially invalidate results for the book preflight since those results were based on the previous set of options.

Parameters
iBookDBIN The database corresponding to the book.
iPreflightOptionsis the new option to set.
Returns
kSuccess or kFailure.
virtual ErrorCode IPreflightUtils::SetPreflightBookOptions (IDataBaseiBookDB,
const IPreflightBookOptionsiOptions 
)
pure virtual

Set the preflight options for a given book via command.

Parameters
iBookDBIN The database corresponding to the book.
iPreflightOptionsis the new option to set.
Returns
kSuccess or an error code from the command.
virtual ErrorCode IPreflightUtils::SetPreflightOptions (IDataBaseiDataBase,
const IPreflightOptionsiOptions 
)
pure virtual

Set preflight options either in the application default or in the document.

See Also
CloneOptions
QueryOptions
Parameters
iDataBasespecifies either the application default or the document database.
iPreflightOptionsis the new option to set.
Returns
kSuccess or an error code from the command.
virtual ErrorCode IPreflightUtils::SetProfileStrings (const UIDRefdstProfileRef,
bool setName,
const PMStringnewName,
bool setDesc,
const PMStringnewDesc 
)
pure virtual

Set the name and/or description of a preflight profile.

Parameters
dstProfileRefis the UIDRef of the destination profile.
setNameIN True to set the name; false to leave it alone.
newnameIN The new name (if setName is true).
setDescIN True to set the description; false to leave it alone.
newDescIN The new descriptino (if setDesc is true).
Returns
kSuccess or an error code from the command.
virtual ErrorCode IPreflightUtils::UpdateActivePreflightOptions (IDataBaseiDataBase,
const IPreflightOptionsiOptions 
)
pure virtual

Update the active preflight options for a given database. The active preflight options are not persistent and the command is not undoable.

See Also
CloneOptions
QueryOptions
Parameters
iDataBaseis the database for the options.
iOptionsis the new option to set.
Returns
kSuccess or an error code.