LibreOffice Module sc (master) 1
workbooksettings.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#pragma once
21
22#include "workbookhelper.hxx"
23
24namespace oox { class AttributeList; }
25namespace oox { class SequenceInputStream; }
26
27namespace com::sun::star::util { struct Date; }
28
29namespace oox::xls {
30
33{
34 OUString maUserName;
35 OUString maAlgorithmName;
36 OUString maHashValue;
37 OUString maSaltValue;
38 sal_uInt32 mnSpinCount;
39 sal_uInt16 mnPasswordHash;
41
42 explicit FileSharingModel();
43};
44
47{
48 OUString maCodeName;
49 sal_Int32 mnShowObjectMode;
55
56 explicit WorkbookSettingsModel();
57
59 void setBiffObjectMode( sal_uInt16 nObjMode );
60};
61
64{
66 sal_Int32 mnCalcId;
67 sal_Int32 mnRefMode;
68 sal_Int32 mnCalcMode;
69 sal_Int32 mnIterateCount;
70 sal_Int32 mnProcCount;
74 bool mbIterate;
76
77 explicit CalcSettingsModel();
78};
79
81{
82public:
83 explicit WorkbookSettings( const WorkbookHelper& rHelper );
84
86 void importFileSharing( const AttributeList& rAttribs );
88 void importWorkbookPr( const AttributeList& rAttribs );
90 void importCalcPr( const AttributeList& rAttribs );
91
98
100 void finalizeImport();
101
103 sal_Int16 getApiShowObjectMode() const;
105 css::util::Date const & getNullDate() const;
106
107private:
109 void setDateMode( bool bDateMode1904, bool bDateCompatibility=true );
110
111private:
115};
116
117} // namespace oox::xls
118
119/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Helper class to provide access to global workbook data.
sal_Int16 getApiShowObjectMode() const
Returns the show objects mode (considered a view setting in Calc).
WorkbookSettingsModel maBookSettings
void finalizeImport()
Converts the imported workbook settings.
CalcSettingsModel maCalcSettings
void importCalcPr(const AttributeList &rAttribs)
Imports the calcPr element containing workbook calculation settings.
void setDateMode(bool bDateMode1904, bool bDateCompatibility=true)
Updates date mode and unit converter nulldate.
WorkbookSettings(const WorkbookHelper &rHelper)
void importFileSharing(const AttributeList &rAttribs)
Imports the fileSharing element containing write protection settings.
css::util::Date const & getNullDate() const
Returns the nulldate of this workbook.
void importWorkbookPr(const AttributeList &rAttribs)
Imports the workbookPr element containing global workbook settings.
void SvStream & rStrm
Workbook calculation settings.
sal_Int32 mnCalcId
Minimum change in circular references.
bool mbCalcOnSave
Number of processors for concurrent calculation.
sal_Int32 mnRefMode
Calculation engine identifier.
sal_Int32 mnProcCount
Number of iterations in circular references.
sal_Int32 mnIterateCount
Automatic or manual recalculation.
bool mbConcurrent
True = allow circular references.
bool mbCalcCompleted
True = always recalculate formulas before save.
bool mbIterate
True = use full precision on calculation.
CalcSettingsModel()
True = concurrent calculation enabled.
sal_Int32 mnCalcMode
Cell reference mode: A1 or R1C1.
bool mbFullPrecision
True = formulas have been recalculated before save.
Settings for workbook write protection.
OUString maAlgorithmName
User who added the write protection password.
OUString maSaltValue
Hash value computed by the algorithm, base-64 encoded.
sal_uInt32 mnSpinCount
Salt value to be prepended to the password, base-64 encoded.
OUString maHashValue
Algorithm name, "SHA-512", "SHA-1", ...
sal_uInt16 mnPasswordHash
Spin count, iterations to run algorithm.
bool mbRecommendReadOnly
Hash value of the write protection password. (unrelated to the above)
FileSharingModel()
True = recommend read-only mode on opening.
Global workbook settings.
void setBiffObjectMode(sal_uInt16 nObjMode)
Sets BIFF object visibility mode.
sal_Int32 mnDefaultThemeVer
Specifies how external links are updated.
bool mbDateCompatibility
True = null date is 1904-01-01.
WorkbookSettingsModel()
True = save cached cell values for external links.
sal_Int32 mnUpdateLinksMode
Specifies how objects are shown.
sal_Int32 mnShowObjectMode
VBA codename for the workbook.
bool mbDateMode1904
Default theme version.
bool mbSaveExtLinkValues
False = null date is 1899-12-30.