Line data Source code
1 : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : /*
3 : * This file is part of the LibreOffice project.
4 : *
5 : * This Source Code Form is subject to the terms of the Mozilla Public
6 : * License, v. 2.0. If a copy of the MPL was not distributed with this
7 : * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 : *
9 : * This file incorporates work covered by the following license notice:
10 : *
11 : * Licensed to the Apache Software Foundation (ASF) under one or more
12 : * contributor license agreements. See the NOTICE file distributed
13 : * with this work for additional information regarding copyright
14 : * ownership. The ASF licenses this file to you under the Apache
15 : * License, Version 2.0 (the "License"); you may not use this file
16 : * except in compliance with the License. You may obtain a copy of
17 : * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 : */
19 :
20 : #ifndef INCLUDED_VCL_INC_SALPRN_HXX
21 : #define INCLUDED_VCL_INC_SALPRN_HXX
22 :
23 : #include <rtl/ustring.hxx>
24 :
25 : #include <tools/solar.h>
26 : #include <vcl/dllapi.h>
27 : #include <vcl/prntypes.hxx>
28 :
29 : #include <vector>
30 :
31 : class SalGraphics;
32 : class SalFrame;
33 : struct ImplJobSetup;
34 : namespace vcl { class PrinterController; }
35 :
36 : struct VCL_PLUGIN_PUBLIC SalPrinterQueueInfo
37 : {
38 : OUString maPrinterName;
39 : OUString maDriver;
40 : OUString maLocation;
41 : OUString maComment;
42 : sal_uLong mnStatus;
43 : sal_uLong mnJobs;
44 : OUString* mpSysData;
45 :
46 : SalPrinterQueueInfo();
47 : ~SalPrinterQueueInfo();
48 : };
49 :
50 : class VCL_PLUGIN_PUBLIC SalInfoPrinter
51 : {
52 : public:
53 : std::vector< PaperInfo > m_aPaperFormats; // all printer supported formats
54 : bool m_bPapersInit; // set to true after InitPaperFormats
55 :
56 680 : SalInfoPrinter() : m_bPapersInit( false ) {}
57 : virtual ~SalInfoPrinter();
58 :
59 : // SalGraphics or NULL, but two Graphics for all SalFrames
60 : // must be returned
61 : virtual SalGraphics* AcquireGraphics() = 0;
62 : virtual void ReleaseGraphics( SalGraphics* pGraphics ) = 0;
63 :
64 : virtual bool Setup( SalFrame* pFrame, ImplJobSetup* pSetupData ) = 0;
65 : // This function set the driver data and
66 : // set the new indepen data in pSetupData
67 : virtual bool SetPrinterData( ImplJobSetup* pSetupData ) = 0;
68 : // This function merged the indepen driver data
69 : // and set the new indepen data in pSetupData
70 : // Only the data must changed, where the bit
71 : // in nFlags is set
72 : virtual bool SetData( sal_uLong nFlags, ImplJobSetup* pSetupData ) = 0;
73 :
74 : virtual void GetPageInfo( const ImplJobSetup* pSetupData,
75 : long& rOutWidth, long& rOutHeight,
76 : long& rPageOffX, long& rPageOffY,
77 : long& rPageWidth, long& rPageHeight ) = 0;
78 : virtual sal_uLong GetCapabilities( const ImplJobSetup* pSetupData, sal_uInt16 nType ) = 0;
79 : virtual sal_uLong GetPaperBinCount( const ImplJobSetup* pSetupData ) = 0;
80 : virtual OUString GetPaperBinName( const ImplJobSetup* pSetupData, sal_uLong nPaperBin ) = 0;
81 : // fills m_aPaperFormats and sets m_bPapersInit to true
82 : virtual void InitPaperFormats( const ImplJobSetup* pSetupData ) = 0;
83 : // returns angle that a landscape page will be turned counterclockwise wrt to portrait
84 : virtual int GetLandscapeAngle( const ImplJobSetup* pSetupData ) = 0;
85 : };
86 :
87 : class VCL_PLUGIN_PUBLIC SalPrinter
88 : {
89 : public:
90 0 : SalPrinter() {}
91 : virtual ~SalPrinter();
92 :
93 : virtual bool StartJob( const OUString* pFileName,
94 : const OUString& rJobName,
95 : const OUString& rAppName,
96 : sal_uLong nCopies,
97 : bool bCollate,
98 : bool bDirect,
99 : ImplJobSetup* pSetupData ) = 0;
100 :
101 : // implement for pull model print systems only,
102 : // default implementations (see salvtables.cxx) just returns false
103 : virtual bool StartJob( const OUString* pFileName,
104 : const OUString& rJobName,
105 : const OUString& rAppName,
106 : ImplJobSetup* pSetupData,
107 : vcl::PrinterController& rController );
108 :
109 : virtual bool EndJob() = 0;
110 : virtual bool AbortJob() = 0;
111 : virtual SalGraphics* StartPage( ImplJobSetup* pSetupData, bool bNewJobData ) = 0;
112 : virtual bool EndPage() = 0;
113 : virtual sal_uLong GetErrorCode() = 0;
114 :
115 : };
116 :
117 : #endif // INCLUDED_VCL_INC_SALPRN_HXX
118 :
119 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|