Get the style color and number just once
[LibreOffice.git] / sc / source / filter / inc / excdoc.hxx
blobaf0ffade53e59559a6090d748e7381c218cc0e45
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
20 #pragma once
22 #include "xeroot.hxx"
23 #include "xerecord.hxx"
24 #include "excrecds.hxx"
25 #include <memory>
27 // Forwards -
29 class SvStream;
30 class XclExpNote;
31 class XclExpStream;
32 class XclExpXmlStream;
33 class XclExpChangeTrack;
36 class XclExpCellTable;
38 class ExcTable final : public XclExpRecordBase, public XclExpRoot
40 private:
41 typedef XclExpRecordList< ExcBundlesheetBase > ExcBoundsheetList;
42 typedef rtl::Reference< XclExpCellTable > XclExpCellTableRef;
43 typedef XclExpRecordList< XclExpNote > XclExpNoteList;
44 typedef rtl::Reference< XclExpNoteList > XclExpNoteListRef;
46 XclExpRecordList<> aRecList;
47 XclExpCellTableRef mxCellTable;
49 SCTAB mnScTab; // table number SC document
50 sal_uInt16 nExcTab; // table number Excel document
52 XclExpNoteListRef mxNoteList;
54 // re-create and forget pRec; delete is done by ExcTable itself!
55 void Add( XclExpRecordBase* pRec );
57 public:
58 ExcTable( const XclExpRoot& rRoot );
59 ExcTable( const XclExpRoot& rRoot, SCTAB nScTab );
60 virtual ~ExcTable() override;
62 void FillAsHeaderBinary( ExcBoundsheetList& rBoundsheetList );
63 void FillAsHeaderXml( ExcBoundsheetList& rBoundsheetList );
65 void FillAsTableBinary( SCTAB nCodeNameIdx );
66 void FillAsTableXml();
68 void FillAsEmptyTable( SCTAB nCodeNameIdx );
70 void Write( XclExpStream& );
71 void WriteXml( XclExpXmlStream& );
74 class ExcDocument final : protected XclExpRoot
76 friend class ExcTable;
78 private:
79 typedef XclExpRecordList< ExcTable > ExcTableList;
80 typedef XclExpRecordList< ExcBundlesheetBase > ExcBoundsheetList;
81 typedef ExcBoundsheetList::RecordRefType ExcBoundsheetRef;
83 ExcTable aHeader;
85 ExcTableList maTableList;
86 ExcBoundsheetList maBoundsheetList;
88 std::unique_ptr<XclExpChangeTrack> m_xExpChangeTrack;
90 public:
91 explicit ExcDocument( const XclExpRoot& rRoot );
92 virtual ~ExcDocument() override;
94 void ReadDoc();
95 void Write( SvStream& rSvStrm );
96 void WriteXml( XclExpXmlStream& );
98 // add an element attributes and values to FastAttributeList
99 static void addElemensToAttrList(rtl::Reference<sax_fastparser::FastAttributeList>& pAttrList,
100 css::uno::Sequence<css::uno::Any>& aSeqs);
103 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */