InDesign SDK  20.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
CHandleShape.h
1 //========================================================================================
2 //
3 // $File$
4 //
5 // Owner: Jack Kirstein
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 __CHandleShape__
25 #define __CHandleShape__
26 
27 #include "IConcreteSelection.h"
28 #include "IHandleShape.h"
29 #include "GraphicsID.h"
30 #include "HelperInterface.h"
31 #include "PMMatrix.h"
32 #include "IAdornmentHandleShape.h"
33 
34 class IGraphicsPort;
35 class IRasterPort;
37 class IHierarchy;
38 
39 class CHandleShape : public IHandleShape
40 {
41 public:
42  CHandleShape(IPMUnknown *boss);
43 
44  virtual void DrawHandleShape(GraphicsData* gd, IConcreteSelection* concreteSelection, int32 shapeflags);
45  virtual void DrawControlPointPath(GraphicsData* gd, int32 shapeflags);
46 
47  virtual bool16 HitTest(GraphicsData* gd, const PMRect &r, PointSelector* handleIndex, bool16 bDragging);
48  virtual bool16 HitTestControlPointPath(GraphicsData* gd, const PMRect &r);
49 
50  virtual void GetControlPointPathOutlineInfo (IOutlineInfo* iOutlineInfo);
51 
52  virtual PMRect GetPaintedHandleBounds( const PMMatrix& theMatrix);
53  virtual void Inval(GraphicsData *gd, ClassID reasonForInval, int32 shapeflags);
54 
55  virtual ITracker* QueryTracker(IControlView *layView, const PBPMPoint& where, int32 selectionMode, const PointSelector& index);
56 
57  virtual ITip* QueryTip(const PointSelector* handleIndex);
58 protected:
59  // sub classes need to override all of these, but NOT the above methods unless you DON'T want text frame behavior
60  virtual void DrawHandlesImmediate(GraphicsData *gd, IConcreteSelection* concreteSelection, int32 shapeflags) = 0;
61  virtual void DrawPathImmediate(GraphicsData *gd, int32 shapeflags) = 0;
62  virtual PMRect GetBBoxImmediate(const PMMatrix& itoview) = 0;
63  virtual bool16 HitTestHandlesImmediate(GraphicsData *gd, const PMRect &r, PointSelector *handleIndex) = 0;
64  virtual bool16 HitTestPathImmediate(GraphicsData *gd, const PMRect &r) = 0;
65 
66  // utilities -- the virtual one CAN be overridden, but rarely are (exception: standoffs)
67  virtual void SetHandleColor( GraphicsData* gd, UID layerUID );
68  virtual bool16 HitTestOneHandle( GraphicsData* gd, const PMRect &r, const PMPoint& point, PMRect::PointIndex whichPoint ) const ;
69 
70  virtual void TextFrameHandlesPath( GraphicsData* gd, int32 textflags, const PMPoint& pt1, const PMPoint& pt2);
71  virtual void DrawTextFrameHandles(GraphicsData *gd, int32 shapeflags, int32 textflags);
72  virtual bool16 HitTestTextFrameHandles(GraphicsData *gd, const PMRect &r, PointSelector *handleIndex, int32 textflags);
73 // virtual void GetTextFrameHandlePositions(PMPoint *point1, PMPoint *point2);
74  virtual void AddTextFrameHandleWidth (const PMMatrix& theMatrix, PMRect* itemBounds) const;
75  virtual ITracker* QueryTextFrameTracker(IControlView *layView, const PBPMPoint& where, int32 selectionMode, const PointSelector& index);
76 
77  bool16 HandlesDisabled (GraphicsData *gd, int32 shapeflags);
78 
79  bool16 HasContent(); // returns ktrue if the item has one or more children
80 
81 protected:
82  // helper methods to access the adornments
83  void DrawAdornments( IAdornmentHandleShape::AdornmentDrawOrder drawOrder, GraphicsData* gd, IConcreteSelection* concreteSelection, int32 flags);
84  void DrawAdornmentControlPointPath(IAdornmentHandleShape::AdornmentDrawOrder drawOrder, GraphicsData* gd, int32 flags);
85  bool16 HitTestAdornment(IAdornmentHandleShape::AdornmentDrawOrder drawOrder, GraphicsData* gd, const PMRect &r, PointSelector* handleIndex, bool16 bDragging);
86  bool16 HitTestAdornmentControlPointPath(IAdornmentHandleShape::AdornmentDrawOrder drawOrder, GraphicsData* gd, const PMRect &r);
87  void GetPaintedAdornmentBounds(IAdornmentHandleShape::AdornmentDrawOrder drawOrder, const PMMatrix& pbtoview, PMRect* handleRect);
88  ITracker* QueryAdornmentTracker
89  (IAdornmentHandleShape::AdornmentDrawOrder drawOrder, IControlView *layView, const PBPMPoint& where, int32 selectionMode, const PointSelector& index);
90 
91 protected:
92  IGeometry* fGeometry; // Never nil
93  IPageItemAdornmentList* fAdornmentList; // may be nil
94 
95  PMReal fHandleRed;
96  PMReal fHandleGreen;
97  PMReal fHandleBlue;
98 
99 
100 private:
101 
102  UID fTextFrameUID;
103 
104 
105 
106 };
107 
108 #endif