1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: svpprn.hxx,v $
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"
41 class PspSalInfoPrinter
: public SalInfoPrinter
44 PspGraphics
* m_pGraphics
;
45 psp::JobData m_aJobData
;
46 psp::PrinterGfx m_aPrinterGfx
;
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
77 bool m_bSwallowFaxNo
:1;
78 PspGraphics
* m_pGraphics
;
79 psp::PrinterJob m_aPrintJob
;
80 psp::JobData m_aJobData
;
81 psp::PrinterGfx m_aPrinterGfx
;
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();
105 class VCL_DLLPUBLIC PrinterUpdate
107 static Timer
* pPrinterUpdateTimer
;
108 static int nActiveJobs
;
110 static void doUpdate();
111 DECL_STATIC_LINK( PrinterUpdate
, UpdateTimerHdl
, void* );
113 static void update();
114 static void jobStarted() { nActiveJobs
++; }
115 static void jobEnded();
119 #endif // _SVP_SVPPRN_HXX