xref: /aoo42x/main/vcl/inc/salprn.hxx (revision ebfcd9af)
1*ebfcd9afSAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3*ebfcd9afSAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*ebfcd9afSAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*ebfcd9afSAndrew Rist  * distributed with this work for additional information
6*ebfcd9afSAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*ebfcd9afSAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*ebfcd9afSAndrew Rist  * "License"); you may not use this file except in compliance
9*ebfcd9afSAndrew Rist  * with the License.  You may obtain a copy of the License at
10*ebfcd9afSAndrew Rist  *
11*ebfcd9afSAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12*ebfcd9afSAndrew Rist  *
13*ebfcd9afSAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*ebfcd9afSAndrew Rist  * software distributed under the License is distributed on an
15*ebfcd9afSAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*ebfcd9afSAndrew Rist  * KIND, either express or implied.  See the License for the
17*ebfcd9afSAndrew Rist  * specific language governing permissions and limitations
18*ebfcd9afSAndrew Rist  * under the License.
19*ebfcd9afSAndrew Rist  *
20*ebfcd9afSAndrew Rist  *************************************************************/
21*ebfcd9afSAndrew Rist 
22*ebfcd9afSAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir #ifndef _SV_SALPRN_HXX
25cdf0e10cSrcweir #define _SV_SALPRN_HXX
26cdf0e10cSrcweir 
27cdf0e10cSrcweir #include <tools/string.hxx>
28cdf0e10cSrcweir #include <vcl/sv.h>
29cdf0e10cSrcweir #include <vcl/dllapi.h>
30cdf0e10cSrcweir #include <vcl/prntypes.hxx>
31cdf0e10cSrcweir 
32cdf0e10cSrcweir #include <vector>
33cdf0e10cSrcweir 
34cdf0e10cSrcweir class SalGraphics;
35cdf0e10cSrcweir class SalFrame;
36cdf0e10cSrcweir struct ImplJobSetup;
37cdf0e10cSrcweir namespace vcl { class PrinterController; }
38cdf0e10cSrcweir 
39cdf0e10cSrcweir // -----------------------
40cdf0e10cSrcweir // - SalPrinterQueueInfo -
41cdf0e10cSrcweir // -----------------------
42cdf0e10cSrcweir 
43cdf0e10cSrcweir struct VCL_PLUGIN_PUBLIC SalPrinterQueueInfo
44cdf0e10cSrcweir {
45cdf0e10cSrcweir 	XubString				maPrinterName;
46cdf0e10cSrcweir 	XubString				maDriver;
47cdf0e10cSrcweir 	XubString				maLocation;
48cdf0e10cSrcweir 	XubString				maComment;
49cdf0e10cSrcweir 	sal_uLong					mnStatus;
50cdf0e10cSrcweir 	sal_uLong					mnJobs;
51cdf0e10cSrcweir 	void*					mpSysData;
52cdf0e10cSrcweir 
53cdf0e10cSrcweir 							SalPrinterQueueInfo();
54cdf0e10cSrcweir 							~SalPrinterQueueInfo();
55cdf0e10cSrcweir };
56cdf0e10cSrcweir 
57cdf0e10cSrcweir // ------------------
58cdf0e10cSrcweir // - SalInfoPrinter -
59cdf0e10cSrcweir // ------------------
60cdf0e10cSrcweir 
61cdf0e10cSrcweir class VCL_PLUGIN_PUBLIC SalInfoPrinter
62cdf0e10cSrcweir {
63cdf0e10cSrcweir public:
64cdf0e10cSrcweir     std::vector< PaperInfo  >			m_aPaperFormats;	// all printer supported formats
65cdf0e10cSrcweir     bool								m_bPapersInit;		// set to true after InitPaperFormats
66cdf0e10cSrcweir     bool                                m_bCompatMetrics;
67cdf0e10cSrcweir 
SalInfoPrinter()68cdf0e10cSrcweir     SalInfoPrinter() : m_bPapersInit( false ), m_bCompatMetrics( false ) {}
69cdf0e10cSrcweir     virtual ~SalInfoPrinter();
70cdf0e10cSrcweir 
71cdf0e10cSrcweir 	// SalGraphics or NULL, but two Graphics for all SalFrames
72cdf0e10cSrcweir 	// must be returned
73cdf0e10cSrcweir 	virtual SalGraphics*			GetGraphics() = 0;
74cdf0e10cSrcweir 	virtual void					ReleaseGraphics( SalGraphics* pGraphics ) = 0;
75cdf0e10cSrcweir 
76cdf0e10cSrcweir 	virtual sal_Bool					Setup( SalFrame* pFrame, ImplJobSetup* pSetupData ) = 0;
77cdf0e10cSrcweir     // This function set the driver data and
78cdf0e10cSrcweir     // set the new indepen data in pSetupData
79cdf0e10cSrcweir 	virtual sal_Bool					SetPrinterData( ImplJobSetup* pSetupData ) = 0;
80cdf0e10cSrcweir     // This function merged the indepen driver data
81cdf0e10cSrcweir     // and set the new indepen data in pSetupData
82cdf0e10cSrcweir     // Only the data must changed, where the bit
83cdf0e10cSrcweir     // in nFlags is set
84cdf0e10cSrcweir 	virtual sal_Bool					SetData( sal_uLong nFlags, ImplJobSetup* pSetupData ) = 0;
85cdf0e10cSrcweir 
86cdf0e10cSrcweir 	virtual void					GetPageInfo( const ImplJobSetup* pSetupData,
87cdf0e10cSrcweir                                                  long& rOutWidth, long& rOutHeight,
88cdf0e10cSrcweir                                                  long& rPageOffX, long& rPageOffY,
89cdf0e10cSrcweir                                                  long& rPageWidth, long& rPageHeight ) = 0;
90cdf0e10cSrcweir 	virtual sal_uLong					GetCapabilities( const ImplJobSetup* pSetupData, sal_uInt16 nType ) = 0;
91cdf0e10cSrcweir 	virtual sal_uLong					GetPaperBinCount( const ImplJobSetup* pSetupData ) = 0;
92cdf0e10cSrcweir 	virtual String					GetPaperBinName( const ImplJobSetup* pSetupData, sal_uLong nPaperBin ) = 0;
93cdf0e10cSrcweir 	// fills m_aPaperFormats and sets m_bPapersInit to true
94cdf0e10cSrcweir     virtual void					InitPaperFormats( const ImplJobSetup* pSetupData ) = 0;
95cdf0e10cSrcweir     // returns angle that a landscape page will be turned counterclockwise wrt to portrait
96cdf0e10cSrcweir     virtual int					GetLandscapeAngle( const ImplJobSetup* pSetupData ) = 0;
97cdf0e10cSrcweir };
98cdf0e10cSrcweir 
99cdf0e10cSrcweir // --------------
100cdf0e10cSrcweir // - SalPrinter -
101cdf0e10cSrcweir // --------------
102cdf0e10cSrcweir 
103cdf0e10cSrcweir class VCL_PLUGIN_PUBLIC SalPrinter
104cdf0e10cSrcweir {
105cdf0e10cSrcweir public: 					// public for Sal Implementation
SalPrinter()106cdf0e10cSrcweir     SalPrinter() {}
107cdf0e10cSrcweir     virtual ~SalPrinter();
108cdf0e10cSrcweir 
109cdf0e10cSrcweir 	virtual sal_Bool					StartJob( const String* pFileName,
110cdf0e10cSrcweir                                               const String& rJobName,
111cdf0e10cSrcweir                                               const String& rAppName,
112cdf0e10cSrcweir                                               sal_uLong nCopies,
113cdf0e10cSrcweir                                               bool bCollate,
114cdf0e10cSrcweir                                               bool bDirect,
115cdf0e10cSrcweir                                               ImplJobSetup* pSetupData ) = 0;
116cdf0e10cSrcweir 
117cdf0e10cSrcweir     // implement for pull model print systems only,
118cdf0e10cSrcweir     // default implementations (see salvtables.cxx) just returns sal_False
119cdf0e10cSrcweir     virtual sal_Bool                    StartJob( const String* pFileName,
120cdf0e10cSrcweir                                               const String& rJobName,
121cdf0e10cSrcweir                                               const String& rAppName,
122cdf0e10cSrcweir                                               ImplJobSetup* pSetupData,
123cdf0e10cSrcweir                                               vcl::PrinterController& rController );
124cdf0e10cSrcweir 
125cdf0e10cSrcweir 	virtual sal_Bool					EndJob() = 0;
126cdf0e10cSrcweir 	virtual sal_Bool					AbortJob() = 0;
127cdf0e10cSrcweir 	virtual SalGraphics*			StartPage( ImplJobSetup* pSetupData, sal_Bool bNewJobData ) = 0;
128cdf0e10cSrcweir 	virtual sal_Bool					EndPage() = 0;
129cdf0e10cSrcweir 	virtual sal_uLong					GetErrorCode() = 0;
130cdf0e10cSrcweir 
131cdf0e10cSrcweir };
132cdf0e10cSrcweir 
133cdf0e10cSrcweir #endif // _SV_SALPRN_HXX
134