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

#include <IDrawCJKGrid.h>

Inheritance diagram for IDrawCJKGrid:
IPMUnknown

Public Member Functions

virtual void Draw (const IPMUnknown *shape, const ICJKGridData *gridData, const ICJKGridManager *gridManager, const PMReal &lineWidth, const GraphicsData *gd, const int32 flags)=0
 
virtual PMRect GetPaintedBBox (const IShape *iShape, const PMRect &itemBounds, const PMMatrix &innertoview) const =0
 
virtual void Inval (IShape *iShape, const GraphicsData *gd, const ClassID reasonForInval, const int32 flags) const =0
 
virtual void DrawOpenCell (const PMRect &rect, int32 &position) const =0
 
virtual void DrawFilledCell (const PMRect &rect, int32 &position) const =0
 
virtual void EndDraw (int32 &position) 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

IDrawCJKGrid allows for custom CJK grid drawing.

Member Function Documentation

virtual void IDrawCJKGrid::Draw (const IPMUnknownshape,
const ICJKGridDatagridData,
const ICJKGridManagergridManager,
const PMReallineWidth,
const GraphicsDatagd,
const int32 flags 
)
pure virtual

Draw will be called to draw the grid.

The drawing of grid cells is optimized by calling DrawVisibleICFBoxRects and DrawVisibleEmBoxRects on the ICJKGridManager. This will in turn call your DrawOpenCell(), DrawFilledCell(), and EndDraw(). If you wish to use optimized grid drawing, you will need to save the GraphicsData from this Draw call and use it in your DrawOpenCell(), DrawFilledCell(), and EndDraw() methods. You will also need to call DrawVisibleEmBoxRects or DrawVisibleICFBoxRects on the ICJKGridManager for this object.

Parameters
shapeIN The shape the grid is drawing on.
gridDataIN The grids ICJKGridData.
gridManagerThe grids ICJKGridManager.
lineWidthIN The linewidth that should be used to draw this grid.
gdIN The GraphicsData you are drawing into.
flagsIN The drawing flags this shape is drawing with.
virtual void IDrawCJKGrid::DrawFilledCell (const PMRectrect,
int32 & position 
) const
pure virtual

DrawFilledCell is called by the grid manager's optimized grid drawing code on filled cells. Your implementation can draw one filled cell any way you like it. It's best not to stroke the graphics port everytime. It however, may be useful to stroke every 1000 cells in case you are drawing a massive grid. Otherwise you should call stroke in EndDraw.

Parameters
rectIN The rectangle bounds of the cell.
positionIN The cell number.
virtual void IDrawCJKGrid::DrawOpenCell (const PMRectrect,
int32 & position 
) const
pure virtual

DrawOpenCell is called by the grid manager's optimized grid drawing code. Your implementation can draw one open cell any way you like it. It's best not to stroke the graphics port everytime. It however, may be useful to stroke every 1000 cells in case you are drawing a massive grid. Otherwise you should call stroke in EndDraw.

Parameters
rectIN The rectangle bounds of the cell.
positionIN The cell number.
virtual void IDrawCJKGrid::EndDraw (int32 & position) const
pure virtual

EndDraw is called after the last call to DrawOpenCell or DrawFilledCell.

Parameters
positionIN The last cell drawn.
Precondition
You probably need to call stroke if position is > 0.
virtual PMRect IDrawCJKGrid::GetPaintedBBox (const IShapeiShape,
const PMRectitemBounds,
const PMMatrixinnertoview 
) const
pure virtual

GetPaintedBBox returns the rect of the grid in view coordinates. This most likely is just itemBounds, but in the event you wish the grid to extend beyond itemBounds, you need to return the extra area.

Parameters
iShapeIN The shape the grid is drawing on.
itemBoundsIN The items current bounds in view coordinates.
innertoviewIN InnerToView transform matrix.
virtual void IDrawCJKGrid::Inval (IShapeiShape,
const GraphicsDatagd,
const ClassID reasonForInval,
const int32 flags 
) const
pure virtual
Inval, like it's namesake on IAdornmentShape is provided for completeness.

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

Parameters
iShapeIN The shape the grid is drawing on.
gdIN The GraphicsData you are drawing into.
reasonForInvalIN Why we are invalidating.
flagsIN The drawing flags this shape is drawing with.