Version 7.5.1.1, tag libreoffice-7.5.1.1
[LibreOffice.git] / sc / inc / defaultsoptions.hxx
blob6b6ace9523c5466dde9e4d33dbe2c8abbaa416db
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/.
8 */
10 #pragma once
12 #include <svl/poolitem.hxx>
13 #include <unotools/configitem.hxx>
14 #include <config_features.h>
15 #include "scdllapi.h"
16 #include "types.hxx"
18 class SC_DLLPUBLIC ScDefaultsOptions
20 private:
21 SCTAB nInitTabCount; // number of Tabs for new Spreadsheet doc
22 OUString aInitTabPrefix; // The Tab prefix name in new Spreadsheet doc
23 bool bJumboSheets;
25 public:
26 ScDefaultsOptions();
28 void SetDefaults();
30 SCTAB GetInitTabCount() const { return nInitTabCount; }
31 void SetInitTabCount( SCTAB nTabs) { nInitTabCount = nTabs; }
32 void SetInitTabPrefix(const OUString& aPrefix) { aInitTabPrefix = aPrefix; }
33 const OUString& GetInitTabPrefix() const { return aInitTabPrefix; }
34 bool GetInitJumboSheets() const { return bJumboSheets; }
35 #if HAVE_FEATURE_JUMBO_SHEETS
36 void SetInitJumboSheets( bool b) { bJumboSheets = b; }
37 #endif
38 bool operator== ( const ScDefaultsOptions& rOpt ) const;
42 // item for the dialog / options page
44 class SC_DLLPUBLIC ScTpDefaultsItem final : public SfxPoolItem
46 public:
47 ScTpDefaultsItem( ScDefaultsOptions aOpt );
48 virtual ~ScTpDefaultsItem() override;
50 ScTpDefaultsItem(ScTpDefaultsItem const &) = default;
51 ScTpDefaultsItem(ScTpDefaultsItem &&) = default;
52 ScTpDefaultsItem & operator =(ScTpDefaultsItem const &) = delete; // due to SfxPoolItem
53 ScTpDefaultsItem & operator =(ScTpDefaultsItem &&) = delete; // due to SfxPoolItem
55 virtual bool operator==( const SfxPoolItem& ) const override;
56 virtual ScTpDefaultsItem* Clone( SfxItemPool *pPool = nullptr ) const override;
58 const ScDefaultsOptions& GetDefaultsOptions() const { return theOptions; }
60 private:
61 ScDefaultsOptions theOptions;
64 // config item
66 class ScDefaultsCfg final : public ScDefaultsOptions, public utl::ConfigItem
68 private:
69 static css::uno::Sequence<OUString> GetPropertyNames();
70 virtual void ImplCommit() override;
72 public:
73 ScDefaultsCfg();
75 void SetOptions( const ScDefaultsOptions& rNew );
77 virtual void Notify( const css::uno::Sequence< OUString >& aPropertyNames ) override;
80 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */