Coverage Report

Created: 2025-12-31 10:39

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/libreoffice/sc/inc/printopt.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 <svl/poolitem.hxx>
23
#include <unotools/configitem.hxx>
24
#include "scdllapi.h"
25
26
class SC_DLLPUBLIC ScPrintOptions
27
{
28
private:
29
    bool    bSkipEmpty;
30
    bool    bAllSheets;
31
    bool    bForceBreaks;
32
33
public:
34
                ScPrintOptions();
35
36
106k
    bool    GetSkipEmpty() const            { return bSkipEmpty; }
37
0
    void    SetSkipEmpty( bool bVal )       { bSkipEmpty = bVal; }
38
0
    bool    GetAllSheets() const            { return bAllSheets; }
39
0
    void    SetAllSheets( bool bVal )       { bAllSheets = bVal; }
40
3.45k
    bool    GetForceBreaks() const              { return bForceBreaks; }
41
0
    void    SetForceBreaks( bool bVal )     { bForceBreaks = bVal; }
42
43
    void    SetDefaults();
44
45
    bool                    operator== ( const ScPrintOptions& rOpt ) const;
46
};
47
48
// item for the dialog / options page
49
50
class SC_DLLPUBLIC ScTpPrintItem final : public SfxPoolItem
51
{
52
public:
53
                ScTpPrintItem( const ScPrintOptions& rOpt );
54
                virtual ~ScTpPrintItem() override;
55
56
    DECLARE_ITEM_TYPE_FUNCTION(ScTpPrintItem)
57
0
    ScTpPrintItem(ScTpPrintItem const &) = default;
58
    ScTpPrintItem(ScTpPrintItem &&) = default;
59
    ScTpPrintItem & operator =(ScTpPrintItem const &) = delete; // due to SfxPoolItem
60
    ScTpPrintItem & operator =(ScTpPrintItem &&) = delete; // due to SfxPoolItem
61
62
    virtual bool            operator==( const SfxPoolItem& ) const override;
63
    virtual ScTpPrintItem*  Clone( SfxItemPool *pPool = nullptr ) const override;
64
65
0
    const ScPrintOptions&   GetPrintOptions() const { return theOptions; }
66
67
private:
68
    ScPrintOptions theOptions;
69
};
70
71
// config item
72
73
class ScPrintCfg final : private ScPrintOptions, public utl::ConfigItem
74
{
75
private:
76
    static css::uno::Sequence<OUString> GetPropertyNames();
77
    void ReadCfg();
78
    virtual void    ImplCommit() override;
79
80
public:
81
            ScPrintCfg();
82
83
109k
    const ScPrintOptions& GetOptions() const { return *this; }
84
    void            SetOptions( const ScPrintOptions& rNew );
85
86
    virtual void Notify( const css::uno::Sequence< OUString >& aPropertyNames ) override;
87
};
88
89
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */