InDesign SDK  20.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
CPanorama.h
1 //========================================================================================
2 //
3 // $File$
4 //
5 // Owner: Michael Burbidge
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 __CPANORAMA__
25 #define __CPANORAMA__
26 
27 #include "IPanorama.h"
28 #include "HelperInterface.h"
29 
30 #ifdef WIDGET_BUILD
31 #endif
32 
33 
34 
35 class CTransform;
36 
42 class CPanorama : public IPanorama
43 {
44 // ----- Constructors/destructors
45 public:
46  CPanorama( IPMUnknown *boss, bool16 push_changes_into_drover = kFalse);
47  virtual ~CPanorama();
48 
51 public:
52 
57  //virtual PMRect GetBounds() const = 0;
58 
59 
63  virtual PMRect GetCentralBounds() const;
64 
65 
69  virtual PMReal GetCentralBorderWhiteSpace() const;
70 
71 
76  virtual void SetPrimaryPanorama(IPanorama* panorama);
77 
78 
80  virtual IPanorama* GetPrimaryPanorama() const;
81 
82 
87  virtual void GetPanoramaDelta(PMPoint& delta) const;
88 
89 
94  virtual void GetPanoramaDeltaMultiple(PMPoint& delta) const;
95 
97 
100 public:
102  virtual void ScrollViewCenterTo(const PBPMPoint& newCenter, bool16 bForceRedraw = kTrue);
103 
104 
106  virtual PBPMPoint ScrollTo_neg(const PBPMPoint& to, bool16 forceRedraw = kTrue, SysRgn InvalRgnCopy = nil);
107 
108 
121  virtual PBPMPoint ScrollBy(const PBPMPoint& by, bool16 bForceRedraw = kTrue, SysRgn InvalRgnCopy = nil);
122 
123 
126  virtual PMPoint GetAutoScrollDelta(const PBPMPoint& viewPoint);
127 
128 
130  virtual PMPoint GetViewCenter() const;
131 
132 
134  virtual PMPoint GetScrollOffset_neg() const;
136 
137 
138 
141 public:
142 
144  virtual void ScalePanorama(const PMReal& xFactor, const PMReal& yFactor);
145 
147  virtual void ScalePanoramaBy(const PMReal& xBy, const PMReal& yBy);
148 
150  virtual PMReal GetXScaleFactor(bool32 actualZoomLevelInsteadOfUIZoomWidgetValue = kTrue) const;
151 
153  virtual PMReal GetYScaleFactor(bool32 actualZoomLevelInsteadOfUIZoomWidgetValue = kTrue) const;
154 
156  virtual PMReal GetPreviousScaleFactor() const;
157 
159  virtual void SetPreviousScaleFactor(PMReal scaleFactor);
160 
162  virtual PMPoint GetPreviousViewCenter() const;
163 
165  virtual PMReal GetMinScaleFactor() const;
166 
168  virtual PMReal GetMaxScaleFactor() const;
169 
171  virtual PMPoint GetViewScrollOffset() const;
172 
174  virtual void SetScrollOffset_neg(PMPoint scrollBy);
176 
177 
178 
181 public:
186  virtual void FitInView();
187 
189  virtual void FullView();
190 
192 
195 public:
303  virtual void UpdatePanoramaTransform(PMMatrix* transform) const;
304 
306 
307 
308 
309 
312 public:
314  virtual void SavePerspective() const;
315 
317  virtual void RestorePerspective();
319 
323  virtual void ScrollViewEdgeTo(const EdgeSpec& edgeSpec, const PBPMPoint& newCenter, bool16 bForceRedraw);
325 
328 protected:
329 
330 
332  virtual PMReal GetScaleToShowRect(const PMRect& r, const PMReal& whiteSpace) const;
333 
335  virtual void DoNotify(ClassID messageID, const PanoramaUpdateParams& params) const;
336 
338  virtual void GetBoundsForAutoScroll(PMRect&) const;
339 
341  virtual PBPMPoint ConstrainTo(const PBPMPoint& value) const;
342 
344  virtual PBPMPoint ConstrainBy(const PBPMPoint& delta) const;
345 
346  virtual SysRgn SystemScroll(const SysPoint& sysDelta, bool16 bDoInval, GSysRect *bbox);
347 
349 
350 // ----- Object state
351 private:
352  PMReal fXScaleFactor; //zooming in increases these scale factors. That is, fXScaleFactor > 1 <==> 1 unit in content coordinates takes up more that 1 unit in frame coordinates
353  PMReal fYScaleFactor;
354  PMReal fPreviousScaleFactor;
355  PMPoint fPreviousViewCenter;
356  PMReal fMinScaleFactor; // Min and max allowable scale factor
357  PMReal fMaxScaleFactor;
358  PMPoint fScrollOffset; //fScrollOffset is the location of the content origin in frame coordinates
359  bool16 fPushPanoramaChangesIntoDrover;
360 
361  IPanorama* fPrimaryPanorama;
362 
363  void DroverPreScroll();
364  void DroverPostScroll();
365 
366  virtual PBPMPoint ScrollTo_(const PBPMPoint& to, bool16 forceRedraw, SysRgn InvalRgnCopy);
367  virtual PBPMPoint ScrollBy_(const PBPMPoint& by, bool16 bForceRedraw, SysRgn InvalRgnCopy);
368  virtual void SetScrollOffset_( PMPoint scrollBy);
369  virtual void ScalePanorama_( const PMReal& xFactor, const PMReal& yFactor);
370 
371 protected:
372  PMPoint GetNearestValueBasedOnScaleFactor(PMPoint scrollDelta);
373 
374 
375 };
376 
377 
378 #endif