1ecfe53c5SAndrew Rist /************************************************************** 2cdf0e10cSrcweir * 3ecfe53c5SAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one 4ecfe53c5SAndrew Rist * or more contributor license agreements. See the NOTICE file 5ecfe53c5SAndrew Rist * distributed with this work for additional information 6ecfe53c5SAndrew Rist * regarding copyright ownership. The ASF licenses this file 7ecfe53c5SAndrew Rist * to you under the Apache License, Version 2.0 (the 8ecfe53c5SAndrew Rist * "License"); you may not use this file except in compliance 9ecfe53c5SAndrew Rist * with the License. You may obtain a copy of the License at 10ecfe53c5SAndrew Rist * 11ecfe53c5SAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0 12ecfe53c5SAndrew Rist * 13ecfe53c5SAndrew Rist * Unless required by applicable law or agreed to in writing, 14ecfe53c5SAndrew Rist * software distributed under the License is distributed on an 15ecfe53c5SAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16ecfe53c5SAndrew Rist * KIND, either express or implied. See the License for the 17ecfe53c5SAndrew Rist * specific language governing permissions and limitations 18ecfe53c5SAndrew Rist * under the License. 19ecfe53c5SAndrew Rist * 20ecfe53c5SAndrew Rist *************************************************************/ 21ecfe53c5SAndrew Rist 22ecfe53c5SAndrew Rist 23cdf0e10cSrcweir #ifndef _XMLOFF_SHAPEEXPORT_HXX_ 24cdf0e10cSrcweir #define _XMLOFF_SHAPEEXPORT_HXX_ 25cdf0e10cSrcweir 26cdf0e10cSrcweir #include "sal/config.h" 27cdf0e10cSrcweir #include "xmloff/dllapi.h" 28cdf0e10cSrcweir #include "sal/types.h" 29cdf0e10cSrcweir 30cdf0e10cSrcweir #include <rtl/ref.hxx> 31cdf0e10cSrcweir #include <rtl/ustring.hxx> 32cdf0e10cSrcweir #include <rtl/ustrbuf.hxx> 33cdf0e10cSrcweir #include <xmloff/uniref.hxx> 34cdf0e10cSrcweir 35cdf0e10cSrcweir #include <com/sun/star/drawing/XShape.hpp> 36cdf0e10cSrcweir #include <com/sun/star/drawing/XShapes.hpp> 37cdf0e10cSrcweir #include <com/sun/star/awt/Point.hpp> 38cdf0e10cSrcweir #include <com/sun/star/beans/PropertyValue.hpp> 39cdf0e10cSrcweir 40cdf0e10cSrcweir #include <map> 41cdf0e10cSrcweir #include <xmloff/xmlprmap.hxx> 42cdf0e10cSrcweir #include <xmloff/xmlexppr.hxx> 43cdf0e10cSrcweir #include <xmloff/animexp.hxx> 44cdf0e10cSrcweir #include <xmloff/families.hxx> 45cdf0e10cSrcweir 46cdf0e10cSrcweir #include "xmloff/table/XMLTableExport.hxx" 47cdf0e10cSrcweir 48cdf0e10cSrcweir // shape export features are bits used for the nFeature 49cdf0e10cSrcweir // parameter of XMLShapeExport::exportShape 50cdf0e10cSrcweir 51cdf0e10cSrcweir #define SEF_EXPORT_X 0x0001 52cdf0e10cSrcweir #define SEF_EXPORT_Y 0x0002 53cdf0e10cSrcweir #define SEF_EXPORT_POSITION 0x0003 54cdf0e10cSrcweir 55cdf0e10cSrcweir #define SEF_EXPORT_WIDTH 0x0004 56cdf0e10cSrcweir #define SEF_EXPORT_HEIGHT 0x0008 57cdf0e10cSrcweir #define SEF_EXPORT_SIZE 0x000c 58cdf0e10cSrcweir 59cdf0e10cSrcweir // when you set this flag a chart does NOT export its own data as table element 60cdf0e10cSrcweir #define SEF_EXPORT_NO_CHART_DATA 0x0010 61cdf0e10cSrcweir 62cdf0e10cSrcweir // When setting the flag below no ignorableWhiteSpace will be called around 63cdf0e10cSrcweir // the drawing object elements 64cdf0e10cSrcweir #define SEF_EXPORT_NO_WS 0x0020 65cdf0e10cSrcweir 66cdf0e10cSrcweir // When setting the flag below a callout shape is exported as office:annotation 67cdf0e10cSrcweir #define SEF_EXPORT_ANNOTATION 0x0040 68cdf0e10cSrcweir 69cdf0e10cSrcweir #define SEF_DEFAULT SEF_EXPORT_POSITION|SEF_EXPORT_SIZE 70cdf0e10cSrcweir 71cdf0e10cSrcweir enum XmlShapeType 72cdf0e10cSrcweir { 73cdf0e10cSrcweir XmlShapeTypeUnknown, // not known 74cdf0e10cSrcweir 75cdf0e10cSrcweir XmlShapeTypeDrawRectangleShape, // "com.sun.star.drawing.RectangleShape" 76cdf0e10cSrcweir XmlShapeTypeDrawEllipseShape, // "com.sun.star.drawing.EllipseShape" 77cdf0e10cSrcweir XmlShapeTypeDrawControlShape, // "com.sun.star.drawing.ControlShape" 78cdf0e10cSrcweir XmlShapeTypeDrawConnectorShape, // "com.sun.star.drawing.ConnectorShape" 79cdf0e10cSrcweir XmlShapeTypeDrawMeasureShape, // "com.sun.star.drawing.MeasureShape" 80cdf0e10cSrcweir XmlShapeTypeDrawLineShape, // "com.sun.star.drawing.LineShape" 81cdf0e10cSrcweir XmlShapeTypeDrawPolyPolygonShape, // "com.sun.star.drawing.PolyPolygonShape" 82cdf0e10cSrcweir XmlShapeTypeDrawPolyLineShape, // "com.sun.star.drawing.PolyLineShape" 83cdf0e10cSrcweir XmlShapeTypeDrawOpenBezierShape, // "com.sun.star.drawing.OpenBezierShape" 84cdf0e10cSrcweir XmlShapeTypeDrawClosedBezierShape, // "com.sun.star.drawing.ClosedBezierShape" 85cdf0e10cSrcweir XmlShapeTypeDrawGraphicObjectShape, // "com.sun.star.drawing.GraphicObjectShape" 86cdf0e10cSrcweir XmlShapeTypeDrawGroupShape, // "com.sun.star.drawing.GroupShape" 87cdf0e10cSrcweir XmlShapeTypeDrawTextShape, // "com.sun.star.drawing.TextShape" 88cdf0e10cSrcweir XmlShapeTypeDrawOLE2Shape, // "com.sun.star.drawing.OLE2Shape" 89cdf0e10cSrcweir XmlShapeTypeDrawChartShape, // embedded com.sun.star.chart 90cdf0e10cSrcweir XmlShapeTypeDrawSheetShape, // embedded com.sun.star.sheet 91cdf0e10cSrcweir XmlShapeTypeDrawPageShape, // "com.sun.star.drawing.PageShape" 92cdf0e10cSrcweir XmlShapeTypeDrawFrameShape, // "com.sun.star.drawing.FrameShape" 93cdf0e10cSrcweir XmlShapeTypeDrawCaptionShape, // "com.sun.star.drawing.CaptionShape" 94cdf0e10cSrcweir XmlShapeTypeDrawAppletShape, // "com.sun.star.drawing.AppletShape" 95cdf0e10cSrcweir XmlShapeTypeDrawPluginShape, // "com.sun.star.drawing.PlugginShape" 96cdf0e10cSrcweir 97cdf0e10cSrcweir XmlShapeTypeDraw3DSceneObject, // "com.sun.star.drawing.Shape3DSceneObject" 98cdf0e10cSrcweir XmlShapeTypeDraw3DCubeObject, // "com.sun.star.drawing.Shape3DCubeObject" 99cdf0e10cSrcweir XmlShapeTypeDraw3DSphereObject, // "com.sun.star.drawing.Shape3DSphereObject" 100cdf0e10cSrcweir XmlShapeTypeDraw3DLatheObject, // "com.sun.star.drawing.Shape3DLatheObject" 101cdf0e10cSrcweir XmlShapeTypeDraw3DExtrudeObject, // "com.sun.star.drawing.Shape3DExtrudeObject" 102cdf0e10cSrcweir 103cdf0e10cSrcweir XmlShapeTypePresTitleTextShape, // "com.sun.star.presentation.TitleTextShape" 104cdf0e10cSrcweir XmlShapeTypePresOutlinerShape, // "com.sun.star.presentation.OutlinerShape" 105cdf0e10cSrcweir XmlShapeTypePresSubtitleShape, // "com.sun.star.presentation.SubtitleShape" 106cdf0e10cSrcweir XmlShapeTypePresGraphicObjectShape, // "com.sun.star.presentation.GraphicObjectShape" 107cdf0e10cSrcweir XmlShapeTypePresPageShape, // "com.sun.star.presentation.PageShape" 108cdf0e10cSrcweir XmlShapeTypePresOLE2Shape, // "com.sun.star.presentation.OLE2Shape" 109cdf0e10cSrcweir XmlShapeTypePresChartShape, // "com.sun.star.presentation.ChartShape" 110cdf0e10cSrcweir XmlShapeTypePresSheetShape, // "com.sun.star.presentation.CalcShape" 111cdf0e10cSrcweir XmlShapeTypePresTableShape, // "com.sun.star.presentation.TableShape" 112cdf0e10cSrcweir XmlShapeTypePresOrgChartShape, // "com.sun.star.presentation.OrgChartShape" 113cdf0e10cSrcweir XmlShapeTypePresNotesShape, // "com.sun.star.presentation.NotesShape" 114cdf0e10cSrcweir XmlShapeTypeHandoutShape, // "com.sun.star.presentation.HandoutShape" 115cdf0e10cSrcweir 116cdf0e10cSrcweir XmlShapeTypePresHeaderShape, // "com.sun.star.presentation.HeaderShape" 117cdf0e10cSrcweir XmlShapeTypePresFooterShape, // "com.sun.star.presentation.FooterShape" 118cdf0e10cSrcweir XmlShapeTypePresSlideNumberShape, // "com.sun.star.presentation.SlideNumberShape" 119cdf0e10cSrcweir XmlShapeTypePresDateTimeShape, // "com.sun.star.presentation.DateTimeShape" 120cdf0e10cSrcweir 121cdf0e10cSrcweir XmlShapeTypeDrawCustomShape, // "com.sun.star.drawing.CustomShape" 122cdf0e10cSrcweir XmlShapeTypeDrawMediaShape, // "com.sun.star.drawing.MediaShape" 123cdf0e10cSrcweir XmlShapeTypePresMediaShape, // "com.sun.star.presentation.MediaShape" 124cdf0e10cSrcweir 125cdf0e10cSrcweir XmlShapeTypeDrawTableShape, // "com.sun.star.drawing.TableShape" 126cdf0e10cSrcweir 127cdf0e10cSrcweir XmlShapeTypeNotYetSet 128cdf0e10cSrcweir }; 129cdf0e10cSrcweir 130cdf0e10cSrcweir /** caches style and type info after a collectShapeAutostyle for later use in exportShape */ 131cdf0e10cSrcweir struct ImplXMLShapeExportInfo 132cdf0e10cSrcweir { 133cdf0e10cSrcweir rtl::OUString msStyleName; 134cdf0e10cSrcweir rtl::OUString msTextStyleName; 135cdf0e10cSrcweir sal_Int32 mnFamily; 136cdf0e10cSrcweir XmlShapeType meShapeType; 137cdf0e10cSrcweir 138cdf0e10cSrcweir com::sun::star::uno::Reference< com::sun::star::drawing::XShape > xCustomShapeReplacement; 139cdf0e10cSrcweir ImplXMLShapeExportInfoImplXMLShapeExportInfo140cdf0e10cSrcweir ImplXMLShapeExportInfo() : mnFamily( XML_STYLE_FAMILY_SD_GRAPHICS_ID ), meShapeType( XmlShapeTypeNotYetSet ) {} 141cdf0e10cSrcweir }; 142cdf0e10cSrcweir 143cdf0e10cSrcweir /** a vector for shape style and type cache information */ 144cdf0e10cSrcweir typedef std::vector< ImplXMLShapeExportInfo > ImplXMLShapeExportInfoVector; 145cdf0e10cSrcweir 146cdf0e10cSrcweir /** a map to store all cache data for already collected XShapes */ 147cdf0e10cSrcweir typedef std::map< com::sun::star::uno::Reference < com::sun::star::drawing::XShapes >, ImplXMLShapeExportInfoVector > ShapesInfos; 148cdf0e10cSrcweir 149cdf0e10cSrcweir ////////////////////////////////////////////////////////////////////////////// 150cdf0e10cSrcweir // predeclarations 151cdf0e10cSrcweir 152cdf0e10cSrcweir class SvXMLExport; 153cdf0e10cSrcweir class SvXMLExportPropertyMapper; 154cdf0e10cSrcweir 155cdf0e10cSrcweir namespace basegfx 156cdf0e10cSrcweir { 157cdf0e10cSrcweir class B2DTuple; 158cdf0e10cSrcweir class B2DHomMatrix; 159cdf0e10cSrcweir } // end of namespace basegfx 160cdf0e10cSrcweir 161cdf0e10cSrcweir class XMLOFF_DLLPUBLIC XMLShapeExport : public UniRefBase 162cdf0e10cSrcweir { 163cdf0e10cSrcweir private: 164cdf0e10cSrcweir 165cdf0e10cSrcweir SvXMLExport& mrExport; 166cdf0e10cSrcweir UniReference< XMLPropertyHandlerFactory > mxSdPropHdlFactory; 167cdf0e10cSrcweir UniReference< SvXMLExportPropertyMapper > mxPropertySetMapper; 168cdf0e10cSrcweir UniReference< XMLAnimationsExporter > mxAnimationsExporter; 169cdf0e10cSrcweir sal_Int32 mnNextUniqueShapeId; 170cdf0e10cSrcweir ShapesInfos maShapesInfos; 171cdf0e10cSrcweir ShapesInfos::iterator maCurrentShapesIter; 172cdf0e10cSrcweir sal_Bool mbExportLayer; 173cdf0e10cSrcweir ImplXMLShapeExportInfoVector maShapeInfos; 174cdf0e10cSrcweir ImplXMLShapeExportInfoVector::iterator maCurrentInfo; 175cdf0e10cSrcweir rtl::OUString msPresentationStylePrefix; 176cdf0e10cSrcweir 177cdf0e10cSrcweir // #88546# possibility to swich progress bar handling on/off 178cdf0e10cSrcweir sal_Bool mbHandleProgressBar; 179cdf0e10cSrcweir 180cdf0e10cSrcweir rtl::Reference< XMLTableExport > mxShapeTableExport; 181cdf0e10cSrcweir 182cdf0e10cSrcweir protected: GetExport()183cdf0e10cSrcweir SvXMLExport& GetExport() { return mrExport; } GetExport() const184cdf0e10cSrcweir const SvXMLExport& GetExport() const { return mrExport; } 185cdf0e10cSrcweir private: 186cdf0e10cSrcweir GetPropertySetMapper() const187cdf0e10cSrcweir SAL_DLLPRIVATE UniReference< SvXMLExportPropertyMapper > GetPropertySetMapper() const { return mxPropertySetMapper; } 188cdf0e10cSrcweir 189cdf0e10cSrcweir const rtl::OUString msZIndex; 190cdf0e10cSrcweir const rtl::OUString msPrintable; 191cdf0e10cSrcweir const rtl::OUString msVisible; 192cdf0e10cSrcweir 193cdf0e10cSrcweir const rtl::OUString msEmptyPres; 194cdf0e10cSrcweir const rtl::OUString msModel; 195cdf0e10cSrcweir const rtl::OUString msStartShape; 196cdf0e10cSrcweir const rtl::OUString msEndShape; 197cdf0e10cSrcweir const rtl::OUString msOnClick; 198cdf0e10cSrcweir #ifdef ISSUE66550_HLINK_FOR_SHAPES 199cdf0e10cSrcweir const rtl::OUString msOnAction; 200cdf0e10cSrcweir const rtl::OUString msAction; 201cdf0e10cSrcweir const rtl::OUString msURL; 202cdf0e10cSrcweir #endif 203cdf0e10cSrcweir const rtl::OUString msEventType; 204cdf0e10cSrcweir const rtl::OUString msPresentation; 205cdf0e10cSrcweir const rtl::OUString msMacroName; 206cdf0e10cSrcweir const rtl::OUString msScript; 207cdf0e10cSrcweir const rtl::OUString msLibrary; 208cdf0e10cSrcweir const rtl::OUString msClickAction; 209cdf0e10cSrcweir const rtl::OUString msBookmark; 210cdf0e10cSrcweir const rtl::OUString msEffect; 211cdf0e10cSrcweir const rtl::OUString msPlayFull; 212cdf0e10cSrcweir const rtl::OUString msVerb; 213cdf0e10cSrcweir const rtl::OUString msSoundURL; 214cdf0e10cSrcweir const rtl::OUString msSpeed; 215cdf0e10cSrcweir const rtl::OUString msStarBasic; 216cdf0e10cSrcweir 217cdf0e10cSrcweir rtl::OUStringBuffer msBuffer; 218cdf0e10cSrcweir 219cdf0e10cSrcweir SAL_DLLPRIVATE void ImpCalcShapeType(const com::sun::star::uno::Reference< com::sun::star::drawing::XShape >& xShape, XmlShapeType& eShapeType); 220cdf0e10cSrcweir 221cdf0e10cSrcweir SAL_DLLPRIVATE void ImpExportNewTrans(const com::sun::star::uno::Reference< com::sun::star::beans::XPropertySet >& xPropSet, sal_Int32 nFeatures, com::sun::star::awt::Point* pRefPoint); 222cdf0e10cSrcweir SAL_DLLPRIVATE void ImpExportNewTrans_GetB2DHomMatrix(::basegfx::B2DHomMatrix& rMatrix, const com::sun::star::uno::Reference< com::sun::star::beans::XPropertySet >& xPropSet); 223cdf0e10cSrcweir SAL_DLLPRIVATE void ImpExportNewTrans_DecomposeAndRefPoint(const ::basegfx::B2DHomMatrix& rMat, ::basegfx::B2DTuple& rTRScale, double& fTRShear, double& fTRRotate, ::basegfx::B2DTuple& rTRTranslate, com::sun::star::awt::Point* pRefPoint); 224cdf0e10cSrcweir SAL_DLLPRIVATE void ImpExportNewTrans_FeaturesAndWrite(::basegfx::B2DTuple& rTRScale, double fTRShear, double fTRRotate, ::basegfx::B2DTuple& rTRTranslate, const sal_Int32 nFeatures); 225cdf0e10cSrcweir SAL_DLLPRIVATE sal_Bool ImpExportPresentationAttributes( const com::sun::star::uno::Reference< com::sun::star::beans::XPropertySet >& xPropSet, const rtl::OUString& rClass ); 226cdf0e10cSrcweir SAL_DLLPRIVATE void ImpExportText( const com::sun::star::uno::Reference< com::sun::star::drawing::XShape >& xShape ); 227cdf0e10cSrcweir SAL_DLLPRIVATE void ImpExportEvents( const com::sun::star::uno::Reference< com::sun::star::drawing::XShape >& xShape ); 228cdf0e10cSrcweir SAL_DLLPRIVATE void ImpExportDescription( const com::sun::star::uno::Reference< com::sun::star::drawing::XShape >& xShape ); // #i68101# 229cdf0e10cSrcweir SAL_DLLPRIVATE void ImpExportGluePoints( const com::sun::star::uno::Reference< com::sun::star::drawing::XShape >& xShape ); 230cdf0e10cSrcweir 231cdf0e10cSrcweir // single shape exporters 232cdf0e10cSrcweir SAL_DLLPRIVATE void ImpExportGroupShape( const com::sun::star::uno::Reference< com::sun::star::drawing::XShape >& xShape, XmlShapeType eShapeType, sal_Int32 nFeatures = SEF_DEFAULT, com::sun::star::awt::Point* pRefPoint = NULL ); 233cdf0e10cSrcweir SAL_DLLPRIVATE void ImpExport3DSceneShape( const com::sun::star::uno::Reference< com::sun::star::drawing::XShape >& xShape, XmlShapeType eShapeType, sal_Int32 nFeatures = SEF_DEFAULT, com::sun::star::awt::Point* pRefPoint = NULL ); 234cdf0e10cSrcweir SAL_DLLPRIVATE void ImpExportRectangleShape( const com::sun::star::uno::Reference< com::sun::star::drawing::XShape >& xShape, XmlShapeType eShapeType, sal_Int32 nFeatures = SEF_DEFAULT, com::sun::star::awt::Point* pRefPoint = NULL ); 235cdf0e10cSrcweir SAL_DLLPRIVATE void ImpExportLineShape(const com::sun::star::uno::Reference< com::sun::star::drawing::XShape >& xShape, XmlShapeType eShapeType, sal_Int32 nFeatures = SEF_DEFAULT, com::sun::star::awt::Point* pRefPoint = NULL ); 236cdf0e10cSrcweir SAL_DLLPRIVATE void ImpExportEllipseShape(const com::sun::star::uno::Reference< com::sun::star::drawing::XShape >& xShape, XmlShapeType eShapeType, sal_Int32 nFeatures = SEF_DEFAULT, com::sun::star::awt::Point* pRefPoint = NULL ); 237cdf0e10cSrcweir SAL_DLLPRIVATE void ImpExportPolygonShape(const com::sun::star::uno::Reference< com::sun::star::drawing::XShape >& xShape, XmlShapeType eShapeType, sal_Int32 nFeatures = SEF_DEFAULT, com::sun::star::awt::Point* pRefPoint = NULL ); 238cdf0e10cSrcweir SAL_DLLPRIVATE void ImpExportTextBoxShape(const com::sun::star::uno::Reference< com::sun::star::drawing::XShape >& xShape, XmlShapeType eShapeType, sal_Int32 nFeatures = SEF_DEFAULT, com::sun::star::awt::Point* pRefPoint = NULL ); 239cdf0e10cSrcweir SAL_DLLPRIVATE void ImpExportGraphicObjectShape(const com::sun::star::uno::Reference< com::sun::star::drawing::XShape >& xShape, XmlShapeType eShapeType, sal_Int32 nFeatures = SEF_DEFAULT, com::sun::star::awt::Point* pRefPoint = NULL ); 240cdf0e10cSrcweir SAL_DLLPRIVATE void ImpExportChartShape(const com::sun::star::uno::Reference< com::sun::star::drawing::XShape >& xShape, XmlShapeType eShapeType, sal_Int32 nFeatures = SEF_DEFAULT, com::sun::star::awt::Point* pRefPoint = NULL, SvXMLAttributeList* pAttrList = NULL ); 241cdf0e10cSrcweir SAL_DLLPRIVATE void ImpExportControlShape(const com::sun::star::uno::Reference< com::sun::star::drawing::XShape >& xShape, XmlShapeType eShapeType, sal_Int32 nFeatures = SEF_DEFAULT, com::sun::star::awt::Point* pRefPoint = NULL ); 242cdf0e10cSrcweir SAL_DLLPRIVATE void ImpExportConnectorShape(const com::sun::star::uno::Reference< com::sun::star::drawing::XShape >& xShape, XmlShapeType eShapeType, sal_Int32 nFeatures = SEF_DEFAULT, com::sun::star::awt::Point* pRefPoint = NULL ); 243cdf0e10cSrcweir SAL_DLLPRIVATE void ImpExportMeasureShape(const com::sun::star::uno::Reference< com::sun::star::drawing::XShape >& xShape, XmlShapeType eShapeType, sal_Int32 nFeatures = SEF_DEFAULT, com::sun::star::awt::Point* pRefPoint = NULL ); 244cdf0e10cSrcweir SAL_DLLPRIVATE void ImpExportOLE2Shape(const com::sun::star::uno::Reference< com::sun::star::drawing::XShape >& xShape, XmlShapeType eShapeType, sal_Int32 nFeatures = SEF_DEFAULT, com::sun::star::awt::Point* pRefPoint = NULL, SvXMLAttributeList* pAttrList = NULL ); 245cdf0e10cSrcweir SAL_DLLPRIVATE void ImpExportPageShape(const com::sun::star::uno::Reference< com::sun::star::drawing::XShape >& xShape, XmlShapeType eShapeType, sal_Int32 nFeatures = SEF_DEFAULT, com::sun::star::awt::Point* pRefPoint = NULL ); 246cdf0e10cSrcweir SAL_DLLPRIVATE void ImpExportCaptionShape(const com::sun::star::uno::Reference< com::sun::star::drawing::XShape >& xShape, XmlShapeType eShapeType, sal_Int32 nFeatures = SEF_DEFAULT, com::sun::star::awt::Point* pRefPoint = NULL ); 247cdf0e10cSrcweir SAL_DLLPRIVATE void ImpExport3DShape(const com::sun::star::uno::Reference< com::sun::star::drawing::XShape >& xShape, XmlShapeType eShapeType, sal_Int32 nFeatures = SEF_DEFAULT, com::sun::star::awt::Point* pRefPoint = NULL ); 248cdf0e10cSrcweir SAL_DLLPRIVATE void ImpExportFrameShape( const com::sun::star::uno::Reference< com::sun::star::drawing::XShape >& xShape, XmlShapeType eShapeType, sal_Int32 nFeatures = SEF_DEFAULT, com::sun::star::awt::Point* pRefPoint = NULL ); 249cdf0e10cSrcweir SAL_DLLPRIVATE void ImpExportPluginShape( const com::sun::star::uno::Reference< com::sun::star::drawing::XShape >& xShape, XmlShapeType eShapeType, sal_Int32 nFeatures = SEF_DEFAULT, com::sun::star::awt::Point* pRefPoint = NULL ); 250cdf0e10cSrcweir SAL_DLLPRIVATE void ImpExportAppletShape( const com::sun::star::uno::Reference< com::sun::star::drawing::XShape >& xShape, XmlShapeType eShapeType, sal_Int32 nFeatures = SEF_DEFAULT, com::sun::star::awt::Point* pRefPoint = NULL ); 251cdf0e10cSrcweir SAL_DLLPRIVATE void ImpExportCustomShape( const com::sun::star::uno::Reference< com::sun::star::drawing::XShape >& xShape, XmlShapeType eShapeType, sal_Int32 nFeatures = SEF_DEFAULT, com::sun::star::awt::Point* pRefPoint = NULL ); 252cdf0e10cSrcweir SAL_DLLPRIVATE void ImpExportMediaShape( const com::sun::star::uno::Reference< com::sun::star::drawing::XShape >& xShape, XmlShapeType eShapeType, sal_Int32 nFeatures = SEF_DEFAULT, com::sun::star::awt::Point* pRefPoint = NULL ); 253cdf0e10cSrcweir SAL_DLLPRIVATE void ImpExportTableShape(const com::sun::star::uno::Reference< com::sun::star::drawing::XShape >& xShape, XmlShapeType eShapeType, sal_Int32 nFeatures = SEF_DEFAULT, com::sun::star::awt::Point* pRefPoint = NULL ); 254cdf0e10cSrcweir public: 255cdf0e10cSrcweir XMLShapeExport(SvXMLExport& rExp, SvXMLExportPropertyMapper *pExtMapper=0 ); 256cdf0e10cSrcweir virtual ~XMLShapeExport(); 257cdf0e10cSrcweir 258cdf0e10cSrcweir // This method collects all automatic styles for the given XShape 259cdf0e10cSrcweir void collectShapeAutoStyles( 260cdf0e10cSrcweir const com::sun::star::uno::Reference < com::sun::star::drawing::XShape >& xShape); 261cdf0e10cSrcweir 262cdf0e10cSrcweir // This method exports the given XShape 263cdf0e10cSrcweir void exportShape( 264cdf0e10cSrcweir const com::sun::star::uno::Reference < com::sun::star::drawing::XShape >& xShape, 265cdf0e10cSrcweir sal_Int32 nFeatures = SEF_DEFAULT, 266cdf0e10cSrcweir com::sun::star::awt::Point* pRefPoint = NULL, 267cdf0e10cSrcweir SvXMLAttributeList* pAttrList = NULL 268cdf0e10cSrcweir ); 269cdf0e10cSrcweir 270cdf0e10cSrcweir // This method collects all automatic styles for the shapes inside the given XShapes collection 271cdf0e10cSrcweir void collectShapesAutoStyles( 272cdf0e10cSrcweir const com::sun::star::uno::Reference < com::sun::star::drawing::XShapes >& xShapes); 273cdf0e10cSrcweir 274cdf0e10cSrcweir // This method exports all XShape inside the given XShapes collection 275cdf0e10cSrcweir void exportShapes( 276cdf0e10cSrcweir const com::sun::star::uno::Reference < com::sun::star::drawing::XShapes >& xShapes, 277cdf0e10cSrcweir sal_Int32 nFeatures = SEF_DEFAULT, 278cdf0e10cSrcweir com::sun::star::awt::Point* pRefPoint = NULL 279cdf0e10cSrcweir ); 280cdf0e10cSrcweir 281cdf0e10cSrcweir /** initializes some internal structures for fast access to the given XShapes collection 282cdf0e10cSrcweir 283cdf0e10cSrcweir <p>This method has to be called before you use exportShape or collectShapeAutoStyles. 284*86e1cf34SPedro Giffuni It is automatically called if you use collectShapesAutoStyles and exportShapes. 285cdf0e10cSrcweir 286cdf0e10cSrcweir @see collectShapeAutoStyles 287cdf0e10cSrcweir @see exportShape 288cdf0e10cSrcweir @see collectShapesAutoStyles 289cdf0e10cSrcweir @see exportShapes 290cdf0e10cSrcweir */ 291cdf0e10cSrcweir void seekShapes( 292cdf0e10cSrcweir const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes >& xShapes ) throw(); 293cdf0e10cSrcweir 294cdf0e10cSrcweir void exportAutoStyles(); 295cdf0e10cSrcweir 296cdf0e10cSrcweir /** sets a new reference to an XMLAnimationExporter. 297cdf0e10cSrcweir If this is a non NULL reference, the animation information from all shapes given to exportShape() 298cdf0e10cSrcweir from now on are collected. 299cdf0e10cSrcweir */ setAnimationsExporter(UniReference<XMLAnimationsExporter> xAnimExport)300cdf0e10cSrcweir void setAnimationsExporter( UniReference< XMLAnimationsExporter > xAnimExport ) { mxAnimationsExporter = xAnimExport; } 301cdf0e10cSrcweir 302cdf0e10cSrcweir /** returns the last set XMLAnimationExport */ getAnimationsExporter() const303cdf0e10cSrcweir UniReference< XMLAnimationsExporter > getAnimationsExporter() const { return mxAnimationsExporter; } 304cdf0e10cSrcweir 305cdf0e10cSrcweir /// returns the export property mapper for external chaining 306cdf0e10cSrcweir static SvXMLExportPropertyMapper* CreateShapePropMapper( SvXMLExport& rExport ); 307cdf0e10cSrcweir enableLayerExport(sal_Bool bEnable=sal_True)308cdf0e10cSrcweir void enableLayerExport( sal_Bool bEnable = sal_True ) { mbExportLayer = bEnable; } IsLayerExportEnabled() const309cdf0e10cSrcweir sal_Bool IsLayerExportEnabled() const { return mbExportLayer; } 310cdf0e10cSrcweir 311cdf0e10cSrcweir // #88546# 312cdf0e10cSrcweir /** defines if the export should increment the progress bar or not */ enableHandleProgressBar(sal_Bool bEnable=sal_True)313cdf0e10cSrcweir void enableHandleProgressBar( sal_Bool bEnable = sal_True ) { mbHandleProgressBar = bEnable; } IsHandleProgressBarEnabled() const314cdf0e10cSrcweir sal_Bool IsHandleProgressBarEnabled() const { return mbHandleProgressBar; } 315cdf0e10cSrcweir setPresentationStylePrefix(const rtl::OUString & rPrefix)316cdf0e10cSrcweir void setPresentationStylePrefix( const rtl::OUString& rPrefix ) { msPresentationStylePrefix = rPrefix; } 317cdf0e10cSrcweir 318cdf0e10cSrcweir /** helper for chart that adds all attributes of a 3d scene element to the export */ 319cdf0e10cSrcweir void export3DSceneAttributes( const com::sun::star::uno::Reference< com::sun::star::beans::XPropertySet >& xPropSet ); 320cdf0e10cSrcweir 321cdf0e10cSrcweir /** helper for chart that exports all lamps from the propertyset */ 322cdf0e10cSrcweir void export3DLamps( const com::sun::star::uno::Reference< com::sun::star::beans::XPropertySet >& xPropSet ); 323cdf0e10cSrcweir 324cdf0e10cSrcweir /** sj: replacing CustomShapes with standard objects that are also supported in OpenOffice.org format */ 325cdf0e10cSrcweir com::sun::star::uno::Reference < com::sun::star::drawing::XShape > checkForCustomShapeReplacement( 326cdf0e10cSrcweir const com::sun::star::uno::Reference < com::sun::star::drawing::XShape >& ); 327cdf0e10cSrcweir 328cdf0e10cSrcweir /** helper to export the style for graphic defaults */ 329cdf0e10cSrcweir void ExportGraphicDefaults(); 330cdf0e10cSrcweir 331cdf0e10cSrcweir /** is called before a shape element for the given XShape is exported */ 332cdf0e10cSrcweir virtual void onExport( const com::sun::star::uno::Reference < com::sun::star::drawing::XShape >& xShape ); 333cdf0e10cSrcweir 334cdf0e10cSrcweir const rtl::Reference< XMLTableExport >& GetShapeTableExport(); 335cdf0e10cSrcweir }; 336cdf0e10cSrcweir 337cdf0e10cSrcweir 338cdf0e10cSrcweir #endif 339