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 // ----------------- 30 // - SalDriverData - 31 // ----------------- 32 33 // WNT3 34 #define SAL_DRIVERDATA_SYSSIGN ((sal_uIntPtr)0x574E5433) 35 #define SAL_DRIVERDATA_VERSION_A 1 36 #define SAL_DRIVERDATA_VERSION_W 2 37 38 #pragma pack( 1 ) 39 40 struct SalDriverData 41 { 42 sal_uIntPtr mnSysSignature; 43 sal_uInt16 mnVersion; 44 sal_uInt16 mnDriverOffset; 45 BYTE maDriverData[1]; 46 }; 47 48 #pragma pack() 49 50 // --------------------- 51 // - WinSalInfoPrinter - 52 // --------------------- 53 54 class WinSalGraphics; 55 56 class WinSalInfoPrinter : public SalInfoPrinter 57 { 58 public: 59 WinSalGraphics* mpGraphics; // current Printer graphics 60 XubString maDriverName; // printer driver name 61 XubString maDeviceName; // printer device name 62 XubString maPortName; // printer port name 63 HDC mhDC; // printer hdc 64 sal_Bool mbGraphics; // is Graphics used 65 public: 66 WinSalInfoPrinter(); 67 virtual ~WinSalInfoPrinter(); 68 69 virtual SalGraphics* GetGraphics(); 70 virtual void ReleaseGraphics( SalGraphics* pGraphics ); 71 virtual sal_Bool Setup( SalFrame* pFrame, ImplJobSetup* pSetupData ); 72 virtual sal_Bool SetPrinterData( ImplJobSetup* pSetupData ); 73 virtual sal_Bool SetData( sal_uIntPtr nFlags, ImplJobSetup* pSetupData ); 74 virtual void GetPageInfo( const ImplJobSetup* pSetupData, 75 long& rOutWidth, long& rOutHeight, 76 long& rPageOffX, long& rPageOffY, 77 long& rPageWidth, long& rPageHeight ); 78 virtual sal_uIntPtr GetCapabilities( const ImplJobSetup* pSetupData, sal_uInt16 nType ); 79 virtual sal_uIntPtr GetPaperBinCount( const ImplJobSetup* pSetupData ); 80 virtual String GetPaperBinName( const ImplJobSetup* pSetupData, sal_uIntPtr nPaperBin ); 81 virtual void InitPaperFormats( const ImplJobSetup* pSetupData ); 82 virtual int GetLandscapeAngle( const ImplJobSetup* pSetupData ); 83 }; 84 85 // ----------------- 86 // - WinSalPrinter - 87 // ----------------- 88 89 class WinSalPrinter : public SalPrinter 90 { 91 public: 92 WinSalGraphics* mpGraphics; // current Printer graphics 93 WinSalInfoPrinter* mpInfoPrinter; // pointer to the compatible InfoPrinter 94 WinSalPrinter* mpNextPrinter; // next printing printer 95 HDC mhDC; // printer hdc 96 sal_uIntPtr mnError; // Error Code 97 sal_uIntPtr mnCopies; // Kopien 98 sal_Bool mbCollate; // Sortierte Kopien 99 sal_Bool mbAbort; // Job Aborted 100 101 bool mbValid; 102 103 public: 104 WinSalPrinter(); 105 virtual ~WinSalPrinter(); 106 107 using SalPrinter::StartJob; 108 virtual sal_Bool StartJob( const XubString* pFileName, 109 const XubString& rJobName, 110 const XubString& rAppName, 111 sal_uIntPtr nCopies, 112 bool bCollate, 113 bool bDirect, 114 ImplJobSetup* pSetupData ); 115 virtual sal_Bool EndJob(); 116 virtual sal_Bool AbortJob(); 117 virtual SalGraphics* StartPage( ImplJobSetup* pSetupData, sal_Bool bNewJobData ); 118 virtual sal_Bool EndPage(); 119 virtual sal_uIntPtr GetErrorCode(); 120 121 void markInvalid(); 122 bool isValid() const { return mbValid; } 123 }; 124 125 #endif // _SV_SALPRN_H 126