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