LibreOffice Module vcl (master) 1
win/salprn.h
Go to the documentation of this file.
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_WIN_SALPRN_H
21#define INCLUDED_VCL_INC_WIN_SALPRN_H
22
23#include <salprn.hxx>
24
25
26// WNT3
27#define SAL_DRIVERDATA_SYSSIGN ((sal_uIntPtr)0x574E5433)
28
29#pragma pack( 1 )
30
32{
33 sal_uIntPtr mnSysSignature;
34 sal_uInt16 mnDriverOffset;
36};
37
38#pragma pack()
39
40
41class WinSalGraphics;
42
44{
45public:
46 OUString maDriverName; // printer driver name
47 OUString maDeviceName; // printer device name
48 OUString maPortName; // printer port name
49
50private:
51 HDC m_hDC;
54
55public:
57 virtual ~WinSalInfoPrinter() override;
58
59 void setHDC(HDC);
60
61 virtual SalGraphics* AcquireGraphics() override;
62 virtual void ReleaseGraphics( SalGraphics* pGraphics ) override;
63 virtual bool Setup( weld::Window* pFrame, ImplJobSetup* pSetupData ) override;
64 virtual bool SetPrinterData( ImplJobSetup* pSetupData ) override;
65 virtual bool SetData( JobSetFlags nFlags, ImplJobSetup* pSetupData ) override;
66 virtual void GetPageInfo( const ImplJobSetup* pSetupData,
67 tools::Long& rOutWidth, tools::Long& rOutHeight,
68 Point& rPageOffset,
69 Size& rPaperSize ) override;
70 virtual sal_uInt32 GetCapabilities( const ImplJobSetup* pSetupData, PrinterCapType nType ) override;
71 virtual sal_uInt16 GetPaperBinCount( const ImplJobSetup* pSetupData ) override;
72 virtual OUString GetPaperBinName( const ImplJobSetup* pSetupData, sal_uInt16 nPaperBin ) override;
73 virtual void InitPaperFormats( const ImplJobSetup* pSetupData ) override;
74 virtual int GetLandscapeAngle( const ImplJobSetup* pSetupData ) override;
75};
76
77
79{
80public:
81 std::unique_ptr<WinSalGraphics> mxGraphics; // current Printer graphics
82 WinSalInfoPrinter* mpInfoPrinter; // pointer to the compatible InfoPrinter
83 WinSalPrinter* mpNextPrinter; // next printing printer
84 HDC mhDC; // printer hdc
85 SalPrinterError mnError; // error code
86 sal_uInt32 mnCopies; // copies
87 bool mbCollate; // collated copies
88 bool mbAbort; // Job Aborted
89
90 bool mbValid;
91
92protected:
93 void DoEndDoc(HDC hDC);
94
95public:
97 virtual ~WinSalPrinter() override;
98
100 virtual bool StartJob( const OUString* pFileName,
101 const OUString& rJobName,
102 const OUString& rAppName,
103 sal_uInt32 nCopies,
104 bool bCollate,
105 bool bDirect,
106 ImplJobSetup* pSetupData ) override;
107 virtual bool EndJob() override;
108 virtual SalGraphics* StartPage( ImplJobSetup* pSetupData, bool bNewJobData ) override;
109 virtual void EndPage() override;
110 virtual SalPrinterError GetErrorCode() override;
111
113 bool isValid() const { return mbValid && mhDC; }
114};
115
116#endif // INCLUDED_VCL_INC_WIN_SALPRN_H
117
118/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual bool StartJob(const OUString *pFileName, const OUString &rJobName, const OUString &rAppName, sal_uInt32 nCopies, bool bCollate, bool bDirect, ImplJobSetup *pSetupData)=0
WinSalGraphics never owns the HDC it uses to draw, because the HDC can have various origins with diff...
Definition: win/salgdi.h:141
OUString maDriverName
Definition: win/salprn.h:46
virtual sal_uInt32 GetCapabilities(const ImplJobSetup *pSetupData, PrinterCapType nType) override
virtual bool SetData(JobSetFlags nFlags, ImplJobSetup *pSetupData) override
virtual OUString GetPaperBinName(const ImplJobSetup *pSetupData, sal_uInt16 nPaperBin) override
virtual sal_uInt16 GetPaperBinCount(const ImplJobSetup *pSetupData) override
HDC m_hDC
printer hdc
Definition: win/salprn.h:51
virtual bool Setup(weld::Window *pFrame, ImplJobSetup *pSetupData) override
virtual ~WinSalInfoPrinter() override
virtual SalGraphics * AcquireGraphics() override
virtual void InitPaperFormats(const ImplJobSetup *pSetupData) override
virtual void GetPageInfo(const ImplJobSetup *pSetupData, tools::Long &rOutWidth, tools::Long &rOutHeight, Point &rPageOffset, Size &rPaperSize) override
virtual int GetLandscapeAngle(const ImplJobSetup *pSetupData) override
OUString maDeviceName
Definition: win/salprn.h:47
virtual void ReleaseGraphics(SalGraphics *pGraphics) override
bool m_bGraphics
is Graphics used
Definition: win/salprn.h:53
WinSalGraphics * m_pGraphics
current Printer graphics
Definition: win/salprn.h:52
OUString maPortName
Definition: win/salprn.h:48
virtual bool SetPrinterData(ImplJobSetup *pSetupData) override
void markInvalid()
virtual void EndPage() override
WinSalPrinter * mpNextPrinter
Definition: win/salprn.h:83
WinSalInfoPrinter * mpInfoPrinter
Definition: win/salprn.h:82
virtual ~WinSalPrinter() override
virtual SalGraphics * StartPage(ImplJobSetup *pSetupData, bool bNewJobData) override
virtual bool StartJob(const OUString *pFileName, const OUString &rJobName, const OUString &rAppName, sal_uInt32 nCopies, bool bCollate, bool bDirect, ImplJobSetup *pSetupData) override
bool isValid() const
Definition: win/salprn.h:113
virtual SalPrinterError GetErrorCode() override
std::unique_ptr< WinSalGraphics > mxGraphics
Definition: win/salprn.h:81
void DoEndDoc(HDC hDC)
sal_uInt32 mnCopies
Definition: win/salprn.h:86
virtual bool EndJob() override
bool mbCollate
Definition: win/salprn.h:87
SalPrinterError mnError
Definition: win/salprn.h:85
long Long
PrinterCapType
Definition: prntypes.hxx:72
JobSetFlags
Definition: salptype.hxx:27
SalPrinterError
Definition: salptype.hxx:41
sal_uIntPtr mnSysSignature
Definition: win/salprn.h:33
sal_uInt16 mnDriverOffset
Definition: win/salprn.h:34
BYTE maDriverData[1]
Definition: win/salprn.h:35
unsigned char BYTE