Version 5.2.6.1, tag libreoffice-5.2.6.1
[LibreOffice.git] / vcl / inc / salprn.hxx
blobbeafef246ffaf4becb89b42b39282da7bbf6fffc
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
20 #ifndef INCLUDED_VCL_INC_SALPRN_HXX
21 #define INCLUDED_VCL_INC_SALPRN_HXX
23 #include <vcl/prntypes.hxx>
25 #include "salptype.hxx"
27 #include <vector>
29 class SalGraphics;
30 class SalFrame;
31 struct ImplJobSetup;
32 namespace vcl { class PrinterController; }
34 struct VCL_PLUGIN_PUBLIC SalPrinterQueueInfo
36 OUString maPrinterName;
37 OUString maDriver;
38 OUString maLocation;
39 OUString maComment;
40 PrintQueueFlags mnStatus;
41 sal_uLong mnJobs;
42 OUString* mpSysData;
44 SalPrinterQueueInfo();
45 ~SalPrinterQueueInfo();
48 class VCL_PLUGIN_PUBLIC SalInfoPrinter
50 public:
51 std::vector< PaperInfo > m_aPaperFormats; // all printer supported formats
52 bool m_bPapersInit; // set to true after InitPaperFormats
54 SalInfoPrinter() : m_bPapersInit( false ) {}
55 virtual ~SalInfoPrinter();
57 // SalGraphics or NULL, but two Graphics for all SalFrames
58 // must be returned
59 virtual SalGraphics* AcquireGraphics() = 0;
60 virtual void ReleaseGraphics( SalGraphics* pGraphics ) = 0;
62 virtual bool Setup( SalFrame* pFrame, ImplJobSetup* pSetupData ) = 0;
63 // This function set the driver data and
64 // set the new indepen data in pSetupData
65 virtual bool SetPrinterData( ImplJobSetup* pSetupData ) = 0;
66 // This function merged the indepen driver data
67 // and set the new indepen data in pSetupData
68 // Only the data must changed, where the bit
69 // in nFlags is set
70 virtual bool SetData( JobSetFlags nFlags, ImplJobSetup* pSetupData ) = 0;
72 virtual void GetPageInfo( const ImplJobSetup* pSetupData,
73 long& rOutWidth, long& rOutHeight,
74 long& rPageOffX, long& rPageOffY,
75 long& rPageWidth, long& rPageHeight ) = 0;
76 virtual sal_uInt32 GetCapabilities( const ImplJobSetup* pSetupData, PrinterCapType nType ) = 0;
77 virtual sal_uLong GetPaperBinCount( const ImplJobSetup* pSetupData ) = 0;
78 virtual OUString GetPaperBinName( const ImplJobSetup* pSetupData, sal_uLong nPaperBin ) = 0;
79 // fills m_aPaperFormats and sets m_bPapersInit to true
80 virtual void InitPaperFormats( const ImplJobSetup* pSetupData ) = 0;
81 // returns angle that a landscape page will be turned counterclockwise wrt to portrait
82 virtual int GetLandscapeAngle( const ImplJobSetup* pSetupData ) = 0;
85 class VCL_PLUGIN_PUBLIC SalPrinter
87 public:
88 SalPrinter() {}
89 virtual ~SalPrinter();
91 virtual bool StartJob( const OUString* pFileName,
92 const OUString& rJobName,
93 const OUString& rAppName,
94 sal_uInt32 nCopies,
95 bool bCollate,
96 bool bDirect,
97 ImplJobSetup* pSetupData ) = 0;
99 // implement for pull model print systems only,
100 // default implementations (see salvtables.cxx) just returns false
101 virtual bool StartJob( const OUString* pFileName,
102 const OUString& rJobName,
103 const OUString& rAppName,
104 ImplJobSetup* pSetupData,
105 vcl::PrinterController& rController );
107 virtual bool EndJob() = 0;
108 virtual SalGraphics* StartPage( ImplJobSetup* pSetupData, bool bNewJobData ) = 0;
109 virtual void EndPage() = 0;
110 virtual sal_uLong GetErrorCode() = 0;
114 #endif // INCLUDED_VCL_INC_SALPRN_HXX
116 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */