Version 5.4.3.2, tag libreoffice-5.4.3.2
[LibreOffice.git] / include / xmloff / txtimp.hxx
blob109469cf74ba1dfc9cb3643bf6c99745648b96f7
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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>
27 #include <map>
28 #include <memory>
30 #include <xmloff/xmltkmap.hxx>
31 #include <rtl/ref.hxx>
32 #include <salhelper/simplereferenceobject.hxx>
34 class XMLTextListsHelper;
35 class SvXMLImportContext;
36 class SvXMLTokenMap;
37 class SvXMLImportPropertyMapper;
38 class SvXMLNamespaceMap;
39 class SvXMLImport;
40 class SvXMLStylesContext;
41 class XMLTextListBlockContext;
42 class SvxXMLListStyleContext;
43 class XMLPropStyleContext;
44 class SvI18NMap;
45 class XMLSectionImportContext;
46 class XMLFontStylesContext;
47 template<class A> class XMLPropertyBackpatcher;
48 class XMLEventsImportContext;
50 namespace xmloff {
51 struct ParsedRDFaAttributes;
54 namespace com { namespace sun { namespace star {
55 namespace text {
56 class XText;
57 class XTextCursor;
58 class XTextRange;
59 class XTextContent;
60 class XFormField;
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; }
68 } } }
70 enum SwXMLTextElemTokens
72 XML_TOK_TEXT_P,
73 XML_TOK_TEXT_H,
74 XML_TOK_TEXT_LIST,
75 XML_TOK_TEXT_FRAME_PAGE,
76 XML_TOK_TABLE_TABLE,
77 XML_TOK_TEXT_VARFIELD_DECLS,
78 XML_TOK_TEXT_USERFIELD_DECLS,
79 XML_TOK_TEXT_SEQUENCE_DECLS,
80 XML_TOK_TEXT_DDE_DECLS,
81 XML_TOK_DRAW_A_PAGE,
82 XML_TOK_TEXT_SECTION,
83 XML_TOK_TEXT_TOC,
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,
94 XML_TOK_TEXT_CHANGE,
95 XML_TOK_TEXT_FORMS,
96 XML_TOK_TEXT_CALCULATION_SETTINGS,
97 XML_TOK_TEXT_AUTOMARK,
98 XML_TOK_TEXT_NUMBERED_PARAGRAPH
101 enum XMLTextPElemTokens
103 XML_TOK_TEXT_SPAN,
104 XML_TOK_TEXT_TAB_STOP,
105 XML_TOK_TEXT_LINE_BREAK,
106 XML_TOK_TEXT_SOFT_PAGE_BREAK,
107 XML_TOK_TEXT_S,
108 XML_TOK_TEXT_FRAME,
109 XML_TOK_TEXT_HYPERLINK,
110 XML_TOK_TEXT_RUBY,
112 XML_TOK_TEXT_NOTE,
113 XML_TOK_TEXT_BOOKMARK,
114 XML_TOK_TEXT_BOOKMARK_START,
115 XML_TOK_TEXT_BOOKMARK_END,
116 XML_TOK_TEXT_REFERENCE,
117 XML_TOK_TEXT_REFERENCE_START,
118 XML_TOK_TEXT_REFERENCE_END,
120 XML_TOK_TEXT_TOC_MARK, // index marks
121 XML_TOK_TEXT_TOC_MARK_START,
122 XML_TOK_TEXT_TOC_MARK_END,
123 XML_TOK_TEXT_USER_INDEX_MARK,
124 XML_TOK_TEXT_USER_INDEX_MARK_START,
125 XML_TOK_TEXT_USER_INDEX_MARK_END,
126 XML_TOK_TEXT_ALPHA_INDEX_MARK,
127 XML_TOK_TEXT_ALPHA_INDEX_MARK_START,
128 XML_TOK_TEXT_ALPHA_INDEX_MARK_END,
130 XML_TOK_TEXT_SENDER_FIRSTNAME, // sender fields
131 XML_TOK_TEXT_SENDER_LASTNAME,
132 XML_TOK_TEXT_SENDER_INITIALS,
133 XML_TOK_TEXT_SENDER_TITLE,
134 XML_TOK_TEXT_SENDER_POSITION,
135 XML_TOK_TEXT_SENDER_EMAIL,
136 XML_TOK_TEXT_SENDER_PHONE_PRIVATE,
137 XML_TOK_TEXT_SENDER_FAX,
138 XML_TOK_TEXT_SENDER_COMPANY,
139 XML_TOK_TEXT_SENDER_PHONE_WORK,
140 XML_TOK_TEXT_SENDER_STREET,
141 XML_TOK_TEXT_SENDER_CITY,
142 XML_TOK_TEXT_SENDER_POSTAL_CODE,
143 XML_TOK_TEXT_SENDER_COUNTRY,
144 XML_TOK_TEXT_SENDER_STATE_OR_PROVINCE,
146 XML_TOK_TEXT_AUTHOR_NAME, // author fields
147 XML_TOK_TEXT_AUTHOR_INITIALS,
149 XML_TOK_TEXT_DATE, // date & time fields
150 XML_TOK_TEXT_TIME,
152 XML_TOK_TEXT_PAGE_NUMBER, // page number fields
153 XML_TOK_TEXT_PAGE_CONTINUATION_STRING,
155 XML_TOK_TEXT_VARIABLE_SET, // variable fields
156 XML_TOK_TEXT_VARIABLE_GET,
157 XML_TOK_TEXT_VARIABLE_INPUT,
158 XML_TOK_TEXT_USER_FIELD_GET,
159 XML_TOK_TEXT_USER_FIELD_INPUT,
160 XML_TOK_TEXT_SEQUENCE,
161 XML_TOK_TEXT_EXPRESSION,
162 XML_TOK_TEXT_TEXT_INPUT,
164 XML_TOK_TEXT_DATABASE_DISPLAY, // database fields
165 XML_TOK_TEXT_DATABASE_NEXT,
166 XML_TOK_TEXT_DATABASE_SELECT,
167 XML_TOK_TEXT_DATABASE_ROW_NUMBER,
168 XML_TOK_TEXT_DATABASE_NAME,
170 XML_TOK_TEXT_DOCUMENT_CREATION_AUTHOR, //document info fields
171 XML_TOK_TEXT_DOCUMENT_CREATION_DATE,
172 XML_TOK_TEXT_DOCUMENT_CREATION_TIME,
173 XML_TOK_TEXT_DOCUMENT_DESCRIPTION,
174 XML_TOK_TEXT_DOCUMENT_PRINT_AUTHOR,
175 XML_TOK_TEXT_DOCUMENT_PRINT_DATE,
176 XML_TOK_TEXT_DOCUMENT_PRINT_TIME,
177 XML_TOK_TEXT_DOCUMENT_TITLE,
178 XML_TOK_TEXT_DOCUMENT_SUBJECT,
179 XML_TOK_TEXT_DOCUMENT_KEYWORDS,
180 XML_TOK_TEXT_DOCUMENT_REVISION,
181 XML_TOK_TEXT_DOCUMENT_EDIT_DURATION,
182 XML_TOK_TEXT_DOCUMENT_SAVE_AUTHOR,
183 XML_TOK_TEXT_DOCUMENT_SAVE_DATE,
184 XML_TOK_TEXT_DOCUMENT_SAVE_TIME,
185 XML_TOK_TEXT_DOCUMENT_USER_DEFINED,
187 XML_TOK_TEXT_PLACEHOLDER, // misc. fields
188 XML_TOK_TEXT_CONDITIONAL_TEXT,
189 XML_TOK_TEXT_HIDDEN_TEXT,
190 XML_TOK_TEXT_HIDDEN_PARAGRAPH,
191 XML_TOK_TEXT_FILENAME,
192 XML_TOK_TEXT_CHAPTER,
193 XML_TOK_TEXT_TEMPLATENAME,
194 XML_TOK_TEXT_WORD_COUNT, // statistics/count fields
195 XML_TOK_TEXT_PARAGRAPH_COUNT,
196 XML_TOK_TEXT_TABLE_COUNT,
197 XML_TOK_TEXT_CHARACTER_COUNT,
198 XML_TOK_TEXT_IMAGE_COUNT,
199 XML_TOK_TEXT_OBJECT_COUNT,
200 XML_TOK_TEXT_PAGE_COUNT,
201 XML_TOK_TEXT_GET_PAGE_VAR,
202 XML_TOK_TEXT_SET_PAGE_VAR,
203 XML_TOK_TEXT_MACRO,
204 XML_TOK_TEXT_DDE,
205 XML_TOK_TEXT_REFERENCE_REF,
206 XML_TOK_TEXT_BOOKMARK_REF,
207 XML_TOK_TEXT_SEQUENCE_REF,
208 XML_TOK_TEXT_NOTE_REF,
209 XML_TOK_TEXT_SHEET_NAME,
210 XML_TOK_TEXT_PAGE_NAME,
211 XML_TOK_TEXT_BIBLIOGRAPHY_MARK,
212 XML_TOK_TEXT_ANNOTATION,
213 XML_TOK_TEXT_ANNOTATION_END,
214 XML_TOK_TEXT_NAME,
215 XML_TOK_TEXT_SCRIPT,
216 XML_TOK_TEXT_TABLE_FORMULA,
217 XML_TOK_TEXT_DROP_DOWN,
219 // RDF metadata
220 XML_TOK_TEXT_META,
221 XML_TOK_TEXT_META_FIELD,
223 // misc
224 XML_TOK_TEXTP_CHANGE_START, // TEXTP avoids clash with SwXMLTextElemTokens
225 XML_TOK_TEXTP_CHANGE_END,
226 XML_TOK_TEXTP_CHANGE,
227 XML_TOK_DRAW_A,
228 XML_TOK_TEXT_MEASURE,
230 XML_TOK_DRAW_HEADER,
231 XML_TOK_DRAW_FOOTER,
232 XML_TOK_DRAW_DATE_TIME,
233 XML_TOK_TEXT_PAGE_CONTINUATION,
235 XML_TOK_TEXT_FIELDMARK,
236 XML_TOK_TEXT_FIELDMARK_START,
237 XML_TOK_TEXT_FIELDMARK_END
240 enum XMLTextPAttrTokens
242 XML_TOK_TEXT_P_XMLID,
243 XML_TOK_TEXT_P_ABOUT,
244 XML_TOK_TEXT_P_PROPERTY,
245 XML_TOK_TEXT_P_CONTENT,
246 XML_TOK_TEXT_P_DATATYPE,
247 XML_TOK_TEXT_P_TEXTID,
248 XML_TOK_TEXT_P_STYLE_NAME,
249 XML_TOK_TEXT_P_COND_STYLE_NAME,
250 XML_TOK_TEXT_P_LEVEL,
251 XML_TOK_TEXT_P_IS_LIST_HEADER,
252 XML_TOK_TEXT_P_RESTART_NUMBERING,
253 XML_TOK_TEXT_P_START_VALUE
256 enum XMLTextNumberedParagraphAttrTokens
258 XML_TOK_TEXT_NUMBERED_PARAGRAPH_XMLID,
259 XML_TOK_TEXT_NUMBERED_PARAGRAPH_LIST_ID,
260 XML_TOK_TEXT_NUMBERED_PARAGRAPH_LEVEL,
261 XML_TOK_TEXT_NUMBERED_PARAGRAPH_STYLE_NAME,
262 XML_TOK_TEXT_NUMBERED_PARAGRAPH_CONTINUE_NUMBERING,
263 XML_TOK_TEXT_NUMBERED_PARAGRAPH_START_VALUE
266 enum XMLTextListBlockAttrTokens
268 XML_TOK_TEXT_LIST_BLOCK_XMLID,
269 XML_TOK_TEXT_LIST_BLOCK_STYLE_NAME,
270 XML_TOK_TEXT_LIST_BLOCK_CONTINUE_NUMBERING,
271 XML_TOK_TEXT_LIST_BLOCK_CONTINUE_LIST
274 enum XMLTextListBlockElemTokens
276 XML_TOK_TEXT_LIST_HEADER,
277 XML_TOK_TEXT_LIST_ITEM
280 enum XMLTextFrameAttrTokens
282 XML_TOK_TEXT_FRAME_STYLE_NAME,
283 XML_TOK_TEXT_FRAME_NAME,
284 XML_TOK_TEXT_FRAME_ANCHOR_TYPE,
285 XML_TOK_TEXT_FRAME_ANCHOR_PAGE_NUMBER,
286 XML_TOK_TEXT_FRAME_X,
287 XML_TOK_TEXT_FRAME_Y,
288 XML_TOK_TEXT_FRAME_WIDTH,
289 XML_TOK_TEXT_FRAME_REL_WIDTH,
290 XML_TOK_TEXT_FRAME_HEIGHT,
291 XML_TOK_TEXT_FRAME_MIN_HEIGHT,
292 XML_TOK_TEXT_FRAME_REL_HEIGHT,
293 XML_TOK_TEXT_FRAME_NEXT_CHAIN_NAME,
294 XML_TOK_TEXT_FRAME_HREF,
295 XML_TOK_TEXT_FRAME_FILTER_NAME,
296 XML_TOK_TEXT_FRAME_Z_INDEX,
297 XML_TOK_TEXT_FRAME_TRANSFORM,
298 XML_TOK_TEXT_FRAME_CLASS_ID,
299 XML_TOK_TEXT_FRAME_CODE,
300 XML_TOK_TEXT_FRAME_OBJECT,
301 XML_TOK_TEXT_FRAME_ARCHIVE,
302 XML_TOK_TEXT_FRAME_MAY_SCRIPT,
303 XML_TOK_TEXT_FRAME_MIME_TYPE,
304 XML_TOK_TEXT_FRAME_APPLET_NAME,
305 XML_TOK_TEXT_FRAME_FRAME_NAME,
306 XML_TOK_TEXT_FRAME_NOTIFY_ON_UPDATE,
307 XML_TOK_TEXT_FRAME_MIN_WIDTH
310 enum XMLTextHyperlinkAttrTokens
312 XML_TOK_TEXT_HYPERLINK_HREF,
313 XML_TOK_TEXT_HYPERLINK_NAME,
314 XML_TOK_TEXT_HYPERLINK_TARGET_FRAME,
315 XML_TOK_TEXT_HYPERLINK_SHOW,
316 XML_TOK_TEXT_HYPERLINK_STYLE_NAME,
317 XML_TOK_TEXT_HYPERLINK_VIS_STYLE_NAME,
318 XML_TOK_TEXT_HYPERLINK_SERVER_MAP
321 enum XMLTextPageMasterElemTokens
323 XML_TOK_TEXT_MP_HEADER,
324 XML_TOK_TEXT_MP_FOOTER,
325 XML_TOK_TEXT_MP_HEADER_LEFT,
326 XML_TOK_TEXT_MP_FOOTER_LEFT,
327 XML_TOK_TEXT_MP_HEADER_FIRST,
328 XML_TOK_TEXT_MP_FOOTER_FIRST
331 enum XMLTextContourAttrTokens
333 XML_TOK_TEXT_CONTOUR_WIDTH,
334 XML_TOK_TEXT_CONTOUR_HEIGHT,
335 XML_TOK_TEXT_CONTOUR_VIEWBOX,
336 XML_TOK_TEXT_CONTOUR_POINTS,
337 XML_TOK_TEXT_CONTOUR_D,
338 XML_TOK_TEXT_CONTOUR_AUTO
340 enum XMLTextType
342 Body,
343 Cell,
344 Shape,
345 TextBox,
346 HeaderFooter,
347 Section,
348 Footnote,
349 ChangedRegion
352 /// variable type (for XMLSetVarFieldImportContext)
353 enum VarType
355 VarTypeSimple,
356 VarTypeUserField,
357 VarTypeSequence
358 // see following NOTE!
361 // NOTE: these values must be distinct from any in "enum VarType" because they
362 // are used as keys to SvI18NMap::Add()
363 #define XML_TEXT_RENAME_TYPE_FRAME 10
364 #define XML_TEXT_RENAME_TYPE_TABLE 20
366 class XMLOFF_DLLPUBLIC XMLTextImportHelper : public salhelper::SimpleReferenceObject
368 private:
369 XMLTextImportHelper(const XMLTextImportHelper&) = delete;
370 XMLTextImportHelper& operator=(const XMLTextImportHelper&) = delete;
372 struct Impl;
373 std::unique_ptr<Impl> m_xImpl;
374 /// ugly, but implementation of this is in XMLPropertyBackpatcher.cxx
375 struct BackpatcherImpl;
376 std::shared_ptr<BackpatcherImpl> m_xBackpatcherImpl;
377 static std::shared_ptr<BackpatcherImpl> MakeBackpatcherImpl();
379 protected:
380 virtual SvXMLImportContext *CreateTableChildContext(
381 SvXMLImport& rImport,
382 sal_uInt16 nPrefix, const OUString& rLocalName,
383 const css::uno::Reference< css::xml::sax::XAttributeList > & xAttrList );
385 // access, lazy initialization and destruction of backpatchers
386 // Code is implemented in XMLPropertyBackpatcher.cxx
387 inline XMLPropertyBackpatcher<sal_Int16>& GetFootnoteBP();
388 inline XMLPropertyBackpatcher<sal_Int16>& GetSequenceIdBP();
389 inline XMLPropertyBackpatcher< OUString> & GetSequenceNameBP();
391 public:
393 XMLTextImportHelper(
394 css::uno::Reference< css::frame::XModel > const& rModel,
395 SvXMLImport& rImport,
396 bool const bInsertMode = false, bool const bStylesOnlyMode = false,
397 bool const bProgress = false, bool const bBlockMode = false,
398 bool const bOrganizerMode = false);
400 virtual ~XMLTextImportHelper() override;
402 void SetCursor(
403 const css::uno::Reference< css::text::XTextCursor >& rCursor );
404 void ResetCursor();
406 void SetAutoStyles( SvXMLStylesContext *pStyles );
408 SvXMLImportContext *CreateTextChildContext(
409 SvXMLImport& rImport,
410 sal_uInt16 nPrefix, const OUString& rLocalName,
411 const css::uno::Reference< css::xml::sax::XAttributeList > & xAttrList,
412 XMLTextType eType = XMLTextType::Shape );
414 SvXMLTokenMap const& GetTextElemTokenMap();
415 SvXMLTokenMap const& GetTextPElemTokenMap();
416 SvXMLTokenMap const& GetTextPAttrTokenMap();
417 SvXMLTokenMap const& GetTextFrameAttrTokenMap();
418 SvXMLTokenMap const& GetTextContourAttrTokenMap();
419 SvXMLTokenMap const& GetTextHyperlinkAttrTokenMap();
420 SvXMLTokenMap const& GetTextMasterPageElemTokenMap();
422 const SvXMLTokenMap& GetTextNumberedParagraphAttrTokenMap();
423 const SvXMLTokenMap& GetTextListBlockAttrTokenMap();
424 const SvXMLTokenMap& GetTextListBlockElemTokenMap();
425 const SvXMLTokenMap& GetTextFieldAttrTokenMap(); // impl: txtfldi.cxx
427 css::uno::Reference< css::text::XText > & GetText();
428 css::uno::Reference< css::text::XTextCursor > & GetCursor();
429 css::uno::Reference< css::text::XTextRange > & GetCursorAsRange();
431 bool IsInsertMode() const;
432 bool IsStylesOnlyMode() const;
433 bool IsBlockMode() const;
434 bool IsOrganizerMode() const;
435 bool IsProgress() const;
437 OUString ConvertStarFonts( const OUString& rChars,
438 const OUString& rStyleName,
439 sal_uInt8& rFlags,
440 bool bPara,
441 SvXMLImport& rImport ) const;
442 // insert a string without special whitespace processing enabled
443 void InsertString( const OUString& rChars );
444 // insert a string with special whitespace processing enabled
445 void InsertString( const OUString& rChars,
446 bool& rIgnoreLeadingSpace );
447 // Delete current paragraph
448 void DeleteParagraph();
450 void InsertControlCharacter( sal_Int16 nControl );
451 void InsertTextContent( css::uno::Reference< css::text::XTextContent > & xContent);
453 // Add parameter <bOutlineLevelAttrFound> (#i73509#)
454 // Add parameter <bSetListAttrs> in order to suppress the handling of the list attributes (#i80724#)
455 OUString SetStyleAndAttrs(
456 SvXMLImport& rImport,
457 const css::uno::Reference< css::text::XTextCursor >& rCursor,
458 const OUString& rStyleName,
459 bool bPara,
460 bool bOutlineLevelAttrFound = false,
461 sal_Int8 nOutlineLevel = -1,
462 bool bSetListAttrs = true );
464 /** Find a suitable name for the given outline level.
465 * If rStyleName is empty, change it to a previously used or default style
466 * name for that level. Otherwise, leave rStyleName unmodified.
468 // Adjust 2nd parameter (#i69629#)
469 void FindOutlineStyleName( OUString& rStyleName,
470 sal_Int8 nOutlineLevel );
472 // Change method name to reflect change of data structure (#i69629#)
473 void AddOutlineStyleCandidate( const sal_Int8 nOutlineLevel,
474 const OUString& rStyleName );
476 void SetOutlineStyles( bool bSetEmpty );
478 void SetHyperlink(
479 SvXMLImport& rImport,
480 const css::uno::Reference< css::text::XTextCursor >& rCursor,
481 const OUString& rHRef,
482 const OUString& rName,
483 const OUString& rTargetFrameName,
484 const OUString& rStyleName,
485 const OUString& rVisitedStyleName,
486 XMLEventsImportContext* pEvents);
487 void SetRuby(
488 SvXMLImport& rImport,
489 const css::uno::Reference< css::text::XTextCursor >& rCursor,
490 const OUString& rStyleName,
491 const OUString& rTextStyleName,
492 const OUString& rText );
494 /// return key appropriate for use with NumberFormat property
495 /// return -1 if style is not found
496 /// (may return whether data style uses the system language)
497 sal_Int32 GetDataStyleKey( const OUString& sStyleName,
498 bool* pIsSystemLanguage = nullptr );
500 const SvxXMLListStyleContext *FindAutoListStyle(
501 const OUString& rName ) const;
502 XMLPropStyleContext *FindAutoFrameStyle(
503 const OUString& rName ) const;
504 XMLPropStyleContext* FindSectionStyle(
505 const OUString& rName ) const;
506 XMLPropStyleContext* FindPageMaster(
507 const OUString& rName ) const;
509 const css::uno::Reference< css::container::XNameContainer> & GetParaStyles() const;
511 const css::uno::Reference< css::container::XNameContainer> & GetTextStyles() const;
513 const css::uno::Reference< css::container::XNameContainer> &
514 GetNumberingStyles() const;
516 const css::uno::Reference< css::container::XNameContainer> & GetFrameStyles() const;
518 const css::uno::Reference< css::container::XNameContainer> & GetPageStyles() const;
520 const css::uno::Reference< css::container::XNameContainer> & GetCellStyles() const;
522 const css::uno::Reference< css::container::XIndexReplace > &
523 GetChapterNumbering() const;
525 bool HasFrameByName( const OUString& rName ) const;
527 bool IsDuplicateFrame(const OUString& sName, sal_Int32 nX, sal_Int32 nY, sal_Int32 nWidth, sal_Int32 nHeight) const;
528 void StoreLastImportedFrameName(const OUString& rName);
529 void ClearLastImportedTextFrameName();
531 void ConnectFrameChains( const OUString& rFrmName,
532 const OUString& rNextFrmName,
533 const css::uno::Reference< css::beans::XPropertySet >& rFrmPropSet );
535 rtl::Reference< SvXMLImportPropertyMapper > const&
536 GetParaImportPropertySetMapper() const;
537 rtl::Reference< SvXMLImportPropertyMapper > const&
538 GetTextImportPropertySetMapper() const;
539 rtl::Reference< SvXMLImportPropertyMapper > const&
540 GetSectionImportPropertySetMapper() const;
541 rtl::Reference< SvXMLImportPropertyMapper > const&
542 GetRubyImportPropertySetMapper() const;
544 static SvXMLImportPropertyMapper *CreateShapeExtPropMapper(SvXMLImport&);
545 static SvXMLImportPropertyMapper *CreateParaExtPropMapper(SvXMLImport&);
546 static SvXMLImportPropertyMapper* CreateParaDefaultExtPropMapper(SvXMLImport&);
547 static SvXMLImportPropertyMapper* CreateTableDefaultExtPropMapper(SvXMLImport&);
548 static SvXMLImportPropertyMapper* CreateTableRowDefaultExtPropMapper(SvXMLImport&);
549 static SvXMLImportPropertyMapper* CreateTableCellExtPropMapper(SvXMLImport&);
551 SvI18NMap& GetRenameMap();
553 /// save the start of a range reference
554 void InsertBookmarkStartRange(
555 const OUString & sName,
556 const css::uno::Reference< css::text::XTextRange> & rRange,
557 OUString const& i_rXmlId,
558 std::shared_ptr< ::xmloff::ParsedRDFaAttributes > &
559 i_rpRDFaAttributes);
561 /// process the start of a range reference
562 bool FindAndRemoveBookmarkStartRange(
563 const OUString & sName,
564 css::uno::Reference< css::text::XTextRange> & o_rRange,
565 OUString & o_rXmlId,
566 std::shared_ptr< ::xmloff::ParsedRDFaAttributes > & o_rpRDFaAttributes);
568 OUString FindActiveBookmarkName();
570 void pushFieldCtx( const OUString& name, const OUString& type );
571 void popFieldCtx();
572 void addFieldParam( const OUString& name, const OUString& value );
573 void setCurrentFieldParamsTo(css::uno::Reference< css::text::XFormField> &xFormField);
574 OUString getCurrentFieldType();
575 bool hasCurrentFieldCtx();
578 /// insert new footnote ID.
579 /// Also fixup open references from the backpatch list to this ID.
580 // Code is implemented in XMLPropertyBackpatcher.cxx
581 void InsertFootnoteID(const OUString& sXMLId, sal_Int16 nAPIId);
583 /// set the proper footnote reference ID,
584 /// or put into backpatch list if ID is unknown
585 // Code is implemented in XMLPropertyBackpatcher.cxx
586 void ProcessFootnoteReference(
587 const OUString& sXMLId,
588 const css::uno::Reference< css::beans::XPropertySet> & xPropSet);
590 /// insert new sequence ID
591 /// Also fixup open references from backpatch list to this ID.
592 // Code is implemented in XMLPropertyBackpatcher.cxx
593 void InsertSequenceID(const OUString& sXMLId,
594 const OUString& sName,
595 sal_Int16 nAPIId);
597 /// set sequence ID or insert into backpatch list
598 // Code is implemented in XMLPropertyBackpatcher.cxx
599 void ProcessSequenceReference(
600 const OUString& sXMLId,
601 const css::uno::Reference< css::beans::XPropertySet> & xPropSet);
603 bool IsInFrame() const;
604 virtual bool IsInHeaderFooter() const;
606 virtual css::uno::Reference< css::beans::XPropertySet>
607 createAndInsertOLEObject( SvXMLImport& rImport,
608 const OUString& rHRef,
609 const OUString &rStyleName,
610 const OUString &rTblName,
611 sal_Int32 nWidth, sal_Int32 nHeight );
613 virtual css::uno::Reference< css::beans::XPropertySet>
614 createAndInsertOOoLink( SvXMLImport& rImport,
615 const OUString& rHRef,
616 const OUString &rStyleName,
617 const OUString &rTblName,
618 sal_Int32 nWidth, sal_Int32 nHeight );
620 virtual css::uno::Reference< css::beans::XPropertySet>
621 createAndInsertApplet(
622 const OUString &rName,
623 const OUString &rCode,
624 bool bMayScript,
625 const OUString& rHRef,
626 sal_Int32 nWidth, sal_Int32 nHeight );
628 virtual css::uno::Reference< css::beans::XPropertySet>
629 createAndInsertPlugin(
630 const OUString &rMimeType,
631 const OUString& rHRef,
632 sal_Int32 nWidth, sal_Int32 nHeight );
634 virtual css::uno::Reference< css::beans::XPropertySet>
635 createAndInsertFloatingFrame(
636 const OUString &rName,
637 const OUString &rHRef,
638 const OUString &rStyleName,
639 sal_Int32 nWidth, sal_Int32 nHeight );
641 virtual void endAppletOrPlugin(
642 const css::uno::Reference< css::beans::XPropertySet> &rPropSet,
643 ::std::map < const OUString, OUString > &rParamMap );
645 // applet helper methods
646 // implemented in sw/filter/xml/txtparai.hxx
648 // redlining helper methods
649 // (to be implemented in sw/filter/xml/txtparai.hxx)
651 virtual void RedlineAdd(
652 /// redline type (insert, del,... )
653 const OUString& rType,
654 /// use to identify this redline
655 const OUString& rId,
656 /// name of the author
657 const OUString& rAuthor,
658 /// redline comment
659 const OUString& rComment,
660 /// date+time
661 const css::util::DateTime& rDateTime,
662 /// merge last paras
663 bool bMergeLastParagraph);
665 virtual css::uno::Reference< css::text::XTextCursor> RedlineCreateText(
666 /// needed to get the document
667 css::uno::Reference< css::text::XTextCursor > & rOldCursor,
668 /// ID used to RedlineAdd() call
669 const OUString& rId);
671 virtual void RedlineSetCursor(
672 /// ID used to RedlineAdd() call
673 const OUString& rId,
674 /// start or end Cursor
675 bool bStart,
676 /// range is not within <text:p>
677 bool bIsOutsideOfParagraph);
679 virtual void RedlineAdjustStartNodeCursor( bool bStart );
680 virtual void SetShowChanges( bool bShowChanges );
681 virtual void SetRecordChanges( bool bRecordChanges );
682 virtual void SetChangesProtectionKey(
683 const css::uno::Sequence<sal_Int8> & rProtectionKey );
685 /// get the last open redline ID
686 OUString GetOpenRedlineId();
687 /// modify the last open redline ID
688 void SetOpenRedlineId( OUString const & rId);
689 /// reset the last open redline ID
690 void ResetOpenRedlineId();
692 /** redlining : Setter to remember the fact we are inside/outside
693 * a <text:deletion> element (deleted redline section) */
694 void SetInsideDeleteContext(bool const bNew);
695 /** redlining : Getter to know if we are inside
696 * a <text:deletion> element (deleted redline section) */
697 bool IsInsideDeleteContext() const;
699 SvXMLImport & GetXMLImport();
701 XMLTextListsHelper & GetTextListHelper();
703 // forwards to TextListHelper; these are used in many places
704 /// push a list context on the list context stack
705 void PushListContext();
706 /// pop the list context stack
707 void PopListContext();
709 void SetCellParaStyleDefault(OUString const& rNewValue);
710 OUString const& GetCellParaStyleDefault();
712 void AddCrossRefHeadingMapping(OUString const& rFrom, OUString const& rTo);
713 void MapCrossRefHeadingFieldsHorribly();
716 #endif
718 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */