1 /************************************************************** 2 * 3 * Licensed to the Apache Software Foundation (ASF) under one 4 * or more contributor license agreements. See the NOTICE file 5 * distributed with this work for additional information 6 * regarding copyright ownership. The ASF licenses this file 7 * to you under the Apache License, Version 2.0 (the 8 * "License"); you may not use this file except in compliance 9 * with the License. You may obtain a copy of the License at 10 * 11 * http://www.apache.org/licenses/LICENSE-2.0 12 * 13 * Unless required by applicable law or agreed to in writing, 14 * software distributed under the License is distributed on an 15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 * KIND, either express or implied. See the License for the 17 * specific language governing permissions and limitations 18 * under the License. 19 * 20 *************************************************************/ 21 22 23 24 #ifndef SC_EXCDOC_HXX 25 #define SC_EXCDOC_HXX 26 27 #include <tools/solar.h> 28 #include "excrecds.hxx" 29 #include "xeroot.hxx" 30 #include "root.hxx" 31 32 //------------------------------------------------------------------ Forwards - 33 34 class SvStream; 35 class ScBaseCell; 36 class ScHorizontalCellIterator; 37 class ScDocument; 38 class ScProgress; 39 40 class NameBuffer; 41 42 class XclExpChangeTrack; 43 44 45 //------------------------------------------------------------ class ExcTable - 46 47 class XclExpCellTable; 48 49 class ExcTable : public XclExpRecordBase, public XclExpRoot 50 { 51 private: 52 typedef XclExpRecordList< ExcBundlesheetBase > ExcBoundsheetList; 53 typedef ScfRef< XclExpCellTable > XclExpCellTableRef; 54 55 XclExpRecordList<> aRecList; 56 XclExpCellTableRef mxCellTable; 57 58 SCTAB mnScTab; // table number SC document 59 sal_uInt16 nExcTab; // table number Excel document 60 sal_uInt16 nAktRow; // fuer'n Iterator 61 sal_uInt16 nAktCol; 62 63 NameBuffer* pTabNames; 64 65 // pRec mit new anlegen und vergessen, delete macht ExcTable selber! 66 void Add( XclExpRecordBase* pRec ); 67 68 void FillAsXmlTable( SCTAB nCodeNameIdx ); 69 70 public: 71 ExcTable( const XclExpRoot& rRoot ); 72 ExcTable( const XclExpRoot& rRoot, SCTAB nScTab ); 73 ~ExcTable(); 74 75 void FillAsHeader( ExcBoundsheetList& rBoundsheetList ); 76 void FillAsTable( SCTAB nCodeNameIdx ); 77 void FillAsEmptyTable( SCTAB nCodeNameIdx ); 78 79 void Write( XclExpStream& ); 80 void WriteXml( XclExpXmlStream& ); 81 }; 82 83 84 //--------------------------------------------------------- class ExcDocument - 85 86 class ExcDocument : protected XclExpRoot 87 { 88 friend class ExcTable; 89 90 private: 91 typedef XclExpRecordList< ExcTable > ExcTableList; 92 typedef ExcTableList::RecordRefType ExcTableRef; 93 typedef XclExpRecordList< ExcBundlesheetBase > ExcBoundsheetList; 94 typedef ExcBoundsheetList::RecordRefType ExcBoundsheetRef; 95 96 ExcTable aHeader; 97 98 ExcTableList maTableList; 99 ExcBoundsheetList maBoundsheetList; 100 101 XclExpChangeTrack* pExpChangeTrack; 102 103 public: 104 explicit ExcDocument( const XclExpRoot& rRoot ); 105 virtual ~ExcDocument(); 106 107 void ReadDoc( void ); 108 void Write( SvStream& rSvStrm ); 109 void WriteXml( SvStream& rSvStrm ); 110 }; 111 112 113 114 115 #endif 116 117