InDesign SDK  20.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
ILayoutController.h
1 //========================================================================================
2 //
3 // $File$
4 //
5 // Owner: jargast
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 // This interface provides hints to the layoutwidget on what has been invalidated.
24 // This interface tells the layout widget whether or not selection is the only
25 // thing that has changed. If that is the case, the layout widget can make some
26 // optimizations for screen refreshing.
27 //
28 // All page items should use this interface instead of IControlView for invalidates
29 // of the layout widget.
30 // All objects that change the content (such as panorama for scrolling) should use
31 // this interface instead of IControlView for invalidates of the layout widget.
32 //
33 //========================================================================================
34 
35 #ifndef __ILayoutController__
36 #define __ILayoutController__
37 
38 #include "IPMUnknown.h"
39 #include "LayoutUIID.h"
40 
41 class PMRect;
42 
44 {
45 public:
46  enum { kDefaultIID = IID_ILAYOUTCONTROLLER };
47 
53  virtual void UpdateEnable (bool16 bEnable) = 0;
54 
55  virtual bool16 IsUpdateEnabled() const = 0;
56 
57  // Enable/Disable offscreen drawing.
58  virtual void OffscreenEnable (bool16 bEnable) = 0;
59  virtual bool16 IsOffscreenEnabled() const = 0;
60 
61  // Invalidate the content. This tells the layout widget to regenerate the background
62  // bitmap (if it is using offscreen updating). If invalidRect is nil it invalidates the
63  // entire view. If systemInvalOK is true and updates are enabled,then a System inval will
64  // occur.
65  virtual void InvalidateContent(const PMRect* invalidRect = nil, bool8 systemInvalOK = kTrue) = 0;
66  virtual void InvalidateContent(const SysRgn invalidRgn, bool8 systemInvalOK = kTrue) = 0;
67  virtual SysRgn GetInvalidContentRgn() const = 0; // client must dispose of result
68  virtual void ValidateContent() = 0;
69 
70  // Invalidates the selection only. This tells the layout widget that the background widget
71  // is ok to reuse and only the selection has changed.
72  virtual void InvalidateSelection(const PMRect* invalidRect = nil, bool8 systemInvalOK = kTrue) = 0;
73  virtual void InvalidateSelection(const SysRgn invalidRgn, bool8 systemInvalOK = kTrue) = 0;
74  virtual SysRgn GetInvalidSelectionRgn() const = 0; // client must dispose of result
75  virtual void ValidateSelection() = 0;
76 
77  // Returns the union of selection and content.
78  virtual PMRect GetInvalidBounds() const = 0;
79  virtual SysRgn GetInvalidRgn() const = 0; // client must dispose of result
80  virtual void DocumentChanged() = 0;
81 
82  // Enable/Disable view updating. If false, all invalidate calls are logged but the window
83  // should not update.
84  // Note: invals during drawing are dropped on Cocoa, so when re-enabling updates,
85  // set doAsynchInvalOnMac to schedule any pending invals.
86  virtual void UpdateEnableWithAsyncInval (bool16 bEnable, bool16 doAsynchInvalOnMac = kFalse) = 0;
87 };
88 
89 #endif