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