Branch data Line data Source code
1 : : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : : /*************************************************************************
3 : : *
4 : : * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 : : *
6 : : * Copyright 2000, 2010 Oracle and/or its affiliates.
7 : : *
8 : : * OpenOffice.org - a multi-platform office productivity suite
9 : : *
10 : : * This file is part of OpenOffice.org.
11 : : *
12 : : * OpenOffice.org is free software: you can redistribute it and/or modify
13 : : * it under the terms of the GNU Lesser General Public License version 3
14 : : * only, as published by the Free Software Foundation.
15 : : *
16 : : * OpenOffice.org is distributed in the hope that it will be useful,
17 : : * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 : : * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 : : * GNU Lesser General Public License version 3 for more details
20 : : * (a copy is included in the LICENSE file that accompanied this code).
21 : : *
22 : : * You should have received a copy of the GNU Lesser General Public License
23 : : * version 3 along with OpenOffice.org. If not, see
24 : : * <http://www.openoffice.org/license.html>
25 : : * for a copy of the LGPLv3 License.
26 : : *
27 : : ************************************************************************/
28 : :
29 : : #ifndef _SDXMLEXP_IMPL_HXX
30 : : #define _SDXMLEXP_IMPL_HXX
31 : :
32 : : #include <xmloff/xmlexp.hxx>
33 : :
34 : : #include <com/sun/star/frame/XModel.hpp>
35 : : #include <com/sun/star/task/XStatusIndicator.hpp>
36 : : #include <com/sun/star/container/XNameAccess.hpp>
37 : : #include <com/sun/star/drawing/XDrawPage.hpp>
38 : : #include <comphelper/stl_types.hxx>
39 : :
40 : : #include <vector>
41 : :
42 : : //////////////////////////////////////////////////////////////////////////////
43 : :
44 : : class Rectangle;
45 : :
46 : : class ImpXMLEXPPageMasterInfo;
47 : : class ImpXMLAutoLayoutInfo;
48 : : class XMLSdPropHdlFactory;
49 : : class XMLShapeExportPropertyMapper;
50 : : class XMLPageExportPropertyMapper;
51 : :
52 : : typedef ::std::vector< ImpXMLEXPPageMasterInfo* > ImpXMLEXPPageMasterList;
53 : : typedef ::std::vector< ImpXMLAutoLayoutInfo* > ImpXMLAutoLayoutInfoList;
54 : :
55 : : //////////////////////////////////////////////////////////////////////////////
56 : :
57 : : enum XmlPlaceholder
58 : : {
59 : : XmlPlaceholderTitle,
60 : : XmlPlaceholderOutline,
61 : : XmlPlaceholderSubtitle,
62 : : XmlPlaceholderText,
63 : : XmlPlaceholderGraphic,
64 : : XmlPlaceholderObject,
65 : : XmlPlaceholderChart,
66 : : XmlPlaceholderOrgchart,
67 : : XmlPlaceholderTable,
68 : : XmlPlaceholderPage,
69 : : XmlPlaceholderNotes,
70 : : XmlPlaceholderHandout,
71 : : XmlPlaceholderVerticalTitle,
72 : : XmlPlaceholderVerticalOutline
73 : : };
74 : :
75 : : DECLARE_STL_STDKEY_SET( sal_Int32, SdXMLFormatMap );
76 : :
77 : : //////////////////////////////////////////////////////////////////////////////
78 : :
79 : 616 : struct HeaderFooterPageSettingsImpl
80 : : {
81 : : rtl::OUString maStrHeaderDeclName;
82 : : rtl::OUString maStrFooterDeclName;
83 : : rtl::OUString maStrDateTimeDeclName;
84 : : };
85 : :
86 : 0 : struct DateTimeDeclImpl
87 : : {
88 : : rtl::OUString maStrText;
89 : : sal_Bool mbFixed;
90 : : sal_Int32 mnFormat;
91 : : };
92 : :
93 : :
94 : : //////////////////////////////////////////////////////////////////////////////
95 : :
96 : : class SdXMLExport : public SvXMLExport
97 : : {
98 : : com::sun::star::uno::Reference< com::sun::star::container::XNameAccess > mxDocStyleFamilies;
99 : : com::sun::star::uno::Reference< com::sun::star::container::XIndexAccess > mxDocMasterPages;
100 : : com::sun::star::uno::Reference< com::sun::star::container::XIndexAccess > mxDocDrawPages;
101 : : sal_Int32 mnDocMasterPageCount;
102 : : sal_Int32 mnDocDrawPageCount;
103 : : sal_uInt32 mnShapeStyleInfoIndex;
104 : : sal_uInt32 mnObjectCount;
105 : :
106 : : // temporary infos
107 : : ImpXMLEXPPageMasterList* mpPageMasterInfoList;
108 : : ImpXMLEXPPageMasterList* mpPageMasterUsageList;
109 : : ImpXMLEXPPageMasterList* mpNotesPageMasterUsageList;
110 : : ImpXMLEXPPageMasterInfo* mpHandoutPageMaster;
111 : : ImpXMLAutoLayoutInfoList* mpAutoLayoutInfoList;
112 : :
113 : : com::sun::star::uno::Sequence< ::rtl::OUString > maDrawPagesAutoLayoutNames;
114 : :
115 : : ::std::vector< ::rtl::OUString > maDrawPagesStyleNames;
116 : : ::std::vector< ::rtl::OUString > maDrawNotesPagesStyleNames;
117 : : ::std::vector< ::rtl::OUString > maMasterPagesStyleNames;
118 : : ::rtl::OUString maHandoutMasterStyleName;
119 : : ::std::vector< HeaderFooterPageSettingsImpl > maDrawPagesHeaderFooterSettings;
120 : : ::std::vector< HeaderFooterPageSettingsImpl > maDrawNotesPagesHeaderFooterSettings;
121 : :
122 : : ::std::vector< ::rtl::OUString > maHeaderDeclsVector;
123 : : ::std::vector< ::rtl::OUString > maFooterDeclsVector;
124 : : ::std::vector< DateTimeDeclImpl > maDateTimeDeclsVector;
125 : :
126 : : HeaderFooterPageSettingsImpl maHandoutPageHeaderFooterSettings;
127 : :
128 : : XMLSdPropHdlFactory* mpSdPropHdlFactory;
129 : : XMLShapeExportPropertyMapper* mpPropertySetMapper;
130 : : XMLPageExportPropertyMapper* mpPresPagePropsMapper;
131 : :
132 : : SdXMLFormatMap maUsedDateStyles; // this is a vector with the used formatings for date fields
133 : : SdXMLFormatMap maUsedTimeStyles; // this is a vector with the used formatings for time fields
134 : :
135 : : sal_Bool mbIsDraw;
136 : : sal_Bool mbFamilyGraphicUsed;
137 : : sal_Bool mbFamilyPresentationUsed;
138 : :
139 : : const rtl::OUString msZIndex;
140 : : const rtl::OUString msEmptyPres;
141 : : const rtl::OUString msModel;
142 : : const rtl::OUString msStartShape;
143 : : const rtl::OUString msEndShape;
144 : : const rtl::OUString msPageLayoutNames;
145 : :
146 : : virtual void _ExportStyles(sal_Bool bUsed);
147 : : virtual void _ExportAutoStyles();
148 : : virtual void _ExportMasterStyles();
149 : : virtual void _ExportContent();
150 : : // #82003#
151 : : virtual void _ExportMeta();
152 : :
153 : : ImpXMLEXPPageMasterInfo* ImpGetOrCreatePageMasterInfo( com::sun::star::uno::Reference< com::sun::star::drawing::XDrawPage > xMasterPage );
154 : : void ImpPrepPageMasterInfos();
155 : : void ImpPrepDrawMasterInfos();
156 : : void ImpWritePageMasterInfos();
157 : : void ImpPrepAutoLayoutInfos();
158 : : HeaderFooterPageSettingsImpl ImpPrepDrawPageHeaderFooterDecls( const com::sun::star::uno::Reference< com::sun::star::drawing::XDrawPage >& xDrawPage );
159 : : ImpXMLEXPPageMasterInfo* ImpGetPageMasterInfoByName(const rtl::OUString& rName);
160 : :
161 : : void ImpPrepDrawPageInfos();
162 : : void ImpPrepMasterPageInfos();
163 : : void ImpWritePresentationStyles();
164 : : ::rtl::OUString ImpCreatePresPageStyleName( com::sun::star::uno::Reference<com::sun::star::drawing::XDrawPage> xDrawPage, bool bExportBackground = true );
165 : :
166 : : sal_Bool ImpPrepAutoLayoutInfo(const com::sun::star::uno::Reference< com::sun::star::drawing::XDrawPage >& xPage, rtl::OUString& rName);
167 : : void ImpWriteAutoLayoutInfos();
168 : : void ImpWriteAutoLayoutPlaceholder(XmlPlaceholder ePl, const Rectangle& rRect);
169 : : void ImpWriteHeaderFooterDecls();
170 : : void ImplExportHeaderFooterDeclAttributes( const HeaderFooterPageSettingsImpl& aSettings );
171 : :
172 : : void exportFormsElement( com::sun::star::uno::Reference< com::sun::star::drawing::XDrawPage > xDrawPage );
173 : : void exportPresentationSettings();
174 : :
175 : : // #82003# helper function for recursive object count
176 : : sal_uInt32 ImpRecursiveObjectCount( com::sun::star::uno::Reference< com::sun::star::drawing::XShapes > xShapes);
177 : :
178 : : rtl::OUString getNavigationOrder( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XDrawPage >& xDrawPage );
179 : :
180 : : void collectAnnotationAutoStyles( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XDrawPage >& xDrawPage );
181 : : void exportAnnotations( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XDrawPage >& xDrawPage );
182 : :
183 : : protected:
184 : : virtual void GetViewSettings(com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue>& aProps);
185 : : virtual void GetConfigurationSettings(com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue>& aProps);
186 : :
187 : : public:
188 : : // #110680#
189 : : SdXMLExport(
190 : : const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xServiceFactory,
191 : : sal_Bool bIsDraw, sal_uInt16 nExportFlags = EXPORT_ALL );
192 : : virtual ~SdXMLExport();
193 : :
194 : : void SetProgress(sal_Int32 nProg);
195 : :
196 : : // XExporter
197 : : 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);
198 : :
199 : : // get factories and mappers
200 : : XMLSdPropHdlFactory* GetSdPropHdlFactory() const { return mpSdPropHdlFactory; }
201 : 152 : XMLShapeExportPropertyMapper* GetPropertySetMapper() const { return mpPropertySetMapper; }
202 : 94 : XMLPageExportPropertyMapper* GetPresPagePropsMapper() const { return mpPresPagePropsMapper; }
203 : :
204 : 20 : sal_Bool IsDraw() const { return mbIsDraw; }
205 : 414 : sal_Bool IsImpress() const { return !mbIsDraw; }
206 : :
207 : : sal_Bool IsFamilyGraphicUsed() const { return mbFamilyGraphicUsed; }
208 : : void SetFamilyGraphicUsed() { mbFamilyGraphicUsed = sal_True; }
209 : : sal_Bool IsFamilyPresentationUsed() const { return mbFamilyPresentationUsed; }
210 : : void SetFamilyPresentationUsed() { mbFamilyPresentationUsed = sal_True; }
211 : :
212 : : virtual void addDataStyle(const sal_Int32 nNumberFormat, sal_Bool bTimeFormat = sal_False );
213 : : virtual void exportDataStyles();
214 : : virtual void exportAutoDataStyles();
215 : : virtual rtl::OUString getDataStyleName(const sal_Int32 nNumberFormat, sal_Bool bTimeFormat = sal_False ) const;
216 : :
217 : : // XServiceInfo ( : SvXMLExport )
218 : : virtual ::rtl::OUString SAL_CALL getImplementationName() throw( ::com::sun::star::uno::RuntimeException );
219 : : };
220 : :
221 : : #endif // _SDXMLEXP_HXX
222 : :
223 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|