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