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

#include <IAttrReport.h>

Inheritance diagram for IAttrReport:
IPMUnknownCPMUnknown< IAttrReport >BscTAAttrReport

Public Types

enum  { kDefaultIID = IID_IATTRREPORT }
 
enum  RecompositionLevel { kInvalOnly, kInkBoundsChange, kRequiresRecomposition }
 
enum  ContinuationType { kNeverContinue, kAlwaysContinue, kContinueFromLeftOnly }
 

Public Member Functions

virtual bool16 IsParagraphAttribute () const =0
 
virtual bool16 LastsThroughStyleChange () const =0
 
virtual
IAttrReport::ContinuationType 
AutomaticContinuation () const =0
 
virtual bool16 CanBeInStyle () const =0
 
virtual
IAttrReport::RecompositionLevel 
RequiresRecomposition () const =0
 
virtual void TellComposition (ICompositionStyle *style, IDrawingStyle *draw) const =0
 
virtual void AppendDescription (PMString *into, IDataBase *theDB, const AttributeBossList *attrBossList) 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 is the "designator" interface for every text attribute. Each attribute implements the following methods: IsParagraphAttribute() – obvious. TellComposition() – each attribute tells the composition style boss what the attribute "means". Both <style> and <draw> are on the same boss. They are both passed in because half the attributes would need need to query for the other if they weren't both available. AppendAttributeName() – add a descriptive name to the end of the passed in string AppendAttributeValue() – add a descriptive value. These 2 are most likely going to change.

Member Enumeration Documentation

See IAttrReport::AutomaticContinuation() for an explanation of the use of these enum values.

See IAttrReport::RequiresRecomposition() for an explanation of the use of these enum values.

Member Function Documentation

virtual void IAttrReport::AppendDescription (PMStringinto,
IDataBasetheDB,
const AttributeBossListattrBossList 
) const
pure virtual

AppendDescription is used to generate the style descriptions that are displayed in the "Settings" display of the "General" panel of the "Style Options" dialog as well as by the style overrides tooltip (that displays when the user lingers over the "+" override symbol next to a style name in the Styles Palettes.

Parameters
intois the string to append the description to.
theDBthe database (document) the attribute is in. (This may be needed to lookup a human readable name associated with a UID referenced by an attribute, such as a Swatch name.)
attrBossListthe other attributes that are applied to the same text run or text style as this attribute. In some cases it is difficult to create a nicely formatted string without knowing the value of other closely related attributes.

Implemented in BscTAAttrReport.

virtual IAttrReport::ContinuationType IAttrReport::AutomaticContinuation () const
pure virtual

Most text attributes return kAlwaysContinue. That is they should be extended to text that is added immediately to the right of a run of text that has this attribute applied. (If you type directly following blue text the newly inserted text is also blue.) However, some special case attributes only apply to a single character and should never be "propagated" to newly entered text. Examples include: pair kerning; the attribute to identify a special glyph when no unique Unicode value exists; and the page number attribute that is applied to a page number character to indicate whether the number should be for this page, or the continued on/from page; among others. kContinueFromLeftOnly is currently unused and should be considered deprecated.

Implemented in BscTAAttrReport.

virtual bool16 IAttrReport::CanBeInStyle () const
pure virtual

Indicates whether this attribute should be part of style definitions. If a text attribute has no end user UI in the Style Options dialog, it should probably return kFalse (since if it were allowed into styles it would be difficult for the end user to edit or remove the attribute from the style).

Implemented in BscTAAttrReport.

virtual bool16 IAttrReport::IsParagraphAttribute () const
pure virtual

Self explanatory.

Implemented in BscTAAttrReport.

virtual bool16 IAttrReport::LastsThroughStyleChange () const
pure virtual

The vast majority of attributes return kFalse. However, if an attribute should not be altered when a style is applied, this method should return kTrue. Examples of attributes that return kTrue include: the page number attribute that is applied to a page number character to indicate whether the number should be for this page, or the continued on/from page; the attribute used to indicate a carriage return is actually a column break, page break, etc. character; and a handful of other attributes.

Implemented in BscTAAttrReport.

virtual IAttrReport::RecompositionLevel IAttrReport::RequiresRecomposition () const
pure virtual

The values of the returned enum are used to decide what level of response is required when an attribute is applied into the model. Most text attributes effect composition (glyph positions, font, point size, etc.). Therefore most attributes return kRequiresRecomposition. However, some attributes only require the screen to be inval'ed and redraw (i.e. color), thus kInvalOnly. And still others don't affect composition, but may change the area the text marks (i.e. paragraph rule weight, offset) and thus kInkBoundsChange. If your attribute adds a text adornment, kInkBoundsChange is the right choice. (Returning anything other than kRequiresRecomposition is purely an optimization. kRequiresRecomposition will always work, but is much slower.)

Implemented in BscTAAttrReport.

virtual void IAttrReport::TellComposition (ICompositionStylestyle,
IDrawingStyledraw 
) const
pure virtual

This is where a text attribute gets a chance to alter composition and/or what is attached to the text for drawing purposes (text adornments). The ICompositionStyle and IDrawingStyle that are passed in are on the same boss. (They're both passed since a large number of attributes would have to query for the other interface if only one was passed in.) The IxxxStyle interfaces are the "setter" interfaces for the "knobs" that control text composition.

Implemented in BscTAAttrReport.