1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
19 #ifndef INCLUDED_XMLOFF_TXTIMP_HXX
20 #define INCLUDED_XMLOFF_TXTIMP_HXX
22 #include <sal/config.h>
23 #include <xmloff/dllapi.h>
24 #include <sal/types.h>
25 #include <rtl/ustring.hxx>
26 #include <com/sun/star/uno/Reference.h>
27 #include <com/sun/star/uno/Sequence.hxx>
32 #include <salhelper/simplereferenceobject.hxx>
34 class XMLTextListsHelper
;
35 class SvXMLImportContext
;
37 class SvXMLImportPropertyMapper
;
39 class SvXMLStylesContext
;
40 class SvxXMLListStyleContext
;
41 class XMLPropStyleContext
;
43 template<class A
> class XMLPropertyBackpatcher
;
44 class XMLEventsImportContext
;
47 struct ParsedRDFaAttributes
;
50 namespace com::sun::star
{
58 namespace frame
{ class XModel
; }
59 namespace container
{ class XNameContainer
; class XIndexReplace
; }
60 namespace beans
{ class XPropertySet
; }
61 namespace xml::sax
{ class XAttributeList
; }
62 namespace util
{ struct DateTime
; }
65 namespace rtl
{ template <class reference_type
> class Reference
; }
67 enum SwXMLTextElemTokens
72 XML_TOK_TEXT_FRAME_PAGE
,
74 XML_TOK_TEXT_VARFIELD_DECLS
,
75 XML_TOK_TEXT_USERFIELD_DECLS
,
76 XML_TOK_TEXT_SEQUENCE_DECLS
,
77 XML_TOK_TEXT_DDE_DECLS
,
81 XML_TOK_TEXT_OBJECT_INDEX
,
82 XML_TOK_TEXT_TABLE_INDEX
,
83 XML_TOK_TEXT_ILLUSTRATION_INDEX
,
84 XML_TOK_TEXT_USER_INDEX
,
85 XML_TOK_TEXT_ALPHABETICAL_INDEX
,
86 XML_TOK_TEXT_BIBLIOGRAPHY_INDEX
,
87 XML_TOK_TEXT_INDEX_TITLE
,
88 XML_TOK_TEXT_TRACKED_CHANGES
,
89 XML_TOK_TEXT_CHANGE_START
,
90 XML_TOK_TEXT_CHANGE_END
,
93 XML_TOK_TEXT_CALCULATION_SETTINGS
,
94 XML_TOK_TEXT_AUTOMARK
,
95 XML_TOK_TEXT_NUMBERED_PARAGRAPH
98 enum XMLTextPElemTokens
101 XML_TOK_TEXT_TAB_STOP
,
102 XML_TOK_TEXT_LINE_BREAK
,
103 XML_TOK_TEXT_SOFT_PAGE_BREAK
,
106 XML_TOK_TEXT_HYPERLINK
,
110 XML_TOK_TEXT_BOOKMARK
,
111 XML_TOK_TEXT_BOOKMARK_START
,
112 XML_TOK_TEXT_BOOKMARK_END
,
113 XML_TOK_TEXT_REFERENCE
,
114 XML_TOK_TEXT_REFERENCE_START
,
115 XML_TOK_TEXT_REFERENCE_END
,
117 XML_TOK_TEXT_TOC_MARK
, // index marks
118 XML_TOK_TEXT_TOC_MARK_START
,
119 XML_TOK_TEXT_TOC_MARK_END
,
120 XML_TOK_TEXT_USER_INDEX_MARK
,
121 XML_TOK_TEXT_USER_INDEX_MARK_START
,
122 XML_TOK_TEXT_USER_INDEX_MARK_END
,
123 XML_TOK_TEXT_ALPHA_INDEX_MARK
,
124 XML_TOK_TEXT_ALPHA_INDEX_MARK_START
,
125 XML_TOK_TEXT_ALPHA_INDEX_MARK_END
,
127 XML_TOK_TEXT_SENDER_FIRSTNAME
, // sender fields
128 XML_TOK_TEXT_SENDER_LASTNAME
,
129 XML_TOK_TEXT_SENDER_INITIALS
,
130 XML_TOK_TEXT_SENDER_TITLE
,
131 XML_TOK_TEXT_SENDER_POSITION
,
132 XML_TOK_TEXT_SENDER_EMAIL
,
133 XML_TOK_TEXT_SENDER_PHONE_PRIVATE
,
134 XML_TOK_TEXT_SENDER_FAX
,
135 XML_TOK_TEXT_SENDER_COMPANY
,
136 XML_TOK_TEXT_SENDER_PHONE_WORK
,
137 XML_TOK_TEXT_SENDER_STREET
,
138 XML_TOK_TEXT_SENDER_CITY
,
139 XML_TOK_TEXT_SENDER_POSTAL_CODE
,
140 XML_TOK_TEXT_SENDER_COUNTRY
,
141 XML_TOK_TEXT_SENDER_STATE_OR_PROVINCE
,
143 XML_TOK_TEXT_AUTHOR_NAME
, // author fields
144 XML_TOK_TEXT_AUTHOR_INITIALS
,
146 XML_TOK_TEXT_DATE
, // date & time fields
149 XML_TOK_TEXT_PAGE_NUMBER
, // page number fields
150 XML_TOK_TEXT_PAGE_CONTINUATION_STRING
,
152 XML_TOK_TEXT_VARIABLE_SET
, // variable fields
153 XML_TOK_TEXT_VARIABLE_GET
,
154 XML_TOK_TEXT_VARIABLE_INPUT
,
155 XML_TOK_TEXT_USER_FIELD_GET
,
156 XML_TOK_TEXT_USER_FIELD_INPUT
,
157 XML_TOK_TEXT_SEQUENCE
,
158 XML_TOK_TEXT_EXPRESSION
,
159 XML_TOK_TEXT_TEXT_INPUT
,
161 XML_TOK_TEXT_DATABASE_DISPLAY
, // database fields
162 XML_TOK_TEXT_DATABASE_NEXT
,
163 XML_TOK_TEXT_DATABASE_SELECT
,
164 XML_TOK_TEXT_DATABASE_ROW_NUMBER
,
165 XML_TOK_TEXT_DATABASE_NAME
,
167 XML_TOK_TEXT_DOCUMENT_CREATION_AUTHOR
, //document info fields
168 XML_TOK_TEXT_DOCUMENT_CREATION_DATE
,
169 XML_TOK_TEXT_DOCUMENT_CREATION_TIME
,
170 XML_TOK_TEXT_DOCUMENT_DESCRIPTION
,
171 XML_TOK_TEXT_DOCUMENT_PRINT_AUTHOR
,
172 XML_TOK_TEXT_DOCUMENT_PRINT_DATE
,
173 XML_TOK_TEXT_DOCUMENT_PRINT_TIME
,
174 XML_TOK_TEXT_DOCUMENT_TITLE
,
175 XML_TOK_TEXT_DOCUMENT_SUBJECT
,
176 XML_TOK_TEXT_DOCUMENT_KEYWORDS
,
177 XML_TOK_TEXT_DOCUMENT_REVISION
,
178 XML_TOK_TEXT_DOCUMENT_EDIT_DURATION
,
179 XML_TOK_TEXT_DOCUMENT_SAVE_AUTHOR
,
180 XML_TOK_TEXT_DOCUMENT_SAVE_DATE
,
181 XML_TOK_TEXT_DOCUMENT_SAVE_TIME
,
182 XML_TOK_TEXT_DOCUMENT_USER_DEFINED
,
184 XML_TOK_TEXT_PLACEHOLDER
, // misc. fields
185 XML_TOK_TEXT_CONDITIONAL_TEXT
,
186 XML_TOK_TEXT_HIDDEN_TEXT
,
187 XML_TOK_TEXT_HIDDEN_PARAGRAPH
,
188 XML_TOK_TEXT_FILENAME
,
189 XML_TOK_TEXT_CHAPTER
,
190 XML_TOK_TEXT_TEMPLATENAME
,
191 XML_TOK_TEXT_WORD_COUNT
, // statistics/count fields
192 XML_TOK_TEXT_PARAGRAPH_COUNT
,
193 XML_TOK_TEXT_TABLE_COUNT
,
194 XML_TOK_TEXT_CHARACTER_COUNT
,
195 XML_TOK_TEXT_IMAGE_COUNT
,
196 XML_TOK_TEXT_OBJECT_COUNT
,
197 XML_TOK_TEXT_PAGE_COUNT
,
198 XML_TOK_TEXT_GET_PAGE_VAR
,
199 XML_TOK_TEXT_SET_PAGE_VAR
,
202 XML_TOK_TEXT_REFERENCE_REF
,
203 XML_TOK_TEXT_BOOKMARK_REF
,
204 XML_TOK_TEXT_SEQUENCE_REF
,
205 XML_TOK_TEXT_NOTE_REF
,
206 XML_TOK_TEXT_SHEET_NAME
,
207 XML_TOK_TEXT_PAGE_NAME
,
208 XML_TOK_TEXT_BIBLIOGRAPHY_MARK
,
209 XML_TOK_TEXT_ANNOTATION
,
210 XML_TOK_TEXT_ANNOTATION_END
,
212 XML_TOK_TEXT_RESOLVED
,
214 XML_TOK_TEXT_TABLE_FORMULA
,
215 XML_TOK_TEXT_DROP_DOWN
,
219 XML_TOK_TEXT_META_FIELD
,
222 XML_TOK_TEXTP_CHANGE_START
, // TEXTP avoids clash with SwXMLTextElemTokens
223 XML_TOK_TEXTP_CHANGE_END
,
224 XML_TOK_TEXTP_CHANGE
,
226 XML_TOK_TEXT_MEASURE
,
230 XML_TOK_DRAW_DATE_TIME
,
231 XML_TOK_TEXT_PAGE_CONTINUATION
,
233 XML_TOK_TEXT_FIELDMARK
,
234 XML_TOK_TEXT_FIELDMARK_START
,
235 XML_TOK_TEXT_FIELDMARK_END
238 enum XMLTextPAttrTokens
240 XML_TOK_TEXT_P_XMLID
,
241 XML_TOK_TEXT_P_ABOUT
,
242 XML_TOK_TEXT_P_PROPERTY
,
243 XML_TOK_TEXT_P_CONTENT
,
244 XML_TOK_TEXT_P_DATATYPE
,
245 XML_TOK_TEXT_P_TEXTID
,
246 XML_TOK_TEXT_P_STYLE_NAME
,
247 XML_TOK_TEXT_P_COND_STYLE_NAME
,
248 XML_TOK_TEXT_P_OUTLINE_CONTENT_VISIBLE
,
249 XML_TOK_TEXT_P_LEVEL
,
250 XML_TOK_TEXT_P_IS_LIST_HEADER
,
251 XML_TOK_TEXT_P_RESTART_NUMBERING
,
252 XML_TOK_TEXT_P_START_VALUE
255 enum XMLTextNumberedParagraphAttrTokens
257 XML_TOK_TEXT_NUMBERED_PARAGRAPH_XMLID
,
258 XML_TOK_TEXT_NUMBERED_PARAGRAPH_LIST_ID
,
259 XML_TOK_TEXT_NUMBERED_PARAGRAPH_LEVEL
,
260 XML_TOK_TEXT_NUMBERED_PARAGRAPH_STYLE_NAME
,
261 XML_TOK_TEXT_NUMBERED_PARAGRAPH_CONTINUE_NUMBERING
,
262 XML_TOK_TEXT_NUMBERED_PARAGRAPH_START_VALUE
265 enum XMLTextListBlockAttrTokens
267 XML_TOK_TEXT_LIST_BLOCK_XMLID
,
268 XML_TOK_TEXT_LIST_BLOCK_STYLE_NAME
,
269 XML_TOK_TEXT_LIST_BLOCK_CONTINUE_NUMBERING
,
270 XML_TOK_TEXT_LIST_BLOCK_CONTINUE_LIST
273 enum XMLTextListBlockElemTokens
275 XML_TOK_TEXT_LIST_HEADER
,
276 XML_TOK_TEXT_LIST_ITEM
279 enum XMLTextFrameAttrTokens
281 XML_TOK_TEXT_FRAME_STYLE_NAME
,
282 XML_TOK_TEXT_FRAME_NAME
,
283 XML_TOK_TEXT_FRAME_ANCHOR_TYPE
,
284 XML_TOK_TEXT_FRAME_ANCHOR_PAGE_NUMBER
,
285 XML_TOK_TEXT_FRAME_X
,
286 XML_TOK_TEXT_FRAME_Y
,
287 XML_TOK_TEXT_FRAME_WIDTH
,
288 XML_TOK_TEXT_FRAME_REL_WIDTH
,
289 XML_TOK_TEXT_FRAME_HEIGHT
,
290 XML_TOK_TEXT_FRAME_MIN_HEIGHT
,
291 XML_TOK_TEXT_FRAME_REL_HEIGHT
,
292 XML_TOK_TEXT_FRAME_NEXT_CHAIN_NAME
,
293 XML_TOK_TEXT_FRAME_HREF
,
294 XML_TOK_TEXT_FRAME_Z_INDEX
,
295 XML_TOK_TEXT_FRAME_TRANSFORM
,
296 XML_TOK_TEXT_FRAME_CLASS_ID
,
297 XML_TOK_TEXT_FRAME_CODE
,
298 XML_TOK_TEXT_FRAME_OBJECT
,
299 XML_TOK_TEXT_FRAME_ARCHIVE
,
300 XML_TOK_TEXT_FRAME_MAY_SCRIPT
,
301 XML_TOK_TEXT_FRAME_MIME_TYPE
,
302 XML_TOK_TEXT_FRAME_APPLET_NAME
,
303 XML_TOK_TEXT_FRAME_FRAME_NAME
,
304 XML_TOK_TEXT_FRAME_NOTIFY_ON_UPDATE
,
305 XML_TOK_TEXT_FRAME_MIN_WIDTH
308 enum XMLTextHyperlinkAttrTokens
310 XML_TOK_TEXT_HYPERLINK_HREF
,
311 XML_TOK_TEXT_HYPERLINK_NAME
,
312 XML_TOK_TEXT_HYPERLINK_TARGET_FRAME
,
313 XML_TOK_TEXT_HYPERLINK_SHOW
,
314 XML_TOK_TEXT_HYPERLINK_STYLE_NAME
,
315 XML_TOK_TEXT_HYPERLINK_VIS_STYLE_NAME
,
316 XML_TOK_TEXT_HYPERLINK_SERVER_MAP
319 enum XMLTextContourAttrTokens
321 XML_TOK_TEXT_CONTOUR_WIDTH
,
322 XML_TOK_TEXT_CONTOUR_HEIGHT
,
323 XML_TOK_TEXT_CONTOUR_VIEWBOX
,
324 XML_TOK_TEXT_CONTOUR_POINTS
,
325 XML_TOK_TEXT_CONTOUR_D
,
326 XML_TOK_TEXT_CONTOUR_AUTO
340 /// variable type (for XMLSetVarFieldImportContext)
346 // see following NOTE!
349 // NOTE: these values must be distinct from any in "enum VarType" because they
350 // are used as keys to SvI18NMap::Add()
351 #define XML_TEXT_RENAME_TYPE_FRAME 10
352 #define XML_TEXT_RENAME_TYPE_TABLE 20
354 class XMLOFF_DLLPUBLIC XMLTextImportHelper
: public salhelper::SimpleReferenceObject
357 XMLTextImportHelper(const XMLTextImportHelper
&) = delete;
358 XMLTextImportHelper
& operator=(const XMLTextImportHelper
&) = delete;
361 std::unique_ptr
<Impl
> m_xImpl
;
362 /// ugly, but implementation of this is in XMLPropertyBackpatcher.cxx
363 struct BackpatcherImpl
;
364 std::shared_ptr
<BackpatcherImpl
> m_xBackpatcherImpl
;
365 static std::shared_ptr
<BackpatcherImpl
> MakeBackpatcherImpl();
368 virtual SvXMLImportContext
*CreateTableChildContext(
369 SvXMLImport
& rImport
,
370 sal_uInt16 nPrefix
, const OUString
& rLocalName
,
371 const css::uno::Reference
< css::xml::sax::XAttributeList
> & xAttrList
);
373 // access, lazy initialization and destruction of backpatchers
374 // Code is implemented in XMLPropertyBackpatcher.cxx
375 inline XMLPropertyBackpatcher
<sal_Int16
>& GetFootnoteBP();
376 inline XMLPropertyBackpatcher
<sal_Int16
>& GetSequenceIdBP();
377 inline XMLPropertyBackpatcher
< OUString
> & GetSequenceNameBP();
382 css::uno::Reference
< css::frame::XModel
> const& rModel
,
383 SvXMLImport
& rImport
,
384 bool const bInsertMode
= false, bool const bStylesOnlyMode
= false,
385 bool const bProgress
= false, bool const bBlockMode
= false,
386 bool const bOrganizerMode
= false);
388 virtual ~XMLTextImportHelper() override
;
393 const css::uno::Reference
< css::text::XTextCursor
>& rCursor
);
396 void SetAutoStyles( SvXMLStylesContext
*pStyles
);
398 SvXMLImportContext
*CreateTextChildContext(
399 SvXMLImport
& rImport
,
400 sal_uInt16 nPrefix
, const OUString
& rLocalName
,
401 const css::uno::Reference
< css::xml::sax::XAttributeList
> & xAttrList
,
402 XMLTextType eType
= XMLTextType::Shape
);
404 SvXMLTokenMap
const& GetTextElemTokenMap();
405 SvXMLTokenMap
const& GetTextPElemTokenMap();
406 SvXMLTokenMap
const& GetTextPAttrTokenMap();
407 SvXMLTokenMap
const& GetTextFrameAttrTokenMap();
408 SvXMLTokenMap
const& GetTextContourAttrTokenMap();
409 SvXMLTokenMap
const& GetTextHyperlinkAttrTokenMap();
411 const SvXMLTokenMap
& GetTextNumberedParagraphAttrTokenMap();
412 const SvXMLTokenMap
& GetTextListBlockAttrTokenMap();
413 const SvXMLTokenMap
& GetTextListBlockElemTokenMap();
415 css::uno::Reference
< css::text::XText
> & GetText();
416 css::uno::Reference
< css::text::XTextCursor
> & GetCursor();
417 css::uno::Reference
< css::text::XTextRange
> & GetCursorAsRange();
419 bool IsInsertMode() const;
420 bool IsStylesOnlyMode() const;
421 bool IsBlockMode() const;
422 bool IsOrganizerMode() const;
423 bool IsProgress() const;
425 OUString
ConvertStarFonts( const OUString
& rChars
,
426 const OUString
& rStyleName
,
429 SvXMLImport
& rImport
) const;
430 // insert a string without special whitespace processing enabled
431 void InsertString( const OUString
& rChars
);
432 // insert a string with special whitespace processing enabled
433 void InsertString( const OUString
& rChars
,
434 bool& rIgnoreLeadingSpace
);
435 // Delete current paragraph
436 void DeleteParagraph();
438 void InsertControlCharacter( sal_Int16 nControl
);
439 void InsertTextContent( css::uno::Reference
< css::text::XTextContent
> const & xContent
);
441 // Add parameter <bOutlineLevelAttrFound> (#i73509#)
442 // Add parameter <bSetListAttrs> in order to suppress the handling of the list attributes (#i80724#)
443 OUString
SetStyleAndAttrs(
444 SvXMLImport
const & rImport
,
445 const css::uno::Reference
< css::text::XTextCursor
>& rCursor
,
446 const OUString
& rStyleName
,
448 bool bOutlineLevelAttrFound
= false,
449 sal_Int8 nOutlineLevel
= -1,
450 bool bSetListAttrs
= true,
451 bool bOutlineContentVisible
= true);
453 /** Find a suitable name for the given outline level.
454 * If rStyleName is empty, change it to a previously used or default style
455 * name for that level. Otherwise, leave rStyleName unmodified.
457 // Adjust 2nd parameter (#i69629#)
458 void FindOutlineStyleName( OUString
& rStyleName
,
459 sal_Int8 nOutlineLevel
);
461 // Change method name to reflect change of data structure (#i69629#)
462 void AddOutlineStyleCandidate( const sal_Int8 nOutlineLevel
,
463 const OUString
& rStyleName
);
465 void SetOutlineStyles( bool bSetEmpty
);
468 SvXMLImport
const & rImport
,
469 const css::uno::Reference
< css::text::XTextCursor
>& rCursor
,
470 const OUString
& rHRef
,
471 const OUString
& rName
,
472 const OUString
& rTargetFrameName
,
473 const OUString
& rStyleName
,
474 const OUString
& rVisitedStyleName
,
475 XMLEventsImportContext
* pEvents
);
477 SvXMLImport
const & rImport
,
478 const css::uno::Reference
< css::text::XTextCursor
>& rCursor
,
479 const OUString
& rStyleName
,
480 const OUString
& rTextStyleName
,
481 const OUString
& rText
);
483 /// return key appropriate for use with NumberFormat property
484 /// return -1 if style is not found
485 /// (may return whether data style uses the system language)
486 sal_Int32
GetDataStyleKey( const OUString
& sStyleName
,
487 bool* pIsSystemLanguage
= nullptr );
489 const SvxXMLListStyleContext
*FindAutoListStyle(
490 const OUString
& rName
) const;
491 XMLPropStyleContext
*FindAutoFrameStyle(
492 const OUString
& rName
) const;
493 XMLPropStyleContext
* FindSectionStyle(
494 const OUString
& rName
) const;
495 XMLPropStyleContext
* FindPageMaster(
496 const OUString
& rName
) const;
497 XMLPropStyleContext
* FindDrawingPage(OUString
const& rName
) const;
499 const css::uno::Reference
< css::container::XNameContainer
> & GetParaStyles() const;
501 const css::uno::Reference
< css::container::XNameContainer
> & GetTextStyles() const;
503 const css::uno::Reference
< css::container::XNameContainer
> &
504 GetNumberingStyles() const;
506 const css::uno::Reference
< css::container::XNameContainer
> & GetFrameStyles() const;
508 const css::uno::Reference
< css::container::XNameContainer
> & GetPageStyles() const;
510 const css::uno::Reference
< css::container::XNameContainer
> & GetCellStyles() const;
512 const css::uno::Reference
< css::container::XIndexReplace
> &
513 GetChapterNumbering() const;
515 bool HasFrameByName( const OUString
& rName
) const;
517 bool IsDuplicateFrame(const OUString
& sName
, sal_Int32 nX
, sal_Int32 nY
, sal_Int32 nWidth
, sal_Int32 nHeight
) const;
518 void StoreLastImportedFrameName(const OUString
& rName
);
519 void ClearLastImportedTextFrameName();
521 void ConnectFrameChains( const OUString
& rFrmName
,
522 const OUString
& rNextFrmName
,
523 const css::uno::Reference
< css::beans::XPropertySet
>& rFrmPropSet
);
525 rtl::Reference
< SvXMLImportPropertyMapper
> const&
526 GetParaImportPropertySetMapper() const;
527 rtl::Reference
< SvXMLImportPropertyMapper
> const&
528 GetTextImportPropertySetMapper() const;
529 rtl::Reference
< SvXMLImportPropertyMapper
> const&
530 GetSectionImportPropertySetMapper() const;
531 rtl::Reference
< SvXMLImportPropertyMapper
> const&
532 GetRubyImportPropertySetMapper() const;
534 static SvXMLImportPropertyMapper
*CreateShapeExtPropMapper(SvXMLImport
&);
535 static SvXMLImportPropertyMapper
*CreateParaExtPropMapper(SvXMLImport
&);
536 static SvXMLImportPropertyMapper
* CreateParaDefaultExtPropMapper(SvXMLImport
&);
537 static SvXMLImportPropertyMapper
* CreateTableDefaultExtPropMapper(SvXMLImport
&);
538 static SvXMLImportPropertyMapper
* CreateTableRowDefaultExtPropMapper(SvXMLImport
&);
539 static SvXMLImportPropertyMapper
* CreateTableCellExtPropMapper(SvXMLImport
&);
540 static SvXMLImportPropertyMapper
* CreateDrawingPageExtPropMapper(SvXMLImport
&);
542 SvI18NMap
& GetRenameMap();
544 /// save the start of a range reference
545 void InsertBookmarkStartRange(
546 const OUString
& sName
,
547 const css::uno::Reference
< css::text::XTextRange
> & rRange
,
548 OUString
const& i_rXmlId
,
549 std::shared_ptr
< ::xmloff::ParsedRDFaAttributes
> &
552 /// process the start of a range reference
553 bool FindAndRemoveBookmarkStartRange(
554 const OUString
& sName
,
555 css::uno::Reference
< css::text::XTextRange
> & o_rRange
,
557 std::shared_ptr
< ::xmloff::ParsedRDFaAttributes
> & o_rpRDFaAttributes
);
559 void pushFieldCtx( const OUString
& name
, const OUString
& type
);
560 css::uno::Reference
<css::text::XFormField
> popFieldCtx();
561 void addFieldParam( const OUString
& name
, const OUString
& value
);
562 void setCurrentFieldParamsTo(css::uno::Reference
< css::text::XFormField
> const &xFormField
);
563 OUString
getCurrentFieldType();
564 bool hasCurrentFieldCtx() const;
567 /// insert new footnote ID.
568 /// Also fixup open references from the backpatch list to this ID.
569 // Code is implemented in XMLPropertyBackpatcher.cxx
570 void InsertFootnoteID(const OUString
& sXMLId
, sal_Int16 nAPIId
);
572 /// set the proper footnote reference ID,
573 /// or put into backpatch list if ID is unknown
574 // Code is implemented in XMLPropertyBackpatcher.cxx
575 void ProcessFootnoteReference(
576 const OUString
& sXMLId
,
577 const css::uno::Reference
< css::beans::XPropertySet
> & xPropSet
);
579 /// insert new sequence ID
580 /// Also fixup open references from backpatch list to this ID.
581 // Code is implemented in XMLPropertyBackpatcher.cxx
582 void InsertSequenceID(const OUString
& sXMLId
,
583 const OUString
& sName
,
586 /// set sequence ID or insert into backpatch list
587 // Code is implemented in XMLPropertyBackpatcher.cxx
588 void ProcessSequenceReference(
589 const OUString
& sXMLId
,
590 const css::uno::Reference
< css::beans::XPropertySet
> & xPropSet
);
592 bool IsInFrame() const;
593 virtual bool IsInHeaderFooter() const;
595 virtual css::uno::Reference
< css::beans::XPropertySet
>
596 createAndInsertOLEObject( SvXMLImport
& rImport
,
597 const OUString
& rHRef
,
598 const OUString
&rStyleName
,
599 const OUString
&rTblName
,
600 sal_Int32 nWidth
, sal_Int32 nHeight
);
602 virtual css::uno::Reference
< css::beans::XPropertySet
>
603 createAndInsertOOoLink( SvXMLImport
& rImport
,
604 const OUString
& rHRef
,
605 const OUString
&rStyleName
,
606 const OUString
&rTblName
,
607 sal_Int32 nWidth
, sal_Int32 nHeight
);
609 virtual css::uno::Reference
< css::beans::XPropertySet
>
610 createAndInsertApplet(
611 const OUString
&rName
,
612 const OUString
&rCode
,
614 const OUString
& rHRef
,
615 sal_Int32 nWidth
, sal_Int32 nHeight
);
617 virtual css::uno::Reference
< css::beans::XPropertySet
>
618 createAndInsertPlugin(
619 const OUString
&rMimeType
,
620 const OUString
& rHRef
,
621 sal_Int32 nWidth
, sal_Int32 nHeight
);
623 virtual css::uno::Reference
< css::beans::XPropertySet
>
624 createAndInsertFloatingFrame(
625 const OUString
&rName
,
626 const OUString
&rHRef
,
627 const OUString
&rStyleName
,
628 sal_Int32 nWidth
, sal_Int32 nHeight
);
630 virtual void endAppletOrPlugin(
631 const css::uno::Reference
< css::beans::XPropertySet
> &rPropSet
,
632 ::std::map
< const OUString
, OUString
> &rParamMap
);
634 // applet helper methods
635 // implemented in sw/filter/xml/txtparai.hxx
637 // redlining helper methods
638 // (to be implemented in sw/filter/xml/txtparai.hxx)
640 virtual void RedlineAdd(
641 /// redline type (insert, del,... )
642 const OUString
& rType
,
643 /// use to identify this redline
645 /// name of the author
646 const OUString
& rAuthor
,
648 const OUString
& rComment
,
650 const css::util::DateTime
& rDateTime
,
652 bool bMergeLastParagraph
);
654 virtual css::uno::Reference
< css::text::XTextCursor
> RedlineCreateText(
655 /// needed to get the document
656 css::uno::Reference
< css::text::XTextCursor
> & rOldCursor
,
657 /// ID used to RedlineAdd() call
658 const OUString
& rId
);
660 virtual void RedlineSetCursor(
661 /// ID used to RedlineAdd() call
663 /// start or end Cursor
665 /// range is not within <text:p>
666 bool bIsOutsideOfParagraph
);
668 virtual void RedlineAdjustStartNodeCursor();
669 virtual void SetShowChanges( bool bShowChanges
);
670 virtual void SetRecordChanges( bool bRecordChanges
);
671 virtual void SetChangesProtectionKey(
672 const css::uno::Sequence
<sal_Int8
> & rProtectionKey
);
674 /// get the last open redline ID
675 OUString
const & GetOpenRedlineId() const;
676 /// modify the last open redline ID
677 void SetOpenRedlineId( OUString
const & rId
);
678 /// reset the last open redline ID
679 void ResetOpenRedlineId();
681 /** redlining : Setter to remember the fact we are inside/outside
682 * a <text:deletion> element (deleted redline section) */
683 void SetInsideDeleteContext(bool const bNew
);
684 /** redlining : Getter to know if we are inside
685 * a <text:deletion> element (deleted redline section) */
686 bool IsInsideDeleteContext() const;
688 SvXMLImport
& GetXMLImport();
690 XMLTextListsHelper
& GetTextListHelper();
692 // forwards to TextListHelper; these are used in many places
693 /// push a list context on the list context stack
694 void PushListContext();
695 /// pop the list context stack
696 void PopListContext();
698 void SetCellParaStyleDefault(OUString
const& rNewValue
);
699 OUString
const& GetCellParaStyleDefault() const;
701 void AddCrossRefHeadingMapping(OUString
const& rFrom
, OUString
const& rTo
);
702 void MapCrossRefHeadingFieldsHorribly();
704 void setBookmarkAttributes(OUString
const& bookmark
, bool hidden
, OUString
const& condition
);
705 bool getBookmarkHidden(OUString
const& bookmark
) const;
706 const OUString
& getBookmarkCondition(OUString
const& bookmark
) const;
712 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */