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 ::rtl::OUString *pMinWidthValue = 0 );
286
287 virtual void exportStyleAttributes(
288 const ::com::sun::star::uno::Reference<
289 ::com::sun::star::style::XStyle > & rStyle );
290
291 void exportPageFrames( sal_Bool bAutoStyles, sal_Bool bProgress );
292 void exportFrameFrames( sal_Bool bAutoStyles, sal_Bool bProgress,
293 const ::com::sun::star::uno::Reference <
294 ::com::sun::star::text::XTextFrame > *pParentTxtFrame = 0 );
295
296 void exportNumStyles( sal_Bool bUsed );
297
298 void exportText(
299 const ::com::sun::star::uno::Reference <
300 ::com::sun::star::text::XText > & rText,
301 sal_Bool bAutoStyles, sal_Bool bProgress, sal_Bool bExportParagraph );
302
303 void exportText(
304 const ::com::sun::star::uno::Reference <
305 ::com::sun::star::text::XText > & rText,
306 const ::com::sun::star::uno::Reference <
307 ::com::sun::star::text::XTextSection > & rBaseSection,
308 sal_Bool bAutoStyles, sal_Bool bProgress, sal_Bool bExportParagraph );
309
310 sal_Bool exportTextContentEnumeration(
311 const ::com::sun::star::uno::Reference <
312 ::com::sun::star::container::XEnumeration > & rContentEnum,
313 sal_Bool bAutoStyles,
314 const ::com::sun::star::uno::Reference <
315 ::com::sun::star::text::XTextSection > & rBaseSection,
316 sal_Bool bProgress,
317 sal_Bool bExportParagraph = sal_True,
318 const ::com::sun::star::uno::Reference <
319 ::com::sun::star::beans::XPropertySet > *pRangePropSet = 0,
320 sal_Bool bExportLevels = sal_True );
321 void exportParagraph(
322 const ::com::sun::star::uno::Reference <
323 ::com::sun::star::text::XTextContent > & rTextContent,
324 sal_Bool bAutoStyles, sal_Bool bProgress,
325 sal_Bool bExportParagraph,
326 MultiPropertySetHelper& rPropSetHelper);
327 virtual void exportTable(
328 const ::com::sun::star::uno::Reference <
329 ::com::sun::star::text::XTextContent > & rTextContent,
330 sal_Bool bAutoStyles, sal_Bool bProgress );
331
332 void exportTextField(
333 const ::com::sun::star::uno::Reference <
334 ::com::sun::star::text::XTextRange > & rTextRange,
335 sal_Bool bAutoStyles, sal_Bool bProgress );
336
337 void exportTextField(
338 const ::com::sun::star::uno::Reference <
339 ::com::sun::star::text::XTextField> & xTextField,
340 const sal_Bool bAutoStyles, const sal_Bool bProgress,
341 const sal_Bool bRecursive );
342
343 void exportAnyTextFrame(
344 const ::com::sun::star::uno::Reference <
345 ::com::sun::star::text::XTextContent > & rTextContent,
346 FrameType eTxpe,
347 sal_Bool bAutoStyles, sal_Bool bProgress, sal_Bool bExportContent,
348 const ::com::sun::star::uno::Reference <
349 ::com::sun::star::beans::XPropertySet > *pRangePropSet = 0 );
350 void _exportTextFrame(
351 const ::com::sun::star::uno::Reference <
352 ::com::sun::star::beans::XPropertySet > & rPropSet,
353 const ::com::sun::star::uno::Reference <
354 ::com::sun::star::beans::XPropertySetInfo > & rPropSetInfo,
355 sal_Bool bProgress );
356 inline void exportTextFrame(
357 const ::com::sun::star::uno::Reference <
358 ::com::sun::star::text::XTextContent > & rTextContent,
359 sal_Bool bAutoStyles, sal_Bool bProgress, sal_Bool bExportContent,
360 const ::com::sun::star::uno::Reference <
361 ::com::sun::star::beans::XPropertySet > *pRangePropSet = 0 );
362 inline void exportShape(
363 const ::com::sun::star::uno::Reference <
364 ::com::sun::star::text::XTextContent > & rTextContent,
365 sal_Bool bAutoStyles,
366 const ::com::sun::star::uno::Reference <
367 ::com::sun::star::beans::XPropertySet > *pRangePropSet = 0 );
368
369 void exportContour(
370 const ::com::sun::star::uno::Reference <
371 ::com::sun::star::beans::XPropertySet > & rPropSet,
372 const ::com::sun::star::uno::Reference <
373 ::com::sun::star::beans::XPropertySetInfo > & rPropSetInfo );
374 void _exportTextGraphic(
375 const ::com::sun::star::uno::Reference <
376 ::com::sun::star::beans::XPropertySet > & rPropSet,
377 const ::com::sun::star::uno::Reference <
378 ::com::sun::star::beans::XPropertySetInfo > & rPropSetInfo );
379 inline void exportTextGraphic(
380 const ::com::sun::star::uno::Reference <
381 ::com::sun::star::text::XTextContent > & rTextContent,
382 sal_Bool bAutoStyles,
383 const ::com::sun::star::uno::Reference <
384 ::com::sun::star::beans::XPropertySet > *pRangePropSet = 0 );
385
386 virtual void _collectTextEmbeddedAutoStyles(
387 const ::com::sun::star::uno::Reference <
388 ::com::sun::star::beans::XPropertySet > & rPropSet );
389 virtual void _exportTextEmbedded(
390 const ::com::sun::star::uno::Reference <
391 ::com::sun::star::beans::XPropertySet > & rPropSet,
392 const ::com::sun::star::uno::Reference <
393 ::com::sun::star::beans::XPropertySetInfo > & rPropSetInfo );
394 inline void exportTextEmbedded(
395 const ::com::sun::star::uno::Reference <
396 ::com::sun::star::text::XTextContent > & rTextContent,
397 sal_Bool bAutoStyles,
398 const ::com::sun::star::uno::Reference <
399 ::com::sun::star::beans::XPropertySet > *pRangePropSet = 0 );
400 virtual void setTextEmbeddedGraphicURL(
401 const ::com::sun::star::uno::Reference <
402 ::com::sun::star::beans::XPropertySet >& rPropSet,
403 ::rtl::OUString& rStreamName ) const;
404
405 /// export a footnote and styles
406 void exportTextFootnote(
407 const ::com::sun::star::uno::Reference<
408 ::com::sun::star::beans::XPropertySet > & rPropSet,
409 const ::rtl::OUString& sString,
410 sal_Bool bAutoStyles, sal_Bool bProgress );
411
412 /// helper for exportTextFootnote
413 void exportTextFootnoteHelper(
414 const ::com::sun::star::uno::Reference<
415 ::com::sun::star::text::XFootnote > & rPropSet,
416 const ::com::sun::star::uno::Reference<
417 ::com::sun::star::text::XText> & rText,
418 const ::rtl::OUString& sString,
419 sal_Bool bAutoStyles,
420 sal_Bool bIsEndnote, sal_Bool bProgress );
421
422 /// export footnote and endnote configuration elements
423 void exportTextFootnoteConfiguration();
424
425 void exportTextFootnoteConfigurationHelper(
426 const ::com::sun::star::uno::Reference<
427 ::com::sun::star::beans::XPropertySet> & rFootnoteSupplier,
428 sal_Bool bIsEndnote);
429
430 void exportTextMark(
431 const ::com::sun::star::uno::Reference<
432 ::com::sun::star::beans::XPropertySet> & xPropSet,
433 const ::rtl::OUString sProperty,
434 const enum ::xmloff::token::XMLTokenEnum pElements[],
435 sal_Bool bAutoStyles);
436
437 void exportIndexMark(
438 const ::com::sun::star::uno::Reference<
439 ::com::sun::star::beans::XPropertySet> & rPropSet,
440 sal_Bool bAutoStyles);
441
442 void exportSoftPageBreak(
443 const ::com::sun::star::uno::Reference<
444 ::com::sun::star::beans::XPropertySet> & rPropSet,
445 sal_Bool bAutoStyles);
446
447 void exportTextRange(
448 const ::com::sun::star::uno::Reference <
449 ::com::sun::star::text::XTextRange > & rTextRange,
450 sal_Bool bAutoStyles,
451 sal_Bool& rPrevCharWasSpace );
452
453 void exportListChange( const XMLTextNumRuleInfo& rPrvInfo,
454 const XMLTextNumRuleInfo& rNextInfo );
455
456 /// check if current section or current list has changed;
457 /// calls exortListChange as appropriate
458 void exportListAndSectionChange(
459 ::com::sun::star::uno::Reference <
460 ::com::sun::star::text::XTextSection > & rOldSection,
461 const ::com::sun::star::uno::Reference <
462 ::com::sun::star::text::XTextSection > & rNewSection,
463 const XMLTextNumRuleInfo& rOldList,
464 const XMLTextNumRuleInfo& rNewList,
465 sal_Bool bAutoStyles );
466
467 /// overload for exportListAndSectionChange;
468 /// takes new content rather than new section.
469 void exportListAndSectionChange(
470 ::com::sun::star::uno::Reference <
471 ::com::sun::star::text::XTextSection > & rOldSection,
472 const ::com::sun::star::uno::Reference <
473 ::com::sun::star::text::XTextContent > & rNewContent,
474 const XMLTextNumRuleInfo& rOldList,
475 const XMLTextNumRuleInfo& rNewList,
476 sal_Bool bAutoStyles );
477 void exportListAndSectionChange(
478 ::com::sun::star::uno::Reference <
479 ::com::sun::star::text::XTextSection > & rOldSection,
480 MultiPropertySetHelper& rPropSetHelper,
481 sal_Int16 nTextSectionId,
482 const ::com::sun::star::uno::Reference <
483 ::com::sun::star::text::XTextContent > & rNewContent,
484 const XMLTextNumRuleInfo& rOldList,
485 const XMLTextNumRuleInfo& rNewList,
486 sal_Bool bAutoStyles );
487
488 /// export a redline text portion
489 void exportChange(
490 const ::com::sun::star::uno::Reference <
491 ::com::sun::star::beans::XPropertySet > & rPropSet,
492 sal_Bool bAutoStyle);
493
494 /// export a ruby
495 void exportRuby(
496 const ::com::sun::star::uno::Reference<
497 ::com::sun::star::beans::XPropertySet> & rPortionPropSet,
498 sal_Bool bAutoStyles );
499
500 /// export a text:meta
501 void exportMeta(
502 const ::com::sun::star::uno::Reference<
503 ::com::sun::star::beans::XPropertySet> & i_xPortion,
504 sal_Bool i_bAutoStyles, sal_Bool i_isProgress );
505
506 public:
507
508 XMLTextParagraphExport(
509 SvXMLExport& rExp,
510 SvXMLAutoStylePoolP & rASP
511 );
512 virtual ~XMLTextParagraphExport();
513
514 /// add autostyle for specified family
515 void Add(
516 sal_uInt16 nFamily,
517 MultiPropertySetHelper& rPropSetHelper,
518 const ::com::sun::star::uno::Reference <
519 ::com::sun::star::beans::XPropertySet > & rPropSet,
520 const XMLPropertyState** pAddState = NULL );
521 void Add(
522 sal_uInt16 nFamily,
523 const ::com::sun::star::uno::Reference <
524 ::com::sun::star::beans::XPropertySet > & rPropSet,
525 const XMLPropertyState** pAddState = NULL, bool bDontSeek = false );
526
527 /// find style name for specified family and parent
528 ::rtl::OUString Find(
529 sal_uInt16 nFamily,
530 const ::com::sun::star::uno::Reference <
531 ::com::sun::star::beans::XPropertySet > & rPropSet,
532 const ::rtl::OUString& rParent,
533 const XMLPropertyState** pAddState = NULL ) const;
534
535 static SvXMLExportPropertyMapper *CreateShapeExtPropMapper(
536 SvXMLExport& rExport );
537 static SvXMLExportPropertyMapper *CreateCharExtPropMapper(
538 SvXMLExport& rExport);
539 static SvXMLExportPropertyMapper *CreateParaExtPropMapper(
540 SvXMLExport& rExport);
541 static SvXMLExportPropertyMapper *CreateParaDefaultExtPropMapper(
542 SvXMLExport& rExport);
543
544 // This methods exports all (or all used) styles
545 void exportTextStyles( sal_Bool bUsed
546 , sal_Bool bProg = sal_False
547 );
548
549 /// This method exports (text field) declarations etc.
550 void exportTextDeclarations();
551
552 /// export the (text field) declarations for a particular XText
553 void exportTextDeclarations(
554 const ::com::sun::star::uno::Reference <
555 ::com::sun::star::text::XText > & rText );
556
557 /// true: export only those declarations that are used;
558 /// false: export all declarations
559 void exportUsedDeclarations( sal_Bool bOnlyUsed );
560
561 /// Export the list of change information (enclosed by <tracked-changes>)
562 /// (or the necessary automatic styles)
563 void exportTrackedChanges(sal_Bool bAutoStyle);
564
565 /// Export the list of change information (enclosed by <tracked-changes>)
566 /// (or the necessary automatic styles)
567 void exportTrackedChanges(const ::com::sun::star::uno::Reference <
568 ::com::sun::star::text::XText > & rText,
569 sal_Bool bAutoStyle );
570
571 /// Record tracked changes for this particular XText
572 /// (empty reference stop recording)
573 /// This should be used if tracked changes for e.g. footers are to
574 /// be exported separately via the exportTrackedChanges(sal_Bool,
575 /// Reference<XText>) method.
576 void recordTrackedChangesForXText(
577 const ::com::sun::star::uno::Reference <
578 ::com::sun::star::text::XText > & rText );
579
580
581 /// Stop recording tracked changes.
582 /// This is the same as calling recordTrackedChanges(...) with an
583 /// empty reference.
584 void recordTrackedChangesNoXText();
585
586
587 // This method exports the given OUString
588 void exportText(
589 const ::rtl::OUString& rText,
590 sal_Bool& rPrevCharWasSpace );
591
592 // 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)593 void collectTextAutoStyles(
594 const ::com::sun::star::uno::Reference <
595 ::com::sun::star::text::XText > & rText,
596 sal_Bool bIsProgress = sal_False,
597 sal_Bool bExportParagraph = sal_True )
598 {
599 exportText( rText, sal_True, bIsProgress, bExportParagraph );
600 }
601
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)602 void collectTextAutoStyles(
603 const ::com::sun::star::uno::Reference <
604 ::com::sun::star::text::XText > & rText,
605 const ::com::sun::star::uno::Reference <
606 ::com::sun::star::text::XTextSection > & rBaseSection,
607 sal_Bool bIsProgress = sal_False,
608 sal_Bool bExportParagraph = sal_True )
609 {
610 exportText( rText, rBaseSection, sal_True, bIsProgress, bExportParagraph );
611 }
612
613 // It the model implements the xAutoStylesSupplier interface, the automatic
614 // styles can exported without iterating over the text portions
615 bool collectTextAutoStylesOptimized(
616 sal_Bool bIsProgress = sal_False );
617
618 // This method exports all automatic styles that have been collected.
619 virtual void exportTextAutoStyles();
620
621 void exportEvents( const ::com::sun::star::uno::Reference < com::sun::star::beans::XPropertySet > & rPropSet );
622 // --> OD 2009-07-22 #i73249#
623 // void exportAlternativeText( const ::com::sun::star::uno::Reference < ::com::sun::star::beans::XPropertySet > & rPropSet,
624 // const ::com::sun::star::uno::Reference < ::com::sun::star::beans::XPropertySetInfo > & rPropSetInfo );
625 void exportTitleAndDescription( const ::com::sun::star::uno::Reference < ::com::sun::star::beans::XPropertySet > & rPropSet,
626 const ::com::sun::star::uno::Reference < ::com::sun::star::beans::XPropertySetInfo > & rPropSetInfo );
627 // <--
628
629 // 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)630 void exportText(
631 const ::com::sun::star::uno::Reference <
632 ::com::sun::star::text::XText > & rText,
633 sal_Bool bIsProgress = sal_False,
634 sal_Bool bExportParagraph = sal_True)
635 {
636 exportText( rText, sal_False, bIsProgress, bExportParagraph );
637 }
638
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)639 void exportText(
640 const ::com::sun::star::uno::Reference <
641 ::com::sun::star::text::XText > & rText,
642 const ::com::sun::star::uno::Reference <
643 ::com::sun::star::text::XTextSection > & rBaseSection,
644 sal_Bool bIsProgress = sal_False,
645 sal_Bool bExportParagraph = sal_True)
646 {
647 exportText( rText, rBaseSection, sal_False, bIsProgress, bExportParagraph );
648 }
649
exportFramesBoundToPage(sal_Bool bIsProgress=sal_False)650 void exportFramesBoundToPage( sal_Bool bIsProgress = sal_False )
651 {
652 exportPageFrames( sal_False, bIsProgress );
653 }
exportFramesBoundToFrame(const::com::sun::star::uno::Reference<::com::sun::star::text::XTextFrame> & rParentTxtFrame,sal_Bool bIsProgress=sal_False)654 void exportFramesBoundToFrame(
655 const ::com::sun::star::uno::Reference <
656 ::com::sun::star::text::XTextFrame >& rParentTxtFrame,
657 sal_Bool bIsProgress = sal_False )
658 {
659 exportFrameFrames( sal_False, bIsProgress, &rParentTxtFrame );
660 }
661 inline const XMLTextListAutoStylePool& GetListAutoStylePool() const;
662
SetBlockMode(sal_Bool bSet)663 void SetBlockMode( sal_Bool bSet ) { bBlock = bSet; }
IsBlockMode() const664 sal_Bool IsBlockMode() const { return bBlock; }
665
666
GetParagraphPropertyMapper() const667 UniReference < SvXMLExportPropertyMapper > GetParagraphPropertyMapper() const
668 {
669 return xParaPropMapper;
670 }
671
672
673 /** exclude form controls which are in mute sections.
674 *
675 * This method is necessary to prevent the form layer export from exporting
676 * control models whose controls are not represented in the document. To
677 * achieve this, this method iterates over all shapes, checks to see if
678 * they are control shapes, and if so, whether they should be exported or
679 * not. If not, the form layer export will be notified accordingly.
680 *
681 * The reason this method is located here is tha it needs to access the
682 * XMLSectionExport, which is only available here.
683 */
684 void PreventExportOfControlsInMuteSections(
685 const ::com::sun::star::uno::Reference<
686 ::com::sun::star::container::XIndexAccess> & rShapes,
687 UniReference<xmloff::OFormLayerXMLExport> xFormExport );
688
GetCharStyleNamesPropInfoCache()689 SinglePropertySetInfoCache& GetCharStyleNamesPropInfoCache() { return aCharStyleNamesPropInfoCache; }
690
691 sal_Int32 GetHeadingLevel( const ::rtl::OUString& rStyleName );
692
693 // --> OD 2008-05-08 #refactorlists#
694 void PushNewTextListsHelper();
695 void PopTextListsHelper();
696 // <--
697 private:
698 XMLTextParagraphExport(XMLTextParagraphExport &); // private copy-ctor because of explicit copy-ctor of auto_ptr
699 };
700
701 inline const XMLTextListAutoStylePool&
GetListAutoStylePool() const702 XMLTextParagraphExport::GetListAutoStylePool() const
703 {
704 return *pListAutoPool;
705 }
706
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)707 inline void XMLTextParagraphExport::exportTextFrame(
708 const ::com::sun::star::uno::Reference <
709 ::com::sun::star::text::XTextContent > & rTextContent,
710 sal_Bool bAutoStyles, sal_Bool bIsProgress, sal_Bool bExportContent,
711 const ::com::sun::star::uno::Reference <
712 ::com::sun::star::beans::XPropertySet > *pRangePropSet)
713 {
714 exportAnyTextFrame( rTextContent, FT_TEXT, bAutoStyles, bIsProgress,
715 bExportContent, pRangePropSet );
716 }
717
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)718 inline void XMLTextParagraphExport::exportTextGraphic(
719 const ::com::sun::star::uno::Reference <
720 ::com::sun::star::text::XTextContent > & rTextContent,
721 sal_Bool bAutoStyles,
722 const ::com::sun::star::uno::Reference <
723 ::com::sun::star::beans::XPropertySet > *pRangePropSet )
724 {
725 exportAnyTextFrame( rTextContent, FT_GRAPHIC, bAutoStyles, sal_False,
726 sal_True, pRangePropSet );
727 }
728
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)729 inline void XMLTextParagraphExport::exportTextEmbedded(
730 const ::com::sun::star::uno::Reference <
731 ::com::sun::star::text::XTextContent > & rTextContent,
732 sal_Bool bAutoStyles,
733 const ::com::sun::star::uno::Reference <
734 ::com::sun::star::beans::XPropertySet > *pRangePropSet )
735 {
736 exportAnyTextFrame( rTextContent, FT_EMBEDDED, bAutoStyles, sal_False,
737 sal_True, pRangePropSet );
738 }
739
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)740 inline void XMLTextParagraphExport::exportShape(
741 const ::com::sun::star::uno::Reference <
742 ::com::sun::star::text::XTextContent > & rTextContent,
743 sal_Bool bAutoStyles,
744 const ::com::sun::star::uno::Reference <
745 ::com::sun::star::beans::XPropertySet > *pRangePropSet )
746 {
747 exportAnyTextFrame( rTextContent, FT_SHAPE, bAutoStyles, sal_False,
748 sal_True, pRangePropSet );
749 }
750
751 #endif
752