InDesign SDK  20.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
BaseHitTestHandler.h
1 //========================================================================================
2 //
3 // $File$
4 //
5 // Owner: Rich Gartland
6 //
7 // $Author$
8 //
9 // $DateTime$
10 //
11 // $Revision$
12 //
13 // $Change$
14 //
15 // Copyright 1997-2010 Adobe Systems Incorporated. All rights reserved.
16 //
17 // NOTICE: Adobe permits you to use, modify, and distribute this file in accordance
18 // with the terms of the Adobe license agreement accompanying it. If you have received
19 // this file from a source other than Adobe, then your use, modification, or
20 // distribution of it requires the prior written permission of Adobe.
21 //
22 //========================================================================================
23 
24 #ifndef __BASEHITTESTHANDLER__
25 #define __BASEHITTESTHANDLER__
26 
27 #include "IPMUnknown.h"
28 #include "IBaseHandler.h"
29 
30 #include "LayoutUIID.h"
31 #include "HelperInterface.h"
32 #include "IAdornmentShape.h"
33 
34 
53 {
54  public:
58  typedef enum {
64 
68  typedef enum {
74 
78  typedef enum {
88 
91 
96  virtual void InitHandler(GraphicsData* gd, IShape* theShape);
97 
100  virtual void TerminateHandler(void);
101 
105  virtual const PMRect GetHandlerIntersectionRect(void) const ;
106 
110  virtual const GraphicsData* GetHandlerGraphicsDataPtr(void) const { return fHitTestHandlerGrarphicsData; }
111 
117  virtual bool16 HandleSpread(IVisitorHelper* pVisitable, IBaseVisitor* theVisitor);
118 
124  virtual bool16 HandleSpreadLayer(IVisitorHelper* pVisitable, IBaseVisitor* theVisitor);
125 
131  virtual bool16 HandleInlineItem(IVisitorHelper* pVisitable, IBaseVisitor* theVisitor);
132 
138  virtual bool16 HandleSplineItem(IVisitorHelper* pVisitable, IBaseVisitor* theVisitor);
139 
145  virtual bool16 HandleMultiColumnFrameItem(IVisitorHelper* pVisitable, IBaseVisitor* theVisitor);
146 
152  virtual bool16 HandleFrameItem(IVisitorHelper* pVisitable, IBaseVisitor* theVisitor);
153 
159  virtual bool16 HandleGroupItem(IVisitorHelper* pVisitable, IBaseVisitor* theVisitor);
160 
166  virtual bool16 HandleGuideItem(IVisitorHelper* pVisitable, IBaseVisitor* theVisitor);
167 
173  virtual bool16 HandlePage(IVisitorHelper* pVisitable, IBaseVisitor* theVisitor);
174 
180  virtual bool16 HandleImageItem(IVisitorHelper* pVisitable, IBaseVisitor* theVisitor);
181 
187  virtual bool16 HandleHTMLItem(IVisitorHelper* pVisitable, IBaseVisitor* theVisitor);
188 
194  virtual bool16 HandleEPSTextItem(IVisitorHelper* pVisitable, IBaseVisitor* theVisitor);
195 
201  virtual bool16 HandleEPSItem(IVisitorHelper* pVisitable, IBaseVisitor* theVisitor);
202 
208  virtual bool16 HandlePICTItem(IVisitorHelper* pVisitable, IBaseVisitor* theVisitor);
209 
215  virtual bool16 HandleWMFItem(IVisitorHelper* pVisitable, IBaseVisitor* theVisitor);
216 
222  virtual bool16 HandlePDFItem(IVisitorHelper* pVisitable, IBaseVisitor* theVisitor);
223 
229  virtual bool16 HandleTOPItem(IVisitorHelper* pVisitable, IBaseVisitor* theVisitor);
230 
236  virtual bool16 HandleOwnedItem(IVisitorHelper* pVisitable, IBaseVisitor* theVisitor);
237 
243  virtual bool16 HandleWaxAnchoredElementItem(IVisitorHelper* pVisitable, IBaseVisitor* theVisitor);
244 
250  virtual bool16 HandleParcelItem(IVisitorHelper* pVisitable, IBaseVisitor* theVisitor);
251 
257  virtual bool16 HandleUnknownItem(IVisitorHelper* pVisitable, IBaseVisitor* theVisitor);
258 
259  protected:
262  virtual bool16 HandleAdornments(IAdornmentShape::AdornmentDrawOrder drawOrder, IVisitorHelper* pVisitable, IBaseVisitor* theVisitor);
263 
267  {
268  public:
270  {
271  fHandler = handler;
272  if (fHandler)
273  {
274  fHandler->AddRef();
275  fHandler->SetupHitTestHandlerPort(theShape);
276  }
277  }
278  ConcatTransformInScope(BaseHitTestHandlerImpl* handler, const PMMatrix& toPasteboard)
279  {
280  fHandler = handler;
281  if (fHandler)
282  {
283  fHandler->AddRef();
284  fHandler->SetupHitTestHandlerPort(toPasteboard);
285  }
286  }
287 
289  {
290  if (fHandler)
291  {
292  fHandler->CleanupHitTestHandlerPort();
293  fHandler->Release();
294  }
295  }
296 
297  private:
299  ConcatTransformInScope& operator=(const ConcatTransformInScope& other);
300 
301  //---- Data
302  BaseHitTestHandlerImpl* fHandler;
303  };
304 
305  friend class ConcatTransformInScope;
306 
307  //---- Helpers
310  void InitAssociatedData(void);
311 
327  virtual bool16 StandardPageItemHandler(IVisitorHelper* pVisitable, IBaseVisitor* theVisitor);
328 
344  virtual bool16 StandardLeafNodeHandler(IVisitorHelper* pVisitable, IBaseVisitor* theVisitor);
345 
353  virtual bool16 HitTestTextOnPath( IShape* iShape, IAdornmentShape::AdornmentDrawOrder drawOrder, GraphicsData* gd, const PMRect& r /*in view coordinates*/) const ;
354 
360  virtual bool16 HandleSpreadOMP(IVisitorHelper* pVisitable, IBaseVisitor* theVisitor);
361 
370 
378  virtual bool16 DoHandleSplineItem(IVisitorHelper* pVisitable, IBaseVisitor* theVisitor, LockedItemTreatment lit = kDontSeeLockedItems);
379 
380  /* Checks to see if an item is locked. It looks for the IID_ILOCKPOSITION interface and checks the lock state.
381  @param item pointer to an impl on the boss of the item to check.
382  @return kTrue if locked. kFalse if unlocked or the interface is not there.
383  */
384  virtual bool16 IsItemLocked(IPMUnknown * item);
385 
386  //---- Data
387  GraphicsData* fHitTestHandlerGrarphicsData;
388  PMRect fTheHitTestRectangle;//view coordinates -- is this ever modified ? set up in BaseHitTestHandlerImpl::InitAssociatedData from theData->GetHitTestRectangle()
389  UIDList* fThingsHit;
390  IShape* fShape;
391 
392 
393 private:
394  void SetupHitTestHandlerPort(IShape* theShape);
395  void SetupHitTestHandlerPort(const PMMatrix& toPasteboard);
396  void CleanupHitTestHandlerPort(void);
397 };
398 
399 
400 #endif