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

#include <IGlobalTextAdornment.h>

Inheritance diagram for IGlobalTextAdornment:
IPMUnknown

Public Types

enum  { kDefaultIID = IID_IGLOBALTEXTADORNMENT }
 

Public Member Functions

virtual Text::DrawPriority GetDrawPriority ()=0
 
virtual bool16 GetCheckIsActive ()=0
 
virtual bool16 GetIsActive (const IParcelShape *parcelShape, const ITextOptions *textOptions, int32 iShapeFlags)=0
 
virtual bool16 GetCheckCouldDraw ()=0
 
virtual bool16 GetCouldDraw (const IWaxRun *waxRun, const IWaxRenderData *waxRenderData, const IWaxGlyphs *waxGlyphs)=0
 
virtual bool16 GetHasInkBounds ()=0
 
virtual void GetInkBounds (PMRect *inkBounds, const IWaxRun *waxRun, const IWaxRenderData *waxRenderData, const IWaxGlyphs *waxGlyphs)=0
 
virtual void Draw (GraphicsData *gd, int32 iShapeFlags, const IWaxRun *waxRun, const IWaxRenderData *waxRenderData, const IWaxGlyphs *waxGlyphs)=0
 
virtual void StartOfParcelDraw (GraphicsData *gd, int32 iShapeFlags, const IParcelShape *parcelShape)=0
 
virtual void EndOfParcelDraw (GraphicsData *gd, int32 iShapeFlags, const IParcelShape *parcelShape)=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

GlobalTextAdornments are a special kind of TextAdornments in that they are treated as if they were attached to every WaxRun, with the exception that they never have run specific data adornment data.

The best example of the application of a GlobalTextAdornment is the ShowInvisibles function. This Adornment will draw special symbols to represent the hidden text characters (paragraph markers, spaces, etc) in a composed line. The drawing of these symbols is triggered by a menu pick and we of course cannot require recomposition in order to attach adornments to individual runs. Implemented as a global adornment, the adornment can have the behavior as if was attached to all the runs but only get called when it says so by having its GetIsActive() method query the state of the menu pick.

Member Function Documentation

virtual void IGlobalTextAdornment::Draw (GraphicsDatagd,
int32 iShapeFlags,
const IWaxRunwaxRun,
const IWaxRenderDatawaxRenderData,
const IWaxGlyphswaxGlyphs 
)
pure virtual

The adornment is allowed to draw.

Parameters
gdPointer to the GraphicsData.
iShapeFlagsThe value of the flags parameter passed into IShape::Draw.
waxRun: the run in question
waxRenderData: drawing data for the run (font, color, etc.) can be nil (e.g. inline graphic)
waxGlyphs: glyph interface for the run. can be nil (e.g. inline graphic)
virtual void IGlobalTextAdornment::EndOfParcelDraw (GraphicsDatagd,
int32 iShapeFlags,
const IParcelShapeparcelShape 
)
pure virtual

Notification that the Parcel has finished the pass.

Parameters
gdPointer to the GraphicsData.
iShapeFlagsThe value of the flags parameter passed into IShape::Draw.
parcelShape: Note that parcelShape MAY NOT be a UID based object.
virtual bool16 IGlobalTextAdornment::GetCheckCouldDraw ()
pure virtual

see GetCouldDraw

virtual bool16 IGlobalTextAdornment::GetCheckIsActive ()
pure virtual
See Also
GetIsActive
virtual bool16 IGlobalTextAdornment::GetCouldDraw (const IWaxRunwaxRun,
const IWaxRenderDatawaxRenderData,
const IWaxGlyphswaxGlyphs 
)
pure virtual

The Adornment is asked if it could like to draw on the particular run. This is NOT a question about whether the adornment is active or not, rather if an adornment didn't want to draw on any of the runs in a particular parcel then that adornment would never be called.

All non-global adornments by definition would like to draw because they are attached to the runs so they never need to be asked this question.

This method helps us optimize the calling of global adorments which are implemented as "triggers" to things in the Wax. Take, for example, the HnJViolations global adornment. It only wants to draw if the WaxLine has HnJViolations AND the appropriate menu pick has occured. So it wants to be able to avoid being called to draw when none of the WaxLines in the frame have any violations even through the menu pick may be active.

Parameters
waxRun: the run in question
waxRenderData: drawing data for the run (font, color, etc.) can be nil (e.g. inline graphic)
waxGlyphs: glyph interface for the run. can be nil (e.g. inline graphic)
virtual Text::DrawPriority IGlobalTextAdornment::GetDrawPriority ()
pure virtual

Returns the Draw priority of the adornment which is used for z-ordering

virtual bool16 IGlobalTextAdornment::GetHasInkBounds ()
pure virtual
See Also
GetInkBounds
virtual void IGlobalTextAdornment::GetInkBounds (PMRectinkBounds,
const IWaxRunwaxRun,
const IWaxRenderDatawaxRenderData,
const IWaxGlyphswaxGlyphs 
)
pure virtual

The Adornment is asked if it has ink bounds. Again, this is NOT a question about whether the adornment is active or not, rather if an adornment didn't want to draw on any of the runs in a particular parcel then that adornment would never be called.

If the Adornment never creates ink that exceeds the standard ink bounds of the run (ie the selection bounds) then it does not have to provide ink bounds.

Parameters
inkBounds,:rectange to set with ink bounds. NOTE: The inkBounds are passed in empty. If your adornment is guaranteed to draw within the Text bounds of the run and the vertical selection bounds of the line then you DO NOT have to return anything for the inkBounds, just leave them unchanged (empty).
waxRun: the run in question
waxRenderData: drawing data for the run (font, color, etc.) can be nil (e.g. inline graphic)
waxGlyphs: glyph interface for the run. can be nil (e.g. inline graphic)
virtual bool16 IGlobalTextAdornment::GetIsActive (const IParcelShapeparcelShape,
const ITextOptionstextOptions,
int32 iShapeFlags 
)
pure virtual

The purpose of this method is to give the Parcel a chance to avoid passes and calling adornments that aren't needed. If, for example, a particular adornment was the only one needing to be called on a particular pass and the adornment wouldn't be drawing because of some global state, by returning kFalse the pass could be avoided.

Global adornments which indicate they are not active will NOT be called to Draw.

Parameters
parcelShape: the parcel this text is in. It MAY NOT be a UID based object.
textOptions: pointer to the document's text options
iShapeFlags: Two important IShape flags must be observed: IShape::kPrinting If set, indicates that we are printing. IShape::kPreviewMode If set, indicates that we are previewing printing to the screen, global adornments that do not draw when printing should not draw for this either
virtual void IGlobalTextAdornment::StartOfParcelDraw (GraphicsDatagd,
int32 iShapeFlags,
const IParcelShapeparcelShape 
)
pure virtual

Notification that the Parcel has started the pass.

Parameters
gdPointer to the GraphicsData.
iShapeFlagsThe value of the flags parameter passed into IShape::Draw.
parcelShape: Note that parcelShape MAY NOT be a UID based object.