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