merge the formfield patch from ooo-build
[ooovba.git] / xmloff / source / draw / sdxmlexp_impl.hxx
blobc5d92fcd057ecef97ca5c0750a90aafd0d3f080b
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: sdxmlexp_impl.hxx,v $
10 * $Revision: 1.29 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #ifndef _SDXMLEXP_IMPL_HXX
32 #define _SDXMLEXP_IMPL_HXX
34 #include <xmloff/xmlexp.hxx>
37 #include <com/sun/star/frame/XModel.hpp>
38 #include <com/sun/star/task/XStatusIndicator.hpp>
39 #include <com/sun/star/container/XNameAccess.hpp>
40 #include <com/sun/star/drawing/XDrawPage.hpp>
41 #include <comphelper/stl_types.hxx>
43 //////////////////////////////////////////////////////////////////////////////
45 class SvXMLUnitConverter;
46 class SvXMLExportItemMapper;
47 class SfxPoolItem;
48 class SfxItemSet;
49 class OUStrings_Impl;
50 class OUStringsSort_Impl;
51 class Rectangle;
53 class ImpPresPageDrawStylePropMapper;
54 class ImpXMLEXPPageMasterList;
55 class ImpXMLEXPPageMasterInfo;
56 class ImpXMLDrawPageInfoList;
57 class ImpXMLAutoLayoutInfoList;
58 class SvXMLAutoStylePoolP;
59 class XMLSdPropHdlFactory;
60 class ImpXMLShapeStyleInfo;
61 class XMLShapeExportPropertyMapper;
62 class XMLPageExportPropertyMapper;
64 //////////////////////////////////////////////////////////////////////////////
66 enum XmlPlaceholder
68 XmlPlaceholderTitle,
69 XmlPlaceholderOutline,
70 XmlPlaceholderSubtitle,
71 XmlPlaceholderText,
72 XmlPlaceholderGraphic,
73 XmlPlaceholderObject,
74 XmlPlaceholderChart,
75 XmlPlaceholderOrgchart,
76 XmlPlaceholderTable,
77 XmlPlaceholderPage,
78 XmlPlaceholderNotes,
79 XmlPlaceholderHandout,
80 XmlPlaceholderVerticalTitle,
81 XmlPlaceholderVerticalOutline
84 DECLARE_STL_STDKEY_SET( sal_Int32, SdXMLFormatMap );
86 //////////////////////////////////////////////////////////////////////////////
88 struct HeaderFooterPageSettingsImpl
90 rtl::OUString maStrHeaderDeclName;
91 rtl::OUString maStrFooterDeclName;
92 rtl::OUString maStrDateTimeDeclName;
95 struct DateTimeDeclImpl
97 rtl::OUString maStrText;
98 sal_Bool mbFixed;
99 sal_Int32 mnFormat;
103 //////////////////////////////////////////////////////////////////////////////
105 class SdXMLExport : public SvXMLExport
107 com::sun::star::uno::Reference< com::sun::star::container::XNameAccess > mxDocStyleFamilies;
108 com::sun::star::uno::Reference< com::sun::star::container::XIndexAccess > mxDocMasterPages;
109 com::sun::star::uno::Reference< com::sun::star::container::XIndexAccess > mxDocDrawPages;
110 sal_Int32 mnDocMasterPageCount;
111 sal_Int32 mnDocDrawPageCount;
112 sal_uInt32 mnShapeStyleInfoIndex;
113 sal_uInt32 mnObjectCount;
115 // temporary infos
116 ImpXMLEXPPageMasterList* mpPageMasterInfoList;
117 ImpXMLEXPPageMasterList* mpPageMasterUsageList;
118 ImpXMLEXPPageMasterList* mpNotesPageMasterUsageList;
119 ImpXMLEXPPageMasterInfo* mpHandoutPageMaster;
120 ImpXMLAutoLayoutInfoList* mpAutoLayoutInfoList;
122 com::sun::star::uno::Sequence< ::rtl::OUString > maDrawPagesAutoLayoutNames;
124 ::std::vector< ::rtl::OUString > maDrawPagesStyleNames;
125 ::std::vector< ::rtl::OUString > maDrawNotesPagesStyleNames;
126 ::std::vector< ::rtl::OUString > maMasterPagesStyleNames;
127 ::rtl::OUString maHandoutMasterStyleName;
128 ::std::vector< HeaderFooterPageSettingsImpl > maDrawPagesHeaderFooterSettings;
129 ::std::vector< HeaderFooterPageSettingsImpl > maDrawNotesPagesHeaderFooterSettings;
131 ::std::vector< ::rtl::OUString > maHeaderDeclsVector;
132 ::std::vector< ::rtl::OUString > maFooterDeclsVector;
133 ::std::vector< DateTimeDeclImpl > maDateTimeDeclsVector;
135 HeaderFooterPageSettingsImpl maHandoutPageHeaderFooterSettings;
137 XMLSdPropHdlFactory* mpSdPropHdlFactory;
138 XMLShapeExportPropertyMapper* mpPropertySetMapper;
139 XMLPageExportPropertyMapper* mpPresPagePropsMapper;
141 SdXMLFormatMap maUsedDateStyles; // this is a vector with the used formatings for date fields
142 SdXMLFormatMap maUsedTimeStyles; // this is a vector with the used formatings for time fields
144 sal_Bool mbIsDraw;
145 sal_Bool mbFamilyGraphicUsed;
146 sal_Bool mbFamilyPresentationUsed;
148 const rtl::OUString msZIndex;
149 const rtl::OUString msEmptyPres;
150 const rtl::OUString msModel;
151 const rtl::OUString msStartShape;
152 const rtl::OUString msEndShape;
153 const rtl::OUString msPageLayoutNames;
155 virtual void _ExportStyles(BOOL bUsed);
156 virtual void _ExportAutoStyles();
157 virtual void _ExportMasterStyles();
158 virtual void _ExportContent();
159 // #82003#
160 virtual void _ExportMeta();
162 ImpXMLEXPPageMasterInfo* ImpGetOrCreatePageMasterInfo( com::sun::star::uno::Reference< com::sun::star::drawing::XDrawPage > xMasterPage );
163 void ImpPrepPageMasterInfos();
164 void ImpPrepDrawMasterInfos();
165 void ImpWritePageMasterInfos();
166 void ImpPrepAutoLayoutInfos();
167 HeaderFooterPageSettingsImpl ImpPrepDrawPageHeaderFooterDecls( const com::sun::star::uno::Reference< com::sun::star::drawing::XDrawPage >& xDrawPage );
168 ImpXMLEXPPageMasterInfo* ImpGetPageMasterInfoByName(const rtl::OUString& rName);
170 void ImpPrepDrawPageInfos();
171 void ImpPrepMasterPageInfos();
172 void ImpWritePresentationStyles();
173 ::rtl::OUString ImpCreatePresPageStyleName( com::sun::star::uno::Reference<com::sun::star::drawing::XDrawPage> xDrawPage, bool bExportBackground = true );
175 BOOL ImpPrepAutoLayoutInfo(const com::sun::star::uno::Reference< com::sun::star::drawing::XDrawPage >& xPage, rtl::OUString& rName);
176 void ImpWriteAutoLayoutInfos();
177 void ImpWriteAutoLayoutPlaceholder(XmlPlaceholder ePl, const Rectangle& rRect);
178 void ImpWriteHeaderFooterDecls();
179 void ImplExportHeaderFooterDeclAttributes( const HeaderFooterPageSettingsImpl& aSettings );
181 void exportFormsElement( com::sun::star::uno::Reference< com::sun::star::drawing::XDrawPage > xDrawPage );
182 void exportPresentationSettings();
184 // #82003# helper function for recursive object count
185 sal_uInt32 ImpRecursiveObjectCount( com::sun::star::uno::Reference< com::sun::star::drawing::XShapes > xShapes);
187 rtl::OUString getNavigationOrder( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XDrawPage >& xDrawPage );
189 void collectAnnotationAutoStyles( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XDrawPage >& xDrawPage );
190 void exportAnnotations( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XDrawPage >& xDrawPage );
192 protected:
193 virtual void GetViewSettings(com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue>& aProps);
194 virtual void GetConfigurationSettings(com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue>& aProps);
196 public:
197 // #110680#
198 SdXMLExport(
199 const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xServiceFactory,
200 sal_Bool bIsDraw, sal_uInt16 nExportFlags = EXPORT_ALL );
201 virtual ~SdXMLExport();
203 void SetProgress(sal_Int32 nProg);
205 // XExporter
206 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);
208 // get factories and mappers
209 XMLSdPropHdlFactory* GetSdPropHdlFactory() const { return mpSdPropHdlFactory; }
210 XMLShapeExportPropertyMapper* GetPropertySetMapper() const { return mpPropertySetMapper; }
211 XMLPageExportPropertyMapper* GetPresPagePropsMapper() const { return mpPresPagePropsMapper; }
213 BOOL IsDraw() const { return mbIsDraw; }
214 BOOL IsImpress() const { return !mbIsDraw; }
216 BOOL IsFamilyGraphicUsed() const { return mbFamilyGraphicUsed; }
217 void SetFamilyGraphicUsed() { mbFamilyGraphicUsed = TRUE; }
218 BOOL IsFamilyPresentationUsed() const { return mbFamilyPresentationUsed; }
219 void SetFamilyPresentationUsed() { mbFamilyPresentationUsed = TRUE; }
221 virtual void addDataStyle(const sal_Int32 nNumberFormat, sal_Bool bTimeFormat = sal_False );
222 virtual void exportDataStyles();
223 virtual void exportAutoDataStyles();
224 virtual rtl::OUString getDataStyleName(const sal_Int32 nNumberFormat, sal_Bool bTimeFormat = sal_False ) const;
226 // XServiceInfo ( : SvXMLExport )
227 virtual ::rtl::OUString SAL_CALL getImplementationName() throw( ::com::sun::star::uno::RuntimeException );
230 #endif // _SDXMLEXP_HXX