LibreOffice Module sc (master) 1
xeroot.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 "xlroot.hxx"
23#include <compiler.hxx>
24#include <memory>
25#include <rtl/ref.hxx>
26
27// Forward declarations of objects in public use ==============================
28
29namespace com::sun::star::beans { struct NamedValue; }
30
32class XclExpString;
33
35typedef std::shared_ptr< XclExpString > XclExpStringRef;
36
37// Global data ================================================================
38
39class XclExpTabInfo;
43class XclExpSst;
44class XclExpPalette;
47class XclExpXFBuffer;
53class XclExpDxfs;
56namespace sc { class CompileFormulaContext; }
57
60{
61 typedef std::shared_ptr< XclExpTabInfo > XclExpTabInfoRef;
62 typedef std::shared_ptr< XclExpAddressConverter > XclExpAddrConvRef;
63 typedef std::shared_ptr< XclExpFormulaCompiler > XclExpFmlaCompRef;
64 typedef std::shared_ptr< XclExpProgressBar > XclExpProgressRef;
65
73 typedef std::shared_ptr< XclExpObjectManager > XclExpObjectMgrRef;
74 typedef std::shared_ptr< XclExpFilterManager > XclExpFilterMgrRef;
75 typedef std::shared_ptr< XclExpPivotTableManager > XclExpPTableMgrRef;
77
82
95
96 std::shared_ptr<XclExpXmlPivotTableManager> mxXmlPTableMgr;
97 std::shared_ptr<XclExpTablesManager> mxTablesMgr;
98 std::shared_ptr<sc::CompileFormulaContext> mpCompileFormulaCxt;
99
101
102 bool mbRelUrl;
103
104 OStringBuffer maStringBuf;
105
106 explicit XclExpRootData( XclBiff eBiff, SfxMedium& rMedium,
107 const tools::SvRef<SotStorage>& xRootStrg, ScDocument& rDoc, rtl_TextEncoding eTextEnc );
108 virtual ~XclExpRootData() override;
109};
110
112class XclExpRoot : public XclRoot
113{
114public:
115 explicit XclExpRoot( XclExpRootData& rExpRootData );
116
118 const XclExpRoot& GetRoot() const { return *this; }
120 bool IsRelUrl() const { return mrExpData.mbRelUrl; }
122
124 XclExpTabInfo& GetTabInfo() const;
131
133 XclExpSst& GetSst() const;
135 XclExpPalette& GetPalette() const;
155 XclExpDxfs& GetDxfs() const;
156
158 OStringBuffer& GetStringBuf() const { mrExpData.maStringBuf.setLength(0); return mrExpData.maStringBuf; }
159
161
163
165 void InitializeConvert();
167 void InitializeGlobals();
169 void InitializeTable( SCTAB nScTab );
171 void InitializeSave();
174 XclExpRecordRef CreateRecord( sal_uInt16 nRecId ) const;
175
176 bool IsDocumentEncrypted() const;
177
178 static css::uno::Sequence< css::beans::NamedValue > GenerateEncryptionData( const OUString& aPass );
179 css::uno::Sequence< css::beans::NamedValue > GetEncryptionData() const;
180 static css::uno::Sequence< css::beans::NamedValue > GenerateDefaultEncryptionData();
181
182private:
183
186
187private:
189};
190
191/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Provides functions to convert Calc cell addresses to Excel cell addresses.
Definition: xehelper.hxx:82
Sheet filter manager.
Definition: excrecds.hxx:433
Stores the data of all fonts used in the document.
Definition: xestyle.hxx:207
The formula compiler to create Excel token arrays from Calc token arrays.
Definition: xeformula.hxx:52
Stores all data for internal/external references (the link table).
Definition: xelink.hxx:146
Manager that stores all internal defined names (NAME records) of the document.
Definition: xename.hxx:32
Stores all number formats used in the document.
Definition: xestyle.hxx:269
Stores all used colors in the document.
Definition: xestyle.hxx:75
The main class for pivot table export.
Definition: xepivot.hxx:406
The main progress bar for the export filter.
Definition: xehelper.hxx:44
Base class for all Excel records.
Definition: xerecord.hxx:39
Access to global data from other classes.
Definition: xeroot.hxx:113
XclExpTablesManager & GetTablesManager()
Definition: xeroot.cxx:177
XclExpLinkManager & GetGlobalLinkManager() const
Returns the global link manager for defined names.
Definition: xeroot.cxx:129
XclExpFontBuffer & GetFontBuffer() const
Returns the font buffer.
Definition: xeroot.cxx:111
XclExpPivotTableManager & GetPivotTableManager() const
Returns the pivot table manager.
Definition: xeroot.cxx:165
void InitializeConvert()
Is called when export filter starts to create the Excel document (all BIFF versions).
Definition: xeroot.cxx:183
XclExpNameManager & GetNameManager() const
Returns the buffer that contains internal defined names.
Definition: xeroot.cxx:141
XclExpFormulaCompiler & GetFormulaCompiler() const
Returns the formula compiler to produce formula token arrays.
Definition: xeroot.cxx:87
void InitializeTable(SCTAB nScTab)
Is called when export filter starts to create data for a single sheet (all BIFF versions).
Definition: xeroot.cxx:264
XclExpObjectManager & GetObjectManager() const
Returns the drawing object manager.
Definition: xeroot.cxx:147
XclExpDxfs & GetDxfs() const
Returns the differential formatting list.
Definition: xeroot.cxx:159
XclExpAddressConverter & GetAddressConverter() const
Returns the address converter.
Definition: xeroot.cxx:81
css::uno::Sequence< css::beans::NamedValue > GetEncryptionData() const
Definition: xeroot.cxx:333
void InitializeGlobals()
Is called when export filter starts to create the workbook global data (>=BIFF5).
Definition: xeroot.cxx:193
XclExpNumFmtBuffer & GetNumFmtBuffer() const
Returns the number format buffer.
Definition: xeroot.cxx:117
static css::uno::Sequence< css::beans::NamedValue > GenerateDefaultEncryptionData()
Definition: xeroot.cxx:350
XclExpSst & GetSst() const
Returns the shared string table.
Definition: xeroot.cxx:99
bool IsDocumentEncrypted() const
Definition: xeroot.cxx:298
sc::CompileFormulaContext & GetCompileFormulaContext() const
Definition: xeroot.hxx:121
XclExpRootData & mrExpData
Definition: xeroot.hxx:188
XclExpLinkManager & GetLocalLinkManager() const
Returns the local link manager for the current sheet.
Definition: xeroot.cxx:135
XclExpXmlPivotTableManager & GetXmlPivotTableManager()
Definition: xeroot.cxx:171
bool IsRelUrl() const
Returns true, if URLs should be stored relative to the document location.
Definition: xeroot.hxx:120
XclExpTabInfo & GetTabInfo() const
Returns the buffer for Calc->Excel sheet index conversion.
Definition: xeroot.cxx:75
static css::uno::Sequence< css::beans::NamedValue > GenerateEncryptionData(const OUString &aPass)
Definition: xeroot.cxx:309
XclExpRecordRef CreateRecord(sal_uInt16 nRecId) const
Returns the reference to a record (or record list) representing a root object.
Definition: xeroot.cxx:280
XclExpPalette & GetPalette() const
Returns the color buffer.
Definition: xeroot.cxx:105
XclExpRoot(XclExpRootData &rExpRootData)
Definition: xeroot.cxx:69
XclExpXFBuffer & GetXFBuffer() const
Returns the cell formatting attributes buffer.
Definition: xeroot.cxx:123
void InitializeSave()
Is called before export filter starts to write the records to the stream.
Definition: xeroot.cxx:274
XclExpProgressBar & GetProgressBar() const
Returns the export progress bar.
Definition: xeroot.cxx:93
XclExpRootData::XclExpLinkMgrRef const & GetLocalLinkMgrRef() const
Returns the local or global link manager, depending on current context.
Definition: xeroot.cxx:355
OStringBuffer & GetStringBuf() const
Clean and return the OStringBuffer.
Definition: xeroot.hxx:158
const XclExpRoot & GetRoot() const
Returns this root instance - for code readability in derived classes.
Definition: xeroot.hxx:118
XclExpFilterManager & GetFilterManager() const
Returns the filter manager.
Definition: xeroot.cxx:153
Provides export of the SST (shared string table) record.
Definition: xecontent.hxx:52
This class stores an unformatted or formatted string for Excel export.
Definition: xestring.hxx:48
Stores the correct Excel sheet index for each Calc sheet.
Definition: xelink.hxx:62
Stores all data for database ranges (tables in Excel speak).
Definition: xedbdata.hxx:53
Stores all XF records (cell formats and cell styles) in the document.
Definition: xestyle.hxx:576
Access to global data for a filter object (imported or exported document) from other classes.
Definition: xlroot.hxx:128
std::shared_ptr< const OpCodeMap > OpCodeMapPtr
CAUTION! The following defines must be in the same namespace as the respective type.
Stores global buffers and data needed for Excel export filter.
Definition: xeroot.hxx:60
XclExpTabInfoRef mxTabInfo
Definition: xeroot.hxx:78
ScCompiler::OpCodeMapPtr mxOpCodeMap
Definition: xeroot.hxx:100
XclExpDxfsRef mxDxfs
All pivot tables and pivot caches.
Definition: xeroot.hxx:94
XclExpLinkMgrRef mxLocLinkMgr
Global link manager for defined names.
Definition: xeroot.hxx:90
OStringBuffer maStringBuf
true = Store URLs relative.
Definition: xeroot.hxx:104
rtl::Reference< XclExpFontBuffer > XclExpFontBfrRef
Definition: xeroot.hxx:68
rtl::Reference< XclExpSst > XclExpSstRef
Definition: xeroot.hxx:66
XclExpLinkMgrRef mxGlobLinkMgr
Internal defined names.
Definition: xeroot.hxx:89
bool mbRelUrl
mapping between op-codes and names
Definition: xeroot.hxx:102
std::shared_ptr< sc::CompileFormulaContext > mpCompileFormulaCxt
Definition: xeroot.hxx:98
XclExpProgressRef mxProgress
The formula compiler.
Definition: xeroot.hxx:81
std::shared_ptr< XclExpFormulaCompiler > XclExpFmlaCompRef
Definition: xeroot.hxx:63
rtl::Reference< XclExpNumFmtBuffer > XclExpNumFmtBfrRef
Definition: xeroot.hxx:69
std::shared_ptr< XclExpProgressBar > XclExpProgressRef
Definition: xeroot.hxx:64
XclExpObjectMgrRef mxObjMgr
Local link manager for a sheet.
Definition: xeroot.hxx:91
rtl::Reference< XclExpNameManager > XclExpNameMgrRef
Definition: xeroot.hxx:71
XclExpFilterMgrRef mxFilterMgr
All drawing objects.
Definition: xeroot.hxx:92
XclExpNumFmtBfrRef mxNumFmtBfr
All fonts in the file.
Definition: xeroot.hxx:86
XclExpRootData(XclBiff eBiff, SfxMedium &rMedium, const tools::SvRef< SotStorage > &xRootStrg, ScDocument &rDoc, rtl_TextEncoding eTextEnc)
buffer to avoid massive OUString allocations
Definition: xeroot.cxx:55
rtl::Reference< XclExpLinkManager > XclExpLinkMgrRef
Definition: xeroot.hxx:72
XclExpFmlaCompRef mxFmlaComp
The address converter.
Definition: xeroot.hxx:80
XclExpNameMgrRef mxNameMgr
All XF records in the file.
Definition: xeroot.hxx:88
XclExpXFBfrRef mxXFBfr
All number formats in the file.
Definition: xeroot.hxx:87
std::shared_ptr< XclExpTablesManager > mxTablesMgr
Definition: xeroot.hxx:97
rtl::Reference< XclExpPalette > XclExpPaletteRef
Definition: xeroot.hxx:67
XclExpSstRef mxSst
The export progress bar.
Definition: xeroot.hxx:83
std::shared_ptr< XclExpTabInfo > XclExpTabInfoRef
Definition: xeroot.hxx:61
std::shared_ptr< XclExpAddressConverter > XclExpAddrConvRef
Definition: xeroot.hxx:62
std::shared_ptr< XclExpPivotTableManager > XclExpPTableMgrRef
Definition: xeroot.hxx:75
XclExpPaletteRef mxPalette
The shared string table.
Definition: xeroot.hxx:84
XclExpPTableMgrRef mxPTableMgr
Manager for filtered areas in all sheets.
Definition: xeroot.hxx:93
rtl::Reference< XclExpXFBuffer > XclExpXFBfrRef
Definition: xeroot.hxx:70
virtual ~XclExpRootData() override
Definition: xeroot.cxx:65
std::shared_ptr< XclExpXmlPivotTableManager > mxXmlPTableMgr
All delta formatting entries.
Definition: xeroot.hxx:96
XclExpAddrConvRef mxAddrConv
Calc->Excel sheet index conversion.
Definition: xeroot.hxx:79
std::shared_ptr< XclExpFilterManager > XclExpFilterMgrRef
Definition: xeroot.hxx:74
std::shared_ptr< XclExpObjectManager > XclExpObjectMgrRef
Definition: xeroot.hxx:73
rtl::Reference< XclExpDxfs > XclExpDxfsRef
Definition: xeroot.hxx:76
XclExpFontBfrRef mxFontBfr
The color buffer.
Definition: xeroot.hxx:85
Stores global buffers and data needed elsewhere in the Excel filters.
Definition: xlroot.hxx:65
sal_Int16 SCTAB
Definition: types.hxx:22
rtl::Reference< XclExpRecordBase > XclExpRecordRef
Definition: xeroot.hxx:32
std::shared_ptr< XclExpString > XclExpStringRef
Definition: xeroot.hxx:35
XclBiff
An enumeration for all Excel file format types (BIFF types).
Definition: xlconst.hxx:30