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

#include <IAdornmentShape.h>

Inheritance diagram for IAdornmentShape:
IPMUnknownCPMUnknown< IAdornmentShape >CusDtLnkAdornmentShapeFrmLblAdornmentTranFxAdornment

Public Types

enum  { kDefaultIID = IID_IADORNMENTSHAPE }
 
enum  AdornmentDrawOrder {
  kNone = 0, kBeforeShape = 1, kAfterFill = 2, kBeforeTextBackground = 4,
  kBeforeText = 8, kBeforeTextForeground = 16, kAfterTextForeground = 32, kBeforeStroke = 64,
  kAfterStroke = 128, kAfterShape = 256, kBeforeFill = 512, kBeforeContent = 1024,
  kAfterContent = 2048, kAfterEndShape = 4096, kAfterSpread = 8192, kAllAdornmentFlags = 16383
}
 
enum  AdornmentDrawNumber { kNumberOfAdornments = 14 }
 

Public Member Functions

virtual AdornmentDrawOrder GetDrawOrderBits ()=0
 
virtual void DrawAdornment (IShape *iShape, AdornmentDrawOrder drawOrder, GraphicsData *gd, int32 flags)=0
 
virtual PMRect GetPaintedAdornmentBounds (IShape *iShape, AdornmentDrawOrder drawOrder, const PMRect &itemBounds, const PMMatrix &innertoview)=0
 
virtual PMRect GetPrintedAdornmentBounds (IShape *iShape, AdornmentDrawOrder drawOrder, const PMRect &itemBounds, const PMMatrix &innertoview)=0
 
virtual void AddToContentInkBounds (IShape *iShape, PMRect *inOutBounds)=0
 
virtual PMReal GetPriority ()=0
 
virtual void Inval (IShape *iShape, AdornmentDrawOrder drawOrder, GraphicsData *gd, ClassID reasonForInval, int32 flags)=0
 
virtual bool16 WillPrint ()=0
 
virtual bool16 WillDraw (IShape *iShape, AdornmentDrawOrder drawOrder, GraphicsData *gd, int32 flags)=0
 
virtual bool16 HitTest (IShape *iShape, AdornmentDrawOrder adornmentDrawOrder, IControlView *layoutView, const PMRect &mouseRect)=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

IAdornmentShape is the interface that a boss must implement to be considered a page item adornment.

The ClassID for the boss will be added to a page item adornment list on a page item. It's draw order bits will designate when the adornment will draw.

Typically the boss that implements this interface would be marked recycleable in the source file that implements this interface. This is because instances of this boss can come and go very frequently during drawing and hit testing.

Member Function Documentation

virtual void IAdornmentShape::AddToContentInkBounds (IShapeiShape,
PMRectinOutBounds 
)
pure virtual

AddToContentInkBounds

Takes as input a rectangle representing the bounds of some content which has changed its inkinkg in some way. The adornment will modify that bounds if necessary to reflect the change in inking that it would want as a result. This is only used by adornments for which the inking bounds are based on the content. Adornments for which inking bboxes are based solely on the frame do not need to implement this routine. Note: The bounds are based on inner coordinates.

Parameters
iShapeIN The shape that is being adorned.
inOutBoundsINOUT The bounds of some content which has changed, the adornment will modify.

Implemented in FrmLblAdornment, TranFxAdornment, and CusDtLnkAdornmentShape.

virtual void IAdornmentShape::DrawAdornment (IShapeiShape,
AdornmentDrawOrder drawOrder,
GraphicsDatagd,
int32 flags 
)
pure virtual

DrawAdornment draws the page item adornment.

Parameters
iShapeIN The shape that's being adorned.
drawOrderIN The current draw order bits.
gdIN The current GraphicsData.
flagsIN The graphics's ports flags.

Implemented in TranFxAdornment, FrmLblAdornment, and CusDtLnkAdornmentShape.

virtual AdornmentDrawOrder IAdornmentShape::GetDrawOrderBits ()
pure virtual

GetDrawOrderBits returns the bits that designate when the adornment draws. Upon calling AddAdornment, the adornment is inserted into the list based on these draw order bits. If more the one of the flags are & together, the adornment is put on the list in all specified locations.

Returns
The bits that designate when the adornment draws.

Implemented in TranFxAdornment, FrmLblAdornment, and CusDtLnkAdornmentShape.

virtual PMRect IAdornmentShape::GetPaintedAdornmentBounds (IShapeiShape,
AdornmentDrawOrder drawOrder,
const PMRectitemBounds,
const PMMatrixinnertoview 
)
pure virtual

GetPaintedAdornmentBounds returns the painted bounds of the adorment.

Parameters
iShapeIN The shape that's being adorned.
drawOrderIN The current draw order bits.
itemBoundsIN The bounds of the adorned object.
innertoviewIN The inner to view matrix.

Implemented in TranFxAdornment, FrmLblAdornment, and CusDtLnkAdornmentShape.

virtual PMRect IAdornmentShape::GetPrintedAdornmentBounds (IShapeiShape,
AdornmentDrawOrder drawOrder,
const PMRectitemBounds,
const PMMatrixinnertoview 
)
pure virtual

GetPrintedAdornmentBounds returns the printed bounds of the adorment.

Parameters
iShapeIN The shape that's being adorned.
drawOrderIN The current draw order bits.
itemBoundsIN The bounds of the adorned object.
innertoviewIN The inner to view matrix.

Implemented in TranFxAdornment, FrmLblAdornment, and CusDtLnkAdornmentShape.

virtual PMReal IAdornmentShape::GetPriority ()
pure virtual

GetPriority is used to resolve ties between adornments in the page item adornment list.

Returns
A floating point number (lower means higher priority).

Implemented in TranFxAdornment, FrmLblAdornment, and CusDtLnkAdornmentShape.

virtual bool16 IAdornmentShape::HitTest (IShapeiShape,
AdornmentDrawOrder adornmentDrawOrder,
IControlViewlayoutView,
const PMRectmouseRect 
)
pure virtual

This method will return true if the mouse point is over the adornment. If you override this you will need to call this directly. It is not hooked into any other hit test framework.

Parameters
iHandleShapethe item with the adornment
adornmentDrawOrderIn case this adornment is used more than once
layoutViewview
mouseRectRectangle around the mouse point in Window coordinates
Returns
true if mouse is over adornment

Implemented in TranFxAdornment, FrmLblAdornment, and CusDtLnkAdornmentShape.

virtual void IAdornmentShape::Inval (IShapeiShape,
AdornmentDrawOrder drawOrder,
GraphicsDatagd,
ClassID reasonForInval,
int32 flags 
)
pure virtual
AddToContentInkBounds

This method is provided for completeness. When the owning shape is inval'd it includes the adornment in it's bounding box. Under most circumstances the adornment need do nothing in its inval method. There are times, however, when specific page items will get a specific reasonFoInval, and an adornment may want to know about that inval. This provides a mechanism to respond to such an event.

Parameters
iShapeIN The shape that's being adorned.
drawOrderIN The current draw order bits.
gdIN The current GraphicsData.
reasonForInvalIN The reason for invaling.
flagsIN The graphics's ports flags.

Implemented in TranFxAdornment, FrmLblAdornment, and CusDtLnkAdornmentShape.

virtual bool16 IAdornmentShape::WillDraw (IShapeiShape,
AdornmentDrawOrder drawOrder,
GraphicsDatagd,
int32 flags 
)
pure virtual

This method is being called by the TextOffScreen code. Textoffscreen drawing is suspended if page item adornments want to draw into the background. The default implementation in CAdornmentShape returns kFalse. Note that FrameShape::Inval still only calls its CShape::InvalPageItemAdornments() if it didn't draw into the text offscreen.

Parameters
iShapeIN The shape that's being adorned.
drawOrderIN The current draw order bits.
gdIN The current GraphicsData.
flagsIN The graphics's ports flags.

Implemented in TranFxAdornment, FrmLblAdornment, and CusDtLnkAdornmentShape.

virtual bool16 IAdornmentShape::WillPrint ()
pure virtual

Return true if this adornment is one that will print (i.e. not just an on-screen adornment). Drop shadow is an example of a printing adornment. Default implementation in CAdornmentShape is to return kFalse.

Returns
kTrue if this adornment will print.

Implemented in TranFxAdornment, FrmLblAdornment, and CusDtLnkAdornmentShape.