xref: /aoo42x/main/vcl/inc/win/salprn.h (revision 2123d757)
1*2123d757SAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3*2123d757SAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*2123d757SAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*2123d757SAndrew Rist  * distributed with this work for additional information
6*2123d757SAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*2123d757SAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*2123d757SAndrew Rist  * "License"); you may not use this file except in compliance
9*2123d757SAndrew Rist  * with the License.  You may obtain a copy of the License at
10*2123d757SAndrew Rist  *
11*2123d757SAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12*2123d757SAndrew Rist  *
13*2123d757SAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*2123d757SAndrew Rist  * software distributed under the License is distributed on an
15*2123d757SAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*2123d757SAndrew Rist  * KIND, either express or implied.  See the License for the
17*2123d757SAndrew Rist  * specific language governing permissions and limitations
18*2123d757SAndrew Rist  * under the License.
19*2123d757SAndrew Rist  *
20*2123d757SAndrew Rist  *************************************************************/
21*2123d757SAndrew Rist 
22*2123d757SAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir #ifndef _SV_SALPRN_H
25cdf0e10cSrcweir #define _SV_SALPRN_H
26cdf0e10cSrcweir 
27cdf0e10cSrcweir #include <salprn.hxx>
28cdf0e10cSrcweir 
29cdf0e10cSrcweir // -----------------
30cdf0e10cSrcweir // - SalDriverData -
31cdf0e10cSrcweir // -----------------
32cdf0e10cSrcweir 
33cdf0e10cSrcweir // WNT3
34cdf0e10cSrcweir #define SAL_DRIVERDATA_SYSSIGN				((sal_uIntPtr)0x574E5433)
35cdf0e10cSrcweir #define SAL_DRIVERDATA_VERSION_A			1
36cdf0e10cSrcweir #define SAL_DRIVERDATA_VERSION_W            2
37cdf0e10cSrcweir 
38cdf0e10cSrcweir #pragma pack( 1 )
39cdf0e10cSrcweir 
40cdf0e10cSrcweir struct SalDriverData
41cdf0e10cSrcweir {
42cdf0e10cSrcweir 	sal_uIntPtr					mnSysSignature;
43cdf0e10cSrcweir 	sal_uInt16					mnVersion;
44cdf0e10cSrcweir 	sal_uInt16					mnDriverOffset;
45cdf0e10cSrcweir 	BYTE					maDriverData[1];
46cdf0e10cSrcweir };
47cdf0e10cSrcweir 
48cdf0e10cSrcweir #pragma pack()
49cdf0e10cSrcweir 
50cdf0e10cSrcweir // ---------------------
51cdf0e10cSrcweir // - WinSalInfoPrinter -
52cdf0e10cSrcweir // ---------------------
53cdf0e10cSrcweir 
54cdf0e10cSrcweir class WinSalGraphics;
55cdf0e10cSrcweir 
56cdf0e10cSrcweir class WinSalInfoPrinter : public SalInfoPrinter
57cdf0e10cSrcweir {
58cdf0e10cSrcweir public:
59cdf0e10cSrcweir 	WinSalGraphics*			mpGraphics; 			// current Printer graphics
60cdf0e10cSrcweir 	XubString				maDriverName;			// printer driver name
61cdf0e10cSrcweir 	XubString				maDeviceName;			// printer device name
62cdf0e10cSrcweir 	XubString				maPortName; 			// printer port name
63cdf0e10cSrcweir 	HDC 					mhDC;					// printer hdc
64cdf0e10cSrcweir 	sal_Bool					mbGraphics; 			// is Graphics used
65cdf0e10cSrcweir public:
66cdf0e10cSrcweir     WinSalInfoPrinter();
67cdf0e10cSrcweir     virtual ~WinSalInfoPrinter();
68cdf0e10cSrcweir 
69cdf0e10cSrcweir 	virtual SalGraphics*			GetGraphics();
70cdf0e10cSrcweir 	virtual void					ReleaseGraphics( SalGraphics* pGraphics );
71cdf0e10cSrcweir 	virtual sal_Bool					Setup( SalFrame* pFrame, ImplJobSetup* pSetupData );
72cdf0e10cSrcweir 	virtual sal_Bool					SetPrinterData( ImplJobSetup* pSetupData );
73cdf0e10cSrcweir 	virtual sal_Bool					SetData( sal_uIntPtr nFlags, ImplJobSetup* pSetupData );
74cdf0e10cSrcweir 	virtual void					GetPageInfo( const ImplJobSetup* pSetupData,
75cdf0e10cSrcweir                                                  long& rOutWidth, long& rOutHeight,
76cdf0e10cSrcweir                                                  long& rPageOffX, long& rPageOffY,
77cdf0e10cSrcweir                                                  long& rPageWidth, long& rPageHeight );
78cdf0e10cSrcweir 	virtual sal_uIntPtr					GetCapabilities( const ImplJobSetup* pSetupData, sal_uInt16 nType );
79cdf0e10cSrcweir 	virtual sal_uIntPtr					GetPaperBinCount( const ImplJobSetup* pSetupData );
80cdf0e10cSrcweir 	virtual String					GetPaperBinName( const ImplJobSetup* pSetupData, sal_uIntPtr nPaperBin );
81cdf0e10cSrcweir     virtual void					InitPaperFormats( const ImplJobSetup* pSetupData );
82cdf0e10cSrcweir     virtual int					GetLandscapeAngle( const ImplJobSetup* pSetupData );
83cdf0e10cSrcweir };
84cdf0e10cSrcweir 
85cdf0e10cSrcweir // -----------------
86cdf0e10cSrcweir // - WinSalPrinter -
87cdf0e10cSrcweir // -----------------
88cdf0e10cSrcweir 
89cdf0e10cSrcweir class WinSalPrinter : public SalPrinter
90cdf0e10cSrcweir {
91cdf0e10cSrcweir public:
92cdf0e10cSrcweir 	WinSalGraphics*			mpGraphics; 			// current Printer graphics
93cdf0e10cSrcweir 	WinSalInfoPrinter* 		mpInfoPrinter;			// pointer to the compatible InfoPrinter
94cdf0e10cSrcweir 	WinSalPrinter* 			mpNextPrinter;			// next printing printer
95cdf0e10cSrcweir 	HDC 					mhDC;					// printer hdc
96cdf0e10cSrcweir 	sal_uIntPtr					mnError;				// Error Code
97cdf0e10cSrcweir 	sal_uIntPtr					mnCopies;				// Kopien
98cdf0e10cSrcweir 	sal_Bool					mbCollate;				// Sortierte Kopien
99cdf0e10cSrcweir 	sal_Bool					mbAbort;				// Job Aborted
100cdf0e10cSrcweir 
101cdf0e10cSrcweir     bool                    mbValid;
102cdf0e10cSrcweir 
103cdf0e10cSrcweir public:
104cdf0e10cSrcweir     WinSalPrinter();
105cdf0e10cSrcweir     virtual ~WinSalPrinter();
106cdf0e10cSrcweir 
107cdf0e10cSrcweir     using SalPrinter::StartJob;
108cdf0e10cSrcweir 	virtual sal_Bool					StartJob( const XubString* pFileName,
109cdf0e10cSrcweir                                               const XubString& rJobName,
110cdf0e10cSrcweir                                               const XubString& rAppName,
111cdf0e10cSrcweir                                               sal_uIntPtr nCopies,
112cdf0e10cSrcweir                                               bool bCollate,
113cdf0e10cSrcweir                                               bool bDirect,
114cdf0e10cSrcweir                                               ImplJobSetup* pSetupData );
115cdf0e10cSrcweir 	virtual sal_Bool					EndJob();
116cdf0e10cSrcweir 	virtual sal_Bool					AbortJob();
117cdf0e10cSrcweir 	virtual SalGraphics*			StartPage( ImplJobSetup* pSetupData, sal_Bool bNewJobData );
118cdf0e10cSrcweir 	virtual sal_Bool					EndPage();
119cdf0e10cSrcweir 	virtual sal_uIntPtr					GetErrorCode();
120cdf0e10cSrcweir 
121cdf0e10cSrcweir     void markInvalid();
122cdf0e10cSrcweir     bool isValid() const { return mbValid; }
123cdf0e10cSrcweir };
124cdf0e10cSrcweir 
125cdf0e10cSrcweir #endif // _SV_SALPRN_H
126