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

#include <IPreflightRuleManager.h>

Inheritance diagram for IPreflightRuleManager:
IPMUnknown

Public Types

enum  { kDefaultIID = IID_IPREFLIGHTRULEMANAGER }
 

Public Member Functions

virtual void Startup ()=0
 
virtual void Shutdown ()=0
 
virtual bool16 RegisterMissingRuleService (const ClassID &providerClassID, const PreflightRuleID &ruleID=PreflightRuleID())=0
 
virtual PreflightRuleIDVector GetAllRuleIDs () const =0
 
virtual IPreflightRuleServiceQueryRuleService (const PreflightRuleID &ruleID) const =0
 
virtual IPreflightRuleInfoCreateRule (PreflightRuleID ruleID, IDataBase *db) const =0
 
virtual void GetAllCategories (K2Vector< PMString > &allCategories) const =0
 
virtual void GetRulesInCategory (const PMString &category, PreflightRuleIDVector &rules) const =0
 
virtual PMString GetRuleCategory (const PreflightRuleID &ruleID) const =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

This interface sits on the session and provides "manager level" access to the database that it maintains about the rules that it knows about (via rule services). Normally you get one of these via

InterfacePtr<IPreflightRuleManager> iRuleMgr(Utils<IPreflightUtils>()->QueryRuleManager());

The idea is that preflight rule services register all the rules they know about. This manager collates this information and provides the API to access rules as if they are derived from a "super service." (Ie, you don't have to talk to the services directly.)

Member Function Documentation

virtual IPreflightRuleInfo* IPreflightRuleManager::CreateRule (PreflightRuleID ruleID,
IDataBasedb 
) const
pure virtual

Given a rule ID, create a rule boss in the specified database (nil for in-memory).

Parameters
ruleIDis the specified rule ID.
dbis the database in which to create the rule
Returns
the preflight rule for the specified ruleID
virtual void IPreflightRuleManager::GetAllCategories (K2Vector< PMString > & allCategories) const
pure virtual

Get a list of all rule categories. Note that rules declare their own categories; this is simply the union of all the returned strings. Also note: Rules that do not wish to appear in the UI return an empty category string. This method does not return an empty category string in the list of categories.

Parameters
allCategoriesOUT Receives the vector of strings. It's cleared before adding the entries.
virtual PreflightRuleIDVector IPreflightRuleManager::GetAllRuleIDs () const
pure virtual
Returns
the list of all rules from all services.
virtual PMString IPreflightRuleManager::GetRuleCategory (const PreflightRuleIDruleID) const
pure virtual

Get the category a rule belongs to. Note: Rule categories are the domain of Rule UI, which may not be available in a server environment or if the preflight UI plugin isn't present. Thus you should only assume that categories are valid for UI purposes.

Parameters
ruleIDIN The rule you're interested in.
Returns
The category the rule belongs to.
virtual void IPreflightRuleManager::GetRulesInCategory (const PMStringcategory,
PreflightRuleIDVectorrules 
) const
pure virtual

Get a list of all the rule IDs declared under a given category. Note: Rule categories are the domain of Rule UI, which may not be available in a server environment or if the preflight UI plugin isn't present. Thus you should only assume that categories are valid for UI purposes.

Parameters
categoryIN The category you're interested in. Pass an empty string if you want to get a list of all the rules that returned an empty category string, ie they do not wish to appear in the UI.
rulesOUT Recevies the vector of rules. It's cleared before adding the entries.
virtual IPreflightRuleService* IPreflightRuleManager::QueryRuleService (const PreflightRuleIDruleID) const
pure virtual

Given a rule ID, returns the service responsible for it.

Parameters
ruleIDis the specified rule ID.
Returns
the preflight rule service associated with the specified ruleID
virtual bool16 IPreflightRuleManager::RegisterMissingRuleService (const ClassIDproviderClassID,
const PreflightRuleIDruleID = PreflightRuleID() 
)
pure virtual

Register a rule service that failed during startup. Ror example, all script-based rules failed during startup since they require the scripting serivces and scripting info database to be completed first. This does not happen until the app completes all startup tasks. The calling client call this method to finish registering the rules.

Parameters
providerClassIDis the service class ID for this rule service.
ruleIDis the missing rule ID to register. If the ruleID spcified is a null string, then all rules associated with the specified service should be register.
Returns
kTrue if we successfully registered missing rule(s).