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 #ifndef SC_XMLEXPRT_HXX 24 #define SC_XMLEXPRT_HXX 25 26 #include <xmloff/xmlexp.hxx> 27 #include <com/sun/star/sheet/XSpreadsheet.hpp> 28 #include <com/sun/star/sheet/XSpreadsheetDocument.hpp> 29 #include <com/sun/star/table/CellRangeAddress.hpp> 30 #include <com/sun/star/table/CellAddress.hpp> 31 #include <com/sun/star/drawing/XShapes.hpp> 32 #include <com/sun/star/table/XCellRange.hpp> 33 34 namespace com { namespace sun { namespace star { 35 namespace beans { class XPropertySet; } 36 } } } 37 38 #include <hash_map> 39 40 class ScOutlineArray; 41 class SvXMLExportPropertyMapper; 42 class ScMyShapesContainer; 43 class ScMyMergedRangesContainer; 44 class ScMyValidationsContainer; 45 class ScMyNotEmptyCellsIterator; 46 class ScChangeTrackingExportHelper; 47 class ScColumnStyles; 48 class ScRowStyles; 49 class ScFormatRangeStyles; 50 class ScRowFormatRanges; 51 class ScMyOpenCloseColumnRowGroup; 52 class ScMyAreaLinksContainer; 53 class ScMyDetectiveOpContainer; 54 struct ScMyCell; 55 class ScDocument; 56 class ScMySharedData; 57 class ScMyDefaultStyles; 58 class XMLNumberFormatAttributesExportHelper; 59 class ScChartListener; 60 class SfxItemPool; 61 class ScAddress; 62 class ScBaseCell; 63 64 typedef std::vector< com::sun::star::uno::Reference < com::sun::star::drawing::XShapes > > ScMyXShapesVec; 65 66 class ScXMLExport : public SvXMLExport 67 { 68 ScDocument* pDoc; 69 com::sun::star::uno::Reference <com::sun::star::sheet::XSpreadsheet> xCurrentTable; 70 com::sun::star::uno::Reference <com::sun::star::table::XCellRange> xCurrentTableCellRange; 71 72 com::sun::star::uno::Reference<com::sun::star::io::XInputStream> xSourceStream; 73 sal_Int32 nSourceStreamPos; 74 75 UniReference < XMLPropertyHandlerFactory > xScPropHdlFactory; 76 UniReference < XMLPropertySetMapper > xCellStylesPropertySetMapper; 77 UniReference < XMLPropertySetMapper > xColumnStylesPropertySetMapper; 78 UniReference < XMLPropertySetMapper > xRowStylesPropertySetMapper; 79 UniReference < XMLPropertySetMapper > xTableStylesPropertySetMapper; 80 UniReference < SvXMLExportPropertyMapper > xCellStylesExportPropertySetMapper; 81 UniReference < SvXMLExportPropertyMapper > xColumnStylesExportPropertySetMapper; 82 UniReference < SvXMLExportPropertyMapper > xRowStylesExportPropertySetMapper; 83 UniReference < SvXMLExportPropertyMapper > xTableStylesExportPropertySetMapper; 84 XMLNumberFormatAttributesExportHelper* pNumberFormatAttributesExportHelper; 85 typedef ::std::hash_map<sal_Int32, sal_Int32> NumberFormatIndexMap; 86 NumberFormatIndexMap aNumFmtIndexMap; 87 ScMySharedData* pSharedData; 88 ScColumnStyles* pColumnStyles; 89 ScRowStyles* pRowStyles; 90 ScFormatRangeStyles* pCellStyles; 91 ScRowFormatRanges* pRowFormatRanges; 92 std::vector<rtl::OUString> aTableStyles; 93 com::sun::star::table::CellRangeAddress aRowHeaderRange; 94 ScMyOpenCloseColumnRowGroup* pGroupColumns; 95 ScMyOpenCloseColumnRowGroup* pGroupRows; 96 ScMyDefaultStyles* pDefaults; 97 ScChartListener* pChartListener; 98 const ScMyCell* pCurrentCell; 99 100 ScMyMergedRangesContainer* pMergedRangesContainer; 101 ScMyValidationsContainer* pValidationsContainer; 102 ScMyNotEmptyCellsIterator* pCellsItr; 103 ScChangeTrackingExportHelper* pChangeTrackingExportHelper; 104 const rtl::OUString sLayerID; 105 const rtl::OUString sCaptionShape; 106 rtl::OUString sExternalRefTabStyleName; 107 rtl::OUString sAttrName; 108 rtl::OUString sAttrStyleName; 109 rtl::OUString sAttrColumnsRepeated; 110 rtl::OUString sAttrFormula; 111 rtl::OUString sAttrValueType; 112 rtl::OUString sAttrStringValue; 113 rtl::OUString sElemCell; 114 rtl::OUString sElemCoveredCell; 115 rtl::OUString sElemCol; 116 rtl::OUString sElemRow; 117 rtl::OUString sElemTab; 118 rtl::OUString sElemP; 119 sal_Int32 nOpenRow; 120 sal_Int32 nProgressCount; 121 sal_uInt16 nCurrentTable; 122 sal_Bool bHasRowHeader; 123 sal_Bool bRowHeaderOpen; 124 sal_Bool mbShowProgress; 125 126 sal_Int32 GetNumberFormatStyleIndex(sal_Int32 nNumFmt) const; 127 sal_Bool HasDrawPages(com::sun::star::uno::Reference <com::sun::star::sheet::XSpreadsheetDocument>& xDoc); 128 void CollectSharedData(sal_Int32& nTableCount, sal_Int32& nShapesCount, const sal_Int32 nCellCount); 129 void CollectShapesAutoStyles(const sal_Int32 nTableCount); 130 void WriteTablesView(const com::sun::star::uno::Any& aTableView); 131 void WriteView(const com::sun::star::uno::Any& aView); 132