|
| virtual void | InitHandler (GraphicsData *theGD, IShape *theShape)=0 |
| |
| virtual void | TerminateHandler (void)=0 |
| |
| virtual const PMRect | GetHandlerIntersectionRect (void) const =0 |
| |
| virtual const GraphicsData * | GetHandlerGraphicsDataPtr (void) const =0 |
| |
| virtual bool16 | HandleSpread (IVisitorHelper *pVisitable, IBaseVisitor *theVisitor)=0 |
| |
| virtual bool16 | HandleSpreadLayer (IVisitorHelper *pVisitable, IBaseVisitor *theVisitor)=0 |
| |
| virtual bool16 | HandleInlineItem (IVisitorHelper *pVisitable, IBaseVisitor *theVisitor)=0 |
| |
| virtual bool16 | HandleSplineItem (IVisitorHelper *pVisitable, IBaseVisitor *theVisitor)=0 |
| |
| virtual bool16 | HandleMultiColumnFrameItem (IVisitorHelper *pVisitable, IBaseVisitor *theVisitor)=0 |
| |
| virtual bool16 | HandleFrameItem (IVisitorHelper *pVisitable, IBaseVisitor *theVisitor)=0 |
| |
| virtual bool16 | HandleGroupItem (IVisitorHelper *pVisitable, IBaseVisitor *theVisitor)=0 |
| |
| virtual bool16 | HandleGuideItem (IVisitorHelper *pVisitable, IBaseVisitor *theVisitor)=0 |
| |
| virtual bool16 | HandlePage (IVisitorHelper *pVisitable, IBaseVisitor *theVisitor)=0 |
| |
| virtual bool16 | HandleImageItem (IVisitorHelper *pVisitable, IBaseVisitor *theVisitor)=0 |
| |
| virtual bool16 | HandleHTMLItem (IVisitorHelper *pVisitable, IBaseVisitor *theVisitor)=0 |
| |
| virtual bool16 | HandleEPSTextItem (IVisitorHelper *pVisitable, IBaseVisitor *theVisitor)=0 |
| |
| virtual bool16 | HandleEPSItem (IVisitorHelper *pVisitable, IBaseVisitor *theVisitor)=0 |
| |
| virtual bool16 | HandlePICTItem (IVisitorHelper *pVisitable, IBaseVisitor *theVisitor)=0 |
| |
| virtual bool16 | HandleWMFItem (IVisitorHelper *pVisitable, IBaseVisitor *theVisitor)=0 |
| |
| virtual bool16 | HandlePDFItem (IVisitorHelper *pVisitable, IBaseVisitor *theVisitor)=0 |
| |
| virtual bool16 | HandleTOPItem (IVisitorHelper *pVisitable, IBaseVisitor *theVisitor)=0 |
| |
| virtual bool16 | HandleOwnedItem (IVisitorHelper *pVisitable, IBaseVisitor *theVisitor)=0 |
| |
| virtual bool16 | HandleWaxAnchoredElementItem (IVisitorHelper *pVisitable, IBaseVisitor *theVisitor)=0 |
| |
| virtual bool16 | HandleParcelItem (IVisitorHelper *pVisitable, IBaseVisitor *theVisitor)=0 |
| |
| virtual bool16 | HandleUnknownItem (IVisitorHelper *pVisitable, IBaseVisitor *theVisitor)=0 |
| |
| virtual IPMUnknown * | QueryInterface (PMIID interfaceID) const =0 |
| |
| virtual void | AddRef () const =0 |
| |
| virtual void | Release () const =0 |
| |
An interface class used in conjunction with IBaseVisitor and IVisitorHelper, IBaseHandler
accomplishes item-specific tasks during a traversal (or visitation) of a structure of connected
nodes -- typically (but not limited to) pageitems on a spread. As the visitor traverses the
structure, it invokes the appropriate method in the handler to accomplish the task for the
current node. Using a separate handler is an extension of the visitor design pattern presented
in Gamma, et al.
The separation of handling the "problem" from the particulars of node traversal allows, for
instance, the same form of traversal to be used for several problem (or "handling") solutions.
For instance, InDesign uses this visitor/handler scheme for hit-testing, but it could (though
presently does not) use the same visitor and a different handler to support pageitem drawing.
NOTE: It is the HandleXXX routine's responsibility to cause visitation of the item's children by
calling theVisitor->VisitChildren(pVisitable), if it is desired that the child nodes be
processed. If for whatever reason the handler decides the children do not need visitation
(say in the case of the handler's task already being accomplished within the HandleXXX routine),
it may simply return without visiting the children.
FURTHER NOTE: Third-party-created pageitems that are not derived from built-in InDesign page item bosses must contain
an IVisitorHelper interface on the page item boss in order for hit-testing to be supported for the item.
Also, HandleXXX routines aren't defined for these pageitems in IBaseHandler, so
these should be provided by custom implementations that are added-in to the kPtrHitTestHandlerBoss.
The kPtrHitTestHandlerBoss is the base boss for InDesign hit-testing; several other boss
classes derive from it.
The handler mechanism can be extended to support a new node, by adding-in a new interface to the handler
boss for the task or problem being handled. Such an interface, say for a node called MyNode, would
contain a HandleMyNode() routine, along these lines:
<pre>
bool16 MyNodeHandlerImpl::HandleMyNode(IVisitorHelper* pVisitable, IBaseVisitor* theVisitor)
{
bool16 bDone = kFalse;
Whatever the task to perform, now is the time to perform it on this node, if the task should be performed before performing it on the node's children. Set bDone to kTrue if no further handling should be done. ...
if ( !bDone )
{
Not done, so visit the children bDone = theVisitor->VisitChildren(pVisitable); If, after visiting the children, we have more to do, do it here } } If there is more data to return to caller than bDone, put it on an interface that has been added-in to the handler boss. The code that started this visitor/handler traversal (see sample code in IVisitorHelper.h) can retrieve it there.
return bDone;
}
</pre>
- See Also
- IBaseVisitor
- IVisitorHelper