LibreOffice Module sc (master)  1
excdoc.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 "xeroot.hxx"
23 #include "xerecord.hxx"
24 #include "excrecds.hxx"
25 #include <memory>
26 
27 // Forwards -
28 
29 class SvStream;
30 class XclExpNote;
31 class XclExpStream;
32 class XclExpXmlStream;
33 class XclExpChangeTrack;
34 
35 
36 class XclExpCellTable;
37 
38 class ExcTable : public XclExpRecordBase, public XclExpRoot
39 {
40 private:
45 
47  XclExpCellTableRef mxCellTable;
48 
49  SCTAB mnScTab; // table number SC document
50  sal_uInt16 nExcTab; // table number Excel document
51 
52  XclExpNoteListRef mxNoteList;
53 
54  // re-create and forget pRec; delete is done by ExcTable itself!
55  void Add( XclExpRecordBase* pRec );
56 
57 public:
58  ExcTable( const XclExpRoot& rRoot );
59  ExcTable( const XclExpRoot& rRoot, SCTAB nScTab );
60  virtual ~ExcTable() override;
61 
62  void FillAsHeaderBinary( ExcBoundsheetList& rBoundsheetList );
63  void FillAsHeaderXml( ExcBoundsheetList& rBoundsheetList );
64 
65  void FillAsTableBinary( SCTAB nCodeNameIdx );
66  void FillAsTableXml();
67 
68  void FillAsEmptyTable( SCTAB nCodeNameIdx );
69 
70  void Write( XclExpStream& );
71  void WriteXml( XclExpXmlStream& );
72 };
73 
74 class ExcDocument : protected XclExpRoot
75 {
76 friend class ExcTable;
77 
78 private:
82 
84 
85  ExcTableList maTableList;
86  ExcBoundsheetList maBoundsheetList;
87 
88  std::unique_ptr<XclExpChangeTrack> m_xExpChangeTrack;
89 
90 public:
91  explicit ExcDocument( const XclExpRoot& rRoot );
92  virtual ~ExcDocument() override;
93 
94  void ReadDoc();
95  void Write( SvStream& rSvStrm );
96  void WriteXml( XclExpXmlStream& );
97 };
98 
99 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
ExcBoundsheetList::RecordRefType ExcBoundsheetRef
Definition: excdoc.hxx:81
ExcTableList maTableList
Definition: excdoc.hxx:85
rtl::Reference< XclExpNoteList > XclExpNoteListRef
Definition: excdoc.hxx:44
This class is used to export Excel record streams.
Definition: xestream.hxx:72
std::unique_ptr< XclExpChangeTrack > m_xExpChangeTrack
Definition: excdoc.hxx:88
XclExpRecordList< ExcBundlesheetBase > ExcBoundsheetList
Definition: excdoc.hxx:41
Represents a NOTE record containing the relevant data of a cell note.
Definition: xeescher.hxx:338
XclExpNoteListRef mxNoteList
Definition: excdoc.hxx:52
XclExpRecordList aRecList
Definition: excdoc.hxx:46
SCTAB mnScTab
Definition: excdoc.hxx:49
XclExpRecordList< ExcBundlesheetBase > ExcBoundsheetList
Definition: excdoc.hxx:80
Access to global data from other classes.
Definition: xeroot.hxx:112
Base class for all Excel records.
Definition: xerecord.hxx:37
sal_uInt16 nExcTab
Definition: excdoc.hxx:50
void WriteXml(XclExpXmlStream &)
Definition: excdoc.cxx:671
void FillAsHeaderXml(ExcBoundsheetList &rBoundsheetList)
Definition: excdoc.cxx:321
rtl::Reference< XclExpCellTable > XclExpCellTableRef
Definition: excdoc.hxx:42
void Write(SvStream &rSvStrm)
Definition: excdoc.cxx:770
ExcDocument(const XclExpRoot &rRoot)
Definition: excdoc.cxx:711
This class contains the cell contents and more of an entire sheet.
Definition: xetable.hxx:974
XclExpRecordList< XclExpNote > XclExpNoteList
Definition: excdoc.hxx:43
void ReadDoc()
Definition: excdoc.cxx:722
ExcTable aHeader
Definition: excdoc.hxx:83
void FillAsHeaderBinary(ExcBoundsheetList &rBoundsheetList)
Definition: excdoc.cxx:137
void Add(XclExpRecordBase *pRec)
Definition: excdoc.cxx:131
XclExpRecordList< ExcTable > ExcTableList
Definition: excdoc.hxx:79
void FillAsTableXml()
Definition: excdoc.cxx:550
void Write(XclExpStream &)
Definition: excdoc.cxx:663
void FillAsTableBinary(SCTAB nCodeNameIdx)
Definition: excdoc.cxx:406
ExcBoundsheetList maBoundsheetList
Definition: excdoc.hxx:86
virtual ~ExcTable() override
Definition: excdoc.cxx:127
void WriteXml(XclExpXmlStream &)
Definition: excdoc.cxx:801
void FillAsEmptyTable(SCTAB nCodeNameIdx)
Definition: excdoc.cxx:642
XclExpCellTableRef mxCellTable
Definition: excdoc.hxx:47
ExcTable(const XclExpRoot &rRoot)
Definition: excdoc.cxx:111
sal_Int16 SCTAB
Definition: types.hxx:22
virtual ~ExcDocument() override
Definition: excdoc.cxx:717