xref: /aoo41x/main/vcl/inc/os2/salprn.h (revision fc9fd3f1)
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 class SalGraphics;
34 class SalInfoPrinter;
35 
36 struct ImplFormInfo;
37 typedef ImplFormInfo* PIMPLFORMINFO;
38 struct ImplTrayInfo;
39 typedef ImplTrayInfo* PIMPLTRAYINFO;
40 
41 // ----------------------
42 // - SalInfoPrinterData -
43 // ----------------------
44 
45 //class SalInfoPrinterData
46 class Os2SalInfoPrinter : public SalInfoPrinter
47 {
48 public:
49 	Os2SalGraphics*			mpGraphics; 			// Graphics
50 	HDC 					mhDC;					// printer hdc
51 	HPS 					mhPS;					// printer hps
52 	ByteString					maPrinterName;			// pszPrinters
53 	ByteString					maName; 				// pszName bzw. LogAdress
54 	ByteString					maDriverName;			// pszDriverName nach .
55 	ByteString					maDeviceName;			// pszDriverName bis .
56 	ByteString					maJobSetupDeviceName;	// DeviceName aus pDriverData
57 	PIMPLFORMINFO*			mpFormArray;			// PaperForm-Names
58 	USHORT					mnFormCount;			// PaperForm-Count
59 	PIMPLTRAYINFO*			mpTrayArray;			// PaperTray-Names
60 	USHORT					mnTrayCount;			// PaperTray-Count
61 	sal_Bool					mbDJPSupported; 		// is driver DJP enabled
62 	sal_Bool					mbGraphics; 			// is Graphics used
63 
64 public:
65     Os2SalInfoPrinter();
66     virtual ~Os2SalInfoPrinter();
67 
68 	virtual SalGraphics*			GetGraphics();
69 	virtual void					ReleaseGraphics( SalGraphics* pGraphics );
70 	virtual sal_Bool					Setup( SalFrame* pFrame, ImplJobSetup* pSetupData );
71 	virtual sal_Bool					SetPrinterData( ImplJobSetup* pSetupData );
72 	virtual sal_Bool					SetData( ULONG nFlags, ImplJobSetup* pSetupData );
73 	virtual void					GetPageInfo( const ImplJobSetup* pSetupData,
74                                                  long& rOutWidth, long& rOutHeight,
75                                                  long& rPageOffX, long& rPageOffY,
76                                                  long& rPageWidth, long& rPageHeight );
77 	virtual ULONG					GetCapabilities( const ImplJobSetup* pSetupData, USHORT nType );
78 	virtual ULONG					GetPaperBinCount( const ImplJobSetup* pSetupData );
79 	virtual String					GetPaperBinName( const ImplJobSetup* pSetupData, ULONG nPaperBin );
80     virtual void					InitPaperFormats( const ImplJobSetup* pSetupData );
81     virtual int					GetLandscapeAngle( const ImplJobSetup* pSetupData );
82 };
83 
84 // ------------------
85 // - SalPrinterData -
86 // ------------------
87 
88 class SalPrinterData00
89 {
90 public:
91 	Os2SalGraphics*			mpGraphics; 			// current Printer graphics
92 	SalInfoPrinter* 		mpInfoPrinter;			// pointer to the compatible InfoPrinter
93 	HDC 					mhDC;					// printer hdc
94 	HPS 					mhPS;					// printer hps
95 	ULONG					mnError;				// Error Code
96 	sal_Bool					mbFirstPage;			// IsFirstPage
97 	sal_Bool					mbAbort;				// JobAborted
98 	sal_Bool					mbPrintDJPSupported;	// is driver PrintDJP enabled (DEVESC_NEWFRAME_WPROP)
99 	char					maCommentBuf[33];		// Comment
100 	char					maCopyBuf[10];			// Kopien
101 };
102 
103 // -----------------
104 // - Os2SalPrinter -
105 // -----------------
106 
107 class Os2SalPrinter : public SalPrinter
108 {
109 public:
110 	Os2SalGraphics*			mpGraphics; 			// current Printer graphics
111 	Os2SalInfoPrinter* 		mpInfoPrinter;			// pointer to the compatible InfoPrinter
112 	Os2SalPrinter* 			mpNextPrinter;			// next printing printer
113 	HDC 					mhDC;					// printer hdc
114 	HPS 					mhPS;					// printer hps
115 	ULONG					mnError;				// Error Code
116 	sal_Bool					mbFirstPage;			// IsFirstPage
117 	sal_Bool					mbAbort;				// JobAborted
118 	sal_Bool					mbPrintDJPSupported;	// is driver PrintDJP enabled (DEVESC_NEWFRAME_WPROP)
119 	char					maCommentBuf[33];		// Comment
120 	char					maCopyBuf[16];			// Kopien
121 	//HDC 					mhDC;					// printer hdc
122 	//ULONG					mnError;				// Error Code
123 	//ULONG					mnCopies;				// Kopien
124 	//sal_Bool					mbCollate;				// Sortierte Kopien
125 	//sal_Bool					mbAbort;				// Job Aborted
126 
127 public:
128     Os2SalPrinter();
129     virtual ~Os2SalPrinter();
130 
131 	virtual sal_Bool					StartJob( const XubString* pFileName,
132                                               const XubString& rJobName,
133                                               const XubString& rAppName,
134                                               ULONG nCopies,
135                                               bool bCollate,
136                                               bool bDirect,
137                                               ImplJobSetup* pSetupData );
138 	virtual sal_Bool					EndJob();
139 	virtual sal_Bool					AbortJob();
140 	virtual SalGraphics*			StartPage( ImplJobSetup* pSetupData, sal_Bool bNewJobData );
141 	virtual sal_Bool					EndPage();
142 	virtual ULONG					GetErrorCode();
143 };
144 
145 #endif // _SV_SALPRN_H
146