xref: /aoo42x/main/vcl/inc/os2/salprn.h (revision 24f6443d)
1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 
24 #ifndef _SV_SALPRN_H
25 #define _SV_SALPRN_H
26 
27 #include <salprn.hxx>
28 
29 class SalGraphics;
30 class SalInfoPrinter;
31 
32 struct ImplFormInfo;
33 typedef ImplFormInfo* PIMPLFORMINFO;
34 struct ImplTrayInfo;
35 typedef ImplTrayInfo* PIMPLTRAYINFO;
36 
37 // ----------------------
38 // - SalInfoPrinterData -
39 // ----------------------
40 
41 //class SalInfoPrinterData
42 class Os2SalInfoPrinter : public SalInfoPrinter
43 {
44 public:
45 	Os2SalGraphics*			mpGraphics; 			// Graphics
46 	HDC 					mhDC;					// printer hdc
47 	HPS 					mhPS;					// printer hps
48 	ByteString					maPrinterName;			// pszPrinters
49 	ByteString					maName; 				// pszName bzw. LogAdress
50 	ByteString					maDriverName;			// pszDriverName nach .
51 	ByteString					maDeviceName;			// pszDriverName bis .
52 	ByteString					maJobSetupDeviceName;	// DeviceName aus pDriverData
53 	PIMPLFORMINFO*			mpFormArray;			// PaperForm-Names
54 	USHORT					mnFormCount;			// PaperForm-Count
55 	PIMPLTRAYINFO*			mpTrayArray;			// PaperTray-Names
56 	USHORT					mnTrayCount;			// PaperTray-Count
57 	sal_Bool					mbDJPSupported; 		// is driver DJP enabled
58 	sal_Bool					mbGraphics; 			// is Graphics used
59 
60 public:
61     Os2SalInfoPrinter();
62     virtual ~Os2SalInfoPrinter();
63 
64 	virtual SalGraphics*			GetGraphics();
65 	virtual void					ReleaseGraphics( SalGraphics* pGraphics );
66 	virtual sal_Bool					Setup( SalFrame* pFrame, ImplJobSetup* pSetupData );
67 	virtual sal_Bool					SetPrinterData( ImplJobSetup* pSetupData );
68 	virtual sal_Bool					SetData( ULONG nFlags, ImplJobSetup* pSetupData );
69 	virtual void					GetPageInfo( const ImplJobSetup* pSetupData,
70                                                  long& rOutWidth, long& rOutHeight,
71                                                  long& rPageOffX, long& rPageOffY,
72                                                  long& rPageWidth, long& rPageHeight );
73 	virtual ULONG					GetCapabilities( const ImplJobSetup* pSetupData, USHORT nType );
74 	virtual ULONG					GetPaperBinCount( const ImplJobSetup* pSetupData );
75 	virtual String					GetPaperBinName( const ImplJobSetup* pSetupData, ULONG nPaperBin );
76     virtual void					InitPaperFormats( const ImplJobSetup* pSetupData );
77     virtual int					GetLandscapeAngle( const ImplJobSetup* pSetupData );
78 };
79 
80 // ------------------
81 // - SalPrinterData -
82 // ------------------
83 
84 class SalPrinterData00
85 {
86 public:
87 	Os2SalGraphics*			mpGraphics; 			// current Printer graphics
88 	SalInfoPrinter* 		mpInfoPrinter;			// pointer to the compatible InfoPrinter
89 	HDC 					mhDC;					// printer hdc
90 	HPS 					mhPS;					// printer hps
91 	ULONG					mnError;				// Error Code
92 	sal_Bool					mbFirstPage;			// IsFirstPage
93 	sal_Bool					mbAbort;				// JobAborted
94 	sal_Bool					mbPrintDJPSupported;	// is driver PrintDJP enabled (DEVESC_NEWFRAME_WPROP)
95 	char					maCommentBuf[33];		// Comment
96 	char					maCopyBuf[10];			// Kopien
97 };
98 
99 // -----------------
100 // - Os2SalPrinter -
101 // -----------------
102 
103 class Os2SalPrinter : public SalPrinter
104 {
105 public:
106 	Os2SalGraphics*			mpGraphics; 			// current Printer graphics
107 	Os2SalInfoPrinter* 		mpInfoPrinter;			// pointer to the compatible InfoPrinter
108 	Os2SalPrinter* 			mpNextPrinter;			// next printing printer
109 	HDC 					mhDC;					// printer hdc
110 	HPS 					mhPS;					// printer hps
111 	ULONG					mnError;				// Error Code
112 	sal_Bool					mbFirstPage;			// IsFirstPage
113 	sal_Bool					mbAbort;				// JobAborted
114 	sal_Bool					mbPrintDJPSupported;	// is driver PrintDJP enabled (DEVESC_NEWFRAME_WPROP)
115 	char					maCommentBuf[33];		// Comment
116 	char					maCopyBuf[16];			// Kopien
117 	//HDC 					mhDC;					// printer hdc
118 	//ULONG					mnError;				// Error Code
119 	//ULONG					mnCopies;				// Kopien
120 	//sal_Bool					mbCollate;				// Sortierte Kopien
121 	//sal_Bool					mbAbort;				// Job Aborted
122 
123 public:
124     Os2SalPrinter();
125     virtual ~Os2SalPrinter();
126 
127 	virtual sal_Bool					StartJob( const XubString* pFileName,
128                                               const XubString& rJobName,
129                                               const XubString& rAppName,
130                                               ULONG nCopies,
131                                               bool bCollate,
132                                               bool bDirect,
133                                               ImplJobSetup* pSetupData );
134 	virtual sal_Bool					EndJob();
135 	virtual sal_Bool					AbortJob();
136 	virtual SalGraphics*			StartPage( ImplJobSetup* pSetupData, sal_Bool bNewJobData );
137 	virtual sal_Bool					EndPage();
138 	virtual ULONG					GetErrorCode();
139 };
140 
141 #endif // _SV_SALPRN_H
142