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 28*cdf0e10cSrcweir #ifndef _XMLOFF_SHAPEIMPORT_HXX_ 29*cdf0e10cSrcweir #define _XMLOFF_SHAPEIMPORT_HXX_ 30*cdf0e10cSrcweir 31*cdf0e10cSrcweir #include "sal/config.h" 32*cdf0e10cSrcweir #include "xmloff/dllapi.h" 33*cdf0e10cSrcweir #include <com/sun/star/beans/XPropertySet.hpp> 34*cdf0e10cSrcweir #include <com/sun/star/frame/XModel.hpp> 35*cdf0e10cSrcweir #include <com/sun/star/xml/sax/XAttributeList.hpp> 36*cdf0e10cSrcweir #include <com/sun/star/drawing/XShapes.hpp> 37*cdf0e10cSrcweir #include <com/sun/star/drawing/HomogenMatrix.hpp> 38*cdf0e10cSrcweir #include <com/sun/star/drawing/ProjectionMode.hpp> 39*cdf0e10cSrcweir #include <com/sun/star/drawing/ShadeMode.hpp> 40*cdf0e10cSrcweir #include <tools/color.hxx> 41*cdf0e10cSrcweir #include <xmloff/uniref.hxx> 42*cdf0e10cSrcweir #include <xmloff/xmlictxt.hxx> 43*cdf0e10cSrcweir 44*cdf0e10cSrcweir #include "xmloff/table/XMLTableImport.hxx" 45*cdf0e10cSrcweir #include <basegfx/vector/b3dvector.hxx> 46*cdf0e10cSrcweir 47*cdf0e10cSrcweir class SvXMLImport; 48*cdf0e10cSrcweir class SvXMLImportContext; 49*cdf0e10cSrcweir class SvXMLTokenMap; 50*cdf0e10cSrcweir class SvXMLStylesContext; 51*cdf0e10cSrcweir class XMLSdPropHdlFactory; 52*cdf0e10cSrcweir class XMLPropertySetMapper; 53*cdf0e10cSrcweir class SvXMLImportPropertyMapper; 54*cdf0e10cSrcweir 55*cdf0e10cSrcweir ////////////////////////////////////////////////////////////////////////////// 56*cdf0e10cSrcweir 57*cdf0e10cSrcweir enum SdXMLGroupShapeElemTokenMap 58*cdf0e10cSrcweir { 59*cdf0e10cSrcweir XML_TOK_GROUP_GROUP, 60*cdf0e10cSrcweir XML_TOK_GROUP_RECT, 61*cdf0e10cSrcweir XML_TOK_GROUP_LINE, 62*cdf0e10cSrcweir XML_TOK_GROUP_CIRCLE, 63*cdf0e10cSrcweir XML_TOK_GROUP_ELLIPSE, 64*cdf0e10cSrcweir XML_TOK_GROUP_POLYGON, 65*cdf0e10cSrcweir XML_TOK_GROUP_POLYLINE, 66*cdf0e10cSrcweir XML_TOK_GROUP_PATH, 67*cdf0e10cSrcweir 68*cdf0e10cSrcweir XML_TOK_GROUP_CONTROL, 69*cdf0e10cSrcweir XML_TOK_GROUP_CONNECTOR, 70*cdf0e10cSrcweir XML_TOK_GROUP_MEASURE, 71*cdf0e10cSrcweir XML_TOK_GROUP_PAGE, 72*cdf0e10cSrcweir XML_TOK_GROUP_CAPTION, 73*cdf0e10cSrcweir 74*cdf0e10cSrcweir XML_TOK_GROUP_CHART, 75*cdf0e10cSrcweir XML_TOK_GROUP_3DSCENE, 76*cdf0e10cSrcweir 77*cdf0e10cSrcweir XML_TOK_GROUP_FRAME, 78*cdf0e10cSrcweir 79*cdf0e10cSrcweir XML_TOK_GROUP_CUSTOM_SHAPE, 80*cdf0e10cSrcweir 81*cdf0e10cSrcweir XML_TOK_GROUP_ANNOTATION, 82*cdf0e10cSrcweir 83*cdf0e10cSrcweir XML_TOK_GROUP_A, 84*cdf0e10cSrcweir 85*cdf0e10cSrcweir XML_TOK_GROUP_LAST 86*cdf0e10cSrcweir }; 87*cdf0e10cSrcweir 88*cdf0e10cSrcweir enum SdXMLFrameShapeElemTokenMap 89*cdf0e10cSrcweir { 90*cdf0e10cSrcweir XML_TOK_FRAME_TEXT_BOX, 91*cdf0e10cSrcweir XML_TOK_FRAME_IMAGE, 92*cdf0e10cSrcweir XML_TOK_FRAME_OBJECT, 93*cdf0e10cSrcweir XML_TOK_FRAME_OBJECT_OLE, 94*cdf0e10cSrcweir XML_TOK_FRAME_PLUGIN, 95*cdf0e10cSrcweir XML_TOK_FRAME_FRAME, 96*cdf0e10cSrcweir XML_TOK_FRAME_FLOATING_FRAME, 97*cdf0e10cSrcweir XML_TOK_FRAME_APPLET, 98*cdf0e10cSrcweir XML_TOK_FRAME_TABLE, 99*cdf0e10cSrcweir 100*cdf0e10cSrcweir XML_TOK_FRAME_LAST 101*cdf0e10cSrcweir }; 102*cdf0e10cSrcweir 103*cdf0e10cSrcweir enum SdXML3DSceneShapeElemTokenMap 104*cdf0e10cSrcweir { 105*cdf0e10cSrcweir XML_TOK_3DSCENE_3DSCENE, 106*cdf0e10cSrcweir XML_TOK_3DSCENE_3DCUBE, 107*cdf0e10cSrcweir XML_TOK_3DSCENE_3DSPHERE, 108*cdf0e10cSrcweir XML_TOK_3DSCENE_3DLATHE, 109*cdf0e10cSrcweir XML_TOK_3DSCENE_3DEXTRUDE, 110*cdf0e10cSrcweir 111*cdf0e10cSrcweir XML_TOK_3DSCENE_LAST 112*cdf0e10cSrcweir }; 113*cdf0e10cSrcweir 114*cdf0e10cSrcweir enum SdXMLShapeAttrTokenMap 115*cdf0e10cSrcweir { 116*cdf0e10cSrcweir XML_TOK_SHAPE_NAME, 117*cdf0e10cSrcweir XML_TOK_SHAPE_DRAWSTYLE_NAME_GRAPHICS, 118*cdf0e10cSrcweir XML_TOK_SHAPE_PRESENTATION_CLASS, 119*cdf0e10cSrcweir XML_TOK_SHAPE_DRAWSTYLE_NAME_PRESENTATION, 120*cdf0e10cSrcweir XML_TOK_SHAPE_TRANSFORM, 121*cdf0e10cSrcweir XML_TOK_SHAPE_IS_PLACEHOLDER, 122*cdf0e10cSrcweir XML_TOK_SHAPE_IS_USER_TRANSFORMED 123*cdf0e10cSrcweir }; 124*cdf0e10cSrcweir 125*cdf0e10cSrcweir enum SdXML3DObjectAttrTokenMap 126*cdf0e10cSrcweir { 127*cdf0e10cSrcweir XML_TOK_3DOBJECT_DRAWSTYLE_NAME, 128*cdf0e10cSrcweir XML_TOK_3DOBJECT_TRANSFORM 129*cdf0e10cSrcweir }; 130*cdf0e10cSrcweir 131*cdf0e10cSrcweir enum SdXML3DPolygonBasedAttrTokenMap 132*cdf0e10cSrcweir { 133*cdf0e10cSrcweir XML_TOK_3DPOLYGONBASED_VIEWBOX, 134*cdf0e10cSrcweir XML_TOK_3DPOLYGONBASED_D 135*cdf0e10cSrcweir }; 136*cdf0e10cSrcweir 137*cdf0e10cSrcweir enum SdXML3DCubeObjectAttrTokenMap 138*cdf0e10cSrcweir { 139*cdf0e10cSrcweir XML_TOK_3DCUBEOBJ_MINEDGE, 140*cdf0e10cSrcweir XML_TOK_3DCUBEOBJ_MAXEDGE 141*cdf0e10cSrcweir }; 142*cdf0e10cSrcweir 143*cdf0e10cSrcweir enum SdXML3DSphereObjectAttrTokenMap 144*cdf0e10cSrcweir { 145*cdf0e10cSrcweir XML_TOK_3DSPHEREOBJ_CENTER, 146*cdf0e10cSrcweir XML_TOK_3DSPHEREOBJ_SIZE 147*cdf0e10cSrcweir }; 148*cdf0e10cSrcweir 149*cdf0e10cSrcweir enum SdXMLPolygonShapeAttrTokenMap 150*cdf0e10cSrcweir { 151*cdf0e10cSrcweir XML_TOK_POLYGONSHAPE_VIEWBOX, 152*cdf0e10cSrcweir XML_TOK_POLYGONSHAPE_POINTS 153*cdf0e10cSrcweir }; 154*cdf0e10cSrcweir 155*cdf0e10cSrcweir enum SdXMLPathShapeAttrTokenMap 156*cdf0e10cSrcweir { 157*cdf0e10cSrcweir XML_TOK_PATHSHAPE_VIEWBOX, 158*cdf0e10cSrcweir XML_TOK_PATHSHAPE_D 159*cdf0e10cSrcweir }; 160*cdf0e10cSrcweir 161*cdf0e10cSrcweir enum SdXML3DSceneShapeAttrTokenMap 162*cdf0e10cSrcweir { 163*cdf0e10cSrcweir XML_TOK_3DSCENESHAPE_TRANSFORM, 164*cdf0e10cSrcweir XML_TOK_3DSCENESHAPE_VRP, 165*cdf0e10cSrcweir XML_TOK_3DSCENESHAPE_VPN, 166*cdf0e10cSrcweir XML_TOK_3DSCENESHAPE_VUP, 167*cdf0e10cSrcweir XML_TOK_3DSCENESHAPE_PROJECTION, 168*cdf0e10cSrcweir XML_TOK_3DSCENESHAPE_DISTANCE, 169*cdf0e10cSrcweir XML_TOK_3DSCENESHAPE_FOCAL_LENGTH, 170*cdf0e10cSrcweir XML_TOK_3DSCENESHAPE_SHADOW_SLANT, 171*cdf0e10cSrcweir XML_TOK_3DSCENESHAPE_SHADE_MODE, 172*cdf0e10cSrcweir XML_TOK_3DSCENESHAPE_AMBIENT_COLOR, 173*cdf0e10cSrcweir XML_TOK_3DSCENESHAPE_LIGHTING_MODE 174*cdf0e10cSrcweir }; 175*cdf0e10cSrcweir 176*cdf0e10cSrcweir enum SdXML3DLightAttrTokenMap 177*cdf0e10cSrcweir { 178*cdf0e10cSrcweir XML_TOK_3DLIGHT_DIFFUSE_COLOR, 179*cdf0e10cSrcweir XML_TOK_3DLIGHT_DIRECTION, 180*cdf0e10cSrcweir XML_TOK_3DLIGHT_ENABLED, 181*cdf0e10cSrcweir XML_TOK_3DLIGHT_SPECULAR 182*cdf0e10cSrcweir }; 183*cdf0e10cSrcweir 184*cdf0e10cSrcweir ////////////////////////////////////////////////////////////////////////////// 185*cdf0e10cSrcweir // dr3d:3dlight context 186*cdf0e10cSrcweir 187*cdf0e10cSrcweir class SdXML3DLightContext: public SvXMLImportContext 188*cdf0e10cSrcweir { 189*cdf0e10cSrcweir // local parameters which need to be read 190*cdf0e10cSrcweir Color maDiffuseColor; 191*cdf0e10cSrcweir ::basegfx::B3DVector maDirection; 192*cdf0e10cSrcweir sal_Bool mbEnabled; 193*cdf0e10cSrcweir sal_Bool mbSpecular; 194*cdf0e10cSrcweir 195*cdf0e10cSrcweir public: 196*cdf0e10cSrcweir SdXML3DLightContext( 197*cdf0e10cSrcweir SvXMLImport& rImport, 198*cdf0e10cSrcweir sal_uInt16 nPrfx, 199*cdf0e10cSrcweir const rtl::OUString& rLName, 200*cdf0e10cSrcweir const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList >& xAttrList); 201*cdf0e10cSrcweir virtual ~SdXML3DLightContext(); 202*cdf0e10cSrcweir 203*cdf0e10cSrcweir const Color& GetDiffuseColor() { return maDiffuseColor; } 204*cdf0e10cSrcweir const ::basegfx::B3DVector& GetDirection() { return maDirection; } 205*cdf0e10cSrcweir sal_Bool GetEnabled() { return mbEnabled; } 206*cdf0e10cSrcweir sal_Bool GetSpecular() { return mbSpecular; } 207*cdf0e10cSrcweir }; 208*cdf0e10cSrcweir 209*cdf0e10cSrcweir ////////////////////////////////////////////////////////////////////////////// 210*cdf0e10cSrcweir 211*cdf0e10cSrcweir DECLARE_LIST(Imp3DLightList, SdXML3DLightContext*) 212*cdf0e10cSrcweir 213*cdf0e10cSrcweir class SdXML3DSceneAttributesHelper 214*cdf0e10cSrcweir { 215*cdf0e10cSrcweir protected: 216*cdf0e10cSrcweir SvXMLImport& mrImport; 217*cdf0e10cSrcweir 218*cdf0e10cSrcweir // list for local light contexts 219*cdf0e10cSrcweir Imp3DLightList maList; 220*cdf0e10cSrcweir 221*cdf0e10cSrcweir // local parameters which need to be read 222*cdf0e10cSrcweir com::sun::star::drawing::HomogenMatrix mxHomMat; 223*cdf0e10cSrcweir sal_Bool mbSetTransform; 224*cdf0e10cSrcweir 225*cdf0e10cSrcweir com::sun::star::drawing::ProjectionMode mxPrjMode; 226*cdf0e10cSrcweir sal_Int32 mnDistance; 227*cdf0e10cSrcweir sal_Int32 mnFocalLength; 228*cdf0e10cSrcweir sal_Int32 mnShadowSlant; 229*cdf0e10cSrcweir com::sun::star::drawing::ShadeMode mxShadeMode; 230*cdf0e10cSrcweir Color maAmbientColor; 231*cdf0e10cSrcweir sal_Bool mbLightingMode; 232*cdf0e10cSrcweir 233*cdf0e10cSrcweir ::basegfx::B3DVector maVRP; 234*cdf0e10cSrcweir ::basegfx::B3DVector maVPN; 235*cdf0e10cSrcweir ::basegfx::B3DVector maVUP; 236*cdf0e10cSrcweir sal_Bool mbVRPUsed; 237*cdf0e10cSrcweir sal_Bool mbVPNUsed; 238*cdf0e10cSrcweir sal_Bool mbVUPUsed; 239*cdf0e10cSrcweir 240*cdf0e10cSrcweir public: 241*cdf0e10cSrcweir SdXML3DSceneAttributesHelper( SvXMLImport& rImporter ); 242*cdf0e10cSrcweir ~SdXML3DSceneAttributesHelper(); 243*cdf0e10cSrcweir 244*cdf0e10cSrcweir /** creates a 3d ligth context and adds it to the internal list for later processing */ 245*cdf0e10cSrcweir SvXMLImportContext * create3DLightContext( sal_uInt16 nPrfx, const rtl::OUString& rLName, const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList >& xAttrList); 246*cdf0e10cSrcweir 247*cdf0e10cSrcweir /** this should be called for each scene attribute */ 248*cdf0e10cSrcweir void processSceneAttribute( sal_uInt16 nPrefix, const ::rtl::OUString& rLocalName, const ::rtl::OUString& rValue ); 249*cdf0e10cSrcweir 250*cdf0e10cSrcweir /** this sets the scene attributes at this propertyset */ 251*cdf0e10cSrcweir void setSceneAttributes( const com::sun::star::uno::Reference< com::sun::star::beans::XPropertySet >& xPropSet ); 252*cdf0e10cSrcweir }; 253*cdf0e10cSrcweir 254*cdf0e10cSrcweir ////////////////////////////////////////////////////////////////////////////// 255*cdf0e10cSrcweir 256*cdf0e10cSrcweir class SvXMLShapeContext : public SvXMLImportContext 257*cdf0e10cSrcweir { 258*cdf0e10cSrcweir protected: 259*cdf0e10cSrcweir com::sun::star::uno::Reference< com::sun::star::drawing::XShape > mxShape; 260*cdf0e10cSrcweir sal_Bool mbTemporaryShape; 261*cdf0e10cSrcweir rtl::OUString msHyperlink; 262*cdf0e10cSrcweir 263*cdf0e10cSrcweir public: 264*cdf0e10cSrcweir SvXMLShapeContext( SvXMLImport& rImp, sal_uInt16 nPrfx, 265*cdf0e10cSrcweir const ::rtl::OUString& rLName, sal_Bool bTemporaryShape ) : SvXMLImportContext( rImp, nPrfx, rLName ), mbTemporaryShape(bTemporaryShape) {} 266*cdf0e10cSrcweir 267*cdf0e10cSrcweir TYPEINFO(); 268*cdf0e10cSrcweir 269*cdf0e10cSrcweir const com::sun::star::uno::Reference< com::sun::star::drawing::XShape >& getShape() const { return mxShape; } 270*cdf0e10cSrcweir 271*cdf0e10cSrcweir void setHyperlink( const ::rtl::OUString& rHyperlink ); 272*cdf0e10cSrcweir }; 273*cdf0e10cSrcweir 274*cdf0e10cSrcweir ////////////////////////////////////////////////////////////////////////////// 275*cdf0e10cSrcweir 276*cdf0e10cSrcweir class ShapeSortContext; 277*cdf0e10cSrcweir struct XMLShapeImportHelperImpl; 278*cdf0e10cSrcweir struct XMLShapeImportPageContextImpl; 279*cdf0e10cSrcweir 280*cdf0e10cSrcweir class XMLOFF_DLLPUBLIC XMLShapeImportHelper : public UniRefBase 281*cdf0e10cSrcweir { 282*cdf0e10cSrcweir XMLShapeImportHelperImpl* mpImpl; 283*cdf0e10cSrcweir 284*cdf0e10cSrcweir XMLShapeImportPageContextImpl* mpPageContext; 285*cdf0e10cSrcweir 286*cdf0e10cSrcweir com::sun::star::uno::Reference< com::sun::star::frame::XModel > mxModel; 287*cdf0e10cSrcweir 288*cdf0e10cSrcweir // PropertySetMappers and factory 289*cdf0e10cSrcweir XMLSdPropHdlFactory* mpSdPropHdlFactory; 290*cdf0e10cSrcweir SvXMLImportPropertyMapper* mpPropertySetMapper; 291*cdf0e10cSrcweir SvXMLImportPropertyMapper* mpPresPagePropsMapper; 292*cdf0e10cSrcweir 293*cdf0e10cSrcweir // contexts for Style and AutoStyle import 294*cdf0e10cSrcweir SvXMLStylesContext* mpStylesContext; 295*cdf0e10cSrcweir SvXMLStylesContext* mpAutoStylesContext; 296*cdf0e10cSrcweir 297*cdf0e10cSrcweir // contexts for xShape contents TokenMaps 298*cdf0e10cSrcweir SvXMLTokenMap* mpGroupShapeElemTokenMap; 299*cdf0e10cSrcweir SvXMLTokenMap* mpFrameShapeElemTokenMap; 300*cdf0e10cSrcweir SvXMLTokenMap* mp3DSceneShapeElemTokenMap; 301*cdf0e10cSrcweir SvXMLTokenMap* mp3DObjectAttrTokenMap; 302*cdf0e10cSrcweir SvXMLTokenMap* mp3DPolygonBasedAttrTokenMap; 303*cdf0e10cSrcweir SvXMLTokenMap* mp3DCubeObjectAttrTokenMap; 304*cdf0e10cSrcweir SvXMLTokenMap* mp3DSphereObjectAttrTokenMap; 305*cdf0e10cSrcweir SvXMLTokenMap* mp3DSceneShapeAttrTokenMap; 306*cdf0e10cSrcweir SvXMLTokenMap* mp3DLightAttrTokenMap; 307*cdf0e10cSrcweir SvXMLTokenMap* mpPathShapeAttrTokenMap; 308*cdf0e10cSrcweir SvXMLTokenMap* mpPolygonShapeAttrTokenMap; 309*cdf0e10cSrcweir 310*cdf0e10cSrcweir const ::rtl::OUString msStartShape; 311*cdf0e10cSrcweir const ::rtl::OUString msEndShape; 312*cdf0e10cSrcweir const ::rtl::OUString msStartGluePointIndex; 313*cdf0e10cSrcweir const ::rtl::OUString msEndGluePointIndex; 314*cdf0e10cSrcweir 315*cdf0e10cSrcweir rtl::Reference< XMLTableImport > mxShapeTableImport; 316*cdf0e10cSrcweir 317*cdf0e10cSrcweir protected: 318*cdf0e10cSrcweir SvXMLImport& mrImporter; 319*cdf0e10cSrcweir 320*cdf0e10cSrcweir public: 321*cdf0e10cSrcweir XMLShapeImportHelper( SvXMLImport& rImporter, 322*cdf0e10cSrcweir const com::sun::star::uno::Reference< com::sun::star::frame::XModel>& rModel, 323*cdf0e10cSrcweir SvXMLImportPropertyMapper *pExtMapper=0 ); 324*cdf0e10cSrcweir 325*cdf0e10cSrcweir ~XMLShapeImportHelper(); 326*cdf0e10cSrcweir 327*cdf0e10cSrcweir SvXMLShapeContext* CreateGroupChildContext( 328*cdf0e10cSrcweir SvXMLImport& rImport, sal_uInt16 nPrefix, const rtl::OUString& rLocalName, 329*cdf0e10cSrcweir const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList >& xAttrList, 330*cdf0e10cSrcweir com::sun::star::uno::Reference< com::sun::star::drawing::XShapes >& rShapes, 331*cdf0e10cSrcweir sal_Bool bTemporaryShape = sal_False); 332*cdf0e10cSrcweir 333*cdf0e10cSrcweir SvXMLShapeContext* CreateFrameChildContext( 334*cdf0e10cSrcweir SvXMLImport& rImport, sal_uInt16 nPrefix, const rtl::OUString& rLocalName, 335*cdf0e10cSrcweir const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList >& xAttrList, 336*cdf0e10cSrcweir com::sun::star::uno::Reference< com::sun::star::drawing::XShapes >& rShapes, 337*cdf0e10cSrcweir const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList >& xFrameAttrList); 338*cdf0e10cSrcweir SvXMLImportContext* CreateFrameChildContext( 339*cdf0e10cSrcweir SvXMLImportContext *pThisContext, sal_uInt16 nPrefix, const rtl::OUString& rLocalName, 340*cdf0e10cSrcweir const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList >& xAttrList ); 341*cdf0e10cSrcweir 342*cdf0e10cSrcweir SvXMLShapeContext* Create3DSceneChildContext( 343*cdf0e10cSrcweir SvXMLImport& rImport, sal_uInt16 nPrefix, const rtl::OUString& rLocalName, 344*cdf0e10cSrcweir const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList >& xAttrList, 345*cdf0e10cSrcweir com::sun::star::uno::Reference< com::sun::star::drawing::XShapes >& rShapes); 346*cdf0e10cSrcweir 347*cdf0e10cSrcweir const SvXMLTokenMap& GetGroupShapeElemTokenMap(); 348*cdf0e10cSrcweir const SvXMLTokenMap& GetFrameShapeElemTokenMap(); 349*cdf0e10cSrcweir const SvXMLTokenMap& Get3DSceneShapeElemTokenMap(); 350*cdf0e10cSrcweir const SvXMLTokenMap& Get3DObjectAttrTokenMap(); 351*cdf0e10cSrcweir const SvXMLTokenMap& Get3DPolygonBasedAttrTokenMap(); 352*cdf0e10cSrcweir const SvXMLTokenMap& Get3DCubeObjectAttrTokenMap(); 353*cdf0e10cSrcweir const SvXMLTokenMap& Get3DSphereObjectAttrTokenMap(); 354*cdf0e10cSrcweir const SvXMLTokenMap& Get3DSceneShapeAttrTokenMap(); 355*cdf0e10cSrcweir const SvXMLTokenMap& Get3DLightAttrTokenMap(); 356*cdf0e10cSrcweir const SvXMLTokenMap& GetPathShapeAttrTokenMap(); 357*cdf0e10cSrcweir const SvXMLTokenMap& GetPolygonShapeAttrTokenMap(); 358*cdf0e10cSrcweir 359*cdf0e10cSrcweir // Styles and AutoStyles contexts 360*cdf0e10cSrcweir SvXMLStylesContext* GetStylesContext() const { return mpStylesContext; } 361*cdf0e10cSrcweir void SetStylesContext(SvXMLStylesContext* pNew); 362*cdf0e10cSrcweir SvXMLStylesContext* GetAutoStylesContext() const { return mpAutoStylesContext; } 363*cdf0e10cSrcweir void SetAutoStylesContext(SvXMLStylesContext* pNew); 364*cdf0e10cSrcweir 365*cdf0e10cSrcweir // get factories and mappers 366*cdf0e10cSrcweir SvXMLImportPropertyMapper* GetPropertySetMapper() const { return mpPropertySetMapper; } 367*cdf0e10cSrcweir SvXMLImportPropertyMapper* GetPresPagePropsMapper() const { return mpPresPagePropsMapper; } 368*cdf0e10cSrcweir 369*cdf0e10cSrcweir // this function is called whenever the implementation classes like to add this new 370*cdf0e10cSrcweir // shape to the given XShapes. 371*cdf0e10cSrcweir virtual void addShape( 372*cdf0e10cSrcweir com::sun::star::uno::Reference< com::sun::star::drawing::XShape >& rShape, 373*cdf0e10cSrcweir const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList >& xAttrList, 374*cdf0e10cSrcweir com::sun::star::uno::Reference< com::sun::star::drawing::XShapes >& rShapes); 375*cdf0e10cSrcweir 376*cdf0e10cSrcweir // this function is called whenever the implementation classes have finished importing 377*cdf0e10cSrcweir // a shape to the given XShapes. The shape is already inserted into its XShapes and 378*cdf0e10cSrcweir // all properties and styles are set. 379*cdf0e10cSrcweir virtual void finishShape( 380*cdf0e10cSrcweir com::sun::star::uno::Reference< com::sun::star::drawing::XShape >& rShape, 381*cdf0e10cSrcweir const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList >& xAttrList, 382*cdf0e10cSrcweir com::sun::star::uno::Reference< com::sun::star::drawing::XShapes >& rShapes); 383*cdf0e10cSrcweir 384*cdf0e10cSrcweir // helper functions for z-order sorting 385*cdf0e10cSrcweir void pushGroupForSorting( com::sun::star::uno::Reference< com::sun::star::drawing::XShapes >& rShapes ); 386*cdf0e10cSrcweir void popGroupAndSort(); 387*cdf0e10cSrcweir 388*cdf0e10cSrcweir void shapeWithZIndexAdded( com::sun::star::uno::Reference< com::sun::star::drawing::XShape >& rShape, 389*cdf0e10cSrcweir sal_Int32 nZIndex ); 390*cdf0e10cSrcweir 391*cdf0e10cSrcweir void addShapeConnection( com::sun::star::uno::Reference< com::sun::star::drawing::XShape >& rConnectorShape, 392*cdf0e10cSrcweir sal_Bool bStart, 393*cdf0e10cSrcweir const rtl::OUString& rDestShapeId, 394*cdf0e10cSrcweir sal_Int32 nDestGlueId ); 395*cdf0e10cSrcweir 396*cdf0e10cSrcweir /** adds a mapping for a glue point identifier from an xml file to the identifier created after inserting 397*cdf0e10cSrcweir the new glue point into the core. The saved mappings can be retrieved by getGluePointId() */ 398*cdf0e10cSrcweir void addGluePointMapping( com::sun::star::uno::Reference< com::sun::star::drawing::XShape >& xShape, 399*cdf0e10cSrcweir sal_Int32 nSourceId, sal_Int32 nDestinnationId ); 400*cdf0e10cSrcweir 401*cdf0e10cSrcweir /** moves all current DestinationId's for rXShape by n */ 402*cdf0e10cSrcweir void moveGluePointMapping( const com::sun::star::uno::Reference< com::sun::star::drawing::XShape >& xShape, const sal_Int32 n ); 403*cdf0e10cSrcweir 404*cdf0e10cSrcweir /** retrieves a mapping for a glue point identifier from the current xml file to the identifier created after 405*cdf0e10cSrcweir inserting the new glue point into the core. The mapping must be initialized first with addGluePointMapping() */ 406*cdf0e10cSrcweir sal_Int32 getGluePointId( com::sun::star::uno::Reference< com::sun::star::drawing::XShape >& xShape, sal_Int32 nSourceId ); 407*cdf0e10cSrcweir 408*cdf0e10cSrcweir /** this method must be calling before the first shape is imported for the given page. 409*cdf0e10cSrcweir Calls to this method can be nested */ 410*cdf0e10cSrcweir void startPage( com::sun::star::uno::Reference< com::sun::star::drawing::XShapes >& rShapes ); 411*cdf0e10cSrcweir 412*cdf0e10cSrcweir /** this method must be calling after the last shape is imported for the given page 413*cdf0e10cSrcweir Calls to this method can be nested */ 414*cdf0e10cSrcweir void endPage( com::sun::star::uno::Reference< com::sun::star::drawing::XShapes >& rShapes ); 415*cdf0e10cSrcweir 416*cdf0e10cSrcweir void restoreConnections(); 417*cdf0e10cSrcweir 418*cdf0e10cSrcweir /** creates a property mapper for external chaining */ 419*cdf0e10cSrcweir static SvXMLImportPropertyMapper* CreateShapePropMapper( 420*cdf0e10cSrcweir const com::sun::star::uno::Reference< com::sun::star::frame::XModel>& rModel, SvXMLImport& rImport ); 421*cdf0e10cSrcweir 422*cdf0e10cSrcweir /** creates a shape property set mapper that can be used for non shape elements */ 423*cdf0e10cSrcweir static SvXMLImportPropertyMapper* CreateExternalShapePropMapper( 424*cdf0e10cSrcweir const com::sun::star::uno::Reference< com::sun::star::frame::XModel>& rModel, SvXMLImport& rImport ); 425*cdf0e10cSrcweir 426*cdf0e10cSrcweir // #88546# 427*cdf0e10cSrcweir /** defines if the import should increment the progress bar or not */ 428*cdf0e10cSrcweir void enableHandleProgressBar( sal_Bool bEnable = sal_True ); 429*cdf0e10cSrcweir sal_Bool IsHandleProgressBarEnabled() const; 430*cdf0e10cSrcweir 431*cdf0e10cSrcweir /** queries the capability of the current model to create presentation shapes */ 432*cdf0e10cSrcweir sal_Bool IsPresentationShapesSupported(); 433*cdf0e10cSrcweir 434*cdf0e10cSrcweir XMLSdPropHdlFactory* GetSdPropHdlFactory() const { return mpSdPropHdlFactory; } 435*cdf0e10cSrcweir 436*cdf0e10cSrcweir const rtl::Reference< XMLTableImport >& GetShapeTableImport(); 437*cdf0e10cSrcweir }; 438*cdf0e10cSrcweir 439*cdf0e10cSrcweir #endif // _XMLOFF_SHAPEIMPORT_HXX_ 440