1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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 .
26 #define SAL_DRIVERDATA_SYSSIGN ((sal_uIntPtr)0x574E5433)
32 sal_uIntPtr mnSysSignature
;
33 sal_uInt16 mnDriverOffset
;
42 class WinSalInfoPrinter final
: public SalInfoPrinter
45 OUString maDriverName
; // printer driver name
46 OUString maDeviceName
; // printer device name
47 OUString maPortName
; // printer port name
50 HDC m_hDC
; ///< printer hdc
51 WinSalGraphics
* m_pGraphics
; ///< current Printer graphics
52 bool m_bGraphics
; ///< is Graphics used
56 virtual ~WinSalInfoPrinter() override
;
60 virtual SalGraphics
* AcquireGraphics() override
;
61 virtual void ReleaseGraphics( SalGraphics
* pGraphics
) override
;
62 virtual bool Setup( weld::Window
* pFrame
, ImplJobSetup
* pSetupData
) override
;
63 virtual bool SetPrinterData( ImplJobSetup
* pSetupData
) override
;
64 virtual bool SetData( JobSetFlags nFlags
, ImplJobSetup
* pSetupData
) override
;
65 virtual void GetPageInfo( const ImplJobSetup
* pSetupData
,
66 tools::Long
& rOutWidth
, tools::Long
& rOutHeight
,
68 Size
& rPaperSize
) override
;
69 virtual sal_uInt32
GetCapabilities( const ImplJobSetup
* pSetupData
, PrinterCapType nType
) override
;
70 virtual sal_uInt16
GetPaperBinCount( const ImplJobSetup
* pSetupData
) override
;
71 virtual OUString
GetPaperBinName( const ImplJobSetup
* pSetupData
, sal_uInt16 nPaperBin
) override
;
72 virtual sal_uInt16
GetPaperBinBySourceIndex(const ImplJobSetup
* pSetupData
,
73 sal_uInt16 nPaperSource
) override
;
74 virtual sal_uInt16
GetSourceIndexByPaperBin(const ImplJobSetup
* pSetupData
,
75 sal_uInt16 nPaperBin
) override
;
77 virtual void InitPaperFormats( const ImplJobSetup
* pSetupData
) override
;
78 virtual int GetLandscapeAngle( const ImplJobSetup
* pSetupData
) override
;
82 class WinSalPrinter
: public SalPrinter
85 std::unique_ptr
<WinSalGraphics
> mxGraphics
; // current Printer graphics
86 WinSalInfoPrinter
* mpInfoPrinter
; // pointer to the compatible InfoPrinter
87 WinSalPrinter
* mpNextPrinter
; // next printing printer
88 HDC mhDC
; // printer hdc
89 SalPrinterError mnError
; // error code
90 sal_uInt32 mnCopies
; // copies
91 bool mbCollate
; // collated copies
92 bool mbAbort
; // Job Aborted
97 void DoEndDoc(HDC hDC
);
101 virtual ~WinSalPrinter() override
;
103 using SalPrinter::StartJob
;
104 virtual bool StartJob( const OUString
* pFileName
,
105 const OUString
& rJobName
,
106 const OUString
& rAppName
,
110 ImplJobSetup
* pSetupData
) override
;
111 virtual bool EndJob() override
;
112 virtual SalGraphics
* StartPage( ImplJobSetup
* pSetupData
, bool bNewJobData
) override
;
113 virtual void EndPage() override
;
114 virtual SalPrinterError
GetErrorCode() override
;
117 bool isValid() const { return mbValid
&& mhDC
; }
120 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */