2010-10-27 13:11:31 +01:00
|
|
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
2012-11-12 17:21:24 +00:00
|
|
|
/*
|
|
|
|
* This file is part of the LibreOffice project.
|
|
|
|
*
|
|
|
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
|
|
*
|
|
|
|
* This file incorporates work covered by the following license notice:
|
|
|
|
*
|
|
|
|
* Licensed to the Apache Software Foundation (ASF) under one or more
|
|
|
|
* contributor license agreements. See the NOTICE file distributed
|
|
|
|
* with this work for additional information regarding copyright
|
|
|
|
* ownership. The ASF licenses this file to you under the Apache
|
|
|
|
* License, Version 2.0 (the "License"); you may not use this file
|
|
|
|
* except in compliance with the License. You may obtain a copy of
|
|
|
|
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
|
|
|
|
*/
|
2000-12-05 22:31:17 +00:00
|
|
|
|
|
|
|
#ifndef _SDXMLEXP_IMPL_HXX
|
|
|
|
#define _SDXMLEXP_IMPL_HXX
|
|
|
|
|
2007-06-27 14:05:18 +00:00
|
|
|
#include <xmloff/xmlexp.hxx>
|
2000-12-05 22:31:17 +00:00
|
|
|
|
|
|
|
#include <com/sun/star/frame/XModel.hpp>
|
|
|
|
#include <com/sun/star/task/XStatusIndicator.hpp>
|
|
|
|
#include <com/sun/star/container/XNameAccess.hpp>
|
|
|
|
#include <com/sun/star/drawing/XDrawPage.hpp>
|
2004-03-30 15:14:49 +00:00
|
|
|
#include <comphelper/stl_types.hxx>
|
|
|
|
|
2010-12-26 08:08:17 -08:00
|
|
|
#include <vector>
|
|
|
|
|
2000-12-05 22:31:17 +00:00
|
|
|
class Rectangle;
|
|
|
|
|
|
|
|
class ImpXMLEXPPageMasterInfo;
|
2010-12-26 16:44:17 -08:00
|
|
|
class ImpXMLAutoLayoutInfo;
|
2000-12-05 22:31:17 +00:00
|
|
|
class XMLSdPropHdlFactory;
|
|
|
|
class XMLShapeExportPropertyMapper;
|
2001-01-17 15:11:05 +00:00
|
|
|
class XMLPageExportPropertyMapper;
|
2000-12-05 22:31:17 +00:00
|
|
|
|
2010-12-26 08:08:17 -08:00
|
|
|
typedef ::std::vector< ImpXMLEXPPageMasterInfo* > ImpXMLEXPPageMasterList;
|
2010-12-26 16:44:17 -08:00
|
|
|
typedef ::std::vector< ImpXMLAutoLayoutInfo* > ImpXMLAutoLayoutInfoList;
|
2010-12-26 08:08:17 -08:00
|
|
|
|
2000-12-05 22:31:17 +00:00
|
|
|
enum XmlPlaceholder
|
|
|
|
{
|
|
|
|
XmlPlaceholderTitle,
|
|
|
|
XmlPlaceholderOutline,
|
|
|
|
XmlPlaceholderSubtitle,
|
|
|
|
XmlPlaceholderText,
|
|
|
|
XmlPlaceholderGraphic,
|
|
|
|
XmlPlaceholderObject,
|
|
|
|
XmlPlaceholderChart,
|
|
|
|
XmlPlaceholderOrgchart,
|
|
|
|
XmlPlaceholderTable,
|
|
|
|
XmlPlaceholderPage,
|
|
|
|
XmlPlaceholderNotes,
|
2001-03-09 12:28:06 +00:00
|
|
|
XmlPlaceholderHandout,
|
|
|
|
XmlPlaceholderVerticalTitle,
|
|
|
|
XmlPlaceholderVerticalOutline
|
2000-12-05 22:31:17 +00:00
|
|
|
};
|
|
|
|
|
2004-03-30 15:14:49 +00:00
|
|
|
DECLARE_STL_STDKEY_SET( sal_Int32, SdXMLFormatMap );
|
|
|
|
|
2004-11-03 15:39:48 +00:00
|
|
|
struct HeaderFooterPageSettingsImpl
|
|
|
|
{
|
2013-04-07 12:06:47 +02:00
|
|
|
OUString maStrHeaderDeclName;
|
|
|
|
OUString maStrFooterDeclName;
|
|
|
|
OUString maStrDateTimeDeclName;
|
2004-11-03 15:39:48 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
struct DateTimeDeclImpl
|
|
|
|
{
|
2013-04-07 12:06:47 +02:00
|
|
|
OUString maStrText;
|
2004-11-03 15:39:48 +00:00
|
|
|
sal_Bool mbFixed;
|
|
|
|
sal_Int32 mnFormat;
|
|
|
|
};
|
|
|
|
|
2000-12-05 22:31:17 +00:00
|
|
|
class SdXMLExport : public SvXMLExport
|
|
|
|
{
|
|
|
|
com::sun::star::uno::Reference< com::sun::star::container::XNameAccess > mxDocStyleFamilies;
|
|
|
|
com::sun::star::uno::Reference< com::sun::star::container::XIndexAccess > mxDocMasterPages;
|
|
|
|
com::sun::star::uno::Reference< com::sun::star::container::XIndexAccess > mxDocDrawPages;
|
|
|
|
sal_Int32 mnDocMasterPageCount;
|
|
|
|
sal_Int32 mnDocDrawPageCount;
|
2001-01-12 15:16:13 +00:00
|
|
|
sal_uInt32 mnShapeStyleInfoIndex;
|
2001-05-14 13:42:46 +00:00
|
|
|
sal_uInt32 mnObjectCount;
|
2000-12-05 22:31:17 +00:00
|
|
|
|
|
|
|
// temporary infos
|
|
|
|
ImpXMLEXPPageMasterList* mpPageMasterInfoList;
|
2002-09-04 13:02:51 +00:00
|
|
|
ImpXMLEXPPageMasterList* mpPageMasterUsageList;
|
|
|
|
ImpXMLEXPPageMasterList* mpNotesPageMasterUsageList;
|
|
|
|
ImpXMLEXPPageMasterInfo* mpHandoutPageMaster;
|
2000-12-05 22:31:17 +00:00
|
|
|
ImpXMLAutoLayoutInfoList* mpAutoLayoutInfoList;
|
|
|
|
|
2013-04-07 12:06:47 +02:00
|
|
|
com::sun::star::uno::Sequence< OUString > maDrawPagesAutoLayoutNames;
|
2001-05-28 12:32:20 +00:00
|
|
|
|
2013-04-07 12:06:47 +02:00
|
|
|
::std::vector< OUString > maDrawPagesStyleNames;
|
|
|
|
::std::vector< OUString > maDrawNotesPagesStyleNames;
|
|
|
|
::std::vector< OUString > maMasterPagesStyleNames;
|
|
|
|
OUString maHandoutMasterStyleName;
|
2004-11-03 15:39:48 +00:00
|
|
|
::std::vector< HeaderFooterPageSettingsImpl > maDrawPagesHeaderFooterSettings;
|
|
|
|
::std::vector< HeaderFooterPageSettingsImpl > maDrawNotesPagesHeaderFooterSettings;
|
|
|
|
|
2013-04-07 12:06:47 +02:00
|
|
|
::std::vector< OUString > maHeaderDeclsVector;
|
|
|
|
::std::vector< OUString > maFooterDeclsVector;
|
2004-11-03 15:39:48 +00:00
|
|
|
::std::vector< DateTimeDeclImpl > maDateTimeDeclsVector;
|
|
|
|
|
|
|
|
HeaderFooterPageSettingsImpl maHandoutPageHeaderFooterSettings;
|
2000-12-06 15:53:44 +00:00
|
|
|
|
2000-12-05 22:31:17 +00:00
|
|
|
XMLSdPropHdlFactory* mpSdPropHdlFactory;
|
|
|
|
XMLShapeExportPropertyMapper* mpPropertySetMapper;
|
2001-01-17 15:11:05 +00:00
|
|
|
XMLPageExportPropertyMapper* mpPresPagePropsMapper;
|
2000-12-05 22:31:17 +00:00
|
|
|
|
2004-03-30 15:14:49 +00:00
|
|
|
SdXMLFormatMap maUsedDateStyles; // this is a vector with the used formatings for date fields
|
|
|
|
SdXMLFormatMap maUsedTimeStyles; // this is a vector with the used formatings for time fields
|
2001-05-09 13:40:42 +00:00
|
|
|
|
2000-12-05 22:31:17 +00:00
|
|
|
sal_Bool mbIsDraw;
|
|
|
|
sal_Bool mbFamilyGraphicUsed;
|
|
|
|
sal_Bool mbFamilyPresentationUsed;
|
|
|
|
|
2013-04-07 12:06:47 +02:00
|
|
|
const OUString msZIndex;
|
|
|
|
const OUString msEmptyPres;
|
|
|
|
const OUString msModel;
|
|
|
|
const OUString msStartShape;
|
|
|
|
const OUString msEndShape;
|
|
|
|
const OUString msPageLayoutNames;
|
2000-12-05 22:31:17 +00:00
|
|
|
|
2010-11-10 13:50:33 +08:00
|
|
|
virtual void _ExportStyles(sal_Bool bUsed);
|
2000-12-05 22:31:17 +00:00
|
|
|
virtual void _ExportAutoStyles();
|
2013-03-01 13:03:06 +01:00
|
|
|
virtual void _ExportFontDecls();
|
2000-12-05 22:31:17 +00:00
|
|
|
virtual void _ExportMasterStyles();
|
|
|
|
virtual void _ExportContent();
|
2001-05-14 13:42:46 +00:00
|
|
|
// #82003#
|
|
|
|
virtual void _ExportMeta();
|
2000-12-05 22:31:17 +00:00
|
|
|
|
2002-09-04 13:02:51 +00:00
|
|
|
ImpXMLEXPPageMasterInfo* ImpGetOrCreatePageMasterInfo( com::sun::star::uno::Reference< com::sun::star::drawing::XDrawPage > xMasterPage );
|
2000-12-05 22:31:17 +00:00
|
|
|
void ImpPrepPageMasterInfos();
|
|
|
|
void ImpPrepDrawMasterInfos();
|
|
|
|
void ImpWritePageMasterInfos();
|
2000-12-06 15:53:44 +00:00
|
|
|
void ImpPrepAutoLayoutInfos();
|
2004-11-03 15:39:48 +00:00
|
|
|
HeaderFooterPageSettingsImpl ImpPrepDrawPageHeaderFooterDecls( const com::sun::star::uno::Reference< com::sun::star::drawing::XDrawPage >& xDrawPage );
|
2013-04-07 12:06:47 +02:00
|
|
|
ImpXMLEXPPageMasterInfo* ImpGetPageMasterInfoByName(const OUString& rName);
|
2000-12-05 22:31:17 +00:00
|
|
|
|
|
|
|
void ImpPrepDrawPageInfos();
|
|
|
|
void ImpPrepMasterPageInfos();
|
|
|
|
void ImpWritePresentationStyles();
|
2013-04-07 12:06:47 +02:00
|
|
|
OUString ImpCreatePresPageStyleName( com::sun::star::uno::Reference<com::sun::star::drawing::XDrawPage> xDrawPage, bool bExportBackground = true );
|
2000-12-05 22:31:17 +00:00
|
|
|
|
2013-04-07 12:06:47 +02:00
|
|
|
sal_Bool ImpPrepAutoLayoutInfo(const com::sun::star::uno::Reference< com::sun::star::drawing::XDrawPage >& xPage, OUString& rName);
|
2000-12-05 22:31:17 +00:00
|
|
|
void ImpWriteAutoLayoutInfos();
|
|
|
|
void ImpWriteAutoLayoutPlaceholder(XmlPlaceholder ePl, const Rectangle& rRect);
|
2004-11-03 15:39:48 +00:00
|
|
|
void ImpWriteHeaderFooterDecls();
|
|
|
|
void ImplExportHeaderFooterDeclAttributes( const HeaderFooterPageSettingsImpl& aSettings );
|
2000-12-05 22:31:17 +00:00
|
|
|
|
2001-01-18 13:53:32 +00:00
|
|
|
void exportFormsElement( com::sun::star::uno::Reference< com::sun::star::drawing::XDrawPage > xDrawPage );
|
2001-02-15 16:35:27 +00:00
|
|
|
void exportPresentationSettings();
|
2001-01-18 13:53:32 +00:00
|
|
|
|
2001-05-14 13:42:46 +00:00
|
|
|
// #82003# helper function for recursive object count
|
|
|
|
sal_uInt32 ImpRecursiveObjectCount( com::sun::star::uno::Reference< com::sun::star::drawing::XShapes > xShapes);
|
|
|
|
|
2013-04-07 12:06:47 +02:00
|
|
|
OUString getNavigationOrder( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XDrawPage >& xDrawPage );
|
2007-08-28 12:34:35 +00:00
|
|
|
|
2009-09-16 13:55:36 +00:00
|
|
|
void collectAnnotationAutoStyles( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XDrawPage >& xDrawPage );
|
|
|
|
void exportAnnotations( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XDrawPage >& xDrawPage );
|
|
|
|
|
2001-03-27 21:03:08 +00:00
|
|
|
protected:
|
|
|
|
virtual void GetViewSettings(com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue>& aProps);
|
|
|
|
virtual void GetConfigurationSettings(com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue>& aProps);
|
2013-02-22 18:06:18 +01:00
|
|
|
virtual XMLFontAutoStylePool* CreateFontAutoStylePool();
|
2001-03-27 21:03:08 +00:00
|
|
|
|
2000-12-05 22:31:17 +00:00
|
|
|
public:
|
2004-05-03 12:34:02 +00:00
|
|
|
SdXMLExport(
|
2013-01-16 17:12:47 +02:00
|
|
|
const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& xContext,
|
2004-05-03 12:34:02 +00:00
|
|
|
sal_Bool bIsDraw, sal_uInt16 nExportFlags = EXPORT_ALL );
|
2000-12-05 22:31:17 +00:00
|
|
|
virtual ~SdXMLExport();
|
|
|
|
|
|
|
|
void SetProgress(sal_Int32 nProg);
|
|
|
|
|
2001-01-12 15:16:13 +00:00
|
|
|
// XExporter
|
|
|
|
virtual void SAL_CALL setSourceDocument( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent >& xDoc ) throw(::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException);
|
|
|
|
|
2000-12-05 22:31:17 +00:00
|
|
|
// get factories and mappers
|
|
|
|
XMLSdPropHdlFactory* GetSdPropHdlFactory() const { return mpSdPropHdlFactory; }
|
|
|
|
XMLShapeExportPropertyMapper* GetPropertySetMapper() const { return mpPropertySetMapper; }
|
2001-01-17 15:11:05 +00:00
|
|
|
XMLPageExportPropertyMapper* GetPresPagePropsMapper() const { return mpPresPagePropsMapper; }
|
2000-12-05 22:31:17 +00:00
|
|
|
|
2010-11-10 13:50:33 +08:00
|
|
|
sal_Bool IsDraw() const { return mbIsDraw; }
|
|
|
|
sal_Bool IsImpress() const { return !mbIsDraw; }
|
2000-12-05 22:31:17 +00:00
|
|
|
|
2010-11-10 13:50:33 +08:00
|
|
|
sal_Bool IsFamilyGraphicUsed() const { return mbFamilyGraphicUsed; }
|
|
|
|
void SetFamilyGraphicUsed() { mbFamilyGraphicUsed = sal_True; }
|
|
|
|
sal_Bool IsFamilyPresentationUsed() const { return mbFamilyPresentationUsed; }
|
|
|
|
void SetFamilyPresentationUsed() { mbFamilyPresentationUsed = sal_True; }
|
2001-05-09 13:40:42 +00:00
|
|
|
|
|
|
|
virtual void addDataStyle(const sal_Int32 nNumberFormat, sal_Bool bTimeFormat = sal_False );
|
|
|
|
virtual void exportDataStyles();
|
|
|
|
virtual void exportAutoDataStyles();
|
2013-04-07 12:06:47 +02:00
|
|
|
virtual OUString getDataStyleName(const sal_Int32 nNumberFormat, sal_Bool bTimeFormat = sal_False ) const;
|
2001-09-14 10:24:06 +00:00
|
|
|
|
|
|
|
// XServiceInfo ( : SvXMLExport )
|
2013-04-07 12:06:47 +02:00
|
|
|
virtual OUString SAL_CALL getImplementationName() throw( ::com::sun::star::uno::RuntimeException );
|
2000-12-05 22:31:17 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // _SDXMLEXP_HXX
|
|
|
|
|
2010-10-27 13:11:31 +01:00
|
|
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|