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 <com/sun/star/uno/Reference.h>
30 #include <xmloff/xmltkmap.hxx>
31 #include <rtl/ref.hxx>
32 #include <salhelper/simplereferenceobject.hxx>
34 class XMLTextListsHelper
;
35 class SvXMLImportContext
;
37 class SvXMLImportPropertyMapper
;
38 class SvXMLNamespaceMap
;
40 class SvXMLStylesContext
;
41 class XMLTextListBlockContext
;
42 class SvxXMLListStyleContext
;
43 class XMLPropStyleContext
;
45 class XMLSectionImportContext
;
46 class XMLFontStylesContext
;
47 template<class A
> class XMLPropertyBackpatcher
;
48 class XMLEventsImportContext
;
51 struct ParsedRDFaAttributes
;
54 namespace com
{ namespace sun
{ namespace star
{
62 namespace frame
{ class XModel
; }
63 namespace container
{ class XNameContainer
; class XIndexReplace
; class XNameAccess
; }
64 namespace beans
{ class XPropertySet
; }
65 namespace xml
{ namespace sax
{ class XAttributeList
; } }
66 namespace util
{ struct DateTime
; }
67 namespace lang
{ class XMultiServiceFactory
; }
70 enum SwXMLTextElemTokens
75 XML_TOK_TEXT_FRAME_PAGE
,
77 XML_TOK_TEXT_VARFIELD_DECLS
,
78 XML_TOK_TEXT_USERFIELD_DECLS
,
79 XML_TOK_TEXT_SEQUENCE_DECLS
,
80 XML_TOK_TEXT_DDE_DECLS
,
84 XML_TOK_TEXT_OBJECT_INDEX
,
85 XML_TOK_TEXT_TABLE_INDEX
,
86 XML_TOK_TEXT_ILLUSTRATION_INDEX
,
87 XML_TOK_TEXT_USER_INDEX
,
88 XML_TOK_TEXT_ALPHABETICAL_INDEX
,
89 XML_TOK_TEXT_BIBLIOGRAPHY_INDEX
,
90 XML_TOK_TEXT_INDEX_TITLE
,
91 XML_TOK_TEXT_TRACKED_CHANGES
,
92 XML_TOK_TEXT_CHANGE_START
,
93 XML_TOK_TEXT_CHANGE_END
,
96 XML_TOK_TEXT_CALCULATION_SETTINGS
,
97 XML_TOK_TEXT_AUTOMARK
,
98 XML_TOK_TEXT_NUMBERED_PARAGRAPH
,
99 XML_TOK_TEXT_ELEM_END
=XML_TOK_UNKNOWN
102 enum XMLTextPElemTokens
105 XML_TOK_TEXT_TAB_STOP
,
106 XML_TOK_TEXT_LINE_BREAK
,
107 XML_TOK_TEXT_SOFT_PAGE_BREAK
,
110 XML_TOK_TEXT_HYPERLINK
,
114 XML_TOK_TEXT_BOOKMARK
,
115 XML_TOK_TEXT_BOOKMARK_START
,
116 XML_TOK_TEXT_BOOKMARK_END
,
117 XML_TOK_TEXT_REFERENCE
,
118 XML_TOK_TEXT_REFERENCE_START
,
119 XML_TOK_TEXT_REFERENCE_END
,
121 XML_TOK_TEXT_TOC_MARK
, // index marks
122 XML_TOK_TEXT_TOC_MARK_START
,
123 XML_TOK_TEXT_TOC_MARK_END
,
124 XML_TOK_TEXT_USER_INDEX_MARK
,
125 XML_TOK_TEXT_USER_INDEX_MARK_START
,
126 XML_TOK_TEXT_USER_INDEX_MARK_END
,
127 XML_TOK_TEXT_ALPHA_INDEX_MARK
,
128 XML_TOK_TEXT_ALPHA_INDEX_MARK_START
,
129 XML_TOK_TEXT_ALPHA_INDEX_MARK_END
,
131 XML_TOK_TEXT_SENDER_FIRSTNAME
, // sender fields
132 XML_TOK_TEXT_SENDER_LASTNAME
,
133 XML_TOK_TEXT_SENDER_INITIALS
,
134 XML_TOK_TEXT_SENDER_TITLE
,
135 XML_TOK_TEXT_SENDER_POSITION
,
136 XML_TOK_TEXT_SENDER_EMAIL
,
137 XML_TOK_TEXT_SENDER_PHONE_PRIVATE
,
138 XML_TOK_TEXT_SENDER_FAX
,
139 XML_TOK_TEXT_SENDER_COMPANY
,
140 XML_TOK_TEXT_SENDER_PHONE_WORK
,
141 XML_TOK_TEXT_SENDER_STREET
,
142 XML_TOK_TEXT_SENDER_CITY
,
143 XML_TOK_TEXT_SENDER_POSTAL_CODE
,
144 XML_TOK_TEXT_SENDER_COUNTRY
,
145 XML_TOK_TEXT_SENDER_STATE_OR_PROVINCE
,
147 XML_TOK_TEXT_AUTHOR_NAME
, // author fields
148 XML_TOK_TEXT_AUTHOR_INITIALS
,
150 XML_TOK_TEXT_DATE
, // date & time fields
153 XML_TOK_TEXT_PAGE_NUMBER
, // page number fields
154 XML_TOK_TEXT_PAGE_CONTINUATION_STRING
,
156 XML_TOK_TEXT_VARIABLE_SET
, // variable fields
157 XML_TOK_TEXT_VARIABLE_GET
,
158 XML_TOK_TEXT_VARIABLE_INPUT
,
159 XML_TOK_TEXT_USER_FIELD_GET
,
160 XML_TOK_TEXT_USER_FIELD_INPUT
,
161 XML_TOK_TEXT_SEQUENCE
,
162 XML_TOK_TEXT_EXPRESSION
,
163 XML_TOK_TEXT_TEXT_INPUT
,
165 XML_TOK_TEXT_DATABASE_DISPLAY
, // database fields
166 XML_TOK_TEXT_DATABASE_NEXT
,
167 XML_TOK_TEXT_DATABASE_SELECT
,
168 XML_TOK_TEXT_DATABASE_ROW_NUMBER
,
169 XML_TOK_TEXT_DATABASE_NAME
,
171 XML_TOK_TEXT_DOCUMENT_CREATION_AUTHOR
, //document info fields
172 XML_TOK_TEXT_DOCUMENT_CREATION_DATE
,
173 XML_TOK_TEXT_DOCUMENT_CREATION_TIME
,
174 XML_TOK_TEXT_DOCUMENT_DESCRIPTION
,
175 XML_TOK_TEXT_DOCUMENT_PRINT_AUTHOR
,
176 XML_TOK_TEXT_DOCUMENT_PRINT_DATE
,
177 XML_TOK_TEXT_DOCUMENT_PRINT_TIME
,
178 XML_TOK_TEXT_DOCUMENT_TITLE
,
179 XML_TOK_TEXT_DOCUMENT_SUBJECT
,
180 XML_TOK_TEXT_DOCUMENT_KEYWORDS
,
181 XML_TOK_TEXT_DOCUMENT_REVISION
,
182 XML_TOK_TEXT_DOCUMENT_EDIT_DURATION
,
183 XML_TOK_TEXT_DOCUMENT_SAVE_AUTHOR
,
184 XML_TOK_TEXT_DOCUMENT_SAVE_DATE
,
185 XML_TOK_TEXT_DOCUMENT_SAVE_TIME
,
186 XML_TOK_TEXT_DOCUMENT_USER_DEFINED
,
188 XML_TOK_TEXT_PLACEHOLDER
, // misc. fields
189 XML_TOK_TEXT_CONDITIONAL_TEXT
,
190 XML_TOK_TEXT_HIDDEN_TEXT
,
191 XML_TOK_TEXT_HIDDEN_PARAGRAPH
,
192 XML_TOK_TEXT_FILENAME
,
193 XML_TOK_TEXT_CHAPTER
,
194 XML_TOK_TEXT_TEMPLATENAME
,
195 XML_TOK_TEXT_WORD_COUNT
, // statistics/count fields
196 XML_TOK_TEXT_PARAGRAPH_COUNT
,
197 XML_TOK_TEXT_TABLE_COUNT
,
198 XML_TOK_TEXT_CHARACTER_COUNT
,
199 XML_TOK_TEXT_IMAGE_COUNT
,
200 XML_TOK_TEXT_OBJECT_COUNT
,
201 XML_TOK_TEXT_PAGE_COUNT
,
202 XML_TOK_TEXT_GET_PAGE_VAR
,
203 XML_TOK_TEXT_SET_PAGE_VAR
,
206 XML_TOK_TEXT_REFERENCE_REF
,
207 XML_TOK_TEXT_BOOKMARK_REF
,
208 XML_TOK_TEXT_SEQUENCE_REF
,
209 XML_TOK_TEXT_NOTE_REF
,
210 XML_TOK_TEXT_SHEET_NAME
,
211 XML_TOK_TEXT_PAGE_NAME
,
212 XML_TOK_TEXT_BIBLIOGRAPHY_MARK
,
213 XML_TOK_TEXT_ANNOTATION
,
214 XML_TOK_TEXT_ANNOTATION_END
,
217 XML_TOK_TEXT_TABLE_FORMULA
,
218 XML_TOK_TEXT_DROP_DOWN
,
222 XML_TOK_TEXT_META_FIELD
,
225 XML_TOK_TEXTP_CHANGE_START
, // TEXTP avoids clash with SwXMLTextElemTokens
226 XML_TOK_TEXTP_CHANGE_END
,
227 XML_TOK_TEXTP_CHANGE
,
229 XML_TOK_TEXT_MEASURE
,
233 XML_TOK_DRAW_DATE_TIME
,
234 XML_TOK_TEXT_PAGE_CONTINUATION
,
236 XML_TOK_TEXT_FIELDMARK
,
237 XML_TOK_TEXT_FIELDMARK_START
,
238 XML_TOK_TEXT_FIELDMARK_END
,
240 XML_TOK_TEXT_P_ELEM_END
=XML_TOK_UNKNOWN
243 enum XMLTextPAttrTokens
245 XML_TOK_TEXT_P_XMLID
,
246 XML_TOK_TEXT_P_ABOUT
,
247 XML_TOK_TEXT_P_PROPERTY
,
248 XML_TOK_TEXT_P_CONTENT
,
249 XML_TOK_TEXT_P_DATATYPE
,
250 XML_TOK_TEXT_P_TEXTID
,
251 XML_TOK_TEXT_P_STYLE_NAME
,
252 XML_TOK_TEXT_P_COND_STYLE_NAME
,
253 XML_TOK_TEXT_P_LEVEL
,
254 XML_TOK_TEXT_P_CLASS_NAMES
,
255 XML_TOK_TEXT_P_IS_LIST_HEADER
,
256 XML_TOK_TEXT_P_RESTART_NUMBERING
,
257 XML_TOK_TEXT_P_START_VALUE
,
258 XML_TOK_TEXT_P_END
=XML_TOK_UNKNOWN
261 enum XMLTextNumberedParagraphAttrTokens
263 XML_TOK_TEXT_NUMBERED_PARAGRAPH_XMLID
,
264 XML_TOK_TEXT_NUMBERED_PARAGRAPH_LIST_ID
,
265 XML_TOK_TEXT_NUMBERED_PARAGRAPH_LEVEL
,
266 XML_TOK_TEXT_NUMBERED_PARAGRAPH_STYLE_NAME
,
267 XML_TOK_TEXT_NUMBERED_PARAGRAPH_CONTINUE_NUMBERING
,
268 XML_TOK_TEXT_NUMBERED_PARAGRAPH_START_VALUE
,
269 XML_TOK_TEXT_NUMBERED_PARAGRAPH_END
=XML_TOK_UNKNOWN
272 enum XMLTextListBlockAttrTokens
274 XML_TOK_TEXT_LIST_BLOCK_XMLID
,
275 XML_TOK_TEXT_LIST_BLOCK_STYLE_NAME
,
276 XML_TOK_TEXT_LIST_BLOCK_CONTINUE_NUMBERING
,
277 XML_TOK_TEXT_LIST_BLOCK_ID
,
278 XML_TOK_TEXT_LIST_BLOCK_CONTINUE_LIST
,
279 XML_TOK_TEXT_LIST_BLOCK_END
=XML_TOK_UNKNOWN
282 enum XMLTextListBlockElemTokens
284 XML_TOK_TEXT_LIST_HEADER
,
285 XML_TOK_TEXT_LIST_ITEM
,
286 XML_TOK_TEXT_LIST_BLOCK_ELEM_END
=XML_TOK_UNKNOWN
289 enum XMLTextFrameAttrTokens
291 XML_TOK_TEXT_FRAME_STYLE_NAME
,
292 XML_TOK_TEXT_FRAME_NAME
,
293 XML_TOK_TEXT_FRAME_ANCHOR_TYPE
,
294 XML_TOK_TEXT_FRAME_ANCHOR_PAGE_NUMBER
,
295 XML_TOK_TEXT_FRAME_X
,
296 XML_TOK_TEXT_FRAME_Y
,
297 XML_TOK_TEXT_FRAME_WIDTH
,
298 XML_TOK_TEXT_FRAME_REL_WIDTH
,
299 XML_TOK_TEXT_FRAME_HEIGHT
,
300 XML_TOK_TEXT_FRAME_MIN_HEIGHT
,
301 XML_TOK_TEXT_FRAME_REL_HEIGHT
,
302 XML_TOK_TEXT_FRAME_NEXT_CHAIN_NAME
,
303 XML_TOK_TEXT_FRAME_HREF
,
304 XML_TOK_TEXT_FRAME_FILTER_NAME
,
305 XML_TOK_TEXT_FRAME_Z_INDEX
,
306 XML_TOK_TEXT_FRAME_TRANSFORM
,
307 XML_TOK_TEXT_FRAME_CLASS_ID
,
308 XML_TOK_TEXT_FRAME_CODE
,
309 XML_TOK_TEXT_FRAME_OBJECT
,
310 XML_TOK_TEXT_FRAME_ARCHIVE
,
311 XML_TOK_TEXT_FRAME_MAY_SCRIPT
,
312 XML_TOK_TEXT_FRAME_MIME_TYPE
,
313 XML_TOK_TEXT_FRAME_APPLET_NAME
,
314 XML_TOK_TEXT_FRAME_FRAME_NAME
,
315 XML_TOK_TEXT_FRAME_NOTIFY_ON_UPDATE
,
316 XML_TOK_TEXT_FRAME_MIN_WIDTH
,
317 XML_TOK_TEXT_FRAME_END
=XML_TOK_UNKNOWN
320 enum XMLTextHyperlinkAttrTokens
322 XML_TOK_TEXT_HYPERLINK_HREF
,
323 XML_TOK_TEXT_HYPERLINK_NAME
,
324 XML_TOK_TEXT_HYPERLINK_TARGET_FRAME
,
325 XML_TOK_TEXT_HYPERLINK_SHOW
,
326 XML_TOK_TEXT_HYPERLINK_STYLE_NAME
,
327 XML_TOK_TEXT_HYPERLINK_VIS_STYLE_NAME
,
328 XML_TOK_TEXT_HYPERLINK_SERVER_MAP
,
329 XML_TOK_TEXT_HYPERLINK_END
=XML_TOK_UNKNOWN
332 enum XMLTextPageMasterElemTokens
334 XML_TOK_TEXT_MP_HEADER
,
335 XML_TOK_TEXT_MP_FOOTER
,
336 XML_TOK_TEXT_MP_HEADER_LEFT
,
337 XML_TOK_TEXT_MP_FOOTER_LEFT
,
338 XML_TOK_TEXT_MP_HEADER_FIRST
,
339 XML_TOK_TEXT_MP_FOOTER_FIRST
,
340 XML_TOK_TEXT_MP_END
=XML_TOK_UNKNOWN
343 enum XMLTextContourAttrTokens
345 XML_TOK_TEXT_CONTOUR_WIDTH
,
346 XML_TOK_TEXT_CONTOUR_HEIGHT
,
347 XML_TOK_TEXT_CONTOUR_VIEWBOX
,
348 XML_TOK_TEXT_CONTOUR_POINTS
,
349 XML_TOK_TEXT_CONTOUR_D
,
350 XML_TOK_TEXT_CONTOUR_AUTO
,
351 XML_TOK_TEXT_CONTOUR_END
=XML_TOK_UNKNOWN
365 /// variable type (for XMLSetVarFieldImportContext)
371 // see following NOTE!
374 // NOTE: these values must be distinct from any in "enum VarType" because they
375 // are used as keys to SvI18NMap::Add()
376 #define XML_TEXT_RENAME_TYPE_FRAME 10
377 #define XML_TEXT_RENAME_TYPE_TABLE 20
379 class XMLOFF_DLLPUBLIC XMLTextImportHelper
: public salhelper::SimpleReferenceObject
382 XMLTextImportHelper(const XMLTextImportHelper
&) = delete;
383 XMLTextImportHelper
& operator=(const XMLTextImportHelper
&) = delete;
386 std::unique_ptr
<Impl
> m_xImpl
;
387 /// ugly, but implementation of this is in XMLPropertyBackpatcher.cxx
388 struct BackpatcherImpl
;
389 std::shared_ptr
<BackpatcherImpl
> m_xBackpatcherImpl
;
390 static std::shared_ptr
<BackpatcherImpl
> MakeBackpatcherImpl();
393 virtual SvXMLImportContext
*CreateTableChildContext(
394 SvXMLImport
& rImport
,
395 sal_uInt16 nPrefix
, const OUString
& rLocalName
,
396 const css::uno::Reference
< css::xml::sax::XAttributeList
> & xAttrList
);
398 // access, lazy initialization and destruction of backpatchers
399 // Code is implemented in XMLPropertyBackpatcher.cxx
400 inline XMLPropertyBackpatcher
<sal_Int16
>& GetFootnoteBP();
401 inline XMLPropertyBackpatcher
<sal_Int16
>& GetSequenceIdBP();
402 inline XMLPropertyBackpatcher
< OUString
> & GetSequenceNameBP();
407 css::uno::Reference
< css::frame::XModel
> const& rModel
,
408 SvXMLImport
& rImport
,
409 bool const bInsertMode
= false, bool const bStylesOnlyMode
= false,
410 bool const bProgress
= false, bool const bBlockMode
= false,
411 bool const bOrganizerMode
= false);
413 virtual ~XMLTextImportHelper() override
;
416 const css::uno::Reference
< css::text::XTextCursor
>& rCursor
);
419 void SetAutoStyles( SvXMLStylesContext
*pStyles
);
421 SvXMLImportContext
*CreateTextChildContext(
422 SvXMLImport
& rImport
,
423 sal_uInt16 nPrefix
, const OUString
& rLocalName
,
424 const css::uno::Reference
< css::xml::sax::XAttributeList
> & xAttrList
,
425 XMLTextType eType
= XMLTextType::Shape
);
427 SvXMLTokenMap
const& GetTextElemTokenMap();
428 SvXMLTokenMap
const& GetTextPElemTokenMap();
429 SvXMLTokenMap
const& GetTextPAttrTokenMap();
430 SvXMLTokenMap
const& GetTextFrameAttrTokenMap();
431 SvXMLTokenMap
const& GetTextContourAttrTokenMap();
432 SvXMLTokenMap
const& GetTextHyperlinkAttrTokenMap();
433 SvXMLTokenMap
const& GetTextMasterPageElemTokenMap();
435 const SvXMLTokenMap
& GetTextNumberedParagraphAttrTokenMap();
436 const SvXMLTokenMap
& GetTextListBlockAttrTokenMap();
437 const SvXMLTokenMap
& GetTextListBlockElemTokenMap();
438 const SvXMLTokenMap
& GetTextFieldAttrTokenMap(); // impl: txtfldi.cxx
440 css::uno::Reference
< css::text::XText
> & GetText();
441 css::uno::Reference
< css::text::XTextCursor
> & GetCursor();
442 css::uno::Reference
< css::text::XTextRange
> & GetCursorAsRange();
444 bool IsInsertMode() const;
445 bool IsStylesOnlyMode() const;
446 bool IsBlockMode() const;
447 bool IsOrganizerMode() const;
448 bool IsProgress() const;
450 OUString
ConvertStarFonts( const OUString
& rChars
,
451 const OUString
& rStyleName
,
454 SvXMLImport
& rImport
) const;
455 // insert a string without special whitespace processing enabled
456 void InsertString( const OUString
& rChars
);
457 // insert a string with special whitespace processing enabled
458 void InsertString( const OUString
& rChars
,
459 bool& rIgnoreLeadingSpace
);
460 // Delete current paragraph
461 void DeleteParagraph();
463 void InsertControlCharacter( sal_Int16 nControl
);
464 void InsertTextContent( css::uno::Reference
< css::text::XTextContent
> & xContent
);
466 // Add parameter <bOutlineLevelAttrFound> (#i73509#)
467 // Add parameter <bSetListAttrs> in order to suppress the handling of the list attributes (#i80724#)
468 OUString
SetStyleAndAttrs(
469 SvXMLImport
& rImport
,
470 const css::uno::Reference
< css::text::XTextCursor
>& rCursor
,
471 const OUString
& rStyleName
,
473 bool bOutlineLevelAttrFound
= false,
474 sal_Int8 nOutlineLevel
= -1,
475 bool bSetListAttrs
= true );
477 /** Find a suitable name for the given outline level.
478 * If rStyleName is empty, change it to a previously used or default style
479 * name for that level. Otherwise, leave rStyleName unmodified.
481 // Adjust 2nd parameter (#i69629#)
482 void FindOutlineStyleName( OUString
& rStyleName
,
483 sal_Int8 nOutlineLevel
);
485 // Change method name to reflect change of data structure (#i69629#)
486 void AddOutlineStyleCandidate( const sal_Int8 nOutlineLevel
,
487 const OUString
& rStyleName
);
489 void SetOutlineStyles( bool bSetEmpty
);
492 SvXMLImport
& rImport
,
493 const css::uno::Reference
< css::text::XTextCursor
>& rCursor
,
494 const OUString
& rHRef
,
495 const OUString
& rName
,
496 const OUString
& rTargetFrameName
,
497 const OUString
& rStyleName
,
498 const OUString
& rVisitedStyleName
,
499 XMLEventsImportContext
* pEvents
);
501 SvXMLImport
& rImport
,
502 const css::uno::Reference
< css::text::XTextCursor
>& rCursor
,
503 const OUString
& rStyleName
,
504 const OUString
& rTextStyleName
,
505 const OUString
& rText
);
507 /// return key appropriate for use with NumberFormat property
508 /// return -1 if style is not found
509 /// (may return whether data style uses the system language)
510 sal_Int32
GetDataStyleKey( const OUString
& sStyleName
,
511 bool* pIsSystemLanguage
= nullptr );
513 const SvxXMLListStyleContext
*FindAutoListStyle(
514 const OUString
& rName
) const;
515 XMLPropStyleContext
*FindAutoFrameStyle(
516 const OUString
& rName
) const;
517 XMLPropStyleContext
* FindSectionStyle(
518 const OUString
& rName
) const;
519 XMLPropStyleContext
* FindPageMaster(
520 const OUString
& rName
) const;
522 const css::uno::Reference
< css::container::XNameContainer
> & GetParaStyles() const;
524 const css::uno::Reference
< css::container::XNameContainer
> & GetTextStyles() const;
526 const css::uno::Reference
< css::container::XNameContainer
> &
527 GetNumberingStyles() const;
529 const css::uno::Reference
< css::container::XNameContainer
> & GetFrameStyles() const;
531 const css::uno::Reference
< css::container::XNameContainer
> & GetPageStyles() const;
533 const css::uno::Reference
< css::container::XNameContainer
> & GetCellStyles() const;
535 const css::uno::Reference
< css::container::XIndexReplace
> &
536 GetChapterNumbering() const;
538 bool HasFrameByName( const OUString
& rName
) const;
540 bool IsDuplicateFrame(const OUString
& sName
, sal_Int32 nX
, sal_Int32 nY
, sal_Int32 nWidth
, sal_Int32 nHeight
) const;
541 void StoreLastImportedFrameName(const OUString
& rName
);
542 void ClearLastImportedTextFrameName();
544 void ConnectFrameChains( const OUString
& rFrmName
,
545 const OUString
& rNextFrmName
,
546 const css::uno::Reference
< css::beans::XPropertySet
>& rFrmPropSet
);
548 rtl::Reference
< SvXMLImportPropertyMapper
> const&
549 GetParaImportPropertySetMapper() const;
550 rtl::Reference
< SvXMLImportPropertyMapper
> const&
551 GetTextImportPropertySetMapper() const;
552 rtl::Reference
< SvXMLImportPropertyMapper
> const&
553 GetSectionImportPropertySetMapper() const;
554 rtl::Reference
< SvXMLImportPropertyMapper
> const&
555 GetRubyImportPropertySetMapper() const;
557 static SvXMLImportPropertyMapper
*CreateShapeExtPropMapper(SvXMLImport
&);
558 static SvXMLImportPropertyMapper
*CreateParaExtPropMapper(SvXMLImport
&);
559 static SvXMLImportPropertyMapper
* CreateParaDefaultExtPropMapper(SvXMLImport
&);
560 static SvXMLImportPropertyMapper
* CreateTableDefaultExtPropMapper(SvXMLImport
&);
561 static SvXMLImportPropertyMapper
* CreateTableRowDefaultExtPropMapper(SvXMLImport
&);
562 static SvXMLImportPropertyMapper
* CreateTableCellExtPropMapper(SvXMLImport
&);
564 SvI18NMap
& GetRenameMap();
566 /// save the start of a range reference
567 void InsertBookmarkStartRange(
568 const OUString
& sName
,
569 const css::uno::Reference
< css::text::XTextRange
> & rRange
,
570 OUString
const& i_rXmlId
,
571 std::shared_ptr
< ::xmloff::ParsedRDFaAttributes
> &
574 /// process the start of a range reference
575 bool FindAndRemoveBookmarkStartRange(
576 const OUString
& sName
,
577 css::uno::Reference
< css::text::XTextRange
> & o_rRange
,
579 std::shared_ptr
< ::xmloff::ParsedRDFaAttributes
> & o_rpRDFaAttributes
);
581 OUString
FindActiveBookmarkName();
583 void pushFieldCtx( const OUString
& name
, const OUString
& type
);
585 void addFieldParam( const OUString
& name
, const OUString
& value
);
586 void setCurrentFieldParamsTo(css::uno::Reference
< css::text::XFormField
> &xFormField
);
587 OUString
getCurrentFieldType();
588 bool hasCurrentFieldCtx();
591 /// insert new footnote ID.
592 /// Also fixup open references from the backpatch list to this ID.
593 // Code is implemented in XMLPropertyBackpatcher.cxx
594 void InsertFootnoteID(const OUString
& sXMLId
, sal_Int16 nAPIId
);
596 /// set the proper footnote reference ID,
597 /// or put into backpatch list if ID is unknown
598 // Code is implemented in XMLPropertyBackpatcher.cxx
599 void ProcessFootnoteReference(
600 const OUString
& sXMLId
,
601 const css::uno::Reference
< css::beans::XPropertySet
> & xPropSet
);
603 /// insert new sequence ID
604 /// Also fixup open references from backpatch list to this ID.
605 // Code is implemented in XMLPropertyBackpatcher.cxx
606 void InsertSequenceID(const OUString
& sXMLId
,
607 const OUString
& sName
,
610 /// set sequence ID or insert into backpatch list
611 // Code is implemented in XMLPropertyBackpatcher.cxx
612 void ProcessSequenceReference(
613 const OUString
& sXMLId
,
614 const css::uno::Reference
< css::beans::XPropertySet
> & xPropSet
);
616 bool IsInFrame() const;
617 virtual bool IsInHeaderFooter() const;
619 virtual css::uno::Reference
< css::beans::XPropertySet
>
620 createAndInsertOLEObject( SvXMLImport
& rImport
,
621 const OUString
& rHRef
,
622 const OUString
&rStyleName
,
623 const OUString
&rTblName
,
624 sal_Int32 nWidth
, sal_Int32 nHeight
);
626 virtual css::uno::Reference
< css::beans::XPropertySet
>
627 createAndInsertOOoLink( SvXMLImport
& rImport
,
628 const OUString
& rHRef
,
629 const OUString
&rStyleName
,
630 const OUString
&rTblName
,
631 sal_Int32 nWidth
, sal_Int32 nHeight
);
633 virtual css::uno::Reference
< css::beans::XPropertySet
>
634 createAndInsertApplet(
635 const OUString
&rName
,
636 const OUString
&rCode
,
638 const OUString
& rHRef
,
639 sal_Int32 nWidth
, sal_Int32 nHeight
);
641 virtual css::uno::Reference
< css::beans::XPropertySet
>
642 createAndInsertPlugin(
643 const OUString
&rMimeType
,
644 const OUString
& rHRef
,
645 sal_Int32 nWidth
, sal_Int32 nHeight
);
647 virtual css::uno::Reference
< css::beans::XPropertySet
>
648 createAndInsertFloatingFrame(
649 const OUString
&rName
,
650 const OUString
&rHRef
,
651 const OUString
&rStyleName
,
652 sal_Int32 nWidth
, sal_Int32 nHeight
);
654 virtual void endAppletOrPlugin(
655 const css::uno::Reference
< css::beans::XPropertySet
> &rPropSet
,
656 ::std::map
< const OUString
, OUString
> &rParamMap
);
658 // applet helper methods
659 // implemented in sw/filter/xml/txtparai.hxx
661 // redlining helper methods
662 // (to be implemented in sw/filter/xml/txtparai.hxx)
664 virtual void RedlineAdd(
665 /// redline type (insert, del,... )
666 const OUString
& rType
,
667 /// use to identify this redline
669 /// name of the author
670 const OUString
& rAuthor
,
672 const OUString
& rComment
,
674 const css::util::DateTime
& rDateTime
,
676 bool bMergeLastParagraph
);
678 virtual css::uno::Reference
< css::text::XTextCursor
> RedlineCreateText(
679 /// needed to get the document
680 css::uno::Reference
< css::text::XTextCursor
> & rOldCursor
,
681 /// ID used to RedlineAdd() call
682 const OUString
& rId
);
684 virtual void RedlineSetCursor(
685 /// ID used to RedlineAdd() call
687 /// start or end Cursor
689 /// range is not within <text:p>
690 bool bIsOutsideOfParagraph
);
692 virtual void RedlineAdjustStartNodeCursor( bool bStart
);
693 virtual void SetShowChanges( bool bShowChanges
);
694 virtual void SetRecordChanges( bool bRecordChanges
);
695 virtual void SetChangesProtectionKey(
696 const css::uno::Sequence
<sal_Int8
> & rProtectionKey
);
698 /// get the last open redline ID
699 OUString
GetOpenRedlineId();
700 /// modify the last open redline ID
701 void SetOpenRedlineId( OUString
const & rId
);
702 /// reset the last open redline ID
703 void ResetOpenRedlineId();
705 /** redlining : Setter to remember the fact we are inside/outside
706 * a <text:deletion> element (deleted redline section) */
707 void SetInsideDeleteContext(bool const bNew
);
708 /** redlining : Getter to know if we are inside
709 * a <text:deletion> element (deleted redline section) */
710 bool IsInsideDeleteContext() const;
712 SvXMLImport
& GetXMLImport();
714 XMLTextListsHelper
& GetTextListHelper();
716 // forwards to TextListHelper; these are used in many places
717 /// push a list context on the list context stack
718 void PushListContext();
719 /// pop the list context stack
720 void PopListContext();
722 void SetCellParaStyleDefault(OUString
const& rNewValue
);
723 OUString
const& GetCellParaStyleDefault();
725 void AddCrossRefHeadingMapping(OUString
const& rFrom
, OUString
const& rTo
);
726 void MapCrossRefHeadingFieldsHorribly();
731 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */