Branch libreoffice-5-0-4
[LibreOffice.git] / include / xmloff / txtimp.hxx
blobca0ce7ab7e5a783d23bd4743d060689a3f9b4c09
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,
99 XML_TOK_TEXT_ELEM_END=XML_TOK_UNKNOWN
102 enum XMLTextPElemTokens
104 XML_TOK_TEXT_SPAN,
105 XML_TOK_TEXT_TAB_STOP,
106 XML_TOK_TEXT_LINE_BREAK,
107 XML_TOK_TEXT_SOFT_PAGE_BREAK,
108 XML_TOK_TEXT_S,
109 XML_TOK_TEXT_FRAME,
110 XML_TOK_TEXT_HYPERLINK,
111 XML_TOK_TEXT_RUBY,
113 XML_TOK_TEXT_NOTE,
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
151 XML_TOK_TEXT_TIME,
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,
204 XML_TOK_TEXT_MACRO,
205 XML_TOK_TEXT_DDE,
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,
215 XML_TOK_TEXT_NAME,
216 XML_TOK_TEXT_SCRIPT,
217 XML_TOK_TEXT_TABLE_FORMULA,
218 XML_TOK_TEXT_DROP_DOWN,
220 // RDF metadata
221 XML_TOK_TEXT_META,
222 XML_TOK_TEXT_META_FIELD,
224 // misc
225 XML_TOK_TEXTP_CHANGE_START, // TEXTP avoids clash with SwXMLTextElemTokens
226 XML_TOK_TEXTP_CHANGE_END,
227 XML_TOK_TEXTP_CHANGE,
228 XML_TOK_DRAW_A,
229 XML_TOK_TEXT_MEASURE,
231 XML_TOK_DRAW_HEADER,
232 XML_TOK_DRAW_FOOTER,
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
353 enum XMLTextType
355 XML_TEXT_TYPE_BODY,
356 XML_TEXT_TYPE_CELL,
357 XML_TEXT_TYPE_SHAPE,
358 XML_TEXT_TYPE_TEXTBOX,
359 XML_TEXT_TYPE_HEADER_FOOTER,
360 XML_TEXT_TYPE_SECTION,
361 XML_TEXT_TYPE_FOOTNOTE,
362 XML_TEXT_TYPE_CHANGED_REGION
365 #define XML_TEXT_RENAME_TYPE_FRAME 10
366 #define XML_TEXT_RENAME_TYPE_TABLE 20
368 class XMLOFF_DLLPUBLIC XMLTextImportHelper : public salhelper::SimpleReferenceObject
370 private:
371 XMLTextImportHelper(const XMLTextImportHelper&) SAL_DELETED_FUNCTION;
372 XMLTextImportHelper& operator=(const XMLTextImportHelper&) SAL_DELETED_FUNCTION;
374 struct Impl;
375 std::unique_ptr<Impl> m_xImpl;
376 /// ugly, but implementation of this is in XMLPropertyBackpatcher.cxx
377 struct BackpatcherImpl;
378 std::shared_ptr<BackpatcherImpl> m_xBackpatcherImpl;
379 static std::shared_ptr<BackpatcherImpl> MakeBackpatcherImpl();
381 protected:
382 virtual SvXMLImportContext *CreateTableChildContext(
383 SvXMLImport& rImport,
384 sal_uInt16 nPrefix, const OUString& rLocalName,
385 const ::com::sun::star::uno::Reference<
386 ::com::sun::star::xml::sax::XAttributeList > & xAttrList );
388 // access, lazy initialization and destruction of backpatchers
389 // Code is implemented in XMLPropertyBackpatcher.cxx
390 inline XMLPropertyBackpatcher<sal_Int16>& GetFootnoteBP();
391 inline XMLPropertyBackpatcher<sal_Int16>& GetSequenceIdBP();
392 inline XMLPropertyBackpatcher< OUString> & GetSequenceNameBP();
394 public:
396 XMLTextImportHelper(
397 ::com::sun::star::uno::Reference <
398 ::com::sun::star::frame::XModel> const& rModel,
399 SvXMLImport& rImport,
400 bool const bInsertMode = false, bool const bStylesOnlyMode = false,
401 bool const bProgress = false, bool const bBlockMode = false,
402 bool const bOrganizerMode = false);
404 virtual ~XMLTextImportHelper();
406 void SetCursor(
407 const ::com::sun::star::uno::Reference <
408 ::com::sun::star::text::XTextCursor >& rCursor );
409 void ResetCursor();
411 void SetAutoStyles( SvXMLStylesContext *pStyles );
413 SvXMLImportContext *CreateTextChildContext(
414 SvXMLImport& rImport,
415 sal_uInt16 nPrefix, const OUString& rLocalName,
416 const ::com::sun::star::uno::Reference<
417 ::com::sun::star::xml::sax::XAttributeList > & xAttrList,
418 XMLTextType eType = XML_TEXT_TYPE_SHAPE );
420 SvXMLTokenMap const& GetTextElemTokenMap();
421 SvXMLTokenMap const& GetTextPElemTokenMap();
422 SvXMLTokenMap const& GetTextPAttrTokenMap();
423 SvXMLTokenMap const& GetTextFrameAttrTokenMap();
424 SvXMLTokenMap const& GetTextContourAttrTokenMap();
425 SvXMLTokenMap const& GetTextHyperlinkAttrTokenMap();
426 SvXMLTokenMap const& GetTextMasterPageElemTokenMap();
428 const SvXMLTokenMap& GetTextNumberedParagraphAttrTokenMap();
429 const SvXMLTokenMap& GetTextListBlockAttrTokenMap();
430 const SvXMLTokenMap& GetTextListBlockElemTokenMap();
431 const SvXMLTokenMap& GetTextFieldAttrTokenMap(); // impl: txtfldi.cxx
433 ::com::sun::star::uno::Reference<
434 ::com::sun::star::text::XText > & GetText();
435 ::com::sun::star::uno::Reference<
436 ::com::sun::star::text::XTextCursor > & GetCursor();
437 ::com::sun::star::uno::Reference<
438 ::com::sun::star::text::XTextRange > & GetCursorAsRange();
440 bool IsInsertMode() const;
441 bool IsStylesOnlyMode() const;
442 bool IsBlockMode() const;
443 bool IsOrganizerMode() const;
444 bool IsProgress() const;
446 OUString ConvertStarFonts( const OUString& rChars,
447 const OUString& rStyleName,
448 sal_uInt8& rFlags,
449 bool bPara,
450 SvXMLImport& rImport ) const;
451 // insert a string without special whitespace processing enabled
452 void InsertString( const OUString& rChars );
453 // insert a string with special whitespace processing enabled
454 void InsertString( const OUString& rChars,
455 bool& rIgnoreLeadingSpace );
456 // Delete current paragraph
457 void DeleteParagraph();
459 void InsertControlCharacter( sal_Int16 nControl );
460 void InsertTextContent( ::com::sun::star::uno::Reference <
461 ::com::sun::star::text::XTextContent > & xContent);
463 // Add parameter <bOutlineLevelAttrFound> (#i73509#)
464 // Add parameter <bSetListAttrs> in order to suppress the handling of the list attributes (#i80724#)
465 OUString SetStyleAndAttrs(
466 SvXMLImport& rImport,
467 const ::com::sun::star::uno::Reference <
468 ::com::sun::star::text::XTextCursor >& rCursor,
469 const OUString& rStyleName,
470 bool bPara,
471 bool bOutlineLevelAttrFound = false,
472 sal_Int8 nOutlineLevel = -1,
473 bool bSetListAttrs = true );
475 /** Find a suitable name for the given outline level.
476 * If rStyleName is empty, change it to a previously used or default style
477 * name for that level. Otherwise, leave rStyleName unmodified.
479 // Adjust 2nd parameter (#i69629#)
480 void FindOutlineStyleName( OUString& rStyleName,
481 sal_Int8 nOutlineLevel );
483 // Change method name to reflect change of data structure (#i69629#)
484 void AddOutlineStyleCandidate( const sal_Int8 nOutlineLevel,
485 const OUString& rStyleName );
487 void SetOutlineStyles( bool bSetEmpty );
489 void SetHyperlink(
490 SvXMLImport& rImport,
491 const ::com::sun::star::uno::Reference <
492 ::com::sun::star::text::XTextCursor >& rCursor,
493 const OUString& rHRef,
494 const OUString& rName,
495 const OUString& rTargetFrameName,
496 const OUString& rStyleName,
497 const OUString& rVisitedStyleName,
498 XMLEventsImportContext* pEvents = NULL);
499 void SetRuby(
500 SvXMLImport& rImport,
501 const ::com::sun::star::uno::Reference <
502 ::com::sun::star::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 = NULL );
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 ::com::sun::star::uno::Reference<
523 ::com::sun::star::container::XNameContainer> & GetParaStyles() const;
525 const ::com::sun::star::uno::Reference<
526 ::com::sun::star::container::XNameContainer> & GetTextStyles() const;
528 const ::com::sun::star::uno::Reference<
529 ::com::sun::star::container::XNameContainer> &
530 GetNumberingStyles() const;
532 const ::com::sun::star::uno::Reference<
533 ::com::sun::star::container::XNameContainer> & GetFrameStyles() const;
535 const ::com::sun::star::uno::Reference<
536 ::com::sun::star::container::XNameContainer> & GetPageStyles() const;
538 const ::com::sun::star::uno::Reference<
539 ::com::sun::star::container::XIndexReplace > &
540 GetChapterNumbering() const;
542 bool HasFrameByName( const OUString& rName ) const;
543 void ConnectFrameChains( const OUString& rFrmName,
544 const OUString& rNextFrmName,
545 const ::com::sun::star::uno::Reference <
546 ::com::sun::star::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&);
563 SvI18NMap& GetRenameMap();
565 /// save the start of a range reference
566 void InsertBookmarkStartRange(
567 const OUString & sName,
568 const ::com::sun::star::uno::Reference<
569 ::com::sun::star::text::XTextRange> & rRange,
570 OUString const& i_rXmlId,
571 std::shared_ptr< ::xmloff::ParsedRDFaAttributes > &
572 i_rpRDFaAttributes);
574 /// process the start of a range reference
575 bool FindAndRemoveBookmarkStartRange(
576 const OUString & sName,
577 ::com::sun::star::uno::Reference<
578 ::com::sun::star::text::XTextRange> & o_rRange,
579 OUString & o_rXmlId,
580 std::shared_ptr< ::xmloff::ParsedRDFaAttributes > &
581 o_rpRDFaAttributes);
583 OUString FindActiveBookmarkName();
585 void pushFieldCtx( const OUString& name, const OUString& type );
586 void popFieldCtx();
587 void addFieldParam( const OUString& name, const OUString& value );
588 void setCurrentFieldParamsTo(::com::sun::star::uno::Reference< ::com::sun::star::text::XFormField> &xFormField);
589 OUString getCurrentFieldType();
590 bool hasCurrentFieldCtx();
593 /// insert new footnote ID.
594 /// Also fixup open references from the backpatch list to this ID.
595 // Code is implemented in XMLPropertyBackpatcher.cxx
596 void InsertFootnoteID(const OUString& sXMLId, sal_Int16 nAPIId);
598 /// set the proper footnote reference ID,
599 /// or put into backpatch list if ID is unknown
600 // Code is implemented in XMLPropertyBackpatcher.cxx
601 void ProcessFootnoteReference(
602 const OUString& sXMLId,
603 const ::com::sun::star::uno::Reference<
604 ::com::sun::star::beans::XPropertySet> & xPropSet);
606 /// insert new sequence ID
607 /// Also fixup open references from backpatch list to this ID.
608 // Code is implemented in XMLPropertyBackpatcher.cxx
609 void InsertSequenceID(const OUString& sXMLId,
610 const OUString& sName,
611 sal_Int16 nAPIId);
613 /// set sequence ID or insert into backpatch list
614 // Code is implemented in XMLPropertyBackpatcher.cxx
615 void ProcessSequenceReference(
616 const OUString& sXMLId,
617 const ::com::sun::star::uno::Reference<
618 ::com::sun::star::beans::XPropertySet> & xPropSet);
620 bool IsInFrame() const;
621 virtual bool IsInHeaderFooter() const;
623 virtual ::com::sun::star::uno::Reference<
624 ::com::sun::star::beans::XPropertySet>
625 createAndInsertOLEObject( SvXMLImport& rImport,
626 const OUString& rHRef,
627 const OUString &rStyleName,
628 const OUString &rTblName,
629 sal_Int32 nWidth, sal_Int32 nHeight );
631 virtual ::com::sun::star::uno::Reference<
632 ::com::sun::star::beans::XPropertySet>
633 createAndInsertOOoLink( SvXMLImport& rImport,
634 const OUString& rHRef,
635 const OUString &rStyleName,
636 const OUString &rTblName,
637 sal_Int32 nWidth, sal_Int32 nHeight );
639 virtual ::com::sun::star::uno::Reference<
640 ::com::sun::star::beans::XPropertySet>
641 createAndInsertApplet(
642 const OUString &rName,
643 const OUString &rCode,
644 bool bMayScript,
645 const OUString& rHRef,
646 sal_Int32 nWidth, sal_Int32 nHeight );
648 virtual ::com::sun::star::uno::Reference<
649 ::com::sun::star::beans::XPropertySet>
650 createAndInsertPlugin(
651 const OUString &rMimeType,
652 const OUString& rHRef,
653 sal_Int32 nWidth, sal_Int32 nHeight );
655 virtual ::com::sun::star::uno::Reference<
656 ::com::sun::star::beans::XPropertySet>
657 createAndInsertFloatingFrame(
658 const OUString &rName,
659 const OUString &rHRef,
660 const OUString &rStyleName,
661 sal_Int32 nWidth, sal_Int32 nHeight );
663 virtual void endAppletOrPlugin(
664 const com::sun::star::uno::Reference<
665 ::com::sun::star::beans::XPropertySet> &rPropSet,
666 ::std::map < const OUString, OUString > &rParamMap );
668 // applet helper methods
669 // implemented in sw/filter/xml/txtparai.hxx
671 // redlining helper methods
672 // (to be implemented in sw/filter/xml/txtparai.hxx)
674 virtual void RedlineAdd(
675 /// redline type (insert, del,... )
676 const OUString& rType,
677 /// use to identify this redline
678 const OUString& rId,
679 /// name of the author
680 const OUString& rAuthor,
681 /// redline comment
682 const OUString& rComment,
683 /// date+time
684 const ::com::sun::star::util::DateTime& rDateTime,
685 /// merge last paras
686 bool bMergeLastParagraph);
688 virtual ::com::sun::star::uno::Reference<
689 ::com::sun::star::text::XTextCursor> RedlineCreateText(
690 /// needed to get the document
691 ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextCursor > & rOldCursor,
692 /// ID used to RedlineAdd() call
693 const OUString& rId);
695 virtual void RedlineSetCursor(
696 /// ID used to RedlineAdd() call
697 const OUString& rId,
698 /// start or end Cursor
699 bool bStart,
700 /// range is not within <text:p>
701 bool bIsOutsideOfParagraph);
703 virtual void RedlineAdjustStartNodeCursor( bool bStart );
704 virtual void SetShowChanges( bool bShowChanges );
705 virtual void SetRecordChanges( bool bRecordChanges );
706 virtual void SetChangesProtectionKey(
707 const ::com::sun::star::uno::Sequence<sal_Int8> & rProtectionKey );
709 /// get the last open redline ID
710 OUString GetOpenRedlineId();
711 /// modify the last open redline ID
712 void SetOpenRedlineId( OUString& rId);
713 /// reset the last open redline ID
714 void ResetOpenRedlineId();
716 // #107848#
717 /** redlining : Setter to remember the fact we are inside/outside
718 * a <text:deletion> element (deleted redline section) */
719 void SetInsideDeleteContext(bool const bNew);
720 /** redlining : Getter to know if we are inside
721 * a <text:deletion> element (deleted redline section) */
722 bool IsInsideDeleteContext() const;
724 SvXMLImport & GetXMLImport();
726 XMLTextListsHelper & GetTextListHelper();
728 // forwards to TextListHelper; these are used in many places
729 /// push a list context on the list context stack
730 void PushListContext(XMLTextListBlockContext *i_pListBlock = 0);
731 /// pop the list context stack
732 void PopListContext();
734 void SetCellParaStyleDefault(OUString const& rNewValue);
735 OUString const& GetCellParaStyleDefault();
738 #endif
740 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */