xref: /aoo42x/main/vcl/inc/salprn.hxx (revision cdf0e10c)
1*cdf0e10cSrcweir /*************************************************************************
2*cdf0e10cSrcweir  *
3*cdf0e10cSrcweir  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4*cdf0e10cSrcweir  *
5*cdf0e10cSrcweir  * Copyright 2000, 2010 Oracle and/or its affiliates.
6*cdf0e10cSrcweir  *
7*cdf0e10cSrcweir  * OpenOffice.org - a multi-platform office productivity suite
8*cdf0e10cSrcweir  *
9*cdf0e10cSrcweir  * This file is part of OpenOffice.org.
10*cdf0e10cSrcweir  *
11*cdf0e10cSrcweir  * OpenOffice.org is free software: you can redistribute it and/or modify
12*cdf0e10cSrcweir  * it under the terms of the GNU Lesser General Public License version 3
13*cdf0e10cSrcweir  * only, as published by the Free Software Foundation.
14*cdf0e10cSrcweir  *
15*cdf0e10cSrcweir  * OpenOffice.org is distributed in the hope that it will be useful,
16*cdf0e10cSrcweir  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17*cdf0e10cSrcweir  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18*cdf0e10cSrcweir  * GNU Lesser General Public License version 3 for more details
19*cdf0e10cSrcweir  * (a copy is included in the LICENSE file that accompanied this code).
20*cdf0e10cSrcweir  *
21*cdf0e10cSrcweir  * You should have received a copy of the GNU Lesser General Public License
22*cdf0e10cSrcweir  * version 3 along with OpenOffice.org.  If not, see
23*cdf0e10cSrcweir  * <http://www.openoffice.org/license.html>
24*cdf0e10cSrcweir  * for a copy of the LGPLv3 License.
25*cdf0e10cSrcweir  *
26*cdf0e10cSrcweir  ************************************************************************/
27*cdf0e10cSrcweir 
28*cdf0e10cSrcweir #ifndef _SV_SALPRN_HXX
29*cdf0e10cSrcweir #define _SV_SALPRN_HXX
30*cdf0e10cSrcweir 
31*cdf0e10cSrcweir #include <tools/string.hxx>
32*cdf0e10cSrcweir #include <vcl/sv.h>
33*cdf0e10cSrcweir #include <vcl/dllapi.h>
34*cdf0e10cSrcweir #include <vcl/prntypes.hxx>
35*cdf0e10cSrcweir 
36*cdf0e10cSrcweir #include <vector>
37*cdf0e10cSrcweir 
38*cdf0e10cSrcweir class SalGraphics;
39*cdf0e10cSrcweir class SalFrame;
40*cdf0e10cSrcweir struct ImplJobSetup;
41*cdf0e10cSrcweir namespace vcl { class PrinterController; }
42*cdf0e10cSrcweir 
43*cdf0e10cSrcweir // -----------------------
44*cdf0e10cSrcweir // - SalPrinterQueueInfo -
45*cdf0e10cSrcweir // -----------------------
46*cdf0e10cSrcweir 
47*cdf0e10cSrcweir struct VCL_PLUGIN_PUBLIC SalPrinterQueueInfo
48*cdf0e10cSrcweir {
49*cdf0e10cSrcweir 	XubString				maPrinterName;
50*cdf0e10cSrcweir 	XubString				maDriver;
51*cdf0e10cSrcweir 	XubString				maLocation;
52*cdf0e10cSrcweir 	XubString				maComment;
53*cdf0e10cSrcweir 	sal_uLong					mnStatus;
54*cdf0e10cSrcweir 	sal_uLong					mnJobs;
55*cdf0e10cSrcweir 	void*					mpSysData;
56*cdf0e10cSrcweir 
57*cdf0e10cSrcweir 							SalPrinterQueueInfo();
58*cdf0e10cSrcweir 							~SalPrinterQueueInfo();
59*cdf0e10cSrcweir };
60*cdf0e10cSrcweir 
61*cdf0e10cSrcweir // ------------------
62*cdf0e10cSrcweir // - SalInfoPrinter -
63*cdf0e10cSrcweir // ------------------
64*cdf0e10cSrcweir 
65*cdf0e10cSrcweir class VCL_PLUGIN_PUBLIC SalInfoPrinter
66*cdf0e10cSrcweir {
67*cdf0e10cSrcweir public:
68*cdf0e10cSrcweir     std::vector< PaperInfo  >			m_aPaperFormats;	// all printer supported formats
69*cdf0e10cSrcweir     bool								m_bPapersInit;		// set to true after InitPaperFormats
70*cdf0e10cSrcweir     bool                                m_bCompatMetrics;
71*cdf0e10cSrcweir 
72*cdf0e10cSrcweir     SalInfoPrinter() : m_bPapersInit( false ), m_bCompatMetrics( false ) {}
73*cdf0e10cSrcweir     virtual ~SalInfoPrinter();
74*cdf0e10cSrcweir 
75*cdf0e10cSrcweir 	// SalGraphics or NULL, but two Graphics for all SalFrames
76*cdf0e10cSrcweir 	// must be returned
77*cdf0e10cSrcweir 	virtual SalGraphics*			GetGraphics() = 0;
78*cdf0e10cSrcweir 	virtual void					ReleaseGraphics( SalGraphics* pGraphics ) = 0;
79*cdf0e10cSrcweir 
80*cdf0e10cSrcweir 	virtual sal_Bool					Setup( SalFrame* pFrame, ImplJobSetup* pSetupData ) = 0;
81*cdf0e10cSrcweir     // This function set the driver data and
82*cdf0e10cSrcweir     // set the new indepen data in pSetupData
83*cdf0e10cSrcweir 	virtual sal_Bool					SetPrinterData( ImplJobSetup* pSetupData ) = 0;
84*cdf0e10cSrcweir     // This function merged the indepen driver data
85*cdf0e10cSrcweir     // and set the new indepen data in pSetupData
86*cdf0e10cSrcweir     // Only the data must changed, where the bit
87*cdf0e10cSrcweir     // in nFlags is set
88*cdf0e10cSrcweir 	virtual sal_Bool					SetData( sal_uLong nFlags, ImplJobSetup* pSetupData ) = 0;
89*cdf0e10cSrcweir 
90*cdf0e10cSrcweir 	virtual void					GetPageInfo( const ImplJobSetup* pSetupData,
91*cdf0e10cSrcweir                                                  long& rOutWidth, long& rOutHeight,
92*cdf0e10cSrcweir                                                  long& rPageOffX, long& rPageOffY,
93*cdf0e10cSrcweir                                                  long& rPageWidth, long& rPageHeight ) = 0;
94*cdf0e10cSrcweir 	virtual sal_uLong					GetCapabilities( const ImplJobSetup* pSetupData, sal_uInt16 nType ) = 0;
95*cdf0e10cSrcweir 	virtual sal_uLong					GetPaperBinCount( const ImplJobSetup* pSetupData ) = 0;
96*cdf0e10cSrcweir 	virtual String					GetPaperBinName( const ImplJobSetup* pSetupData, sal_uLong nPaperBin ) = 0;
97*cdf0e10cSrcweir 	// fills m_aPaperFormats and sets m_bPapersInit to true
98*cdf0e10cSrcweir     virtual void					InitPaperFormats( const ImplJobSetup* pSetupData ) = 0;
99*cdf0e10cSrcweir     // returns angle that a landscape page will be turned counterclockwise wrt to portrait
100*cdf0e10cSrcweir     virtual int					GetLandscapeAngle( const ImplJobSetup* pSetupData ) = 0;
101*cdf0e10cSrcweir };
102*cdf0e10cSrcweir 
103*cdf0e10cSrcweir // --------------
104*cdf0e10cSrcweir // - SalPrinter -
105*cdf0e10cSrcweir // --------------
106*cdf0e10cSrcweir 
107*cdf0e10cSrcweir class VCL_PLUGIN_PUBLIC SalPrinter
108*cdf0e10cSrcweir {
109*cdf0e10cSrcweir public: 					// public for Sal Implementation
110*cdf0e10cSrcweir     SalPrinter() {}
111*cdf0e10cSrcweir     virtual ~SalPrinter();
112*cdf0e10cSrcweir 
113*cdf0e10cSrcweir 	virtual sal_Bool					StartJob( const String* pFileName,
114*cdf0e10cSrcweir                                               const String& rJobName,
115*cdf0e10cSrcweir                                               const String& rAppName,
116*cdf0e10cSrcweir                                               sal_uLong nCopies,
117*cdf0e10cSrcweir                                               bool bCollate,
118*cdf0e10cSrcweir                                               bool bDirect,
119*cdf0e10cSrcweir                                               ImplJobSetup* pSetupData ) = 0;
120*cdf0e10cSrcweir 
121*cdf0e10cSrcweir     // implement for pull model print systems only,
122*cdf0e10cSrcweir     // default implementations (see salvtables.cxx) just returns sal_False
123*cdf0e10cSrcweir     virtual sal_Bool                    StartJob( const String* pFileName,
124*cdf0e10cSrcweir                                               const String& rJobName,
125*cdf0e10cSrcweir                                               const String& rAppName,
126*cdf0e10cSrcweir                                               ImplJobSetup* pSetupData,
127*cdf0e10cSrcweir                                               vcl::PrinterController& rController );
128*cdf0e10cSrcweir 
129*cdf0e10cSrcweir 	virtual sal_Bool					EndJob() = 0;
130*cdf0e10cSrcweir 	virtual sal_Bool					AbortJob() = 0;
131*cdf0e10cSrcweir 	virtual SalGraphics*			StartPage( ImplJobSetup* pSetupData, sal_Bool bNewJobData ) = 0;
132*cdf0e10cSrcweir 	virtual sal_Bool					EndPage() = 0;
133*cdf0e10cSrcweir 	virtual sal_uLong					GetErrorCode() = 0;
134*cdf0e10cSrcweir 
135*cdf0e10cSrcweir };
136*cdf0e10cSrcweir 
137*cdf0e10cSrcweir #endif // _SV_SALPRN_HXX
138