1*0d63794cSAndrew Rist /************************************************************** 2cdf0e10cSrcweir * 3*0d63794cSAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one 4*0d63794cSAndrew Rist * or more contributor license agreements. See the NOTICE file 5*0d63794cSAndrew Rist * distributed with this work for additional information 6*0d63794cSAndrew Rist * regarding copyright ownership. The ASF licenses this file 7*0d63794cSAndrew Rist * to you under the Apache License, Version 2.0 (the 8*0d63794cSAndrew Rist * "License"); you may not use this file except in compliance 9*0d63794cSAndrew Rist * with the License. You may obtain a copy of the License at 10*0d63794cSAndrew Rist * 11*0d63794cSAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0 12*0d63794cSAndrew Rist * 13*0d63794cSAndrew Rist * Unless required by applicable law or agreed to in writing, 14*0d63794cSAndrew Rist * software distributed under the License is distributed on an 15*0d63794cSAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16*0d63794cSAndrew Rist * KIND, either express or implied. See the License for the 17*0d63794cSAndrew Rist * specific language governing permissions and limitations 18*0d63794cSAndrew Rist * under the License. 19*0d63794cSAndrew Rist * 20*0d63794cSAndrew Rist *************************************************************/ 21*0d63794cSAndrew Rist 22*0d63794cSAndrew Rist 23cdf0e10cSrcweir 24cdf0e10cSrcweir #ifndef _SVP_SVPPRN_HXX 25cdf0e10cSrcweir #define _SVP_SVPPRN_HXX 26cdf0e10cSrcweir 27cdf0e10cSrcweir #include "vcl/jobdata.hxx" 28cdf0e10cSrcweir 29cdf0e10cSrcweir #include "printergfx.hxx" 30cdf0e10cSrcweir #include "printerjob.hxx" 31cdf0e10cSrcweir #include "salprn.hxx" 32cdf0e10cSrcweir 33cdf0e10cSrcweir #include "vclpluginapi.h" 34cdf0e10cSrcweir 35cdf0e10cSrcweir class PspGraphics; 36cdf0e10cSrcweir 37cdf0e10cSrcweir class PspSalInfoPrinter : public SalInfoPrinter 38cdf0e10cSrcweir { 39cdf0e10cSrcweir public: 40cdf0e10cSrcweir PspGraphics* m_pGraphics; 41cdf0e10cSrcweir psp::JobData m_aJobData; 42cdf0e10cSrcweir psp::PrinterGfx m_aPrinterGfx; 43cdf0e10cSrcweir 44cdf0e10cSrcweir PspSalInfoPrinter(); 45cdf0e10cSrcweir virtual ~PspSalInfoPrinter(); 46cdf0e10cSrcweir 47cdf0e10cSrcweir // overload all pure virtual methods 48cdf0e10cSrcweir virtual SalGraphics* GetGraphics(); 49cdf0e10cSrcweir virtual void ReleaseGraphics( SalGraphics* pGraphics ); 50cdf0e10cSrcweir virtual sal_Bool Setup( SalFrame* pFrame, ImplJobSetup* pSetupData ); 51cdf0e10cSrcweir virtual sal_Bool SetPrinterData( ImplJobSetup* pSetupData ); 52cdf0e10cSrcweir virtual sal_Bool SetData( sal_uLong nFlags, ImplJobSetup* pSetupData ); 53cdf0e10cSrcweir virtual void GetPageInfo( const ImplJobSetup* pSetupData, 54cdf0e10cSrcweir long& rOutWidth, long& rOutHeight, 55cdf0e10cSrcweir long& rPageOffX, long& rPageOffY, 56cdf0e10cSrcweir long& rPageWidth, long& rPageHeight ); 57cdf0e10cSrcweir virtual sal_uLong GetCapabilities( const ImplJobSetup* pSetupData, sal_uInt16 nType ); 58cdf0e10cSrcweir virtual sal_uLong GetPaperBinCount( const ImplJobSetup* pSetupData ); 59cdf0e10cSrcweir virtual String GetPaperBinName( const ImplJobSetup* pSetupData, sal_uLong nPaperBin ); 60cdf0e10cSrcweir virtual void InitPaperFormats( const ImplJobSetup* pSetupData ); 61cdf0e10cSrcweir virtual int GetLandscapeAngle( const ImplJobSetup* pSetupData ); 62cdf0e10cSrcweir }; 63cdf0e10cSrcweir 64cdf0e10cSrcweir class PspSalPrinter : public SalPrinter 65cdf0e10cSrcweir { 66cdf0e10cSrcweir public: 67cdf0e10cSrcweir String m_aFileName; 68cdf0e10cSrcweir String m_aTmpFile; 69cdf0e10cSrcweir String m_aFaxNr; 70cdf0e10cSrcweir bool m_bFax:1; 71cdf0e10cSrcweir bool m_bPdf:1; 72cdf0e10cSrcweir bool m_bSwallowFaxNo:1; 73cdf0e10cSrcweir PspGraphics* m_pGraphics; 74cdf0e10cSrcweir psp::PrinterJob m_aPrintJob; 75cdf0e10cSrcweir psp::JobData m_aJobData; 76cdf0e10cSrcweir psp::PrinterGfx m_aPrinterGfx; 77cdf0e10cSrcweir sal_uLong m_nCopies; 78cdf0e10cSrcweir bool m_bCollate; 79cdf0e10cSrcweir SalInfoPrinter* m_pInfoPrinter; 80cdf0e10cSrcweir 81cdf0e10cSrcweir PspSalPrinter( SalInfoPrinter* ); 82cdf0e10cSrcweir virtual ~PspSalPrinter(); 83cdf0e10cSrcweir 84cdf0e10cSrcweir // overload all pure virtual methods 85cdf0e10cSrcweir using SalPrinter::StartJob; 86cdf0e10cSrcweir virtual sal_Bool StartJob( const XubString* pFileName, 87cdf0e10cSrcweir const XubString& rJobName, 88cdf0e10cSrcweir const XubString& rAppName, 89cdf0e10cSrcweir sal_uLong nCopies, 90cdf0e10cSrcweir bool bCollate, 91cdf0e10cSrcweir bool bDirect, 92cdf0e10cSrcweir ImplJobSetup* pSetupData ); 93cdf0e10cSrcweir virtual sal_Bool EndJob(); 94cdf0e10cSrcweir virtual sal_Bool AbortJob(); 95cdf0e10cSrcweir virtual SalGraphics* StartPage( ImplJobSetup* pSetupData, sal_Bool bNewJobData ); 96cdf0e10cSrcweir virtual sal_Bool EndPage(); 97cdf0e10cSrcweir virtual sal_uLong GetErrorCode(); 98cdf0e10cSrcweir }; 99cdf0e10cSrcweir 100cdf0e10cSrcweir class Timer; 101cdf0e10cSrcweir 102cdf0e10cSrcweir namespace vcl_sal { 103cdf0e10cSrcweir class VCLPLUG_SVP_PUBLIC PrinterUpdate 104cdf0e10cSrcweir { 105cdf0e10cSrcweir static Timer* pPrinterUpdateTimer; 106cdf0e10cSrcweir static int nActiveJobs; 107cdf0e10cSrcweir 108cdf0e10cSrcweir static void doUpdate(); 109cdf0e10cSrcweir DECL_STATIC_LINK( PrinterUpdate, UpdateTimerHdl, void* ); 110cdf0e10cSrcweir public: 111cdf0e10cSrcweir static void update(); jobStarted()112cdf0e10cSrcweir static void jobStarted() { nActiveJobs++; } 113cdf0e10cSrcweir static void jobEnded(); 114cdf0e10cSrcweir }; 115cdf0e10cSrcweir } 116cdf0e10cSrcweir 117cdf0e10cSrcweir #endif // _SVP_SVPPRN_HXX 118cdf0e10cSrcweir 119cdf0e10cSrcweir 120