InDesign SDK  20.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
IPanorama.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 __IPANORAMA__
25 #define __IPANORAMA__
26 
27 #include "PMReal.h"
28 #include "PMRect.h"
29 #include "widgetid.h"
30 
31 
32 class PMMatrix;
33 
34 
40 class EdgeSpec
41 {
42 public:
43  enum Edge { kLeft, kTop, kRight, kBottom, kNone };
44 
45  EdgeSpec(Edge horizontal = kNone, Edge vertical = kNone) :
46  fHorizontal(horizontal),
47  fVertical(vertical)
48  {
49  }
50 
51  Edge fHorizontal, fVertical;
52 };
53 
54 
55 
56 //========================================================================================
57 // CLASS IPanorama
63 //========================================================================================
64 
65 class IPanorama : public IPMUnknown
66 {
67 // ----- Message Ids
68 public:
69  enum { kDefaultIID = IID_IPANORAMA };
70 
73 public:
83  virtual PMRect GetBounds() const = 0;
84 
85 
95  virtual PMRect GetCentralBounds() const = 0;
96 
97 
102  virtual PMReal GetCentralBorderWhiteSpace() const = 0;
103 
104 
110  virtual void SetPrimaryPanorama(IPanorama* panorama) = 0;
111 
112 
114  virtual IPanorama* GetPrimaryPanorama() const = 0;
115 
116 
118  virtual void GetPanoramaDelta(PMPoint& delta) const = 0;
119 
120 
122  virtual void GetPanoramaDeltaMultiple(PMPoint& delta) const = 0;
124 
125 
128 public:
134  inline void ScrollContentLocationToFrameCenter( const PBPMPoint& contentLocation, bool16 bForceRedraw = kTrue)
135  {
136  ScrollViewCenterTo( contentLocation, bForceRedraw);
137  }
138 
139 
144  virtual void ScrollViewCenterTo(const PBPMPoint& newCenter, bool16 bForceRedraw = kTrue) = 0;
145 
146 
155  inline PBPMPoint ScrollContentLocationToFrameOrigin( const PBPMPoint& contentLocation, bool16 forceRedraw = kTrue, SysRgn InvalRgnCopy = nil)
156  {
157  return ScrollTo_neg( -contentLocation, forceRedraw, InvalRgnCopy);
158  }
159 
160 
166  virtual PBPMPoint ScrollTo_neg( const PBPMPoint& to, bool16 forceRedraw = kTrue, SysRgn InvalRgnCopy = nil) = 0;
167 
168 
186  virtual PBPMPoint ScrollBy(const PBPMPoint& by, bool16 bForceRedraw = kTrue, SysRgn InvalRgnCopy = nil) = 0;
187 
188 
195  virtual PMPoint GetAutoScrollDelta(const PBPMPoint& viewPoint) = 0;
196 
197 
201  {
202  return -GetScrollOffset_neg();
203  }
204 
210  virtual PMPoint GetScrollOffset_neg() const = 0;
211 
212 
215  {
216  return GetViewCenter();
217  }
218 
219 
224  virtual PMPoint GetViewCenter() const = 0;
225 
227 
228 
229 
232 public:
233 
240  virtual void ScalePanorama(const PMReal& xFactor, const PMReal& yFactor) = 0;
241 
242 
244  virtual void ScalePanoramaBy(const PMReal& xBy, const PMReal& yBy) = 0;
245 
246 
254  virtual PMReal GetXScaleFactor(bool32 actualZoomLevelInsteadOfUIZoomWidgetValue = kTrue) const = 0;
255 
263  virtual PMReal GetYScaleFactor(bool32 actualZoomLevelInsteadOfUIZoomWidgetValue = kTrue) const = 0;
264 
265 
267  virtual PMReal GetPreviousScaleFactor() const = 0;
268 
269 
271  virtual void SetPreviousScaleFactor(PMReal scaleFactor) = 0;
272 
273 
275  virtual PMPoint GetPreviousViewCenter() const = 0;
276 
277 
279  virtual PMReal GetMinScaleFactor() const = 0;
280 
281 
283  virtual PMReal GetMaxScaleFactor() const = 0;
284 
286 
287 
288 
291 public:
293  virtual void FitInView() = 0;
294 
296  virtual void FullView() = 0;
297 
299 
302 public:
318  virtual void UpdatePanoramaTransform( PMMatrix* transform) const = 0;
319 
320 
322 
325 public:
327  virtual void SavePerspective() const = 0;
328 
330  virtual void RestorePerspective() = 0;
332 
341  virtual void ScrollViewEdgeTo(const EdgeSpec& edgeSpec, const PBPMPoint& pt, bool16 bForceRedraw = kTrue) = 0;
343 };
344 
345 
346 
347 
348 
349 //========================================================================================
350 // class PanoramaUpdateParams
360 //========================================================================================
362 {
363 public:
365  PanoramaUpdateParams(IPanorama* panorama, const PMPoint& offset) :
366  fPanorama(panorama),
367  fOffset(offset),
368  fXScaleFactor(1.0),
369  fYScaleFactor(1.0)
370  {
371  }
372 
374  PanoramaUpdateParams(IPanorama* panorama, const PMReal& xScaleFactor, const PMReal& yScaleFactor) :
375  fPanorama(panorama),
376  fXScaleFactor(xScaleFactor),
377  fYScaleFactor(yScaleFactor)
378  {
379  }
380 
389 };
390 
391 #endif