xref: /trunk/main/vcl/inc/win/salprn.h (revision cdf0e10c)
1 /*************************************************************************
2  *
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
5  * Copyright 2000, 2010 Oracle and/or its affiliates.
6  *
7  * OpenOffice.org - a multi-platform office productivity suite
8  *
9  * This file is part of OpenOffice.org.
10  *
11  * OpenOffice.org is free software: you can redistribute it and/or modify
12  * it under the terms of the GNU Lesser General Public License version 3
13  * only, as published by the Free Software Foundation.
14  *
15  * OpenOffice.org is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU Lesser General Public License version 3 for more details
19  * (a copy is included in the LICENSE file that accompanied this code).
20  *
21  * You should have received a copy of the GNU Lesser General Public License
22  * version 3 along with OpenOffice.org.  If not, see
23  * <http://www.openoffice.org/license.html>
24  * for a copy of the LGPLv3 License.
25  *
26  ************************************************************************/
27 
28 #ifndef _SV_SALPRN_H
29 #define _SV_SALPRN_H
30 
31 #include <salprn.hxx>
32 
33 // -----------------
34 // - SalDriverData -
35 // -----------------
36 
37 // WNT3
38 #define SAL_DRIVERDATA_SYSSIGN				((sal_uIntPtr)0x574E5433)
39 #define SAL_DRIVERDATA_VERSION_A			1
40 #define SAL_DRIVERDATA_VERSION_W            2
41 
42 #pragma pack( 1 )
43 
44 struct SalDriverData
45 {
46 	sal_uIntPtr					mnSysSignature;
47 	sal_uInt16					mnVersion;
48 	sal_uInt16					mnDriverOffset;
49 	BYTE					maDriverData[1];
50 };
51 
52 #pragma pack()
53 
54 // ---------------------
55 // - WinSalInfoPrinter -
56 // ---------------------
57 
58 class WinSalGraphics;
59 
60 class WinSalInfoPrinter : public SalInfoPrinter
61 {
62 public:
63 	WinSalGraphics*			mpGraphics; 			// current Printer graphics
64 	XubString				maDriverName;			// printer driver name
65 	XubString				maDeviceName;			// printer device name
66 	XubString				maPortName; 			// printer port name
67 	HDC 					mhDC;					// printer hdc
68 	sal_Bool					mbGraphics; 			// is Graphics used
69 public:
70     WinSalInfoPrinter();
71     virtual ~WinSalInfoPrinter();
72 
73 	virtual SalGraphics*			GetGraphics();
74 	virtual void					ReleaseGraphics( SalGraphics* pGraphics );
75 	virtual sal_Bool					Setup( SalFrame* pFrame, ImplJobSetup* pSetupData );
76 	virtual sal_Bool					SetPrinterData( ImplJobSetup* pSetupData );
77 	virtual sal_Bool					SetData( sal_uIntPtr nFlags, ImplJobSetup* pSetupData );
78 	virtual void					GetPageInfo( const ImplJobSetup* pSetupData,
79                                                  long& rOutWidth, long& rOutHeight,
80                                                  long& rPageOffX, long& rPageOffY,
81                                                  long& rPageWidth, long& rPageHeight );
82 	virtual sal_uIntPtr					GetCapabilities( const ImplJobSetup* pSetupData, sal_uInt16 nType );
83 	virtual sal_uIntPtr					GetPaperBinCount( const ImplJobSetup* pSetupData );
84 	virtual String					GetPaperBinName( const ImplJobSetup* pSetupData, sal_uIntPtr nPaperBin );
85     virtual void					InitPaperFormats( const ImplJobSetup* pSetupData );
86     virtual int					GetLandscapeAngle( const ImplJobSetup* pSetupData );
87 };
88 
89 // -----------------
90 // - WinSalPrinter -
91 // -----------------
92 
93 class WinSalPrinter : public SalPrinter
94 {
95 public:
96 	WinSalGraphics*			mpGraphics; 			// current Printer graphics
97 	WinSalInfoPrinter* 		mpInfoPrinter;			// pointer to the compatible InfoPrinter
98 	WinSalPrinter* 			mpNextPrinter;			// next printing printer
99 	HDC 					mhDC;					// printer hdc
100 	sal_uIntPtr					mnError;				// Error Code
101 	sal_uIntPtr					mnCopies;				// Kopien
102 	sal_Bool					mbCollate;				// Sortierte Kopien
103 	sal_Bool					mbAbort;				// Job Aborted
104 
105     bool                    mbValid;
106 
107 public:
108     WinSalPrinter();
109     virtual ~WinSalPrinter();
110 
111     using SalPrinter::StartJob;
112 	virtual sal_Bool					StartJob( const XubString* pFileName,
113                                               const XubString& rJobName,
114                                               const XubString& rAppName,
115                                               sal_uIntPtr nCopies,
116                                               bool bCollate,
117                                               bool bDirect,
118                                               ImplJobSetup* pSetupData );
119 	virtual sal_Bool					EndJob();
120 	virtual sal_Bool					AbortJob();
121 	virtual SalGraphics*			StartPage( ImplJobSetup* pSetupData, sal_Bool bNewJobData );
122 	virtual sal_Bool					EndPage();
123 	virtual sal_uIntPtr					GetErrorCode();
124 
125     void markInvalid();
126     bool isValid() const { return mbValid; }
127 };
128 
129 #endif // _SV_SALPRN_H
130