1*cdf0e10cSrcweir /************************************************************************* 2*cdf0e10cSrcweir * 3*cdf0e10cSrcweir * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4*cdf0e10cSrcweir * 5*cdf0e10cSrcweir * Copyright 2000, 2010 Oracle and/or its affiliates. 6*cdf0e10cSrcweir * 7*cdf0e10cSrcweir * OpenOffice.org - a multi-platform office productivity suite 8*cdf0e10cSrcweir * 9*cdf0e10cSrcweir * This file is part of OpenOffice.org. 10*cdf0e10cSrcweir * 11*cdf0e10cSrcweir * OpenOffice.org is free software: you can redistribute it and/or modify 12*cdf0e10cSrcweir * it under the terms of the GNU Lesser General Public License version 3 13*cdf0e10cSrcweir * only, as published by the Free Software Foundation. 14*cdf0e10cSrcweir * 15*cdf0e10cSrcweir * OpenOffice.org is distributed in the hope that it will be useful, 16*cdf0e10cSrcweir * but WITHOUT ANY WARRANTY; without even the implied warranty of 17*cdf0e10cSrcweir * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18*cdf0e10cSrcweir * GNU Lesser General Public License version 3 for more details 19*cdf0e10cSrcweir * (a copy is included in the LICENSE file that accompanied this code). 20*cdf0e10cSrcweir * 21*cdf0e10cSrcweir * You should have received a copy of the GNU Lesser General Public License 22*cdf0e10cSrcweir * version 3 along with OpenOffice.org. If not, see 23*cdf0e10cSrcweir * <http://www.openoffice.org/license.html> 24*cdf0e10cSrcweir * for a copy of the LGPLv3 License. 25*cdf0e10cSrcweir * 26*cdf0e10cSrcweir ************************************************************************/ 27*cdf0e10cSrcweir #ifndef SCH_XMLIMPORT_HXX_ 28*cdf0e10cSrcweir #define SCH_XMLIMPORT_HXX_ 29*cdf0e10cSrcweir 30*cdf0e10cSrcweir #include <xmloff/SchXMLImportHelper.hxx> 31*cdf0e10cSrcweir #include <xmloff/xmlimp.hxx> 32*cdf0e10cSrcweir #include <xmloff/xmltkmap.hxx> 33*cdf0e10cSrcweir #include <xmloff/xmlictxt.hxx> 34*cdf0e10cSrcweir #include <xmloff/prhdlfac.hxx> 35*cdf0e10cSrcweir #include <xmloff/families.hxx> 36*cdf0e10cSrcweir 37*cdf0e10cSrcweir /* ---------------------------------------- 38*cdf0e10cSrcweir these enums are used for the 39*cdf0e10cSrcweir SvXMLTokenMapEntries to distinguish 40*cdf0e10cSrcweir the tokens in switch-directives 41*cdf0e10cSrcweir ----------------------------------------*/ 42*cdf0e10cSrcweir 43*cdf0e10cSrcweir enum SchXMLDocElemTokenMap 44*cdf0e10cSrcweir { 45*cdf0e10cSrcweir XML_TOK_DOC_AUTOSTYLES, 46*cdf0e10cSrcweir XML_TOK_DOC_STYLES, 47*cdf0e10cSrcweir XML_TOK_DOC_META, 48*cdf0e10cSrcweir XML_TOK_DOC_BODY 49*cdf0e10cSrcweir }; 50*cdf0e10cSrcweir 51*cdf0e10cSrcweir enum SchXMLTableElemTokenMap 52*cdf0e10cSrcweir { 53*cdf0e10cSrcweir XML_TOK_TABLE_HEADER_COLS, 54*cdf0e10cSrcweir XML_TOK_TABLE_COLUMNS, 55*cdf0e10cSrcweir XML_TOK_TABLE_COLUMN, 56*cdf0e10cSrcweir XML_TOK_TABLE_HEADER_ROWS, 57*cdf0e10cSrcweir XML_TOK_TABLE_ROWS, 58*cdf0e10cSrcweir XML_TOK_TABLE_ROW 59*cdf0e10cSrcweir }; 60*cdf0e10cSrcweir 61*cdf0e10cSrcweir enum SchXMLChartElemTokenMap 62*cdf0e10cSrcweir { 63*cdf0e10cSrcweir XML_TOK_CHART_PLOT_AREA, 64*cdf0e10cSrcweir XML_TOK_CHART_TITLE, 65*cdf0e10cSrcweir XML_TOK_CHART_SUBTITLE, 66*cdf0e10cSrcweir XML_TOK_CHART_LEGEND, 67*cdf0e10cSrcweir XML_TOK_CHART_TABLE 68*cdf0e10cSrcweir }; 69*cdf0e10cSrcweir 70*cdf0e10cSrcweir enum SchXMLPlotAreaElemTokenMap 71*cdf0e10cSrcweir { 72*cdf0e10cSrcweir XML_TOK_PA_COORDINATE_REGION_EXT, 73*cdf0e10cSrcweir XML_TOK_PA_COORDINATE_REGION, 74*cdf0e10cSrcweir XML_TOK_PA_AXIS, 75*cdf0e10cSrcweir XML_TOK_PA_SERIES, 76*cdf0e10cSrcweir XML_TOK_PA_WALL, 77*cdf0e10cSrcweir XML_TOK_PA_FLOOR, 78*cdf0e10cSrcweir XML_TOK_PA_LIGHT_SOURCE, 79*cdf0e10cSrcweir XML_TOK_PA_STOCK_GAIN, 80*cdf0e10cSrcweir XML_TOK_PA_STOCK_LOSS, 81*cdf0e10cSrcweir XML_TOK_PA_STOCK_RANGE 82*cdf0e10cSrcweir }; 83*cdf0e10cSrcweir 84*cdf0e10cSrcweir enum SchXMLSeriesElemTokenMap 85*cdf0e10cSrcweir { 86*cdf0e10cSrcweir XML_TOK_SERIES_DATA_POINT, 87*cdf0e10cSrcweir XML_TOK_SERIES_DOMAIN, 88*cdf0e10cSrcweir XML_TOK_SERIES_MEAN_VALUE_LINE, 89*cdf0e10cSrcweir XML_TOK_SERIES_REGRESSION_CURVE, 90*cdf0e10cSrcweir XML_TOK_SERIES_ERROR_INDICATOR 91*cdf0e10cSrcweir }; 92*cdf0e10cSrcweir 93*cdf0e10cSrcweir // ---------------------------------------- 94*cdf0e10cSrcweir 95*cdf0e10cSrcweir enum SchXMLChartAttrMap 96*cdf0e10cSrcweir { 97*cdf0e10cSrcweir XML_TOK_CHART_HREF, 98*cdf0e10cSrcweir XML_TOK_CHART_CLASS, 99*cdf0e10cSrcweir XML_TOK_CHART_WIDTH, 100*cdf0e10cSrcweir XML_TOK_CHART_HEIGHT, 101*cdf0e10cSrcweir XML_TOK_CHART_STYLE_NAME, 102*cdf0e10cSrcweir XML_TOK_CHART_ADDIN_NAME, 103*cdf0e10cSrcweir XML_TOK_CHART_COL_MAPPING, 104*cdf0e10cSrcweir XML_TOK_CHART_ROW_MAPPING 105*cdf0e10cSrcweir }; 106*cdf0e10cSrcweir 107*cdf0e10cSrcweir enum SchXMLPlotAreaAttrTokenMap 108*cdf0e10cSrcweir { 109*cdf0e10cSrcweir XML_TOK_PA_X, 110*cdf0e10cSrcweir XML_TOK_PA_Y, 111*cdf0e10cSrcweir XML_TOK_PA_WIDTH, 112*cdf0e10cSrcweir XML_TOK_PA_HEIGHT, 113*cdf0e10cSrcweir XML_TOK_PA_STYLE_NAME, 114*cdf0e10cSrcweir XML_TOK_PA_TRANSFORM, 115*cdf0e10cSrcweir XML_TOK_PA_CHART_ADDRESS, 116*cdf0e10cSrcweir XML_TOK_PA_TABLE_NUMBER_LIST, 117*cdf0e10cSrcweir XML_TOK_PA_DS_HAS_LABELS, 118*cdf0e10cSrcweir XML_TOK_PA_VRP, 119*cdf0e10cSrcweir XML_TOK_PA_VPN, 120*cdf0e10cSrcweir XML_TOK_PA_VUP, 121*cdf0e10cSrcweir XML_TOK_PA_PROJECTION, 122*cdf0e10cSrcweir XML_TOK_PA_DISTANCE, 123*cdf0e10cSrcweir XML_TOK_PA_FOCAL_LENGTH, 124*cdf0e10cSrcweir XML_TOK_PA_SHADOW_SLANT, 125*cdf0e10cSrcweir XML_TOK_PA_SHADE_MODE, 126*cdf0e10cSrcweir XML_TOK_PA_AMBIENT_COLOR, 127*cdf0e10cSrcweir XML_TOK_PA_LIGHTING_MODE 128*cdf0e10cSrcweir }; 129*cdf0e10cSrcweir 130*cdf0e10cSrcweir enum SchXMLAutoStyleAttrMap 131*cdf0e10cSrcweir { 132*cdf0e10cSrcweir XML_TOK_AS_FAMILY, 133*cdf0e10cSrcweir XML_TOK_AS_NAME 134*cdf0e10cSrcweir }; 135*cdf0e10cSrcweir 136*cdf0e10cSrcweir enum SchXMLCellAttrMap 137*cdf0e10cSrcweir { 138*cdf0e10cSrcweir XML_TOK_CELL_VAL_TYPE, 139*cdf0e10cSrcweir XML_TOK_CELL_VALUE 140*cdf0e10cSrcweir }; 141*cdf0e10cSrcweir 142*cdf0e10cSrcweir enum SchXMLSeriesAttrMap 143*cdf0e10cSrcweir { 144*cdf0e10cSrcweir XML_TOK_SERIES_CELL_RANGE, 145*cdf0e10cSrcweir XML_TOK_SERIES_LABEL_ADDRESS, 146*cdf0e10cSrcweir XML_TOK_SERIES_ATTACHED_AXIS, 147*cdf0e10cSrcweir XML_TOK_SERIES_STYLE_NAME, 148*cdf0e10cSrcweir XML_TOK_SERIES_CHART_CLASS 149*cdf0e10cSrcweir }; 150*cdf0e10cSrcweir 151*cdf0e10cSrcweir enum SchXMLRegEquationAttrMap 152*cdf0e10cSrcweir { 153*cdf0e10cSrcweir XML_TOK_REGEQ_STYLE_NAME, 154*cdf0e10cSrcweir XML_TOK_REGEQ_DISPLAY_EQUATION, 155*cdf0e10cSrcweir XML_TOK_REGEQ_DISPLAY_R_SQUARE, 156*cdf0e10cSrcweir XML_TOK_REGEQ_POS_X, 157*cdf0e10cSrcweir XML_TOK_REGEQ_POS_Y 158*cdf0e10cSrcweir }; 159*cdf0e10cSrcweir 160*cdf0e10cSrcweir class SchXMLImport : public SvXMLImport 161*cdf0e10cSrcweir { 162*cdf0e10cSrcweir private: 163*cdf0e10cSrcweir com::sun::star::uno::Reference< com::sun::star::task::XStatusIndicator > mxStatusIndicator; 164*cdf0e10cSrcweir 165*cdf0e10cSrcweir SchXMLImportHelper maImportHelper; 166*cdf0e10cSrcweir 167*cdf0e10cSrcweir protected: 168*cdf0e10cSrcweir virtual SvXMLImportContext *CreateContext( 169*cdf0e10cSrcweir sal_uInt16 nPrefix, 170*cdf0e10cSrcweir const ::rtl::OUString& rLocalName, 171*cdf0e10cSrcweir const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList >& xAttrList ); 172*cdf0e10cSrcweir 173*cdf0e10cSrcweir public: 174*cdf0e10cSrcweir // #110680# 175*cdf0e10cSrcweir SchXMLImport( 176*cdf0e10cSrcweir const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xServiceFactory, 177*cdf0e10cSrcweir sal_uInt16 nImportFlags = IMPORT_ALL ); 178*cdf0e10cSrcweir 179*cdf0e10cSrcweir // #110680# 180*cdf0e10cSrcweir SchXMLImport( 181*cdf0e10cSrcweir const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xServiceFactory, 182*cdf0e10cSrcweir com::sun::star::uno::Reference< com::sun::star::frame::XModel > xModel, 183*cdf0e10cSrcweir com::sun::star::uno::Reference< com::sun::star::document::XGraphicObjectResolver > &, 184*cdf0e10cSrcweir sal_Bool bLoadDoc, sal_Bool bShowProgress ); 185*cdf0e10cSrcweir 186*cdf0e10cSrcweir virtual ~SchXMLImport() throw (); 187*cdf0e10cSrcweir 188*cdf0e10cSrcweir // XServiceInfo ( : SvXMLExport ) 189*cdf0e10cSrcweir virtual ::rtl::OUString SAL_CALL getImplementationName() throw( ::com::sun::star::uno::RuntimeException ); 190*cdf0e10cSrcweir 191*cdf0e10cSrcweir SvXMLImportContext* CreateStylesContext( const ::rtl::OUString& rLocalName, 192*cdf0e10cSrcweir const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList >& xAttrList ); 193*cdf0e10cSrcweir 194*cdf0e10cSrcweir // XImporter 195*cdf0e10cSrcweir virtual void SAL_CALL setTargetDocument( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent >& xDoc ) throw(::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException); 196*cdf0e10cSrcweir }; 197*cdf0e10cSrcweir 198*cdf0e10cSrcweir #endif // SCH_XMLIMPORT_HXX_ 199