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 
41 class WinSalGraphics;
42 
44 {
45 public:
46  WinSalGraphics* mpGraphics; // current Printer graphics
47  OUString maDriverName; // printer driver name
48  OUString maDeviceName; // printer device name
49  OUString maPortName; // printer port name
50  HDC mhDC; // printer hdc
51  bool mbGraphics; // is Graphics used
52 public:
54  virtual ~WinSalInfoPrinter() override;
55 
56  virtual SalGraphics* AcquireGraphics() override;
57  virtual void ReleaseGraphics( SalGraphics* pGraphics ) override;
58  virtual bool Setup( weld::Window* pFrame, ImplJobSetup* pSetupData ) override;
59  virtual bool SetPrinterData( ImplJobSetup* pSetupData ) override;
60  virtual bool SetData( JobSetFlags nFlags, ImplJobSetup* pSetupData ) override;
61  virtual void GetPageInfo( const ImplJobSetup* pSetupData,
62  long& rOutWidth, long& rOutHeight,
63  Point& rPageOffset,
64  Size& rPaperSize ) override;
65  virtual sal_uInt32 GetCapabilities( const ImplJobSetup* pSetupData, PrinterCapType nType ) override;
66  virtual sal_uInt16 GetPaperBinCount( const ImplJobSetup* pSetupData ) override;
67  virtual OUString GetPaperBinName( const ImplJobSetup* pSetupData, sal_uInt16 nPaperBin ) override;
68  virtual void InitPaperFormats( const ImplJobSetup* pSetupData ) override;
69  virtual int GetLandscapeAngle( const ImplJobSetup* pSetupData ) override;
70 };
71 
72 
73 class WinSalPrinter : public SalPrinter
74 {
75 public:
76  WinSalGraphics* mpGraphics; // current Printer graphics
77  WinSalInfoPrinter* mpInfoPrinter; // pointer to the compatible InfoPrinter
78  WinSalPrinter* mpNextPrinter; // next printing printer
79  HDC mhDC; // printer hdc
80  SalPrinterError mnError; // error code
81  sal_uIntPtr mnCopies; // copies
82  bool mbCollate; // collated copies
83  bool mbAbort; // Job Aborted
84 
85  bool mbValid;
86 
87 protected:
88  void DoEndDoc(HDC hDC);
89 
90 public:
91  WinSalPrinter();
92  virtual ~WinSalPrinter() override;
93 
95  virtual bool StartJob( const OUString* pFileName,
96  const OUString& rJobName,
97  const OUString& rAppName,
98  sal_uInt32 nCopies,
99  bool bCollate,
100  bool bDirect,
101  ImplJobSetup* pSetupData ) override;
102  virtual bool EndJob() override;
103  virtual SalGraphics* StartPage( ImplJobSetup* pSetupData, bool bNewJobData ) override;
104  virtual void EndPage() override;
105  virtual SalPrinterError GetErrorCode() override;
106 
107  void markInvalid();
108  bool isValid() const { return mbValid; }
109 };
110 
111 #endif // INCLUDED_VCL_INC_WIN_SALPRN_H
112 
113 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual void InitPaperFormats(const ImplJobSetup *pSetupData) override
virtual sal_uInt16 GetPaperBinCount(const ImplJobSetup *pSetupData) override
sal_uIntPtr mnSysSignature
Definition: win/salprn.h:33
WinSalGraphics * mpGraphics
Definition: win/salprn.h:76
WinSalInfoPrinter * mpInfoPrinter
Definition: win/salprn.h:77
PrinterCapType
Definition: prntypes.hxx:71
unsigned char BYTE
virtual bool StartJob(const OUString *pFileName, const OUString &rJobName, const OUString &rAppName, sal_uInt32 nCopies, bool bCollate, bool bDirect, ImplJobSetup *pSetupData)=0
WinSalPrinter * mpNextPrinter
Definition: win/salprn.h:78
virtual bool SetPrinterData(ImplJobSetup *pSetupData) override
virtual sal_uInt32 GetCapabilities(const ImplJobSetup *pSetupData, PrinterCapType nType) override
virtual bool StartJob(const OUString *pFileName, const OUString &rJobName, const OUString &rAppName, sal_uInt32 nCopies, bool bCollate, bool bDirect, ImplJobSetup *pSetupData) override
virtual SalGraphics * StartPage(ImplJobSetup *pSetupData, bool bNewJobData) override
SalPrinterError mnError
Definition: win/salprn.h:80
virtual void EndPage() override
virtual ~WinSalPrinter() override
OUString maDeviceName
Definition: win/salprn.h:48
WinSalGraphics * mpGraphics
Definition: win/salprn.h:46
virtual OUString GetPaperBinName(const ImplJobSetup *pSetupData, sal_uInt16 nPaperBin) override
sal_uIntPtr mnCopies
Definition: win/salprn.h:81
JobSetFlags
Definition: salptype.hxx:27
virtual bool SetData(JobSetFlags nFlags, ImplJobSetup *pSetupData) override
void markInvalid()
sal_uInt16 mnDriverOffset
Definition: win/salprn.h:34
virtual bool Setup(weld::Window *pFrame, ImplJobSetup *pSetupData) override
virtual void ReleaseGraphics(SalGraphics *pGraphics) override
virtual SalGraphics * AcquireGraphics() override
bool mbCollate
Definition: win/salprn.h:82
OUString maPortName
Definition: win/salprn.h:49
virtual void GetPageInfo(const ImplJobSetup *pSetupData, long &rOutWidth, long &rOutHeight, Point &rPageOffset, Size &rPaperSize) override
virtual int GetLandscapeAngle(const ImplJobSetup *pSetupData) override
void DoEndDoc(HDC hDC)
virtual SalPrinterError GetErrorCode() override
BYTE maDriverData[1]
Definition: win/salprn.h:35
bool isValid() const
Definition: win/salprn.h:108
OUString maDriverName
Definition: win/salprn.h:47
SalPrinterError
Definition: salptype.hxx:41
virtual bool EndJob() override
virtual ~WinSalInfoPrinter() override