LibreOffice Module sc (master)  1
printopt.hxx
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_SC_INC_PRINTOPT_HXX
21 #define INCLUDED_SC_INC_PRINTOPT_HXX
22 
23 #include <svl/poolitem.hxx>
24 #include <unotools/configitem.hxx>
25 #include "scdllapi.h"
26 
28 {
29 private:
30  bool bSkipEmpty;
31  bool bAllSheets;
33 
34 public:
36 
37  bool GetSkipEmpty() const { return bSkipEmpty; }
38  void SetSkipEmpty( bool bVal ) { bSkipEmpty = bVal; }
39  bool GetAllSheets() const { return bAllSheets; }
40  void SetAllSheets( bool bVal ) { bAllSheets = bVal; }
41  bool GetForceBreaks() const { return bForceBreaks; }
42  void SetForceBreaks( bool bVal ) { bForceBreaks = bVal; }
43 
44  void SetDefaults();
45 
46  bool operator== ( const ScPrintOptions& rOpt ) const;
47 };
48 
49 // item for the dialog / options page
50 
52 {
53 public:
54  ScTpPrintItem( const ScPrintOptions& rOpt );
55  virtual ~ScTpPrintItem() override;
56 
57  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  const ScPrintOptions& GetPrintOptions() const { return theOptions; }
66 
67 private:
69 };
70 
71 // config item
72 
73 class ScPrintCfg final : public ScPrintOptions, public utl::ConfigItem
74 {
75 private:
76  static css::uno::Sequence<OUString> GetPropertyNames();
77 
78  virtual void ImplCommit() override;
79 
80 public:
81  ScPrintCfg();
82 
83  void SetOptions( const ScPrintOptions& rNew );
84 
85  virtual void Notify( const css::uno::Sequence< OUString >& aPropertyNames ) override;
86 };
87 
88 #endif
89 
90 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
bool operator==(const XclFontData &rLeft, const XclFontData &rRight)
Definition: xlstyle.cxx:517
virtual void ImplCommit() override
Definition: printopt.cxx:119
virtual bool operator==(const SfxPoolItem &) const =0
virtual SfxPoolItem * Clone(SfxItemPool *pPool=nullptr) const =0
static css::uno::Sequence< OUString > GetPropertyNames()
Definition: printopt.cxx:80
SfxPoolItem & operator=(const SfxPoolItem &)=delete
void SetForceBreaks(bool bVal)
Definition: printopt.hxx:42
ScPrintOptions theOptions
Definition: printopt.hxx:68
bool GetForceBreaks() const
Definition: printopt.hxx:41
void SetAllSheets(bool bVal)
Definition: printopt.hxx:40
virtual void Notify(const css::uno::Sequence< OUString > &aPropertyNames) override
Definition: printopt.cxx:150
const ScPrintOptions & GetPrintOptions() const
Definition: printopt.hxx:65
bool GetAllSheets() const
Definition: printopt.hxx:39
void SetSkipEmpty(bool bVal)
Definition: printopt.hxx:38
bool GetSkipEmpty() const
Definition: printopt.hxx:37
#define SC_DLLPUBLIC
Definition: scdllapi.h:28
bool bForceBreaks
Definition: printopt.hxx:32
void SetOptions(const ScPrintOptions &rNew)
Definition: printopt.cxx:144