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

Public Types | |
| enum | { kDefaultIID = IID_IPREFLIGHTRESULTRECORD } |
Public Member Functions | |
| virtual void | SetObjectID (const PreflightObjectID &objid)=0 |
| virtual const PreflightObjectID & | GetObjectID () const =0 |
| virtual bool | AddSubpart (ClassID subpartID)=0 |
| virtual bool | AddSubparts (const K2Vector< ClassID > &subparts)=0 |
| virtual bool | AddSubparts (const IPreflightResultRecord *iOther)=0 |
| virtual void | GetSubparts (K2Vector< ClassID > &subparts) const =0 |
| virtual bool | HasSubpart (ClassID subpartID) const =0 |
| virtual bool | HasCommonSubpart (ClassID *commonID) const =0 |
| virtual bool | AddValue (const PMReal &r)=0 |
| virtual bool | AddValues (const K2Vector< PMReal > &values)=0 |
| virtual bool | AddValues (const IPreflightResultRecord *iOther)=0 |
| virtual void | GetValues (K2Vector< PMReal > &values) const =0 |
| virtual PMReal | GetMinValue () const =0 |
| virtual PMReal | GetMaxValue () const =0 |
| virtual bool | HasCommonValue (PMReal *pCommon=nil) const =0 |
| virtual void | SetCriteria (ClassID criteriaID)=0 |
| virtual ClassID | GetCriteria () const =0 |
| virtual void | SetAuxString (const PMString &s)=0 |
| virtual PMString | GetAuxString () const =0 |
| virtual void | SetProcessNode (IPreflightProcess::NodeID nodeID)=0 |
| virtual IPreflightProcess::NodeID | GetProcessNode () const =0 |
| virtual void | ReadData (PreflightXferStream &s)=0 |
| virtual void | WriteData (PreflightXferStream &s) 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 interface would normally be used by a preflight rule implementation.
This interface has two main purposes: it records data for a preflight rule visit, and later serves as a mechanism for organizing those results when aggregating. Normally a preflight result record is created in your rule visitor via IPreflightVisitInfo::CreateResultRecord but if you want to create your own during results aggregation you can use IPreflightAggregatedResultsUtils::CreatePreflightResultRecord.
The fields in the result record are meant to be generic in nature, ie rule-dependent. Their sole purpose is to aid in recording and aggregating records together. In all cases the preflight result record is associated with a preflight object ID. In some cases that may be all you need, in which case your use of this interface is trivial. In other cases you'll want to record more detailed information about the violation. It's purely a question of what information you need to display later on during the aggregation phase, and/or whether that information is inexpensive to obtain later and therefore you don't care about recording it when you find the error.
As an example, the font types rule records the name of the font in the aux string field, because that makes it easy later to create subtables by aux string value and it's mildly complex to re-obtain the font name later, so it's more efficient to record it in the Visit() phase.
To save you the trouble of scanning through all the APIs below, the data stored in a record includes:
| pure virtual |
Add a subpart to the record. Each record has a vector of subparts. This is normally auto-setup by IPreflightAggregatedResultsUtils, but there's no reason you can't make up your own subparts and apply them at the time you encounter the error.
| subpartID | IN The subpart to add to the vector. |
Merge a vector of subparts with the record's vector.
| subparts | IN The vector of subparts to add. |
| pure virtual |
Merge another record's subparts into this record's vector.
| iOther | IN The other record. |
| pure virtual |
Add a value to the record. Each record has a vector of PMReal values. These are completely 'untyped' otherwise; what a value is depends entirely on your rule. However, preflight aggregation utilities will tend to aggregate together values. For example, if your value is the width of a stroke you encounter, the aggregation utilities may aggregate together records with everything else the same except the values; in that case the value vectors are merged.
| r | IN The value to add to the vector. |
Merge a vector of values with the record's vector.
| values | IN The vector of values to add. |
| pure virtual |
Merge another record's values into this record's vector.
| iOther | IN The other record. |
| pure virtual |
| pure virtual |
| pure virtual |
Get the maximum value found in the vector.
| pure virtual |
Get the minimum value found in the vector.
| pure virtual |
Get the related object ID.
| pure virtual |
Get the subparts in this record's subpart vector.
| subparts | OUT Receives the subpart vector. |
Get the values in this record's values vector.
| values | OUT Receives the values vector. |
| pure virtual |
Returns whether the subpart vector is of size 1 (ie, all of the subparts added have been the same value), and optionally returns what that common value is.
| commonID | OUT If not nil, receives the common value if there is one, or kInvalidClass if there isn't. |
| pure virtual |
Returns whether the values vector is of size 1 (ie, all of the values added have been the same value), and optionally returns what that common value is.
| pCommon | OUT If not nil, receives the common value if there is one, or 0 if there isn't. |
| pure virtual |
Determines whether the given subpart appears in the subpart vector.
| subpartID | IN THe subpart you wish to test for. |
| pure virtual |
Internal use only. Desrializes the record data from a blob that's stored in the preflight process database.
| s | IN The serialization stream. |
| pure virtual |
Sets the aux string, which you can use for other sorting operations where criteria isn't the way you want to sort. For example if you want to store a font name you can put it in here and later present the violations arranged by that.
Note that the IPreflightAggregatedResultsUtils aggregation methods will not aggregate together any entries which have different aux strings.
| s | IN The new aux string. |
| pure virtual |
Set the criteria for this record. A criteria ID is normally a way of distinguishing one kind of failure from another. For example the image resolution rule has different criteria IDs for each kind of image (color, gray, b&w). If your rule only has one kind of criteria you don't need to store this; it defaults to kPreflightRC_Default. Since criteria IDs are defined in plugin ID space you can add your own (should, really).
| criteriaID | IN The criteria to set. |
| pure virtual |
Set the related object ID. This is automatically set up for you if you're using IPreflightVisitInfo::CreateResultRecord().
| objid | IN The object ID to set. |
| pure virtual |
Set the process node. This generally applies only to the first generation (pre-aggregation) results, since after aggregation there isn't usually a corresponding process database node. Normally you don't set this; the preflight visit info does at creation time.
| nodeID | IN the process node ID. |
| pure virtual |
Internal use only. Serializes the record data into a blob that's stored in the preflight process database.
| s | IN The serialization stream. |