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 .
20 #ifndef INCLUDED_VCL_INC_JOBSET_H
21 #define INCLUDED_VCL_INC_JOBSET_H
23 #include <rtl/ustring.hxx>
24 #include <vcl/prntypes.hxx>
25 #include <unordered_map>
27 // see com.sun.star.portal.client.JobSetupSystem.idl:
28 #define JOBSETUP_SYSTEM_WINDOWS 1
29 #define JOBSETUP_SYSTEM_UNIX 3
30 #define JOBSETUP_SYSTEM_MAC 4
32 class VCL_DLLPUBLIC ImplJobSetup
35 sal_uInt16 mnSystem
; //< System - JOBSETUP_SYSTEM_xxxx
36 OUString maPrinterName
; //< Printer-Name
37 OUString maDriver
; //< Driver-Name
38 Orientation meOrientation
; //< Orientation
39 DuplexMode meDuplexMode
; //< Duplex
40 sal_uInt16 mnPaperBin
; //< paper bin / in tray
41 Paper mePaperFormat
; //< paper format
42 long mnPaperWidth
; //< paper width (100th mm)
43 long mnPaperHeight
; //< paper height (100th mm)
44 sal_uInt32 mnDriverDataLen
; //< length of system specific data
45 sal_uInt8
* mpDriverData
; //< system specific data (will be streamed a byte block)
46 bool mbPapersizeFromSetup
;
48 PrinterSetupMode meSetupMode
;
49 // TODO: orig paper size
50 std::unordered_map
< OUString
, OUString
> maValueMap
;
54 ImplJobSetup( const ImplJobSetup
& rJobSetup
);
57 bool operator==( const ImplJobSetup
& rImplJobSetup
) const;
59 sal_uInt16
GetSystem() const { return mnSystem
; }
60 void SetSystem(sal_uInt16 nSystem
);
62 const OUString
& GetPrinterName() const { return maPrinterName
; }
63 void SetPrinterName(const OUString
& rPrinterName
);
65 const OUString
& GetDriver() const { return maDriver
; }
66 void SetDriver(const OUString
& rDriver
);
68 Orientation
GetOrientation() const { return meOrientation
; }
69 void SetOrientation(Orientation eOrientation
);
71 DuplexMode
GetDuplexMode() const { return meDuplexMode
; }
72 void SetDuplexMode(DuplexMode eDuplexMode
);
74 sal_uInt16
GetPaperBin() const { return mnPaperBin
; }
75 void SetPaperBin(sal_uInt16 nPaperBin
);
77 Paper
GetPaperFormat() const { return mePaperFormat
; }
78 void SetPaperFormat(Paper ePaperFormat
);
80 long GetPaperWidth() const { return mnPaperWidth
; }
81 void SetPaperWidth(long nWidth
);
83 long GetPaperHeight() const { return mnPaperHeight
; }
84 void SetPaperHeight(long nHeight
);
86 sal_uInt32
GetDriverDataLen() const { return mnDriverDataLen
; }
87 void SetDriverDataLen(sal_uInt32 nDriverDataLen
);
89 const sal_uInt8
* GetDriverData() const { return mpDriverData
; }
90 void SetDriverData(sal_uInt8
* pDriverData
);
92 bool GetPapersizeFromSetup() const { return mbPapersizeFromSetup
; }
93 void SetPapersizeFromSetup(bool bPapersizeFromSetup
);
95 PrinterSetupMode
GetPrinterSetupMode() const { return meSetupMode
; }
96 void SetPrinterSetupMode(PrinterSetupMode eMode
);
98 const std::unordered_map
< OUString
, OUString
>& GetValueMap() const
99 { return maValueMap
; }
100 void SetValueMap(const OUString
& rKey
, const OUString
& rValue
);
103 // If paper format is PAPER_USER, in the system-independent part it will
104 // automatically be computed from paper width/height.
105 // If paper width/height is 0, in the system-independent part it will
106 // automatically be computed from paper format, if the latter is not PAPER_USER.
108 #endif // INCLUDED_VCL_INC_JOBSET_H
110 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */