InDesign SDK  20.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
CLayoutTracker.h
1 //========================================================================================
2 //
3 // $File$
4 //
5 // Owner: Richard Rodseth
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 // Base class of ScaleTracker and RotateTracker
24 // Introduces StartDrag/ContinueDrag/StopDrag protocol, and patient user support
25 // Intended as potential replacement for CWireTracker
26 //
27 //========================================================================================
28 
29 #ifndef __CLAYOUTTRACKER__
30 #define __CLAYOUTTRACKER__
31 
32 #include "CTracker.h"
33 #include "PMRect.h"
34 
35 //----------------------------------------------------------------------------------------
36 // Forward declarations
37 //----------------------------------------------------------------------------------------
38 class ITrackerTimer;
39 
40 //----------------------------------------------------------------------------------------
41 // Class CLayoutTracker
42 //----------------------------------------------------------------------------------------
43 
44 
45 class CLayoutTracker : public CTracker
46 {
47  public:
48  virtual ~CLayoutTracker();
49 
50  virtual bool16 BeginTracking(IEvent* theEvent);
51  virtual void ContinueTracking(const PBPMPoint& where, bool16 mouseDidMove);
52  virtual bool16 EndTracking(IEvent* theEvent);
53  virtual void AbortTracking(IEvent* theEvent);
54 
55  protected: // Frequently overridden
56  virtual void Initialize(IEvent* theEvent);
57  virtual bool16 DoBeginTracking(IEvent* theEvent);
58  virtual void StartDrag(const PBPMPoint& where);
59  virtual void ContinueDrag(const PBPMPoint& where, bool16 shiftDown);
60  virtual void StopDrag(const PBPMPoint& where);
61 
62 
63  protected: // Rarely overridden
65 
66  virtual void HandleStartDrag(const PBPMPoint& where);
67  // Sets fDragStarted, and calls StartDrag
68 
69  virtual void HandleStopDrag(const PBPMPoint& where);
70  // Calls StartDrag and sets fDragStarted
71 
72  virtual void TimerMessage(int32 flags);
73  virtual bool16 WantTimer(ClassID trackerTimerBoss);
74 
75  // Drag state
76  virtual void SetDragStarted(bool16 start);
77  virtual bool16 IsDragStarted() const;
78 
79  // Shift key state
80  virtual void SetShiftKeyPressed(bool16 pressed);
81  virtual bool16 IsShiftKeyPressed() const;
82 
83 
84  protected:
85  // PMPoint fInitialPoint; Use fFirstPoint from CTracker.h instead.
86  PMPoint fInitialViewPoint;
87  bool16 fDragStarted;
88  bool16 fShiftKeyPressed; // True if shift key is currently pressed
89  PMRect fPasteboardBounds;
90 };
91 
92 
93 #endif