xref: /aoo4110/main/xmloff/inc/xmloff/txtparae.hxx (revision b1cdbd2c)
1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 #ifndef _XMLOFF_TEXTPARAE_HXX_
24 #define _XMLOFF_TEXTPARAE_HXX_
25 
26 #include "sal/config.h"
27 #include "xmloff/dllapi.h"
28 #include <rtl/ustring.hxx>
29 #include <com/sun/star/uno/Reference.h>
30 #include <com/sun/star/uno/Sequence.h>
31 #include <com/sun/star/beans/PropertyValue.hpp>
32 #include <xmloff/uniref.hxx>
33 #include <xmloff/xmlexppr.hxx>
34 #include <xmloff/styleexp.hxx>
35 #include <xmloff/xmltoken.hxx>
36 #include <xmloff/SinglePropertySetInfoCache.hxx>
37 #include <xmloff/XMLStringVector.hxx>
38 
39 // --> OD 2008-04-25 #refactorlists#
40 class XMLTextListsHelper;
41 #include <vector>
42 // <--
43 
44 class SvXMLExport;
45 class SvXMLAutoStylePoolP;
46 class XMLTextFieldExport;
47 class OUStrings_Impl;
48 class OUStringsSort_Impl;
49 class XMLTextNumRuleInfo;
50 class XMLTextListAutoStylePool;
51 class SvLongs;
52 class XMLSectionExport;
53 class XMLIndexMarkExport;
54 class XMLRedlineExport;
55 struct XMLPropertyState;
56 class MultiPropertySetHelper;
57 
58 namespace com { namespace sun { namespace star
59 {
60 	namespace beans { class XPropertySet; class XPropertyState;
61 					  class XPropertySetInfo; }
62 	namespace container { class XEnumerationAccess; class XEnumeration; class XIndexAccess; }
63 	namespace text { class XTextContent; class XTextRange; class XText;
64                      class XFootnote; class XTextFrame; class XTextSection;
65                      class XTextField;
66 					 class XDocumentIndex; class XTextShapesSupplier; }
67 } } }
68 
69 namespace xmloff
70 {
71     class OFormLayerXMLExport;
72     class BoundFrameSets;
73 }
74 
75 class XMLOFF_DLLPUBLIC XMLTextParagraphExport : public XMLStyleExport
76 {
77 
78 //	SvXMLExport& rExport;
79 	SvXMLAutoStylePoolP& rAutoStylePool;
80 	UniReference < SvXMLExportPropertyMapper > xParaPropMapper;
81 	UniReference < SvXMLExportPropertyMapper > xTextPropMapper;
82 	UniReference < SvXMLExportPropertyMapper > xFramePropMapper;
83 	UniReference < SvXMLExportPropertyMapper > xAutoFramePropMapper;
84 	UniReference < SvXMLExportPropertyMapper > xSectionPropMapper;
85 	UniReference < SvXMLExportPropertyMapper > xRubyPropMapper;
86 
87     const ::std::auto_ptr< ::xmloff::BoundFrameSets > pBoundFrameSets;
88 	XMLTextFieldExport			*pFieldExport;
89 	OUStrings_Impl				*pListElements;
90     // --> OD 2008-05-07 #refactorlists# - no longer needed
91 //    OUStringsSort_Impl          *pExportedLists;
92     // <--
93 	XMLTextListAutoStylePool	*pListAutoPool;
94 	XMLSectionExport			*pSectionExport;
95 	XMLIndexMarkExport			*pIndexMarkExport;
96 
97 	/// may be NULL (if no redlines should be exported; e.g. in block mode)
98 	XMLRedlineExport			*pRedlineExport;
99 	XMLStringVector				*pHeadingStyles;
100 
101 	sal_Bool					bProgress;
102 
103 	sal_Bool					bBlock;
104 
105 	// keep track of open rubies
106 	::rtl::OUString				sOpenRubyText;
107 	::rtl::OUString				sOpenRubyCharStyle;
108 	sal_Bool					bOpenRuby;
109 
110     XMLTextListsHelper* mpTextListsHelper;
111     ::std::vector< XMLTextListsHelper* > maTextListsHelperStack;
112 
113 	enum FrameType { FT_TEXT, FT_GRAPHIC, FT_EMBEDDED, FT_SHAPE };
114 
115 
116     void exportTextRangeSpan(
117             const ::com::sun::star::uno::Reference< com::sun::star::text::XTextRange > & rTextRange,
118             ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > & xPropSet,
119             ::com::sun::star::uno::Reference < ::com::sun::star::beans::XPropertySetInfo > & xPropSetInfo,
120             const sal_Bool bIsUICharStyle,
121             const sal_Bool bHasAutoStyle,
122             const ::rtl::OUString& sStyle,
123             sal_Bool& rPrevCharIsSpace );
124 
125 protected:
126 
127 	const ::rtl::OUString sActualSize;
128     // --> OD 2009-07-22 #i73249#
129 //    const ::rtl::OUString sAlternativeText;
130     const ::rtl::OUString sTitle;
131     const ::rtl::OUString sDescription;
132     // <--
133 	const ::rtl::OUString sAnchorCharStyleName;
134 	const ::rtl::OUString sAnchorPageNo;
135 	const ::rtl::OUString sAnchorType;
136 	const ::rtl::OUString sBeginNotice;
137 	const ::rtl::OUString sBookmark;
138 	const ::rtl::OUString sCategory;
139 	const ::rtl::OUString sChainNextName;
140 	const ::rtl::OUString sCharStyleName;
141 	const ::rtl::OUString sCharStyleNames;
142 	const ::rtl::OUString sContourPolyPolygon;
143 	const ::rtl::OUString sDocumentIndex;
144 	const ::rtl::OUString sDocumentIndexMark;
145 	const ::rtl::OUString sEndNotice;
146 	const ::rtl::OUString sFootnote;
147 	const ::rtl::OUString sFootnoteCounting;
148 	const ::rtl::OUString sFrame;
149 	const ::rtl::OUString sFrameHeightAbsolute;
150 	const ::rtl::OUString sFrameHeightPercent;
151 	const ::rtl::OUString sFrameStyleName;
152 	const ::rtl::OUString sFrameWidthAbsolute;
153 	const ::rtl::OUString sFrameWidthPercent;
154 	const ::rtl::OUString sGraphicFilter;
155 	const ::rtl::OUString sGraphicRotation;
156 	const ::rtl::OUString sGraphicURL;
157 	const ::rtl::OUString sReplacementGraphicURL;
158 	const ::rtl::OUString sHeight;
159 	const ::rtl::OUString sHoriOrient;
160 	const ::rtl::OUString sHoriOrientPosition;
161 	const ::rtl::OUString sHyperLinkName;
162 	const ::rtl::OUString sHyperLinkTarget;
163 	const ::rtl::OUString sHyperLinkURL;
164 	const ::rtl::OUString sIsAutomaticContour;
165 	const ::rtl::OUString sIsCollapsed;
166 	const ::rtl::OUString sIsPixelContour;
167 	const ::rtl::OUString sIsStart;
168 	const ::rtl::OUString sIsSyncHeightToWidth;
169 	const ::rtl::OUString sIsSyncWidthToHeight;
170 	const ::rtl::OUString sNumberingRules;
171 	const ::rtl::OUString sNumberingType;
172 	const ::rtl::OUString sPageDescName;
173 	const ::rtl::OUString sPageStyleName;
174 	const ::rtl::OUString sParaChapterNumberingLevel;
175 	const ::rtl::OUString sParaConditionalStyleName;
176 	const ::rtl::OUString sParagraphService;
177 	const ::rtl::OUString sParaStyleName;
178 	const ::rtl::OUString sPositionEndOfDoc;
179 	const ::rtl::OUString sPrefix;
180 	const ::rtl::OUString sRedline;
181 	const ::rtl::OUString sReferenceId;
182 	const ::rtl::OUString sReferenceMark;
183 	const ::rtl::OUString sRelativeHeight;
184 	const ::rtl::OUString sRelativeWidth;
185 	const ::rtl::OUString sRuby;
186 	const ::rtl::OUString sRubyAdjust;
187 	const ::rtl::OUString sRubyCharStyleName;
188 	const ::rtl::OUString sRubyText;
189 	const ::rtl::OUString sServerMap;
190 	const ::rtl::OUString sShapeService;
191 	const ::rtl::OUString sSizeType;
192     const ::rtl::OUString sSoftPageBreak;
193 	const ::rtl::OUString sStartAt;
194 	const ::rtl::OUString sSuffix;
195 	const ::rtl::OUString sTableService;
196 	const ::rtl::OUString sText;
197 	const ::rtl::OUString sTextContentService;
198 	const ::rtl::OUString sTextEmbeddedService;
199 	const ::rtl::OUString sTextEndnoteService;
200 	const ::rtl::OUString sTextField;
201 	const ::rtl::OUString sTextFieldService;
202 	const ::rtl::OUString sTextFrameService;
203 	const ::rtl::OUString sTextGraphicService;
204 	const ::rtl::OUString sTextPortionType;
205 	const ::rtl::OUString sTextSection;
206 	const ::rtl::OUString sUnvisitedCharStyleName;
207 	const ::rtl::OUString sVertOrient;
208 	const ::rtl::OUString sVertOrientPosition;
209 	const ::rtl::OUString sVisitedCharStyleName;
210 	const ::rtl::OUString sWidth;
211 	const ::rtl::OUString sWidthType;
212 	const ::rtl::OUString sTextFieldStart;
213 	const ::rtl::OUString sTextFieldEnd;
214 	const ::rtl::OUString sTextFieldStartEnd;
215 
216 	SinglePropertySetInfoCache aCharStyleNamesPropInfoCache;
217 
218 //	SvXMLExport& GetExport() { return rExport; }
219 //	const SvXMLExport& GetExport() const  { return rExport; }
220 
GetParaPropMapper() const221 	UniReference < SvXMLExportPropertyMapper > GetParaPropMapper() const
222 	{
223 		return xParaPropMapper;
224 	}
225 
GetTextPropMapper() const226 	UniReference < SvXMLExportPropertyMapper > GetTextPropMapper() const
227 	{
228 		return xTextPropMapper;
229 	}
230 
GetFramePropMapper() const231 	UniReference < SvXMLExportPropertyMapper > GetFramePropMapper() const
232 	{
233 		return xFramePropMapper;
234 	}
GetAutoFramePropMapper() const235 	UniReference < SvXMLExportPropertyMapper > GetAutoFramePropMapper() const
236 	{
237 		return xAutoFramePropMapper;
238 	}
GetSectionPropMapper() const239 	UniReference < SvXMLExportPropertyMapper > GetSectionPropMapper() const
240 	{
241 		return xSectionPropMapper;
242 	}
GetRubyPropMapper() const243 	UniReference < SvXMLExportPropertyMapper > GetRubyPropMapper() const
244 	{
245 		return xRubyPropMapper;
246 	}
247 
248 
GetAutoStylePool()249 	SvXMLAutoStylePoolP& GetAutoStylePool() { return rAutoStylePool; }
GetAutoStylePool() const250 	const SvXMLAutoStylePoolP& GetAutoStylePool() const { return rAutoStylePool; }
251 
252 public:
253 	::rtl::OUString FindTextStyle(
254 			const ::com::sun::star::uno::Reference <
255 				::com::sun::star::beans::XPropertySet > & rPropSet,
256 			sal_Bool& rbHasCharStyle ) const;
257 	::rtl::OUString FindTextStyleAndHyperlink(
258 			const ::com::sun::star::uno::Reference <
259 				::com::sun::star::beans::XPropertySet > & rPropSet,
260             sal_Bool& rbHyperlink,
261 			sal_Bool& rbHasCharStyle,
262             sal_Bool& rbHasAutoStyle,
263 			const XMLPropertyState** pAddState = NULL) const;
264 	sal_Bool addHyperlinkAttributes(
265 		const ::com::sun::star::uno::Reference <
266 				::com::sun::star::beans::XPropertySet > & rPropSet,
267 		const ::com::sun::star::uno::Reference <
268 				::com::sun::star::beans::XPropertyState > & rPropState,
269 		const ::com::sun::star::uno::Reference <
270 				::com::sun::star::beans::XPropertySetInfo > & rPropSetInfo );
271 
272     void exportTextRangeEnumeration(
273         const ::com::sun::star::uno::Reference <
274             ::com::sun::star::container::XEnumeration > & rRangeEnum,
275         sal_Bool bAutoStyles, sal_Bool bProgress,
276         sal_Bool bPrvChrIsSpc = sal_True );
277 
278 protected:
279 
280 	sal_Int32 addTextFrameAttributes(
281 		const ::com::sun::star::uno::Reference <
282 				::com::sun::star::beans::XPropertySet >& rPropSet,
283 		sal_Bool bShape,
284 		::rtl::OUString *pMinHeightValue = 0 );
285 
286 	virtual void exportStyleAttributes(
287 		const ::com::sun::star::uno::Reference<
288 				::com::sun::star::style::XStyle > & rStyle );
289 
290     void exportPageFrames( sal_Bool bAutoStyles, sal_Bool bProgress );
291     void exportFrameFrames( sal_Bool bAutoStyles, sal_Bool bProgress,
292 			const ::com::sun::star::uno::Reference <
293 					::com::sun::star::text::XTextFrame > *pParentTxtFrame = 0 );
294 
295 	void exportNumStyles( sal_Bool bUsed );
296 
297 	void exportText(
298 		const ::com::sun::star::uno::Reference <
299 			::com::sun::star::text::XText > & rText,
300         sal_Bool bAutoStyles, sal_Bool bProgress, sal_Bool bExportParagraph );
301 
302     void exportText(
303 		const ::com::sun::star::uno::Reference <
304 			::com::sun::star::text::XText > & rText,
305 		const ::com::sun::star::uno::Reference <
306 			::com::sun::star::text::XTextSection > & rBaseSection,
307         sal_Bool bAutoStyles, sal_Bool bProgress, sal_Bool bExportParagraph );
308 
309     sal_Bool exportTextContentEnumeration(
310 		const ::com::sun::star::uno::Reference <
311 			::com::sun::star::container::XEnumeration > & rContentEnum,
312 		sal_Bool bAutoStyles,
313 		const ::com::sun::star::uno::Reference <
314 			::com::sun::star::text::XTextSection > & rBaseSection,
315         sal_Bool bProgress,
316 		sal_Bool bExportParagraph = sal_True,
317 		const ::com::sun::star::uno::Reference <
318 			::com::sun::star::beans::XPropertySet > *pRangePropSet = 0,
319         sal_Bool bExportLevels = sal_True );
320 	void exportParagraph(
321 		const ::com::sun::star::uno::Reference <
322 			::com::sun::star::text::XTextContent > & rTextContent,
323         sal_Bool bAutoStyles, sal_Bool bProgress,
324         sal_Bool bExportParagraph,
325         MultiPropertySetHelper& rPropSetHelper);
326 	virtual void exportTable(
327 		const ::com::sun::star::uno::Reference <
328 			::com::sun::star::text::XTextContent > & rTextContent,
329         sal_Bool bAutoStyles, sal_Bool bProgress );
330 
331 	void exportTextField(
332 		const ::com::sun::star::uno::Reference <
333 			::com::sun::star::text::XTextRange > & rTextRange,
334         sal_Bool bAutoStyles, sal_Bool bProgress );
335 
336     void exportTextField(
337         const ::com::sun::star::uno::Reference <
338             ::com::sun::star::text::XTextField> & xTextField,
339         const sal_Bool bAutoStyles, const sal_Bool bProgress,
340         const sal_Bool bRecursive );
341 
342 	void exportAnyTextFrame(
343 		const ::com::sun::star::uno::Reference <
344 			::com::sun::star::text::XTextContent > & rTextContent,
345 		FrameType eTxpe,
346         sal_Bool bAutoStyles, sal_Bool bProgress, sal_Bool bExportContent,
347 		const ::com::sun::star::uno::Reference <
348 			::com::sun::star::beans::XPropertySet > *pRangePropSet = 0 );
349 	void _exportTextFrame(
350 		const ::com::sun::star::uno::Reference <
351 			::com::sun::star::beans::XPropertySet > & rPropSet,
352 		const ::com::sun::star::uno::Reference <
353 			::com::sun::star::beans::XPropertySetInfo > & rPropSetInfo,
354         sal_Bool bProgress );
355 	inline void exportTextFrame(
356 		const ::com::sun::star::uno::Reference <
357 			::com::sun::star::text::XTextContent > & rTextContent,
358         sal_Bool bAutoStyles, sal_Bool bProgress, sal_Bool bExportContent,
359 		const ::com::sun::star::uno::Reference <
360 			::com::sun::star::beans::XPropertySet > *pRangePropSet = 0 );
361 	inline void exportShape(
362 		const ::com::sun::star::uno::Reference <
363 			::com::sun::star::text::XTextContent > & rTextContent,
364 		sal_Bool bAutoStyles,
365 		const ::com::sun::star::uno::Reference <
366 			::com::sun::star::beans::XPropertySet > *pRangePropSet = 0  );
367 
368 	void exportContour(
369 		const ::com::sun::star::uno::Reference <
370 			::com::sun::star::beans::XPropertySet > & rPropSet,
371 		const ::com::sun::star::uno::Reference <
372 			::com::sun::star::beans::XPropertySetInfo > & rPropSetInfo );
373 	void _exportTextGraphic(
374 		const ::com::sun::star::uno::Reference <
375 			::com::sun::star::beans::XPropertySet > & rPropSet,
376 		const ::com::sun::star::uno::Reference <
377 			::com::sun::star::beans::XPropertySetInfo > & rPropSetInfo );
378 	inline void exportTextGraphic(
379 		const ::com::sun::star::uno::Reference <
380 			::com::sun::star::text::XTextContent > & rTextContent,
381 		sal_Bool bAutoStyles,
382 		const ::com::sun::star::uno::Reference <
383 			::com::sun::star::beans::XPropertySet > *pRangePropSet = 0  );
384 
385 	virtual void _collectTextEmbeddedAutoStyles(
386 		const ::com::sun::star::uno::Reference <
387 			::com::sun::star::beans::XPropertySet > & rPropSet );
388 	virtual void _exportTextEmbedded(
389 		const ::com::sun::star::uno::Reference <
390 			::com::sun::star::beans::XPropertySet > & rPropSet,
391 		const ::com::sun::star::uno::Reference <
392 			::com::sun::star::beans::XPropertySetInfo > & rPropSetInfo );
393 	inline void exportTextEmbedded(
394 		const ::com::sun::star::uno::Reference <
395 			::com::sun::star::text::XTextContent > & rTextContent,
396 		sal_Bool bAutoStyles,
397 		const ::com::sun::star::uno::Reference <
398 			::com::sun::star::beans::XPropertySet > *pRangePropSet = 0  );
399 	virtual void setTextEmbeddedGraphicURL(
400 		const ::com::sun::star::uno::Reference <
401 				::com::sun::star::beans::XPropertySet >& rPropSet,
402 		::rtl::OUString& rStreamName ) const;
403 
404 	/// export a footnote and styles
405 	void exportTextFootnote(
406 		const ::com::sun::star::uno::Reference<
407 			::com::sun::star::beans::XPropertySet > & rPropSet,
408 		const ::rtl::OUString& sString,
409         sal_Bool bAutoStyles, sal_Bool bProgress );
410 
411 	/// helper for exportTextFootnote
412 	void exportTextFootnoteHelper(
413 		const ::com::sun::star::uno::Reference<
414 			::com::sun::star::text::XFootnote > & rPropSet,
415 		const ::com::sun::star::uno::Reference<
416 			::com::sun::star::text::XText> & rText,
417 		const ::rtl::OUString& sString,
418 		sal_Bool bAutoStyles,
419         sal_Bool bIsEndnote, sal_Bool bProgress );
420 
421 	/// export footnote and endnote configuration elements
422 	void exportTextFootnoteConfiguration();
423 
424 	void exportTextFootnoteConfigurationHelper(
425 		const ::com::sun::star::uno::Reference<
426 			::com::sun::star::beans::XPropertySet> & rFootnoteSupplier,
427 		sal_Bool bIsEndnote);
428 
429 	void exportTextMark(
430 		const ::com::sun::star::uno::Reference<
431 			::com::sun::star::beans::XPropertySet> & xPropSet,
432 		const ::rtl::OUString sProperty,
433 		const enum ::xmloff::token::XMLTokenEnum pElements[],
434 		sal_Bool bAutoStyles);
435 
436 	void exportIndexMark(
437 		const ::com::sun::star::uno::Reference<
438 			::com::sun::star::beans::XPropertySet> & rPropSet,
439 		sal_Bool bAutoStyles);
440 
441 	void exportSoftPageBreak(
442 		const ::com::sun::star::uno::Reference<
443 			::com::sun::star::beans::XPropertySet> & rPropSet,
444 		sal_Bool bAutoStyles);
445 
446 	void exportTextRange(
447 		const ::com::sun::star::uno::Reference <
448 			::com::sun::star::text::XTextRange > & rTextRange,
449 		sal_Bool bAutoStyles,
450 		sal_Bool& rPrevCharWasSpace	);
451 
452 	void exportListChange( const XMLTextNumRuleInfo& rPrvInfo,
453 		    			   const XMLTextNumRuleInfo& rNextInfo );
454 
455 	/// check if current section or current list has changed;
456 	/// calls exortListChange as appropriate
457 	void exportListAndSectionChange(
458 		::com::sun::star::uno::Reference <
459 			::com::sun::star::text::XTextSection > & rOldSection,
460 		const ::com::sun::star::uno::Reference <
461 			::com::sun::star::text::XTextSection > & rNewSection,
462 		const XMLTextNumRuleInfo& rOldList,
463 		const XMLTextNumRuleInfo& rNewList,
464 		sal_Bool bAutoStyles );
465 
466 	/// overload for exportListAndSectionChange;
467 	/// takes new content rather than new section.
468 	void exportListAndSectionChange(
469 		::com::sun::star::uno::Reference <
470 			::com::sun::star::text::XTextSection > & rOldSection,
471 		const ::com::sun::star::uno::Reference <
472 			::com::sun::star::text::XTextContent > & rNewContent,
473 		const XMLTextNumRuleInfo& rOldList,
474 		const XMLTextNumRuleInfo& rNewList,
475 		sal_Bool bAutoStyles );
476 	void exportListAndSectionChange(
477 		::com::sun::star::uno::Reference <
478 			::com::sun::star::text::XTextSection > & rOldSection,
479 		MultiPropertySetHelper& rPropSetHelper,
480 		sal_Int16 nTextSectionId,
481 		const ::com::sun::star::uno::Reference <
482 			::com::sun::star::text::XTextContent > & rNewContent,
483 		const XMLTextNumRuleInfo& rOldList,
484 		const XMLTextNumRuleInfo& rNewList,
485 		sal_Bool bAutoStyles );
486 
487 	/// export a redline text portion
488 	void exportChange(
489 		const ::com::sun::star::uno::Reference <
490 			::com::sun::star::beans::XPropertySet > & rPropSet,
491 		sal_Bool bAutoStyle);
492 
493 	/// export a ruby
494 	void exportRuby(
495 		const ::com::sun::star::uno::Reference<
496 			::com::sun::star::beans::XPropertySet> & rPortionPropSet,
497 		sal_Bool bAutoStyles );
498 
499     /// export a text:meta
500     void exportMeta(
501         const ::com::sun::star::uno::Reference<
502             ::com::sun::star::beans::XPropertySet> & i_xPortion,
503         sal_Bool i_bAutoStyles, sal_Bool i_isProgress );
504 
505 public:
506 
507 	XMLTextParagraphExport(
508 			SvXMLExport& rExp,
509 		   	SvXMLAutoStylePoolP & rASP
510 						  );
511 	virtual ~XMLTextParagraphExport();
512 
513 	/// add autostyle for specified family
514 	void Add(
515 		sal_uInt16 nFamily,
516 	    MultiPropertySetHelper& rPropSetHelper,
517 		const ::com::sun::star::uno::Reference <
518 			::com::sun::star::beans::XPropertySet > & rPropSet,
519 		const XMLPropertyState** pAddState = NULL );
520 	void Add(
521 		sal_uInt16 nFamily,
522 		const ::com::sun::star::uno::Reference <
523 			::com::sun::star::beans::XPropertySet > & rPropSet,
524         const XMLPropertyState** pAddState = NULL, bool bDontSeek = false );
525 
526 	/// find style name for specified family and parent
527 	::rtl::OUString Find(
528 		sal_uInt16 nFamily,
529 		const ::com::sun::star::uno::Reference <
530 			::com::sun::star::beans::XPropertySet > & rPropSet,
531 		const ::rtl::OUString& rParent,
532 		const XMLPropertyState** pAddState = NULL ) const;
533 
534 	static SvXMLExportPropertyMapper *CreateShapeExtPropMapper(
535 												SvXMLExport& rExport );
536 	static SvXMLExportPropertyMapper *CreateCharExtPropMapper(
537 												SvXMLExport& rExport);
538 	static SvXMLExportPropertyMapper *CreateParaExtPropMapper(
539 												SvXMLExport& rExport);
540 	static SvXMLExportPropertyMapper *CreateParaDefaultExtPropMapper(
541 												SvXMLExport& rExport);
542 
543 	// This methods exports all (or all used) styles
544 	void exportTextStyles( sal_Bool bUsed
545 						   , sal_Bool bProg = sal_False
546 						 );
547 
548 	/// This method exports (text field) declarations etc.
549 	void exportTextDeclarations();
550 
551 	/// export the (text field) declarations for a particular XText
552 	void exportTextDeclarations(
553 		const ::com::sun::star::uno::Reference <
554 			::com::sun::star::text::XText > & rText );
555 
556 	/// true: export only those declarations that are used;
557 	/// false: export all declarations
558 	void exportUsedDeclarations( sal_Bool bOnlyUsed );
559 
560 	/// Export the list of change information (enclosed by <tracked-changes>)
561 	/// (or the necessary automatic styles)
562 	void exportTrackedChanges(sal_Bool bAutoStyle);
563 
564 	/// Export the list of change information (enclosed by <tracked-changes>)
565 	/// (or the necessary automatic styles)
566 	void exportTrackedChanges(const ::com::sun::star::uno::Reference <
567 								  ::com::sun::star::text::XText > & rText,
568 							  sal_Bool bAutoStyle );
569 
570 	/// Record tracked changes for this particular XText
571 	/// (empty reference stop recording)
572 	/// This should be used if tracked changes for e.g. footers are to
573 	/// be exported seperately via the exportTrackedChanges(sal_Bool,
574 	/// Reference<XText>) method.
575 	void recordTrackedChangesForXText(
576 		const ::com::sun::star::uno::Reference <
577 			::com::sun::star::text::XText > & rText );
578 
579 
580 	/// Stop recording tracked changes.
581 	/// This is the same as calling recordTrackedChanges(...) with an
582 	/// empty reference.
583 	void recordTrackedChangesNoXText();
584 
585 
586 	// This method exports the given OUString
587 	void exportText(
588 		const ::rtl::OUString& rText,
589 		sal_Bool& rPrevCharWasSpace );
590 
591 	// This method collects all automatic styles for the given XText
collectTextAutoStyles(const::com::sun::star::uno::Reference<::com::sun::star::text::XText> & rText,sal_Bool bIsProgress=sal_False,sal_Bool bExportParagraph=sal_True)592 	void collectTextAutoStyles(
593 		const ::com::sun::star::uno::Reference <
594 			::com::sun::star::text::XText > & rText,
595         sal_Bool bIsProgress = sal_False,
596         sal_Bool bExportParagraph = sal_True )
597     {
598         exportText( rText, sal_True, bIsProgress, bExportParagraph );
599     }
600 
collectTextAutoStyles(const::com::sun::star::uno::Reference<::com::sun::star::text::XText> & rText,const::com::sun::star::uno::Reference<::com::sun::star::text::XTextSection> & rBaseSection,sal_Bool bIsProgress=sal_False,sal_Bool bExportParagraph=sal_True)601 	void collectTextAutoStyles(
602 		const ::com::sun::star::uno::Reference <
603 			::com::sun::star::text::XText > & rText,
604 		const ::com::sun::star::uno::Reference <
605 			::com::sun::star::text::XTextSection > & rBaseSection,
606 		sal_Bool bIsProgress = sal_False,
607 		sal_Bool bExportParagraph = sal_True )
608 	{
609 		exportText( rText, rBaseSection, sal_True, bIsProgress, bExportParagraph );
610 	}
611 
612     // It the model implements the xAutoStylesSupplier interface, the automatic
613     // styles can exported without iterating over the text portions
614     bool collectTextAutoStylesOptimized(
615         sal_Bool bIsProgress = sal_False );
616 
617 	// This method exports all automatic styles that have been collected.
618 	virtual void exportTextAutoStyles();
619 
620 	void exportEvents( const ::com::sun::star::uno::Reference < com::sun::star::beans::XPropertySet > & rPropSet );
621     // --> OD 2009-07-22 #i73249#
622 //    void exportAlternativeText( const ::com::sun::star::uno::Reference < ::com::sun::star::beans::XPropertySet > & rPropSet,
623 //                                const ::com::sun::star::uno::Reference < ::com::sun::star::beans::XPropertySetInfo > & rPropSetInfo );
624     void exportTitleAndDescription( const ::com::sun::star::uno::Reference < ::com::sun::star::beans::XPropertySet > & rPropSet,
625                                     const ::com::sun::star::uno::Reference < ::com::sun::star::beans::XPropertySetInfo > & rPropSetInfo );
626     // <--
627 
628 	// This method exports the given XText
exportText(const::com::sun::star::uno::Reference<::com::sun::star::text::XText> & rText,sal_Bool bIsProgress=sal_False,sal_Bool bExportParagraph=sal_True)629 	void exportText(
630 		const ::com::sun::star::uno::Reference <
631 			::com::sun::star::text::XText > & rText,
632 		sal_Bool bIsProgress = sal_False,
633 		sal_Bool bExportParagraph = sal_True)
634 	{
635 		exportText( rText, sal_False, bIsProgress, bExportParagraph );
636 	}
637 
exportText(const::com::sun::star::uno::Reference<::com::sun::star::text::XText> & rText,const::com::sun::star::uno::Reference<::com::sun::star::text::XTextSection> & rBaseSection,sal_Bool bIsProgress=sal_False,sal_Bool bExportParagraph=sal_True)638 	void exportText(
639 		const ::com::sun::star::uno::Reference <
640 			::com::sun::star::text::XText > & rText,
641 		const ::com::sun::star::uno::Reference <
642 			::com::sun::star::text::XTextSection > & rBaseSection,
643 		sal_Bool bIsProgress = sal_False,
644 		sal_Bool bExportParagraph = sal_True)
645 	{
646 		exportText( rText, rBaseSection, sal_False, bIsProgress, bExportParagraph );
647 	}
648 
exportFramesBoundToPage(sal_Bool bIsProgress=sal_False)649 	void exportFramesBoundToPage( sal_Bool bIsProgress = sal_False )
650 	{
651 		exportPageFrames( sal_False, bIsProgress );
652 	}
exportFramesBoundToFrame(const::com::sun::star::uno::Reference<::com::sun::star::text::XTextFrame> & rParentTxtFrame,sal_Bool bIsProgress=sal_False)653 	void exportFramesBoundToFrame(
654 			const ::com::sun::star::uno::Reference <
655 					::com::sun::star::text::XTextFrame >& rParentTxtFrame,
656 			sal_Bool bIsProgress = sal_False )
657 	{
658 		exportFrameFrames( sal_False, bIsProgress, &rParentTxtFrame );
659 	}
660 	inline const XMLTextListAutoStylePool& GetListAutoStylePool() const;
661 
SetBlockMode(sal_Bool bSet)662 	void SetBlockMode( sal_Bool bSet ) { bBlock = bSet; }
IsBlockMode() const663 	sal_Bool IsBlockMode() const { return bBlock; }
664 
665 
GetParagraphPropertyMapper() const666 	UniReference < SvXMLExportPropertyMapper > GetParagraphPropertyMapper() const
667 	{
668 		return xParaPropMapper;
669 	}
670 
671 
672     /** exclude form controls which are in mute sections.
673      *
674      * This method is necessary to prevent the form layer export from exporting
675      * control models whose controls are not represented in the document.  To
676      * achieve this, this method iterates over all shapes, checks to see if
677      * they are control shapes, and if so, whether they should be exported or
678      * not. If not, the form layer export will be notified accordingly.
679      *
680      * The reason this method is located here is tha it needs to access the
681      * XMLSectionExport, which is only available here.
682      */
683     void PreventExportOfControlsInMuteSections(
684         const ::com::sun::star::uno::Reference<
685             ::com::sun::star::container::XIndexAccess> & rShapes,
686         UniReference<xmloff::OFormLayerXMLExport> xFormExport );
687 
GetCharStyleNamesPropInfoCache()688 	SinglePropertySetInfoCache& GetCharStyleNamesPropInfoCache() { return aCharStyleNamesPropInfoCache; }
689 
690 	sal_Int32 GetHeadingLevel( const ::rtl::OUString& rStyleName );
691 
692     // --> OD 2008-05-08 #refactorlists#
693     void PushNewTextListsHelper();
694     void PopTextListsHelper();
695     // <--
696     private:
697         XMLTextParagraphExport(XMLTextParagraphExport &); // private copy-ctor because of explicit copy-ctor of auto_ptr
698 };
699 
700 inline const XMLTextListAutoStylePool&
GetListAutoStylePool() const701 	XMLTextParagraphExport::GetListAutoStylePool() const
702 {
703 	return *pListAutoPool;
704 }
705 
exportTextFrame(const::com::sun::star::uno::Reference<::com::sun::star::text::XTextContent> & rTextContent,sal_Bool bAutoStyles,sal_Bool bIsProgress,sal_Bool bExportContent,const::com::sun::star::uno::Reference<::com::sun::star::beans::XPropertySet> * pRangePropSet)706 inline void XMLTextParagraphExport::exportTextFrame(
707 		const ::com::sun::star::uno::Reference <
708 			::com::sun::star::text::XTextContent > & rTextContent,
709         sal_Bool bAutoStyles, sal_Bool bIsProgress, sal_Bool bExportContent,
710         const ::com::sun::star::uno::Reference <
711 			::com::sun::star::beans::XPropertySet > *pRangePropSet)
712 {
713     exportAnyTextFrame( rTextContent, FT_TEXT, bAutoStyles, bIsProgress,
714                         bExportContent, pRangePropSet );
715 }
716 
exportTextGraphic(const::com::sun::star::uno::Reference<::com::sun::star::text::XTextContent> & rTextContent,sal_Bool bAutoStyles,const::com::sun::star::uno::Reference<::com::sun::star::beans::XPropertySet> * pRangePropSet)717 inline void XMLTextParagraphExport::exportTextGraphic(
718 		const ::com::sun::star::uno::Reference <
719 			::com::sun::star::text::XTextContent > & rTextContent,
720 		sal_Bool bAutoStyles,
721 		const ::com::sun::star::uno::Reference <
722 			::com::sun::star::beans::XPropertySet > *pRangePropSet )
723 {
724     exportAnyTextFrame( rTextContent, FT_GRAPHIC, bAutoStyles, sal_False,
725                         sal_True, pRangePropSet );
726 }
727 
exportTextEmbedded(const::com::sun::star::uno::Reference<::com::sun::star::text::XTextContent> & rTextContent,sal_Bool bAutoStyles,const::com::sun::star::uno::Reference<::com::sun::star::beans::XPropertySet> * pRangePropSet)728 inline void XMLTextParagraphExport::exportTextEmbedded(
729 		const ::com::sun::star::uno::Reference <
730 			::com::sun::star::text::XTextContent > & rTextContent,
731 		sal_Bool bAutoStyles,
732 		const ::com::sun::star::uno::Reference <
733 			::com::sun::star::beans::XPropertySet > *pRangePropSet )
734 {
735     exportAnyTextFrame( rTextContent, FT_EMBEDDED, bAutoStyles, sal_False,
736                         sal_True, pRangePropSet );
737 }
738 
exportShape(const::com::sun::star::uno::Reference<::com::sun::star::text::XTextContent> & rTextContent,sal_Bool bAutoStyles,const::com::sun::star::uno::Reference<::com::sun::star::beans::XPropertySet> * pRangePropSet)739 inline void XMLTextParagraphExport::exportShape(
740 		const ::com::sun::star::uno::Reference <
741 			::com::sun::star::text::XTextContent > & rTextContent,
742 		sal_Bool bAutoStyles,
743 		const ::com::sun::star::uno::Reference <
744 			::com::sun::star::beans::XPropertySet > *pRangePropSet )
745 {
746     exportAnyTextFrame( rTextContent, FT_SHAPE, bAutoStyles, sal_False,
747                         sal_True, pRangePropSet );
748 }
749 
750 #endif
751