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

#include <IPreflightRuleUI.h>

Inheritance diagram for IPreflightRuleUI:
IPMUnknownCPMUnknown< IPreflightRuleUI >PreflightBlackOverprintRuleUIPreflightFontRuleUI

Public Types

enum  { kDefaultIID = IID_IPREFLIGHTRULEUI }
 
enum  UnitType {
  kDefaultUnit = -1, kXCoordinate, kYCoordinate, kPoints,
  kTextUnits, kTextSizeUnits, kLineUnits, kPercent,
  kCoordinateGroupWithConstrain, kCoordinateGroupNoConstrain, kEnumerator, kStaticText
}
 

Public Member Functions

virtual bool HasUI () const =0
 
virtual IControlViewCreateCustomUI (IDataBase *iUIDataBase) const =0
 
virtual bool ApplyDataToCustomUI (IControlView *iCustomUI, IPreflightRuleData *iRuleDataToApply) const =0
 
virtual bool GetDataFromCustomUI (IControlView *iCustomUI, IPreflightRuleData *iRuleData) const =0
 
virtual PMString GetDataParemeterDescription (const IPreflightRuleData::Key &key) const =0
 
virtual UnitType GetDataParemeterUnitType (const IPreflightRuleData::Key &key) const =0
 
virtual bool GetDataParemeterRange (const IPreflightRuleData::Key &key, ScriptData &maxData, ScriptData &minData) const =0
 
virtual bool ValidateParameterData (const IPreflightRuleData::Key &key, const ScriptData &newData, PMString &errorString) const =0
 
virtual bool GetDataParemeterMapping (const IPreflightRuleData::Key &key, ScriptListData &enumData, ScriptListData &stringData) const =0
 
virtual IPreflightRuleData::Key GetDataParamRoot () const =0
 
virtual void GetDataParamParent (const IPreflightRuleData::Key &key, IPreflightRuleData::Key &keyParent) const =0
 
virtual bool GetDataParamDirectChildren (const IPreflightRuleData::Key &key, std::vector< IPreflightRuleData::Key > &keyList) 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 a rule boss and provides rule-specific UI entry points. If the rule does not have any data parameters, then no implementation is needed.

If the rule wants to provide its own custom UI to be included in the InDesign preflight profile rule definition dialog, the following methods require implementation. These three methods allows the profile rule definition UI to embed the rule's custom UI, apply data to the UI, and retrieve data from the UI.

See Also
CreateCustomUI
ApplyDataToCustomUI
GetDataFromCustomUI

Note that if custom UI is used then there's no need to implement any of the methods for creating auto generated UI.

If the rule has simple data parameters and wants the InDesign preflight profile rule definition UI to construct automatically InDesign's UI widgets to represent the rule's data parameters, the remaining methods described in this class should have some implementation. To auto-generate the UI, we use these data and widget mapping: boolean data => checkbox PMReal, longint, shortint, string => edit boxes within this mapping, the data's UI UnitType specifies the edit box details. enumerator, longint, shortint, boolean can be mapped to a dropdown list. kCoordinateGroupWithConstrain & kCoordinateGroupNoConstrain will generate a special group control containing n editboxes either with a lock or without a lock contrain. The lock constrain will affect all edit units in the group alike.

Member Enumeration Documentation

This is the UI unit/value type for the data parameters. Use kDefaultUnit to indicate that the data value can be represented with default type.
Enumerator
kDefaultUnit 

Value is InDesign default type.

kXCoordinate 

Value is in XUnitOfMeasure

kYCoordinate 

Value is in XUnitOfMeasure

kPoints 

Value is in YUnitOfMeasure

kTextUnits 

Value is in points

kTextSizeUnits 

Value is in TextSizeUnitOfMeasure

kLineUnits 

Value is in LineUnitOfMeasure

kPercent 

The followings are special units to help auto generate more complicated UI.Value is in percentage

kCoordinateGroupWithConstrain 

Group of coordinate values with contrain

kCoordinateGroupNoConstrain 

Group of coordinate values without contrain

kEnumerator 

Value is a custom enumerator-style type. Use GetDataParemeterMapping to provide/access detail about data.

kStaticText 

No value; the parameter is just a static text item.

Member Function Documentation

virtual bool IPreflightRuleUI::ApplyDataToCustomUI (IControlViewiCustomUI,
IPreflightRuleDataiRuleDataToApply 
) const
pure virtual

Apply specified rule data to the cutom UI. The custom UI view passed is the same IControlView* initially created from CreateCustomUI ().

Parameters
iCustomUIis the custom UI control view to apply the data to.
iRuleDataToApplyis the rule data to apply to the custome UI widget.
Returns
true if custom UI handled the data; otherwise false.

Implemented in PreflightFontRuleUI, and PreflightBlackOverprintRuleUI.

virtual IControlView* IPreflightRuleUI::CreateCustomUI (IDataBaseiUIDataBase) const
pure virtual

Get the cutom UI for this rule

Returns
The custom IControlView.

Implemented in PreflightFontRuleUI, and PreflightBlackOverprintRuleUI.

virtual bool IPreflightRuleUI::GetDataFromCustomUI (IControlViewiCustomUI,
IPreflightRuleDataiRuleData 
) const
pure virtual

Retrieve rule data from the specified cutom UI. The custom UI view passed is the same IControlView* initially created from CreateCustomUI (). This is called when the main profile rule definition dialog is notified there're rule data changes. The custom UI notifies this change by broadcasting on the profile dialog's IDialogController's subject with the following arguments: theChange = kProfileCustomRuleDataChangeMessage protocol IID = IID_IPROFILEDLGUTILS changedBy = the custom UI controlview In turn, the main rule definition UI will ask for rule data from custom UI with this call.

Parameters
iCustomUIis the custom UI control view to retrieve the data from. This should match the controlview which it originally broadcasted the data change.
iRuleDatais the rule data to which the custome UI widget should set the resulting rule data.
Returns
true if custom UI handled the data; otherwise false.

Implemented in PreflightFontRuleUI, and PreflightBlackOverprintRuleUI.

virtual bool IPreflightRuleUI::GetDataParamDirectChildren (const IPreflightRuleData::Keykey,
std::vector< IPreflightRuleData::Key > & keyList 
) const
pure virtual

Get the specified parameter key's direct child parameter keys.

Parameters
keyis the parameter key.
keyListis the parameter's list of child parameter keys.
Returns
true if the specified key has children.

Implemented in PreflightFontRuleUI, and PreflightBlackOverprintRuleUI.

virtual void IPreflightRuleUI::GetDataParamParent (const IPreflightRuleData::Keykey,
IPreflightRuleData::KeykeyParent 
) const
pure virtual

Get the specified parameter key's parent. If the rule has a flat list of data parameters, then the parent is the root.

Parameters
keyis the parameter key.
keyParentis the parameter's parent.

Implemented in PreflightFontRuleUI, and PreflightBlackOverprintRuleUI.

virtual IPreflightRuleData::Key IPreflightRuleUI::GetDataParamRoot () const
pure virtual
Returns
the data parameter's root This is usually the rule itself.

Implemented in PreflightFontRuleUI, and PreflightBlackOverprintRuleUI.

virtual PMString IPreflightRuleUI::GetDataParemeterDescription (const IPreflightRuleData::Keykey) const
pure virtual

Get the description of the specified data key for this rule.

Parameters
keyis the specified data key
Returns
the description string.

Implemented in PreflightFontRuleUI, and PreflightBlackOverprintRuleUI.

virtual bool IPreflightRuleUI::GetDataParemeterMapping (const IPreflightRuleData::Keykey,
ScriptListData & enumData,
ScriptListData & stringData 
) const
pure virtual

Get the data value mapping for this data parameter. This is used when specifying the data parameter as a dropdown list. This mapping allows mapping of integer values to a string for the dropdown list.

Parameters
keyis the specified data key
enumDatais the list of enum values for this data key
stringDatais the list of strings mapped to the corresponding enum values for this data key
Returns
kTrue is data key has mapping; otherwise returns kFalse.

Implemented in PreflightFontRuleUI, and PreflightBlackOverprintRuleUI.

virtual bool IPreflightRuleUI::GetDataParemeterRange (const IPreflightRuleData::Keykey,
ScriptDatamaxData,
ScriptDataminData 
) const
pure virtual

Get the maximum and minimum range for this data paramete.

Parameters
keyis the specified data key
maxDatais the upper limit for this data key
minDatais the lower limit for this data key
Returns
kTrue is data key has max and min limits; otherwise returns kFalse.

Implemented in PreflightFontRuleUI, and PreflightBlackOverprintRuleUI.

virtual UnitType IPreflightRuleUI::GetDataParemeterUnitType (const IPreflightRuleData::Keykey) const
pure virtual

Get the data parameter unit type. It can be one of type, UnitType defined above.

Parameters
keyis the specified data key
Returns
the enum for the unit type.

Implemented in PreflightFontRuleUI, and PreflightBlackOverprintRuleUI.

virtual bool IPreflightRuleUI::HasUI () const
pure virtual
Returns
whether the rule has any UI, either custom or auto-generated. By "UI" we mean that there are widgets to be shown under the on/off checkbox. The on/off checkbox is always present. If you return true to this method you'll get a triangle next to your rule; if not, you won't.

Implemented in PreflightFontRuleUI, and PreflightBlackOverprintRuleUI.

virtual bool IPreflightRuleUI::ValidateParameterData (const IPreflightRuleData::Keykey,
const ScriptDatanewData,
PMStringerrorString 
) const
pure virtual

Validate new data value for the specified data key. This is needed if data requires more than just validating between max and min range specified by method GetDataParemeterRange.

See Also
GetDataparameterRange
Parameters
keyis the specified data key
newDatais the new data value for this key to validate.
errorStringis the error alert string to be shown if there's an error with this new value. If the errorString is a custom error string, it should be translated first. errorString is empty if there's no error or if alert is not needed.
Returns
true if the data value is good.

Implemented in PreflightFontRuleUI, and PreflightBlackOverprintRuleUI.