![]() | InDesign SDK 20.5 |
#include <IPreflightFacade.h>

Public Types | |
| enum | { kDefaultIID = IID_IPREFLIGHTFACADE } |
Public Member Functions | |
| virtual void | TurnOnPreflighting (IDataBase *iTargetDB)=0 |
| virtual void | TurnOffPreflighting (IDataBase *iTargetDB)=0 |
| virtual bool16 | IsPreflightingOn (IDataBase *iTargetDB) const =0 |
| virtual void | SetEmbedProfileInNewDocuments (bool16 autoEmbed)=0 |
| virtual bool16 | GetEmbedProfileInNewDocuments (void) const =0 |
| virtual void | SetOpenDocumentPolicy (IPreflightOptions::PreflightProfilePolicy &profilePolicy)=0 |
| virtual IPreflightOptions::PreflightProfilePolicy | GetOpenDocumentPolicy (void) const =0 |
| virtual void | SetIncludeLayers (IDataBase *iTargetDB, const IPreflightOptions::LayerOptions whichLayer)=0 |
| virtual IPreflightOptions::LayerOptions | GetIncludeLayers (IDataBase *iTargetDB) const =0 |
| virtual void | SetIncludeObjectsOnPasteboard (IDataBase *iTargetDB, const bool16 onOff)=0 |
| virtual bool16 | GetIncludeObjectsOnPasteboard (IDataBase *) const =0 |
| virtual void | SetIncludeNonPrintingObjects (IDataBase *, const bool16 onOff)=0 |
| virtual bool16 | GetIncludeNonPrintingObjects (IDataBase *) const =0 |
| virtual void | SetPreflightScope (IDataBase *iTargetDB, const IPreflightOptions::PreflightScope &scope, PMString *pPageRange=nil)=0 |
| virtual IPreflightOptions::PreflightScope | GetPreflightScope (IDataBase *iTargetDB) const =0 |
| virtual void | GetPreflightScopePageRange (IDataBase *iTargetDB, PMString &pageRange) const =0 |
| virtual void | SetWorkingProfile (IDataBase *iTargetDB, const UIDRef &preflightProfile)=0 |
| virtual UIDRef | GetWorkingProfile (IDataBase *iTargetDB) const =0 |
| virtual ErrorCode | CreateProfile (const PMString &profileName, const PMString &profileDesc, bool prepopulateRules, UID *newProfileUID)=0 |
| virtual ErrorCode | DeleteProfile (const UIDRef &profileRef)=0 |
| virtual ErrorCode | DuplicateProfile (IDataBase *targetDB, const UIDRef &refSrcProfile, UID *newProfileUID)=0 |
| virtual ErrorCode | EmbedProfile (IDataBase *docDB, const UIDRef &refProfileToEmbed, UID *embeddedProfileUID)=0 |
| virtual ErrorCode | UnembedProfile (IDataBase *docDB, bool copyEmbeddedToApplication=kTrue)=0 |
| virtual ErrorCode | LoadPreflightProfileFromFile (const IDFile &sourceFile, UID *pNewProfileUID, bool16 showAlert)=0 |
| virtual ErrorCode | ExportPreflightProfileAsINX (const UIDRef &preflightProfile, const IDFile &exportFile)=0 |
| virtual void | GetAllProfiles (UIDList &profileList) const =0 |
| virtual void | GetProfileName (const UIDRef &preflightProfile, PMString &profileName) const =0 |
| virtual ErrorCode | SetProfileName (const UIDRef preflightProfile, const PMString &profileName)=0 |
| virtual void | GetProfileDescription (const UIDRef &preflightProfile, PMString &profileDesc) const =0 |
| virtual ErrorCode | SetProfileDescription (const UIDRef &preflightProfile, const PMString &profileDesc)=0 |
| virtual UID | GetRule (const UIDRef preflightProfile, const PreflightRuleID &ruleID) const =0 |
| virtual UID | GetNthRule (const UIDRef preflightProfile, int16 n) const =0 |
| virtual int32 | GetProfileRuleCount (const UIDRef preflightProfile) const =0 |
| virtual ErrorCode | RemoveAllRules (const UIDRef preflightProfile)=0 |
| virtual ErrorCode | UpdateEachRulesData (const UIDList &profiles)=0 |
| virtual ErrorCode | CreateRule (const UIDRef &preflightProfile, const PreflightRuleID &ruleID, UID *pNewRuleUID)=0 |
| virtual ErrorCode | DeleteRule (const UIDRef &rule)=0 |
| virtual void | GetAllCategories (K2Vector< PMString > &allCategories) const =0 |
| virtual void | GetRulesInCategory (const PMString &category, PreflightRuleIDVector &rules) const =0 |
| virtual PMString | GetRuleCategory (const UIDRef &rule) const =0 |
| virtual PreflightRuleID | GetRuleID (const UIDRef &rule) const =0 |
| virtual bool16 | IsRuleEnabled (const UIDRef &rule) const =0 |
| virtual ErrorCode | EnableRule (const UIDRef &rule, bool isEnabled)=0 |
| virtual PMString | GetRuleDescription (const UIDRef &rule) const =0 |
| virtual ErrorCode | SetRuleData (const UIDRef &rule, const IPreflightRuleData::Key &key, const ScriptData &value)=0 |
| virtual ErrorCode | GetRuleData (const UIDRef &rule, const IPreflightRuleData::Key &key, ScriptData &value, bool *pExist) const =0 |
| virtual bool16 | ArePreflightResultsAvailable (IDataBase *iTargetDB) const =0 |
| virtual void | GetPreflightResults (IDataBase *iTargetDB, ScriptListData &results) const =0 |
Public Member Functions inherited from IPMUnknown | |
| virtual IPMUnknown * | QueryInterface (PMIID interfaceID) const =0 |
| virtual void | AddRef () const =0 |
| virtual void | Release () const =0 |
This facade provides services for obtaining and modifying the preflight engine that is new to InDesign CS4. This preflight engine supports preflight profiles, extensible rule sets, and background (idle loop) as well as synchronous preflight.
Working from the top down, the important interfaces and objects in the preflight domain include the following.
Preflight profiles: These are bosses which represent a named set of rules and rule parameters. A list of these is maintained at the application and document levels by the IPreflightProfileManager interface.
Each preflight profile maintains a list of profile rules. These rules are bosses created by preflight rule services. InDesign has a native rule service boss which implements all the rules that ship with the application. Anyone can implement a rule service which extends the set of rules that work with the application.
The engine itself is governed by the application-level IPreflightProcessManager and each instance of a profile being cheked against a document is represented by an in-memory Preflight Process boss that hosts an IPreflightProcess interface.
The preflight process is basically a state machine with a database attached. The state machine uses the database to keep track of what parts of the document have been examined against the set of rules in its assigned profile, and what results if any were found during that traversal. Since preflight works in the background, changes to the document require selective invalidation of portions of the database and subsequent re-investigation of those portions.
The preflight process is actually governed by two inputs. The first is the preflight profile, which of course provides the rules and rule parameters. The second is the preflight options, which control the filtering of objects that the rules are shown.
Another core piece of the preflight feature is the preflight object model. This is the mechanism by which preflight rules can access information in the document including information that has no other API; it also allows preflight to maintain information about documents that aren't open at the moment; and it's extensible so that a developer can introduce its own hierarchy and objects. The preflight object model is implemented via a service and abstracted/multiplexed at the application level via IPreflightObjectModel.
Preflight also works at the book level. The IPreflightBookRef interface sits on the book and maintains a reference to an in-memory preflight book object. This object shadows the book's content and records the preflight results for each chapter. It also has an IPreflightBookController interface which drives the state machine of book preflight, which is not a background operation.
This facade doesn't attempt to cover everything above. In particular the extensible pieces, rule and object model services, are not represented here because they're well defined in their own interface headers. Instead this facade concentrates on the maintenance of preflight profiles, their rule settings, and getting/setting the parameters assigned to document preflight processes.
| pure virtual |
Preflight result related facade.Return true if the active preflight process for the specified database has completed and aggregated result are available.
| iTargetDB | is the database of the preflight process result. |
| pure virtual |
The Preflight profile facade methodsThis method does the following:
| profileName | IN The name to use for the new profile. |
| profileDesc | IN The longer description of the profile. |
| prepopulateRules | IN 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.' |
| newProfileUID | receives the UID of new profile. If profile is not created, kInvalidUID is returned. |
| pure virtual |
Create an instance of rule ID in the database
| preflightProfile | IN The target profile in which to create the rule. |
| ruleID | IN The rule to create. |
| pNewRuleUID | OUT If not nil, contains the new rule UID. |
| pure virtual |
Delete the specified profile. This removes the profile from its database's profile manager list and then deletes the UID of the profile and all rules.
| profileRef | is the profile to delete. |
| pure virtual |
Delete athe specified rule
| rule | IN The rule to delete. |
| pNewRuleUID | OUT If not nil, contains the new rule UID. |
| pure virtual |
Duplicate the specified profile in the specified target database (which can be the same database as the source profile). The name of the new profile is autogenerated via GetUniqueProfileName() using the source profile's name.
| targetDB | is the database in which the new profile should be created (and the corresponding IPreflightProfileManager that will receive the new profile). If nil, the new profile will be created in the default document (aka app). |
| srcProfileRef | is the UIDRef of the profile to duplicate. |
| newProfileUID | receives the UID of the duplicate (or kInvalidUID if error). This UID will be in the target DB. |
| pure virtual |
Embed a profile in a document. This creates a copy of an application level profile in a document, removing any existing document profile.
| docDB | is the target document database. |
| refProfileToEmbed | is the application-level profile to embed. |
| embeddedProfileUID | if not nil receives the resulting profile UID in the document. |
| pure virtual |
Enable or disable the specified rule.
| rule | IN The rule. |
| isEnabled | IN Enable the rule if true; otherwise disable the rule. |
| pure virtual |
Export a preflight profile as an InDesign preflight profile file.
| iProfile | is the preflight profile to export. |
| exportFile | is the IDFile to export to. |
| pure virtual |
Returns a list of rule categories supported
| allCategories | OUT The list of all categories |
| pure virtual |
Returns a list of all the profiles in the application profile list.
| profileList | Out The list containing the profiles.. |
| pure virtual |
| pure virtual |
| pure virtual |
| pure virtual |
| pure virtual |
Returns the nth rule UID in the given preflight profile.
| preflighProfile | IN The preflight profile. |
| n | IN The nth rule UID to get. |
| pure virtual |
| pure virtual |
Return the aggregated result for the active preflight process of the specified database
| iTargetDB | is the database of the preflight process result. |
| results | is aggregated results. The results are formated as key-value pairs: document name key (string) document name (string) profile name key (string) profile name (string) ResultEntryKey (string) list of string arrays entries for error nodes. |
Each of the string array describes an error node with the following:
| pure virtual |
Returns the preflight scope for the specified document database. If hte database is a application default database, the scope is always set to IPreflightOptions::kAllPages.
| iTargetDB | is the database. |
| pure virtual |
Returns the preflight scope's page range for the specified document database. If hte database is a application default database, the scope page range is always set to an empty string.
| iTargetDB | is the database. |
| pageRange | the current scope page range. |
| pure virtual |
Returns the profile description for the specified profile.
| profileRef | IN The UIDRef of the profile. |
| profileDesc | OUT The profile description of the specified preflight profile. |
| pure virtual |
Returns the profile name for the specified profile.
| profileRef | IN The UIDRef of the profile. |
| profileName | OUT The profile name of the specified preflight profile. |
| pure virtual |
Returns the number of rules in the given preflight profile.
| preflighProfile | IN The preflight profile. |
| pure virtual |
The Preflight profile rules facade methodsReturns the rule UID for the specified ruleID in the given preflight profile.
| preflighProfile | IN The preflight profile. |
| ruleID | IN The rule ID in the preflight profile. |
Returns the category for the specified rule.
| rule | IN The rule. |
| pure virtual |
Get rule data for the specified rule.
| rule | IN The rule. |
| key | IN The data parameter key. |
| value | OUT The data parameter value corresponding to the key. |
| pExist | OUT If not nil, this is true if the specified data key exists for the rule; otherwise, it is false. |
| pure virtual |
Returns the rule description for the specified rule. Rule description cannot be edited.
| rule | IN The rule. |
| pure virtual |
Returns the rule ID for the specified rule.
| rule | IN The rule. |
| pure virtual |
Returns a list of rules in the specified category.
| category | IN The rule category. |
| rules | OUT The list of rules for the specified category. |
| pure virtual |
Get the current working preflight profile for the specified database. The working profile will have the same database if it's the document's embedded profile. Or the working profile is a profile in the application's profile list.
| iTargetDB | is the database. |
| pure virtual |
Returns true if preflight is turned on for the given database.
| iTargetDB | is the specified database If nil, application default database is assumed. |
| pure virtual |
| pure virtual |
Import a preflight profile from a file. This file can be a InDesign preflight profile file (IDPP) or an InDesign document.
| sourceFile | is the file to import from. |
| pNewProfileUID | is the UID of the profile imported from the specified INX file. |
| showAlert | is true if alert should be shown for errors. |
| pure virtual |
Remove all rules in the given profile
| preflighProfile | IN The preflight profile. |
| pure virtual |
Set to true if the current default working preflight profile should be automatically embedded when creating a new document. This is an application level only preference setting.
| autoEmbed | is true if auto embed the working profile in the new document. |
| pure virtual |
Set the preflight's include layer options for the specified database. If the database is the application default database, this setting is applied to new documents and when opening documents. If the database is a document database, this setting is only valid for as long as the document stayed opened. The setting is not saved with the document. When the document is opened again, this setting is initialized to the current application default.
| iTargetDB | is the database. |
| whichLayer | is the include layer option to set. |
| pure virtual |
Set the preflight's include non-printing objects preference for the specified database. If the database is the application default database, this setting is applied to new documents and when opening documents. If the database is a document database, this setting is only valid for as long as the document stayed opened. The setting is not saved with the document. When the document is opened again, this setting is initialized to the current application default.
| iTargetDB | is the database. |
| onOff | is true if set inclusion to true; otherwise set to false. |
| pure virtual |
Set the preflight's include objects on pasteboard preference for the specified database. If the database is the application default database, this setting is applied to new documents and when opening documents. If the database is a document database, this setting is only valid for as long as the document stayed opened. The setting is not saved with the document. When the document is opened again, this setting is initialized to the current application default.
| iTargetDB | is the database. |
| onOff | is true if set inclusion to true; otherwise set to false. |
| pure virtual |
Set the preflight profile policy for openeing existing document. This is an application level only preference setting.
| profilePolicy |
| pure virtual |
Set the preflight's scope preference for the specified database. This setting is only applicable if database is a document database. If the database is a application default database, the setting is ignored.
| iTargetDB | is the database. |
| scope | is the preflight scope to set to. |
| pPageRange | if not nil sets the page ranges. This parameter is only useful if setting scope to kPageRange. |
| pure virtual |
Sets the new profile description for the specified profile.
| profileRef | IN The UIDRef of the profile. |
| profileDesc | IN The profile description to set. |
| pure virtual |
Sets the new profile name for the specified profile.
| profileRef | IN The UIDRef of the profile. |
| profileName | IN The profile name to set. |
| pure virtual |
Set rule data for the specified rule.
| rule | IN The rule. |
| key | IN The data parameter key. |
| value | IN The data parameter value. |
| pure virtual |
Sets the working preflight profile for the given database. If the database is the application default database, this is the working space that will be set in the document when it is opened if the open document policy is set to use the working profile. If open policy is set to using the document embedded and the document does not have an embedded profile, then the document's working profile is set to the application default working profile when the document if first opened.
This is also the working profile to auto-embed if
| pure virtual |
Turn preflight off for the specified data base. If the database is the application default database, this action affects all new documents as well as all currently opened documents. If the database is a document database, then preflight is turned off for this document only.
| iTargetDB | is the database for which the preflighting is turned off. If nil, application default database is assumed. |
| pure virtual |
The Preflight preferences facade methodsTurn preflight on for the specified data base. If the database is the application default database, this action affects all new documents as well as all currently opened documents. If the database is a document database, then preflight is turned on for this document only.
| iTargetDB | is the database for which the preflighting is turned on. If nil, application default database is assumed. |
| pure virtual |
Unembed the document profile. This simply deletes any existing profiles in the document.
| docDB | is the target document. |
| copyEmbeddedToApplication | IN Specifies whether to apply the default behavior that the currently-embedded profile in the document, if any, will be copied to the application level list of profiles if a profile by that name does not currently exist at the application level. If this argument is false then this method does a simple unembed without any copying. |
| pure virtual |
Give all of the rules in the specified profile(s) a chance to update their parameter values. If a rule's parameters change from one version to another it may need to tweak the parameters.
| profiles | IN A list of the profiles to update. |