InDesign SDK  20.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
C9PointProxyEH.h
1 //========================================================================================
2 //
3 // $File$
4 //
5 // Owner:
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 __ProxyViewEventHandler__
25 #define __ProxyViewEventHandler__
26 
27 #include "IReferencePointData.h"
28 
29 class IPMUnknown;
30 class IEvent;
31 class VirtualKey;
32 class PMLine;
33 
39 #include "DVControlEventHandler.h"
40 
41 
43 {
45 
46 public:
48  enum
49  {
50  kMainDiamondHeight = 24,
51  kCornerDiamondHeight = 8,
52  kMainSquareHeight = 19,
53  kCornerSquareHeight = 7,
54  kLineSquareHeight = 7
55  };
56 
58  ~C9PointProxyEH();
59 
64  virtual bool16 CanHaveKeyFocus() const = 0;
65 
72  virtual bool16 KeyDown(IEvent* e);
73 
79  virtual bool16 LButtonDn(IEvent* e);
80 
91  const PMReal& xScale,
92  const PMReal& yScale,
93  const PMReal& cwAngle,
94  bool16 invert);
95 
104  static void TransformPoint(PMPoint& point,
105  const PMReal& xScale, const PMReal& yScale, const PMReal& cwAngle,
106  const PMPoint& referencePoint, bool16 invert);
107 
113 
119 
127  const PMRect& mainSquare);
128 
137  const PMRect& mainSquare,
138  const PMReal& cornerHeight);
139 
148  const PMPolygon4& mainDiamond,
149  const PMReal& cornerHeight);
150 
156  static bool16 Contains(const PMPolygon4& poly4, const PMPoint& point);
157 
163  static void MakeDiamond(PMPolygon4& poly4, const PMPoint& center, const PMReal& height);
164 
169  static void Poly4Inset(PMPolygon4& poly4, const PMReal& inset);
170 
176  static short Octant(const PMReal& angle);
177 
183 
189 
190 protected:
195  virtual void PostGetKeyFocus();
196 
201  virtual void PostGiveUpKeyFocus();
202 
208 
214 
220 
221 
228 
233 
237  void HandleKeyEvent(VirtualKey& key);
238 
239 private:
242  virtual void InvalidateFocus();
243 
246  virtual void ReleaseKeyBoardFocus();
247 };
248 
249 #endif
250