InDesign SDK  20.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
GraphicsData.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 
24 #ifndef __GraphicsData__
25 #define __GraphicsData__
26 
27 #include "PMMatrix.h"
28 #include "IDrawOptions.h"
29 
30 class IViewPort;
31 class ITransform;
32 class IControlView;
33 class IGraphicsPort;
34 class IRasterPort;
35 class IGraphicsContext;
36 class IDrwEvtDispatcher;
37 class IDrawMgr;
38 class ILayoutController;
40 class GraphicsData;
41 class TextDrawInfo;
42 
43 
57 {
58 public:
64 public:
66 public:
67 
72 
78  GraphicsData* operator->() const;
79 
85  operator GraphicsData*();
86 
87 private:
88  GraphicsData* fGraphicsData;
89 };
90 
91 //
92 // The internal class
93 //
94 
111 {
112 public:
113  friend class GraphicsDataPtr;
114 
115 private:
116  GraphicsData(); //not implemented
117  GraphicsData(GraphicsData* gd); //not implemented
118  GraphicsData(const GraphicsData& gd); //not implemented
119  GraphicsData(IGraphicsContext* gc); //only implemented constructor--called from GraphicsDataPtr constructor
120 
121  ~GraphicsData();
122 
123  GraphicsData& operator=(const GraphicsData& gd);
124 
125 public:
135 
144  IRasterPort* GetRasterPort() const;
145 
155 
164  IDrawMgr* GetDrawManager() const;
165 
175  IControlView* GetView() const;
176 
185  IViewPort* GetViewPort() const;
186 
196 
207 
214  const PMMatrix& GetContentToViewMatrix() const;
215 
222  const PMMatrix& GetViewToContentMatrix() const;
223 
231 
244  DrawOptionsSet GetDrawOptions(const IPMUnknown *drawablePageItemInterface = nil) const;
245 
252  TextDrawInfo* GetTextDrawInfo() const;
253 
254 private:
255  IGraphicsContext* fContext;
256  IGraphicsPort* fGPort;
257  IRasterPort* fRPort;
258  IDrwEvtDispatcher* fDEDispatcher;
259  IDrawMgr* fDrawMgr;
260  IControlView* fCView;
261  ILayoutController* fController;
262  IViewPort* fViewPort;
263  IViewPortAttributes* fVPAttr;
264  PMMatrix fTransform;
265  PMMatrix fInvTransform;
266  DrawOptionsSet fDrawOptionsSet;
267  bool8 fIgnoreDrawOptionOverrides;
268  TextDrawInfo* fTextDrawInfo;
269 };
270 
271 
272 //
273 
275 {
276  return fGraphicsData;
277 }
278 
279 inline GraphicsDataPtr::operator GraphicsData*()
280 {
281  return fGraphicsData;
282 }
283 
284 //
285 
286 // The graphics port will never be nil.
287 inline IGraphicsPort* GraphicsData::GetGraphicsPort() const { return fGPort; }
288 
289 // The rasterport may be nil if not drawing to the screen.
290 inline IRasterPort* GraphicsData::GetRasterPort() const { return fRPort; }
291 
292 // The draw event dispatcher will never be nil
293 inline IDrwEvtDispatcher* GraphicsData::GetDrawEventDispatcher() const { return fDEDispatcher; }
294 
295 // The draw manager will never be nil
296 inline IDrawMgr* GraphicsData::GetDrawManager() const { return fDrawMgr; }
297 
298 // The control view may be nil (nil indicates drawing to a printer or other
299 // non-screen device)
300 inline IControlView* GraphicsData::GetView() const { return fCView; }
301 
302 // The layout controller will not be nil during calls to inval, but may
303 // be nil otherwise
304 inline ILayoutController* GraphicsData::GetLayoutController() const { return fController; }
305 
306 // The transform represents the matrix from pasteboard to device.
307 inline const PMMatrix& GraphicsData::GetContentToViewMatrix() const { return fTransform; }
308 inline const PMMatrix& GraphicsData::GetViewToContentMatrix() const { return fInvTransform; }
309 
310 // Code to get the graphics context for any that need it.
311 inline IGraphicsContext* GraphicsData::GetGraphicsContext() const { return fContext; }
312 
313 inline IViewPort* GraphicsData::GetViewPort() const { return fViewPort; }
314 
315 inline IViewPortAttributes* GraphicsData::GetViewPortAttributes() const { return fVPAttr; }
316 
317 inline TextDrawInfo* GraphicsData::GetTextDrawInfo() const { return fTextDrawInfo; }
318 
319 #endif