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

#include <IWaxRunShape.h>

Inheritance diagram for IWaxRunShape:
IPMUnknownCPMUnknown< IWaxRunShape >CWaxRunShapeCWaxCollectionShape

Public Types

enum  { kDefaultIID = IID_IWAXRUNSHAPE }
 
enum  { kFlag_IsFirstStacked = 0x00000001, kFlag_IsLastStacked = 0x00000002, kFlag_ReservedForImplementors = 0xffff0000 }
 

Public Member Functions

virtual void GetInkBounds (PMRect *pInkBounds, Text::DrawPassInfoList *passList) const =0
 
virtual void GetWaxBounds (int32 offset, int32 length, K2Vector< PMPolygon4 > *pSetOfBounds) const =0
 
virtual bool16 GetHighlightBounds (int32 offset, int32 length, K2Vector< PMPolygon4 > *pSetOfBounds, PMRect &highlightAdjust, const PMLineSeg &maxTopBottom) const =0
 
virtual bool16 GetHighlightBoundsME (int32 runGlyphStartIndex, int32 start, int32 startInner, int32 end, int32 endInner, K2Vector< PMPolygon4 > *pSetOfBounds, PMRect &highlightAdjust, const PMLineSeg &maxTopBottom) const =0
 
virtual bool16 GetSelectionLine (PMLineSeg *pSelectionLine) const =0
 
virtual bool16 GetHighlightLine (PMLineSeg *pHighlightLine, const PMLineSeg &maxTopBottom) const =0
 
virtual void GetCaretLineAt (int32 offset, PMLineSeg *pCaretLine, const PMLineSeg &maxTopBottom) const =0
 
virtual int32 GetSelectionMode () const =0
 
virtual void SetSelectionMode (int32 mode)=0
 
virtual int32 GetFlags () const =0
 
virtual void SetFlags (int32 flags)=0
 
virtual void GetBorderShadingHeight (int32 mode, PMLineSeg *pShadingHeight) const =0
 
- Public Member Functions inherited from IPMUnknown
virtual IPMUnknownQueryInterface (PMIID interfaceID) const =0
 
virtual void AddRef () const =0
 
virtual void Release () const =0
 

Public Attributes

enum IWaxRunShape:: { ... }  WaxRunFlags
 

Detailed Description

Interface for accessing the shape of the wax run. I.e. it's various bounds and related flags. Used mostly for selection and highlighting.

See Also
CWaxRunShape, IWaxLineShape

Member Enumeration Documentation

anonymous enum

WaxRun flags
Enumerator
kFlag_IsFirstStacked 

Run is in a stacked collection and is the first in the collection

kFlag_IsLastStacked 

Run is in a stacked collection and is the last in the collection

kFlag_ReservedForImplementors 

Area in which 3rd parties can add flags.

Member Function Documentation

virtual void IWaxRunShape::GetBorderShadingHeight (int32 mode,
PMLineSegpShadingHeight 
) const
pure virtual
Returns the shading height for this wax run based on the input shading mode.

Parameters
shadingHeightModeIN -
See Also
IWaxLineShape::ShadingHeightMode - different modes for determining shading height.
Parameters
pShadingHeightOUT - pointer to the line segment containing shading height.

Implemented in CWaxRunShape.

virtual void IWaxRunShape::GetCaretLineAt (int32 offset,
PMLineSegpCaretLine,
const PMLineSegmaxTopBottom 
) const
pure virtual
Returns the caret bounds at the given position.  I.e. the bounds of the caret.

Parameters
offsetA valid offset in to the wax, relative to this run.
pCaretLineThe returned bounds of the caret. See IWaxLineShape::GetCaretLineAt() for more details.
maxTopBottomConstraint on the caret height - pCaretLine will be trimmed to maxTopBottom (if DeltaY() is non-zero).
See Also
IWaxLineShape

Implemented in CWaxRunShape, and CWaxCollectionShape.

virtual int32 IWaxRunShape::GetFlags () const
pure virtual

Property Accessor for WaxRunFlags in this interface.

Implemented in CWaxRunShape.

virtual bool16 IWaxRunShape::GetHighlightBounds (int32 offset,
int32 length,
K2Vector< PMPolygon4 > * pSetOfBounds,
PMRecthighlightAdjust,
const PMLineSegmaxTopBottom 
) const
pure virtual
Get the set of polygons representing the area to be highlighted when the given range of text is highlighted, taking

into consideration the context of the run. (i.e. convert TextRange to Bounding box)

Parameters
offsetIN where in the run to start the computation for the highlight (0 for the start of the waxRun)
lengthIN the length of the text to highlight (-1 can be used to denote the rest of the text to the end of the waxRun)
pSetOfBoundsOUT the resulting set of bounds. There may be none, one, or many bounds that apply to this run.
highlightAdjustIN Used to indicate that an amount should be shaved off the highlight on the indicated side (used to prevent double XOR problems when two (adjacent) waxRun's highlights touch).
maxTopBottomIN is used to prevent double XOR problems when waxRuns are too close together.
  • any highlight should be trimmed to these bounds (if DeltaY() is non-zero).
Returns
kTrue if you can use XOR to highlight the text.
Note
See notes in GetWaxBounds for the difference between waxBounds and highlightBounds.

Implemented in CWaxCollectionShape, and CWaxRunShape.

virtual bool16 IWaxRunShape::GetHighlightLine (PMLineSegpHighlightLine,
const PMLineSegmaxTopBottom 
) const
pure virtual
Get the highlight line (top/bottom) for this run within its collection.

Note
: this depends on the collection having processed each run's Selection Line (which is presented to this run as maxTopBottom).
Parameters
maxTopBottomConstraint on the caret height - pHighlightLine will be trimmed to maxTopBottom (if DeltaY() is non-zero).
Returns
kTrue if you can use XOR to highlight the text.
Note
See notes in GetWaxBounds for the difference between waxBounds (in this case, selectionLine) and highlightBounds (in this case, highlightLine).

Implemented in CWaxRunShape, and CWaxCollectionShape.

virtual void IWaxRunShape::GetInkBounds (PMRectpInkBounds,
Text::DrawPassInfoListpassList 
) const
pure virtual
Retrieve the Ink Bounds for this wax run.  Called by IWaxLineShape. For more details on parameters and description, see IWaxLineShape.

Parameters
pInkBoundsOUT The overall bounds of this run.
passListOUT The list of Draw() passes that this Run requires to draw. This includes the text, local adornments and OPTIONAL global adornments.
  • The only IGlobalTextAdornment that need to be added in this list are those whose CheckCouldDraw() method returns kTrue AND whose CheckGetCheckIsActive() method return kTrue. (there is no reason for the WaxRuns and WaxLines to save pass information for global adornments that are not optional - the containing parcel has access to the same information through the ITextSessionData interface)

When called, the passList may not be empty so it is important to avoid creating duplicates or redundant pass information. The rule is that a required pass always overrides one or more optional passes. However, lacking a required pass, any number of optional passes may simultaneous exist. I.e. use the following pattern:

// -- required pass
Text::DrawPassInfo required(pass, kInvalidClass);
if (passList->Location(required) == -1)
passList->Append(required); // optionals remain.
// -- optional pass
Text::DrawPassInfo optional(pass, someClassID);
if (passList->Location(required) == -1) // Note the use of required as parameter.
passList->Append(optional);
See Also
IWaxLineShape, IGlobalTextAdornment, ITextAdornment, IWaxRunText

Implemented in CWaxCollectionShape, and CWaxRunShape.

virtual bool16 IWaxRunShape::GetSelectionLine (PMLineSegpSelectionLine) const
pure virtual
Get the selection line (top/bottom) for THIS run.

Note
: this is NOT necessarily the actual highlight line - that is determined by looking at all the runs in the collection.
Parameters
pSelectionLineOUT the calculated line.
Returns
kTrue if you can use XOR to highlight the text.
Note
See notes in GetWaxBounds for the difference between waxBounds (in this case, selectionLine) and highlightBounds (in this case, highlightLine).

Implemented in CWaxRunShape, and CWaxCollectionShape.

virtual int32 IWaxRunShape::GetSelectionMode () const
pure virtual

Property Accessor for the wax run Selection Mode.

See Also
IWaxLineShape::SelectionMode, GetSelectionMode.

Implemented in CWaxRunShape.

virtual void IWaxRunShape::GetWaxBounds (int32 offset,
int32 length,
K2Vector< PMPolygon4 > * pSetOfBounds 
) const
pure virtual
Get the set of polygons representing the area of the wax representing the glyphs representing the text.

(i.e. convert TextRange to Bounding box)

Parameters
offsetIN where in the run to start the computation for the highlight (0 for the start of the waxRun)
lengthIN the length of the text to highlight (-1 can be used to denote the rest of the text to the end of the waxRun)
pSetOfBoundsOUT the resulting set of bounds. There may be none, one, or many bounds that apply to this run.
Note
The Wax Bounds represents the true area of the run.
: the DIFFERENCE between the wax bounds and the highlight bounds is that the latter can be modified due to the context of the waxRun. E.g. if the leading is too small the wax bounds can overlap, so the higher level code restricts the top/bottom of the highlight. Also, if the font is smaller in this run, the upper level code may ask for consistent highlighting and can expand the bounds. Super/Subscripts are another example. (and Drop Caps are another issue entirely.)

Implemented in CWaxCollectionShape, and CWaxRunShape.

virtual void IWaxRunShape::SetFlags (int32 flags)
pure virtual

Property Accessor for WaxRunFlags in this interface. - Caller must do any ANDing or ORing.

Implemented in CWaxRunShape.

virtual void IWaxRunShape::SetSelectionMode (int32 mode)
pure virtual

Property Accessor for the wax run Selection Mode.

See Also
IWaxLineShape::SelectionMode, SetSelectionMode.

Implemented in CWaxRunShape.