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

#include <IWaxLineShape.h>

Inheritance diagram for IWaxLineShape:
IPMUnknown

Public Types

enum  { kDefaultIID = IID_IWAXLINESHAPE }
 
enum  SelectionFlags {
  kFlag_SelectionAscToDesc = 0x00000000, kFlag_SelectionAscToBase = 0x00000001, kFlag_SelectionLeadToBase = 0x00000002, kFlag_SelectionJapanese = 0x00000004,
  kFlag_SelectionRangeMask = 0x0000000f, kFlag_SelectionRespectShift = 0x00000010, kFlag_SelectionSkipThisYTop = 0x00000020, kFlag_SelectionSkipLineYTop = 0x00000040,
  kFlag_SelectionSkipThisYBottom = 0x00000080, kFlag_SelectionSkipLineYBottom = 0x00000100, kFlag_SelectionMask = 0x000001ff, kFlag_ReservedForImplementors = 0xffff0000
}
 
enum  SelectionMode {
  kSelectionMode_AscToDesc = kFlag_SelectionAscToDesc, kSelectionMode_DropCap, kSelectionMode_Anchor = kFlag_SelectionLeadToBase, kSelectionMode_Japanese = kFlag_SelectionJapanese,
  kSelectionMode_Default = kSelectionMode_AscToDesc
}
 
enum  CachedDataType { kCachedDataType_Ink = 0, kCachedDataType_Shading = 1, kCachedDataType_Border = 2, kCachedDataType_ColumnRule = 4 }
 
enum  ShadingHeightFlags {
  kFlag_ShadingTopFlag_Ascent = 0x00000001, kFlag_ShadingTopFlag_Leading = 0x00000002, kFlag_ShadingTopFlag_Baseline = 0x00000004, kFlag_ShadingTopFlag_CapHeight = 0x00000008,
  kFlag_ShadingTopFlag_EmBox = 0x00000010, kFlag_ShadingTopFlag_xHeight = 0x00000020, kFlag_ShadingTopFlag_EmBoxCenter = 0x00000040, kFlag_ShadingTopRangeMask = 0x000000ff,
  kFlag_ShadingBottomFlag_Baseline = 0x00000100, kFlag_ShadingBottomFlag_Descent = 0x00000200, kFlag_ShadingBottomFlag_EmBox = 0x00000400, kFlag_ShadingBottomFlag_EmBoxCenter = 0x00000800,
  kFlag_ShadingBottomRangeMask = 0x00000f00
}
 
enum  ShadingHeightMode {
  kFlag_ShadingHeightAscToDesc = kFlag_ShadingTopFlag_Ascent | kFlag_ShadingBottomFlag_Descent, kFlag_ShadingHeightAscToBase = kFlag_ShadingTopFlag_Ascent | kFlag_ShadingBottomFlag_Baseline, kFlag_ShadingHeightAscToEmBox = kFlag_ShadingTopFlag_Ascent | kFlag_ShadingBottomFlag_EmBox, kFlag_ShadingHeightAscToEmBoxCenter = kFlag_ShadingTopFlag_Ascent | kFlag_ShadingBottomFlag_EmBoxCenter,
  kFlag_ShadingHeightLeadToDesc = kFlag_ShadingTopFlag_Leading | kFlag_ShadingBottomFlag_Descent, kFlag_ShadingHeightLeadToBase = kFlag_ShadingTopFlag_Leading | kFlag_ShadingBottomFlag_Baseline, kFlag_ShadingHeightLeadToEmBox = kFlag_ShadingTopFlag_Leading | kFlag_ShadingBottomFlag_EmBox, kFlag_ShadingHeightLeadToEmBoxCenter = kFlag_ShadingTopFlag_Leading | kFlag_ShadingBottomFlag_EmBoxCenter,
  kFlag_ShadingHeightBaseToDesc = kFlag_ShadingTopFlag_Baseline | kFlag_ShadingBottomFlag_Descent, kFlag_ShadingHeightBaseToBase = kFlag_ShadingTopFlag_Baseline | kFlag_ShadingBottomFlag_Baseline, kFlag_ShadingHeightBaseToEmBox = kFlag_ShadingTopFlag_Baseline | kFlag_ShadingBottomFlag_EmBox, kFlag_ShadingHeightBaseToEmBoxCenter = kFlag_ShadingTopFlag_Baseline | kFlag_ShadingBottomFlag_EmBoxCenter,
  kFlag_ShadingHeightEmBoxToDesc = kFlag_ShadingTopFlag_EmBox | kFlag_ShadingBottomFlag_Descent, kFlag_ShadingHeightEmBoxToBase = kFlag_ShadingTopFlag_EmBox | kFlag_ShadingBottomFlag_Baseline, kFlag_ShadingHeightEmBoxToEmBox = kFlag_ShadingTopFlag_EmBox | kFlag_ShadingBottomFlag_EmBox, kFlag_ShadingHeightEmBoxToEmBoxCenter = kFlag_ShadingTopFlag_EmBox | kFlag_ShadingBottomFlag_EmBoxCenter,
  kFlag_ShadingHeightxHeightToDesc = kFlag_ShadingTopFlag_xHeight | kFlag_ShadingBottomFlag_Descent, kFlag_ShadingHeightxHeightToBase = kFlag_ShadingTopFlag_xHeight | kFlag_ShadingBottomFlag_Baseline, kFlag_ShadingHeightxHeightToEmBox = kFlag_ShadingTopFlag_xHeight | kFlag_ShadingBottomFlag_EmBox, kFlag_ShadingHeightxHeightToEmBoxCenter = kFlag_ShadingTopFlag_xHeight | kFlag_ShadingBottomFlag_EmBoxCenter,
  kFlag_ShadingHeightCapHeightToDesc = kFlag_ShadingTopFlag_CapHeight | kFlag_ShadingBottomFlag_Descent, kFlag_ShadingHeightCapHeightToBase = kFlag_ShadingTopFlag_CapHeight | kFlag_ShadingBottomFlag_Baseline, kFlag_ShadingHeightCapHeightToEmBox = kFlag_ShadingTopFlag_CapHeight | kFlag_ShadingBottomFlag_EmBox, kFlag_ShadingHeightCapHeightToEmBoxCenter = kFlag_ShadingTopFlag_CapHeight | kFlag_ShadingBottomFlag_EmBoxCenter,
  kFlag_ShadingHeightEmBoxCenterToDesc = kFlag_ShadingTopFlag_EmBoxCenter | kFlag_ShadingBottomFlag_Descent, kFlag_ShadingHeightEmBoxCenterToBase = kFlag_ShadingTopFlag_EmBoxCenter | kFlag_ShadingBottomFlag_Baseline, kFlag_ShadingHeightEmBoxCenterToEmBox = kFlag_ShadingTopFlag_EmBoxCenter | kFlag_ShadingBottomFlag_EmBox, kFlag_ShadingHeightEmBoxCenterToEmBoxCenter = kFlag_ShadingTopFlag_EmBoxCenter | kFlag_ShadingBottomFlag_EmBoxCenter
}
 

Public Member Functions

virtual void Draw (GraphicsData *gd, int32 iShapeFlags, Text::DrawPassInfo::Pass pass, const PMRect *areaToDraw=nil)=0
 
virtual void GetInkBounds (PMRect *pInkBounds)=0
 
virtual int32 GetPassCount ()=0
 
virtual Text::DrawPassInfo GetNthPass (int32 n)=0
 
virtual int32 GetSelectionMode () const =0
 
virtual void SetSelectionMode (int32 mode)=0
 
virtual bool16 GetHasOverlappingHiliteRects ()=0
 
virtual void GetSelectionLine (PMLineSeg *pSelectionLine)=0
 
virtual void GetCaretLineAt (int32 offset, PMLineSeg *pCaretLine, const PMLineSeg &pMaxTopBottom) const =0
 
virtual void InvalCachedData (const bool16 invalAll=kTrue, const IWaxLineShape::CachedDataType cachedDataType=IWaxLineShape::kCachedDataType_Ink)=0
 
virtual bool16 GetHasCachedData (const IWaxLineShape::CachedDataType cachedDataType=IWaxLineShape::kCachedDataType_Ink) const =0
 
virtual void UpdateInkBounds (const PMRect *pInitialBounds=nil)=0
 
virtual void GetShadingHeight (ShadingHeightMode shadingHeightMode, PMLineSeg *pShadingHeight, const PMReal &romanBaseline)=0
 
virtual void GetBorderHeight (ShadingHeightMode borderHeightMode, PMLineSeg *pBorderHeight, const PMReal &romanBaseline)=0
 
virtual bool16 GetShadingBounds (PMRect &shadingBounds) const =0
 
virtual bool16 GetBorderBounds (PMRect &borderBounds) const =0
 
virtual void SetShadingBounds (const PMRect &shadingBounds)=0
 
virtual void SetBorderBounds (const PMRect &borderBounds)=0
 
virtual void GetColumnRuleHeight (ShadingHeightMode columnHeightMode, PMLineSeg *pColumnHeight, const PMReal &romanBaseline)=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

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

Member Enumeration Documentation

Parameters for the selection height (describe what the top and bottom of the selection should be derived from.) It is divided into two parts: General Range and Overrides. Each run in the line inspects these flags and computes its selection height. So, the flags pertain to a particular run and is sometimes constrained by the line's parameters.
Enumerator
kFlag_SelectionAscToDesc 

Ascent to Descent

kFlag_SelectionAscToBase 

Ascent to Baseline

kFlag_SelectionLeadToBase 

(Top of) Leading to Baseline - all other flags are ignored if this is set

kFlag_SelectionJapanese 

Embox based

kFlag_SelectionRangeMask 

Mask for the above bits

kFlag_SelectionRespectShift 

Respect the baseline shift, if any

kFlag_SelectionSkipThisYTop 

ignore this run's Top when computing entire line's bounds

kFlag_SelectionSkipLineYTop 

ignore the line's Top when computing a particular run's bounds

kFlag_SelectionSkipThisYBottom 

ignore this run's Bottom when computing entire line's bounds

kFlag_SelectionSkipLineYBottom 

ignore the line's Bottom when computing a particular run's bounds

kFlag_SelectionMask 

Mask for the above bits

kFlag_ReservedForImplementors 

Reserved area for 3rd party flags

Really just a grouping of SelectionFlags for ease of use

Enumerator
kFlag_ShadingHeightAscToDesc 

Ascent to Descent

kFlag_ShadingHeightAscToBase 

Ascent to Baseline

kFlag_ShadingHeightAscToEmBox 

Ascent to EmBox

kFlag_ShadingHeightAscToEmBoxCenter 

Ascent to EmBox center

kFlag_ShadingHeightLeadToDesc 

Leading to Descent

kFlag_ShadingHeightLeadToBase 

Leading to Baseline

kFlag_ShadingHeightLeadToEmBox 

Leading to EmBox

kFlag_ShadingHeightLeadToEmBoxCenter 

Leading to EmBox Center

kFlag_ShadingHeightBaseToDesc 

Baseline to Descent

kFlag_ShadingHeightBaseToBase 

Baseline to Baseline

kFlag_ShadingHeightBaseToEmBox 

Baseline to EmBox

kFlag_ShadingHeightBaseToEmBoxCenter 

Baseline to EmBox Center

kFlag_ShadingHeightEmBoxToDesc 

Embox height to Descent

kFlag_ShadingHeightEmBoxToBase 

Embox height to Baseline

kFlag_ShadingHeightEmBoxToEmBox 

Embox top to bottom

kFlag_ShadingHeightEmBoxToEmBoxCenter 

Embox top to Embox bottom center

kFlag_ShadingHeightxHeightToDesc 

xHeight to Descent

kFlag_ShadingHeightxHeightToBase 

xHeight to Baseline

kFlag_ShadingHeightxHeightToEmBox 

xHeight to EmBox

kFlag_ShadingHeightxHeightToEmBoxCenter 

xHeight to EmBox center

kFlag_ShadingHeightCapHeightToDesc 

Cap Height to Descent

kFlag_ShadingHeightCapHeightToBase 

Cap Height to Baseline

kFlag_ShadingHeightCapHeightToEmBox 

Cap Height to EmBox

kFlag_ShadingHeightCapHeightToEmBoxCenter 

Cap Height to EmBox Center

kFlag_ShadingHeightEmBoxCenterToDesc 

Embox Top Center to Descent

kFlag_ShadingHeightEmBoxCenterToBase 

Embox Top Center to Baseline

kFlag_ShadingHeightEmBoxCenterToEmBox 

Embox Top Center to EmBox

kFlag_ShadingHeightEmBoxCenterToEmBoxCenter 

Embox Top Center to EmBox Bottom Center

Member Function Documentation

virtual void IWaxLineShape::Draw (GraphicsDatagd,
int32 iShapeFlags,
Text::DrawPassInfo::Pass pass,
const PMRectareaToDraw = nil 
)
pure virtual
Draw the waxLine. This includes the text associated with this wax line and any adornments (including global adornments) attacted to it.

The method should inspect all objects (i.e. adornments) associated with it and match any that relate to this pass.

Only objects matching this particular pass should be drawn.

This method will (also) ask each waxRun (via IWaxRunText) to draw itself.

Parameters
gdIN Where to draw.
iShapeFlagsIN Flags defining this type of draw. See IShape "drawing flags" enum.
passIN This particular phase of drawing. The line may not necessarily have anything to draw on every pass.
areaToDrawIN If this is non-nil then it specifies the rectangle that will be drawn and may be used for optimizing what is actually drawn.
See Also
IShape, IGlobalTextAdornment, ITextAdornment, IAdornmentShape, IWaxRunText, DrawPassInfo
virtual bool16 IWaxLineShape::GetBorderBounds (PMRectborderBounds) const
pure virtual
Returns the cached border bounds for this waxline.

Parameters
borderBoundsOUT - cached border bounds.
Returns
- kTrue indicates there are valid border bounds available, and kFalse for otherwise.
virtual void IWaxLineShape::GetBorderHeight (ShadingHeightMode borderHeightMode,
PMLineSegpBorderHeight,
const PMRealromanBaseline 
)
pure virtual
Returns the border height for this waxline based on the input border mode and the roman baseline passed.    

Parameters
borderHeightModeIN -
See Also
IWaxLineShape::ShadingHeightMode - different modes for determining border height.
Parameters
pBorderHeightOUT - pointer to the line segment containing border height.
romanBaselineIN - this is the roman baseline for this wax line. In different locales and feature sets this value may differ. Typically for English this value is 0 and Japanese it's (-Embox bottom).
virtual void IWaxLineShape::GetCaretLineAt (int32 offset,
PMLineSegpCaretLine,
const PMLineSegpMaxTopBottom 
) 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. The direction of the caret can be determined by checking for a logical width of 0. In other words, if the caret is vertical, the width will be 0 and if the caret is horizontal, the height will be 0. NOTE: it is possible that in the future the caret could be some other angle, so that should be accounted for.
maxTopBottomConstraint on the caret height - pCaretLine will be trimmed to maxTopBottom (if DeltaY() is non-zero).
virtual void IWaxLineShape::GetColumnRuleHeight (ShadingHeightMode columnHeightMode,
PMLineSegpColumnHeight,
const PMRealromanBaseline 
)
pure virtual

Returns the column rule for this waxline based on the input border mode and the roman baseline passed.

Parameters
columnHeightModeIN -
See Also
IWaxLineShape::ShadingHeightMode - different modes for determining column rule height.
Parameters
pColumnHeightOUT - pointer to the line segment containing column rule height.
romanBaselineIN - this is the roman baseline for this wax line. In different locales and feature sets this value may differ. Typically for English this value is 0 and Japanese it's (-Embox bottom).
virtual bool16 IWaxLineShape::GetHasCachedData (const IWaxLineShape::CachedDataType cachedDataType = IWaxLineShape::kCachedDataType_Ink) const
pure virtual
Return whether or not this object has cached data for the input type.

Parameters
cachedDataTypeSpecific cached data type, for which the presence of caching data needs to be returned. Default value is kCachedDataType_Ink
Returns
- kTrue indicates cached data for the input type is available, and kFalse for otherwise.
virtual bool16 IWaxLineShape::GetHasOverlappingHiliteRects ()
pure virtual

Return whether this waxLines has overlapping highlight rectangles.

virtual void IWaxLineShape::GetInkBounds (PMRectpInkBounds)
pure virtual
Retrieve the Ink Bounds for this wax line.  The ink bounds is the area (rectangle) in which the ink will draw.

It is used primarily for invalidation. The caller is guaranteed that no ink will draw outside this rectangle for any thing associated with this wax run.

This method will ask each waxRun for its bounds and aggregate them (union).

Parameters
pInkBoundsOUT Should be initialized to empty when called. It will be untouched if there is no ink drawn by this run. The bounds will include the effect of text, local adornments and any IGlobalTextAdornment whose GetHasInkBounds() method returns kTrue.
Note
The ink bounds are in waxLine coordinate space (i.e. "within the line" space). (The same space as the waxRun itself - no xForm need be done at the waxLine level).
See Also
IGlobalTextAdornment, ITextAdornment, IWaxRunShape
virtual Text::DrawPassInfo IWaxLineShape::GetNthPass (int32 n)
pure virtual

Return the pass information structure for the nth Pass. Typically this information is collected in a sorted list and then processed (after all lines in the parcel have been asked).

Note
The pass information at this level DOES NOT include those global text adornments whose IGlobalTextAdornment::CheckCouldDraw() method returns kFalse. That class of adornments are considered to be attached to ALL WaxRuns and therefore it is pointless to make the WaxLine remember them - this is left upto the Parcel container to sort out. See IWaxRunText for more information.
The DrawPassInfo is NOT sorted.
virtual int32 IWaxLineShape::GetPassCount ()
pure virtual
Return the number of passes needed to draw this run.

See Also
DrawPassInfo
virtual void IWaxLineShape::GetSelectionLine (PMLineSegpSelectionLine)
pure virtual
Get the selection line (top/bottom) for this line.  This is typically used to determine the constraints on the height of the highlight for this waxLine.

See GetCaretLineAt for more details on this and IWaxLineHilite for more details on highlighting, in general.

Parameters
pSelectionLineOUT the calculated line.
See Also
IWaxLineHilite
virtual bool16 IWaxLineShape::GetShadingBounds (PMRectshadingBounds) const
pure virtual
Returns the cached shading bounds for this waxline.

Parameters
shadingBoundsOUT - cached shading bounds.
Returns
- kTrue indicates there are valid shading bounds available, and kFalse for otherwise.
virtual void IWaxLineShape::GetShadingHeight (ShadingHeightMode shadingHeightMode,
PMLineSegpShadingHeight,
const PMRealromanBaseline 
)
pure virtual
Returns the shading height for this waxline based on the input shading mode and the roman baseline passed.  

Parameters
shadingHeightModeIN -
See Also
IWaxLineShape::ShadingHeightMode - different modes for determining shading height.
Parameters
pShadingHeightOUT - pointer to the line segment containing shading height.
romanBaselineIN - this is the roman baseline for this wax line. In different locales and feature sets this value may differ. Typically for English this value is 0 and Japanese it's (-Embox bottom).
virtual void IWaxLineShape::InvalCachedData (const bool16 invalAll = kTrue,
const IWaxLineShape::CachedDataType cachedDataType = IWaxLineShape::kCachedDataType_Ink 
)
pure virtual
Invalidate cached information (if any) held by this interface with the aim that subsequent calls to this interface will (automatically and silently) re-compute the original data.

Parameters
invalAllA boolean value depicting whether all the cached content needs to be invalidated, or the specific cached data type, passed as second argument, needs to be invalidated. Its default value is kTrue.
cachedDataTypeSpecific cached data type to be invalidated. This will be honored only if the first arugment passed has kFalse value. Default value is kCachedDataType_Ink
Note
that this does NOT cause screen inval with WaxLine::Inval()
virtual void IWaxLineShape::SetBorderBounds (const PMRectborderBounds)
pure virtual
Sets the border bounds to be cached for this waxline.

Parameters
borderBoundsIN - border bounds to be set for this waxline.
virtual void IWaxLineShape::SetSelectionMode (int32 mode)
pure virtual
Note
ADDs mode to the current mode - there is no way to clear existing flags
virtual void IWaxLineShape::SetShadingBounds (const PMRectshadingBounds)
pure virtual
Sets the shading bounds to be cached for this waxline.

Parameters
shadingBoundsIN - shading bounds to be set for this waxline.
virtual void IWaxLineShape::UpdateInkBounds (const PMRectpInitialBounds = nil)
pure virtual

The implementation is asked to re-compute the InkBounds.