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