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