LanguageTool: don't crash if REST protocol isn't set
[LibreOffice.git] / sc / inc / printopt.hxx
blob1f00ab1cf486cd2877e8365ac51c4ca0c7c8b648
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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 #pragma once
22 #include <svl/poolitem.hxx>
23 #include <unotools/configitem.hxx>
24 #include "scdllapi.h"
26 class SC_DLLPUBLIC ScPrintOptions
28 private:
29 bool bSkipEmpty;
30 bool bAllSheets;
31 bool bForceBreaks;
33 public:
34 ScPrintOptions();
36 bool GetSkipEmpty() const { return bSkipEmpty; }
37 void SetSkipEmpty( bool bVal ) { bSkipEmpty = bVal; }
38 bool GetAllSheets() const { return bAllSheets; }
39 void SetAllSheets( bool bVal ) { bAllSheets = bVal; }
40 bool GetForceBreaks() const { return bForceBreaks; }
41 void SetForceBreaks( bool bVal ) { bForceBreaks = bVal; }
43 void SetDefaults();
45 bool operator== ( const ScPrintOptions& rOpt ) const;
48 // item for the dialog / options page
50 class SC_DLLPUBLIC ScTpPrintItem final : public SfxPoolItem
52 public:
53 ScTpPrintItem( const ScPrintOptions& rOpt );
54 virtual ~ScTpPrintItem() override;
56 ScTpPrintItem(ScTpPrintItem const &) = default;
57 ScTpPrintItem(ScTpPrintItem &&) = default;
58 ScTpPrintItem & operator =(ScTpPrintItem const &) = delete; // due to SfxPoolItem
59 ScTpPrintItem & operator =(ScTpPrintItem &&) = delete; // due to SfxPoolItem
61 virtual bool operator==( const SfxPoolItem& ) const override;
62 virtual ScTpPrintItem* Clone( SfxItemPool *pPool = nullptr ) const override;
64 const ScPrintOptions& GetPrintOptions() const { return theOptions; }
66 private:
67 ScPrintOptions theOptions;
70 // config item
72 class ScPrintCfg final : public ScPrintOptions, public utl::ConfigItem
74 private:
75 static css::uno::Sequence<OUString> GetPropertyNames();
77 virtual void ImplCommit() override;
79 public:
80 ScPrintCfg();
82 void SetOptions( const ScPrintOptions& rNew );
84 virtual void Notify( const css::uno::Sequence< OUString >& aPropertyNames ) override;
87 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */