InDesign SDK  20.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
ViewPortAttributes.h
1 //========================================================================================
2 //
3 // $File$
4 //
5 // Owner: Zak_Williamson
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 __ViewPortAttributes__
25 #define __ViewPortAttributes__
26 
27 #include "IControlView.h"
28 #include "IViewPortAttributes.h"
29 #include "PMRect.h"
30 #include "HelperInterface.h"
31 #include <map>
32 
33 
34 
36 {
37 public:
39  virtual ~ViewPortAttributes();
40 
41  virtual void Initialize(IDataBase* db, IControlView *controlView);
42  // Initializes the attributes available by the Get methods below.
43  // A ViewPort should call Initialize() before each time it begins
44  // to draw in order to be sure that the attributes are up to date.
45  // The optional IDataBase argument can be used by initialize to get preference
46  // settings from the given database, when it is known that the ViewPort
47  // is drawing one document.
48  // Note: Initialization of the ViewPortBounds must be done
49  // explicitly with SetViewPortBounds().
50 
51  virtual PMReal GetViewPortResolution(void) const;
52  virtual void SetViewPortResolution(PMReal resolution);
53  // Get/Set the resolution of the view port. Currently this is used
54  // when importing an EPS because MPS requires the output device's
55  // resolution when creating the display list.
56 
57  virtual bool16 GetViewPortOutputOPIComments(void) const;
58  virtual void SetViewPortOutputOPIComments( bool16 b ) ;
59  // Does the ViewPort want to output OPI comments?
60 
61  virtual bool16 GetViewPortCacheing(void) const;
62  virtual void SetViewPortCacheing(bool16 cacheing);
63  // Does the ViewPort want to optimize re-display by cacheing things
64  // like images? Cacheing is most useful when diplaying on-screen;
65  // for printing and exporting, it is typically not recommended.
66 
67  virtual int32 GetViewPortBitmapSampling(void) const;
68  virtual void SetViewPortBitmapSampling(int32 sampling);
69  // What type of bitmap data does the ViewPort want to display, export,
70  // or print? Hi-res, low-res, or omit?
71 
72  virtual int32 GetViewPortVectorSampling(void) const;
73  virtual void SetViewPortVectorSampling(int32 sampling);
74  // What type of vector data does the ViewPort want to display, export,
75  // or print? Hi-res, low-res, optimized or omit?
76 
77  virtual bool16 GetViewPortFilterContent(void) const;
78  virtual void SetViewPortFilterContent(bool16 filter);
79  // Does this view port want to filter content
80 
81  virtual PMReal GetViewPortLineScreen(void) const;
82  virtual void SetViewPortLineScreen( const PMReal& n ) ;
83  // Get the line screen of the view port. Currently this is used
84  // when in the calculation of the desired resolution when BitmapSampling
85  // is set to Optimize. Currently this is only set up for PS view ports.
86  virtual bool16 GetViewPortTiling(void) const;
87  virtual void SetViewPortTiling( bool16 b );
88  // Does this ViewPort support IagmServer_Image tiling? Rather
89  // than making separate IGraphicsPort::image() calls for each band
90  // of a large image, one image() call can be made with an IagmServer_Image,
91  // allowing the entire image to be accessed.
92  virtual bool16 GetViewPortProofPrint(void) const;
93  virtual void SetViewPortProofPrint(bool16 b);
94  // Are we currently doing a proof print? Images, EPSs and PDFs draw
95  // as gray box.
96  virtual bool16 GetViewPortDisallowImageCrop(void) const;
97  virtual void SetViewPortDisallowImageCrop(bool16 b);
98  // Do we want to make sure that we get all the image data--even
99  // what has been cropped by the frame?
100  virtual bool16 GetViewPortOmitEPS(void) const;
101  virtual void SetViewPortOmitEPS(bool16 b);
102  // Should placed EPSs be omitted?
103  virtual bool16 GetViewPortOmitPDF(void) const;
104  virtual void SetViewPortOmitPDF(bool16 b);
105  // Should placed PDFs be omitted?
106  virtual bool16 GetViewPortOmitBitmapImages(void) const;
107  virtual void SetViewPortOmitBitmapImages(bool16 b) ;
108  // Should placed bitmap images be omitted?
109 
110  virtual void SetViewPortDrawPasteboardShadow (bool16 drawShadow);
111 
112  virtual bool16 GetViewPortDrawPasteboardShadow (void) const;
113 
114  virtual void SetViewPortDrawPageShadow (bool16 drawShadow);
115 
116  virtual bool16 GetViewPortDrawPageShadow (void) const;
117 
118  virtual bool16 GetViewPortIsPrintingPort (void) const;
119  virtual void SetViewPortIsPrintingPort( bool16 b );
120  // Indicates if screen drawing things should happen
121  // or not. This is the same concept as IShape::kPrinting
122  // which is passed to drawing methods, though at port level.
123 
124  virtual bool32 IsAttrDefined(VPAttrID attr) const;
125  virtual void SetAttr(VPAttrID attr, int32 value);
126  virtual void SetAttr(VPAttrID attr, PMReal value);
127  virtual int32 GetAttr(VPAttrID attr, int32 defVal = 0) const;
128  virtual PMReal GetAttrReal(VPAttrID attr, PMReal defVal = 0.) const;
129 
130 protected:
131  PMReal fViewPortResolution;
132  PMReal fViewPortLineScreen;
133  bool16 fViewPortOutputOPI;
134  bool16 fViewPortDoCacheing;
135  int32 fViewPortBitmapSampling;
136  int32 fViewPortVectorSampling;
137  bool16 fViewPortFilterContent;
138  bool16 fViewPortDoTiling;
139  bool16 fViewPortProofPrint;
140  bool16 fViewPortDisallowImageCrop;
141  bool16 fViewPortOmitPDF;
142  bool16 fViewPortOmitEPS;
143  bool16 fViewPortOmitBitmapImages;
144  bool16 fViewPortDrawPasteboardShadow;
145  bool16 fViewPortDrawPageShadow;
146  bool16 fViewPortIsPrintingPort;
147 
148  typedef std::map<VPAttrID, PMReal> VPAttrMap;
149  VPAttrMap fViewPortAttrMap;
150 
151 
152 };
153 
154 
155 #endif