Coverage Report

Created: 2026-07-10 11:04

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/libreoffice/vcl/inc/jobdata.hxx
Line
Count
Source
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
#pragma once
21
22
#include "ppdparser.hxx"
23
24
namespace psp {
25
26
enum class orientation {
27
    Portrait,
28
    Landscape
29
};
30
31
struct VCL_DLLPUBLIC JobData
32
{
33
    int                     m_nCopies;
34
    bool                    m_bCollate;
35
    int                     m_nLeftMarginAdjust;
36
    int                     m_nRightMarginAdjust;
37
    int                     m_nTopMarginAdjust;
38
    int                     m_nBottomMarginAdjust;
39
    // user overrides for PPD
40
    int                     m_nColorDepth;
41
    int                     m_nColorDevice; // 0: no override, -1 grey scale, +1 color
42
    orientation             m_eOrientation;
43
    OUString                m_aPrinterName;
44
    bool                    m_bPapersizeFromSetup;
45
    const PPDParser*        m_pParser;
46
    PPDContext              m_aContext;
47
48
    JobData() :
49
0
            m_nCopies( 1 ),
50
0
            m_bCollate(false),
51
0
            m_nLeftMarginAdjust( 0 ),
52
0
            m_nRightMarginAdjust( 0 ),
53
0
            m_nTopMarginAdjust( 0 ),
54
0
            m_nBottomMarginAdjust( 0 ),
55
0
            m_nColorDepth( 24 ),
56
0
            m_nColorDevice( 0 ),
57
0
            m_eOrientation( orientation::Portrait ),
58
0
            m_bPapersizeFromSetup( false ),
59
0
            m_pParser( nullptr ) {}
60
61
    JobData& operator=(const psp::JobData& rRight);
62
63
0
    JobData( const JobData& rData ) { *this = rData; }
64
65
    void setCollate( bool bCollate );
66
    void setPaper( int nWidth, int nHeight ); // dimensions in pt
67
    void setPaperBin( int nPaperBin );
68
69
    // creates a new buffer using new
70
    // it is up to the user to delete it again
71
    bool getStreamBuffer( std::unique_ptr<sal_uInt8[]>& pData, sal_uInt32& bytes );
72
    static bool constructFromStreamBuffer( const void* pData, sal_uInt32 bytes, JobData& rJobData );
73
};
74
75
} // namespace
76
77
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */