Update ooo320-m1
[ooovba.git] / vcl / unx / headless / svpprn.hxx
blob2281d244de65843ff6d2144c45824b2084f59580
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: svpprn.hxx,v $
10 * $Revision: 1.4 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #ifndef _SVP_SVPPRN_HXX
32 #define _SVP_SVPPRN_HXX
34 #include "vcl/jobdata.hxx"
35 #include "vcl/printergfx.hxx"
36 #include "vcl/printerjob.hxx"
37 #include "vcl/salprn.hxx"
39 class PspGraphics;
41 class PspSalInfoPrinter : public SalInfoPrinter
43 public:
44 PspGraphics* m_pGraphics;
45 psp::JobData m_aJobData;
46 psp::PrinterGfx m_aPrinterGfx;
48 PspSalInfoPrinter();
49 virtual ~PspSalInfoPrinter();
51 // overload all pure virtual methods
52 virtual SalGraphics* GetGraphics();
53 virtual void ReleaseGraphics( SalGraphics* pGraphics );
54 virtual BOOL Setup( SalFrame* pFrame, ImplJobSetup* pSetupData );
55 virtual BOOL SetPrinterData( ImplJobSetup* pSetupData );
56 virtual BOOL SetData( ULONG nFlags, ImplJobSetup* pSetupData );
57 virtual void GetPageInfo( const ImplJobSetup* pSetupData,
58 long& rOutWidth, long& rOutHeight,
59 long& rPageOffX, long& rPageOffY,
60 long& rPageWidth, long& rPageHeight );
61 virtual ULONG GetCapabilities( const ImplJobSetup* pSetupData, USHORT nType );
62 virtual ULONG GetPaperBinCount( const ImplJobSetup* pSetupData );
63 virtual String GetPaperBinName( const ImplJobSetup* pSetupData, ULONG nPaperBin );
64 virtual void InitPaperFormats( const ImplJobSetup* pSetupData );
65 virtual int GetLandscapeAngle( const ImplJobSetup* pSetupData );
66 virtual DuplexMode GetDuplexMode( const ImplJobSetup* pSetupData );
69 class PspSalPrinter : public SalPrinter
71 public:
72 String m_aFileName;
73 String m_aTmpFile;
74 String m_aFaxNr;
75 bool m_bFax:1;
76 bool m_bPdf:1;
77 bool m_bSwallowFaxNo:1;
78 PspGraphics* m_pGraphics;
79 psp::PrinterJob m_aPrintJob;
80 psp::JobData m_aJobData;
81 psp::PrinterGfx m_aPrinterGfx;
82 ULONG m_nCopies;
83 SalInfoPrinter* m_pInfoPrinter;
85 PspSalPrinter( SalInfoPrinter* );
86 virtual ~PspSalPrinter();
88 // overload all pure virtual methods
89 using SalPrinter::StartJob;
90 virtual BOOL StartJob( const XubString* pFileName,
91 const XubString& rJobName,
92 const XubString& rAppName,
93 ULONG nCopies, BOOL bCollate,
94 ImplJobSetup* pSetupData );
95 virtual BOOL EndJob();
96 virtual BOOL AbortJob();
97 virtual SalGraphics* StartPage( ImplJobSetup* pSetupData, BOOL bNewJobData );
98 virtual BOOL EndPage();
99 virtual ULONG GetErrorCode();
102 class Timer;
104 namespace vcl_sal {
105 class VCL_DLLPUBLIC PrinterUpdate
107 static Timer* pPrinterUpdateTimer;
108 static int nActiveJobs;
110 static void doUpdate();
111 DECL_STATIC_LINK( PrinterUpdate, UpdateTimerHdl, void* );
112 public:
113 static void update();
114 static void jobStarted() { nActiveJobs++; }
115 static void jobEnded();
119 #endif // _SVP_SVPPRN_HXX