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