bump product version to 4.2.0.1
[LibreOffice.git] / include / xmloff / txtimp.hxx
blob99e10bc07d4b67dbbac4e01f78c171bea37a2b7c
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 <boost/utility.hpp>
29 #include <boost/shared_ptr.hpp>
30 #include <boost/scoped_ptr.hpp>
32 #include <xmloff/xmltkmap.hxx>
33 #include <comphelper/stl_types.hxx>
34 #include <xmloff/uniref.hxx>
36 class XMLTextListsHelper;
37 class SvXMLImportContext;
38 class SvXMLTokenMap;
39 class SvXMLImportPropertyMapper;
40 class SvXMLNamespaceMap;
41 class SvXMLImport;
42 class SvXMLStylesContext;
43 class XMLTextListBlockContext;
44 class SvxXMLListStyleContext;
45 class XMLPropStyleContext;
46 class SvI18NMap;
47 class XMLSectionImportContext;
48 class XMLFontStylesContext;
49 template<class A> class XMLPropertyBackpatcher;
50 class XMLEventsImportContext;
52 namespace xmloff {
53 struct ParsedRDFaAttributes;
56 namespace com { namespace sun { namespace star {
57 namespace text {
58 class XText;
59 class XTextCursor;
60 class XTextRange;
61 class XTextContent;
62 class XFormField;
64 namespace frame { class XModel; }
65 namespace container { class XNameContainer; class XIndexReplace; class XNameAccess; }
66 namespace beans { class XPropertySet; }
67 namespace xml { namespace sax { class XAttributeList; } }
68 namespace util { struct DateTime; }
69 namespace lang { class XMultiServiceFactory; }
70 } } }
72 enum SwXMLTextElemTokens
74 XML_TOK_TEXT_P,
75 XML_TOK_TEXT_H,
76 XML_TOK_TEXT_LIST,
77 XML_TOK_TEXT_FRAME_PAGE,
78 XML_TOK_TABLE_TABLE,
79 XML_TOK_TEXT_VARFIELD_DECLS,
80 XML_TOK_TEXT_USERFIELD_DECLS,
81 XML_TOK_TEXT_SEQUENCE_DECLS,
82 XML_TOK_TEXT_DDE_DECLS,
83 XML_TOK_DRAW_A_PAGE,
84 XML_TOK_TEXT_SECTION,
85 XML_TOK_TEXT_TOC,
86 XML_TOK_TEXT_OBJECT_INDEX,
87 XML_TOK_TEXT_TABLE_INDEX,
88 XML_TOK_TEXT_ILLUSTRATION_INDEX,
89 XML_TOK_TEXT_USER_INDEX,
90 XML_TOK_TEXT_ALPHABETICAL_INDEX,
91 XML_TOK_TEXT_BIBLIOGRAPHY_INDEX,
92 XML_TOK_TEXT_INDEX_TITLE,
93 XML_TOK_TEXT_TRACKED_CHANGES,
94 XML_TOK_TEXT_CHANGE_START,
95 XML_TOK_TEXT_CHANGE_END,
96 XML_TOK_TEXT_CHANGE,
97 XML_TOK_TEXT_FORMS,
98 XML_TOK_TEXT_CALCULATION_SETTINGS,
99 XML_TOK_TEXT_AUTOMARK,
100 XML_TOK_TEXT_NUMBERED_PARAGRAPH,
101 XML_TOK_TEXT_ELEM_END=XML_TOK_UNKNOWN
104 enum XMLTextPElemTokens
106 XML_TOK_TEXT_SPAN,
107 XML_TOK_TEXT_TAB_STOP,
108 XML_TOK_TEXT_LINE_BREAK,
109 XML_TOK_TEXT_SOFT_PAGE_BREAK,
110 XML_TOK_TEXT_S,
111 XML_TOK_TEXT_FRAME,
112 XML_TOK_TEXT_HYPERLINK,
113 XML_TOK_TEXT_RUBY,
115 XML_TOK_TEXT_NOTE,
116 XML_TOK_TEXT_BOOKMARK,
117 XML_TOK_TEXT_BOOKMARK_START,
118 XML_TOK_TEXT_BOOKMARK_END,
119 XML_TOK_TEXT_REFERENCE,
120 XML_TOK_TEXT_REFERENCE_START,
121 XML_TOK_TEXT_REFERENCE_END,
123 XML_TOK_TEXT_TOC_MARK, // index marks
124 XML_TOK_TEXT_TOC_MARK_START,
125 XML_TOK_TEXT_TOC_MARK_END,
126 XML_TOK_TEXT_USER_INDEX_MARK,
127 XML_TOK_TEXT_USER_INDEX_MARK_START,
128 XML_TOK_TEXT_USER_INDEX_MARK_END,
129 XML_TOK_TEXT_ALPHA_INDEX_MARK,
130 XML_TOK_TEXT_ALPHA_INDEX_MARK_START,
131 XML_TOK_TEXT_ALPHA_INDEX_MARK_END,
133 XML_TOK_TEXT_SENDER_FIRSTNAME, // sender fields
134 XML_TOK_TEXT_SENDER_LASTNAME,
135 XML_TOK_TEXT_SENDER_INITIALS,
136 XML_TOK_TEXT_SENDER_TITLE,
137 XML_TOK_TEXT_SENDER_POSITION,
138 XML_TOK_TEXT_SENDER_EMAIL,
139 XML_TOK_TEXT_SENDER_PHONE_PRIVATE,
140 XML_TOK_TEXT_SENDER_FAX,
141 XML_TOK_TEXT_SENDER_COMPANY,
142 XML_TOK_TEXT_SENDER_PHONE_WORK,
143 XML_TOK_TEXT_SENDER_STREET,
144 XML_TOK_TEXT_SENDER_CITY,
145 XML_TOK_TEXT_SENDER_POSTAL_CODE,
146 XML_TOK_TEXT_SENDER_COUNTRY,
147 XML_TOK_TEXT_SENDER_STATE_OR_PROVINCE,
149 XML_TOK_TEXT_AUTHOR_NAME, // author fields
150 XML_TOK_TEXT_AUTHOR_INITIALS,
152 XML_TOK_TEXT_DATE, // date & time fields
153 XML_TOK_TEXT_TIME,
155 XML_TOK_TEXT_PAGE_NUMBER, // page number fields
156 XML_TOK_TEXT_PAGE_CONTINUATION_STRING,
158 XML_TOK_TEXT_VARIABLE_SET, // variable fields
159 XML_TOK_TEXT_VARIABLE_GET,
160 XML_TOK_TEXT_VARIABLE_INPUT,
161 XML_TOK_TEXT_USER_FIELD_GET,
162 XML_TOK_TEXT_USER_FIELD_INPUT,
163 XML_TOK_TEXT_SEQUENCE,
164 XML_TOK_TEXT_EXPRESSION,
165 XML_TOK_TEXT_TEXT_INPUT,
167 XML_TOK_TEXT_DATABASE_DISPLAY, // database fields
168 XML_TOK_TEXT_DATABASE_NEXT,
169 XML_TOK_TEXT_DATABASE_SELECT,
170 XML_TOK_TEXT_DATABASE_ROW_NUMBER,
171 XML_TOK_TEXT_DATABASE_NAME,
173 XML_TOK_TEXT_DOCUMENT_CREATION_AUTHOR, //document info fields
174 XML_TOK_TEXT_DOCUMENT_CREATION_DATE,
175 XML_TOK_TEXT_DOCUMENT_CREATION_TIME,
176 XML_TOK_TEXT_DOCUMENT_DESCRIPTION,
177 XML_TOK_TEXT_DOCUMENT_PRINT_AUTHOR,
178 XML_TOK_TEXT_DOCUMENT_PRINT_DATE,
179 XML_TOK_TEXT_DOCUMENT_PRINT_TIME,
180 XML_TOK_TEXT_DOCUMENT_TITLE,
181 XML_TOK_TEXT_DOCUMENT_SUBJECT,
182 XML_TOK_TEXT_DOCUMENT_KEYWORDS,
183 XML_TOK_TEXT_DOCUMENT_REVISION,
184 XML_TOK_TEXT_DOCUMENT_EDIT_DURATION,
185 XML_TOK_TEXT_DOCUMENT_SAVE_AUTHOR,
186 XML_TOK_TEXT_DOCUMENT_SAVE_DATE,
187 XML_TOK_TEXT_DOCUMENT_SAVE_TIME,
188 XML_TOK_TEXT_DOCUMENT_USER_DEFINED,
190 XML_TOK_TEXT_PLACEHOLDER, // misc. fields
191 XML_TOK_TEXT_CONDITIONAL_TEXT,
192 XML_TOK_TEXT_HIDDEN_TEXT,
193 XML_TOK_TEXT_HIDDEN_PARAGRAPH,
194 XML_TOK_TEXT_FILENAME,
195 XML_TOK_TEXT_CHAPTER,
196 XML_TOK_TEXT_TEMPLATENAME,
197 XML_TOK_TEXT_WORD_COUNT, // statistics/count fields
198 XML_TOK_TEXT_PARAGRAPH_COUNT,
199 XML_TOK_TEXT_TABLE_COUNT,
200 XML_TOK_TEXT_CHARACTER_COUNT,
201 XML_TOK_TEXT_IMAGE_COUNT,
202 XML_TOK_TEXT_OBJECT_COUNT,
203 XML_TOK_TEXT_PAGE_COUNT,
204 XML_TOK_TEXT_GET_PAGE_VAR,
205 XML_TOK_TEXT_SET_PAGE_VAR,
206 XML_TOK_TEXT_MACRO,
207 XML_TOK_TEXT_DDE,
208 XML_TOK_TEXT_REFERENCE_REF,
209 XML_TOK_TEXT_BOOKMARK_REF,
210 XML_TOK_TEXT_SEQUENCE_REF,
211 XML_TOK_TEXT_NOTE_REF,
212 XML_TOK_TEXT_SHEET_NAME,
213 XML_TOK_TEXT_BIBLIOGRAPHY_MARK,
214 XML_TOK_TEXT_ANNOTATION,
215 XML_TOK_TEXT_ANNOTATION_END,
216 XML_TOK_TEXT_NAME,
217 XML_TOK_TEXT_SCRIPT,
218 XML_TOK_TEXT_TABLE_FORMULA,
219 XML_TOK_TEXT_DROPDOWN,
221 // RDF metadata
222 XML_TOK_TEXT_META,
223 XML_TOK_TEXT_META_FIELD,
225 // misc
226 XML_TOK_TEXTP_CHANGE_START, // TEXTP avoids clash with SwXMLTextElemTokens
227 XML_TOK_TEXTP_CHANGE_END,
228 XML_TOK_TEXTP_CHANGE,
229 XML_TOK_DRAW_A,
230 XML_TOK_TEXT_MEASURE,
232 XML_TOK_DRAW_HEADER,
233 XML_TOK_DRAW_FOOTER,
234 XML_TOK_DRAW_DATE_TIME,
235 XML_TOK_TEXT_PAGE_CONTINUATION,
237 XML_TOK_TEXT_FIELDMARK,
238 XML_TOK_TEXT_FIELDMARK_START,
239 XML_TOK_TEXT_FIELDMARK_END,
241 XML_TOK_TEXT_P_ELEM_END=XML_TOK_UNKNOWN
244 enum XMLTextPAttrTokens
246 XML_TOK_TEXT_P_XMLID,
247 XML_TOK_TEXT_P_ABOUT,
248 XML_TOK_TEXT_P_PROPERTY,
249 XML_TOK_TEXT_P_CONTENT,
250 XML_TOK_TEXT_P_DATATYPE,
251 XML_TOK_TEXT_P_TEXTID,
252 XML_TOK_TEXT_P_STYLE_NAME,
253 XML_TOK_TEXT_P_COND_STYLE_NAME,
254 XML_TOK_TEXT_P_LEVEL,
255 XML_TOK_TEXT_P_CLASS_NAMES,
256 XML_TOK_TEXT_P_IS_LIST_HEADER,
257 XML_TOK_TEXT_P_RESTART_NUMBERING,
258 XML_TOK_TEXT_P_START_VALUE,
259 XML_TOK_TEXT_P_END=XML_TOK_UNKNOWN
262 enum XMLTextNumberedParagraphAttrTokens
264 XML_TOK_TEXT_NUMBERED_PARAGRAPH_XMLID,
265 XML_TOK_TEXT_NUMBERED_PARAGRAPH_LIST_ID,
266 XML_TOK_TEXT_NUMBERED_PARAGRAPH_LEVEL,
267 XML_TOK_TEXT_NUMBERED_PARAGRAPH_STYLE_NAME,
268 XML_TOK_TEXT_NUMBERED_PARAGRAPH_CONTINUE_NUMBERING,
269 XML_TOK_TEXT_NUMBERED_PARAGRAPH_START_VALUE,
270 XML_TOK_TEXT_NUMBERED_PARAGRAPH_END=XML_TOK_UNKNOWN
273 enum XMLTextListBlockAttrTokens
275 XML_TOK_TEXT_LIST_BLOCK_XMLID,
276 XML_TOK_TEXT_LIST_BLOCK_STYLE_NAME,
277 XML_TOK_TEXT_LIST_BLOCK_CONTINUE_NUMBERING,
278 XML_TOK_TEXT_LIST_BLOCK_ID,
279 XML_TOK_TEXT_LIST_BLOCK_CONTINUE_LIST,
280 XML_TOK_TEXT_LIST_BLOCK_END=XML_TOK_UNKNOWN
283 enum XMLTextListBlockElemTokens
285 XML_TOK_TEXT_LIST_HEADER,
286 XML_TOK_TEXT_LIST_ITEM,
287 XML_TOK_TEXT_LIST_BLOCK_ELEM_END=XML_TOK_UNKNOWN
290 enum XMLTextFrameAttrTokens
292 XML_TOK_TEXT_FRAME_STYLE_NAME,
293 XML_TOK_TEXT_FRAME_NAME,
294 XML_TOK_TEXT_FRAME_ANCHOR_TYPE,
295 XML_TOK_TEXT_FRAME_ANCHOR_PAGE_NUMBER,
296 XML_TOK_TEXT_FRAME_X,
297 XML_TOK_TEXT_FRAME_Y,
298 XML_TOK_TEXT_FRAME_WIDTH,
299 XML_TOK_TEXT_FRAME_REL_WIDTH,
300 XML_TOK_TEXT_FRAME_HEIGHT,
301 XML_TOK_TEXT_FRAME_MIN_HEIGHT,
302 XML_TOK_TEXT_FRAME_REL_HEIGHT,
303 XML_TOK_TEXT_FRAME_NEXT_CHAIN_NAME,
304 XML_TOK_TEXT_FRAME_HREF,
305 XML_TOK_TEXT_FRAME_FILTER_NAME,
306 XML_TOK_TEXT_FRAME_Z_INDEX,
307 XML_TOK_TEXT_FRAME_TRANSFORM,
308 XML_TOK_TEXT_FRAME_CLASS_ID,
309 XML_TOK_TEXT_FRAME_CODE,
310 XML_TOK_TEXT_FRAME_OBJECT,
311 XML_TOK_TEXT_FRAME_ARCHIVE,
312 XML_TOK_TEXT_FRAME_MAY_SCRIPT,
313 XML_TOK_TEXT_FRAME_MIME_TYPE,
314 XML_TOK_TEXT_FRAME_APPLET_NAME,
315 XML_TOK_TEXT_FRAME_FRAME_NAME,
316 XML_TOK_TEXT_FRAME_NOTIFY_ON_UPDATE,
317 XML_TOK_TEXT_FRAME_MIN_WIDTH,
318 XML_TOK_TEXT_FRAME_END=XML_TOK_UNKNOWN
321 enum XMLTextHyperlinkAttrTokens
323 XML_TOK_TEXT_HYPERLINK_HREF,
324 XML_TOK_TEXT_HYPERLINK_NAME,
325 XML_TOK_TEXT_HYPERLINK_TARGET_FRAME,
326 XML_TOK_TEXT_HYPERLINK_SHOW,
327 XML_TOK_TEXT_HYPERLINK_STYLE_NAME,
328 XML_TOK_TEXT_HYPERLINK_VIS_STYLE_NAME,
329 XML_TOK_TEXT_HYPERLINK_SERVER_MAP,
330 XML_TOK_TEXT_HYPERLINK_END=XML_TOK_UNKNOWN
333 enum XMLTextPageMasterElemTokens
335 XML_TOK_TEXT_MP_HEADER,
336 XML_TOK_TEXT_MP_FOOTER,
337 XML_TOK_TEXT_MP_HEADER_LEFT,
338 XML_TOK_TEXT_MP_FOOTER_LEFT,
339 XML_TOK_TEXT_MP_HEADER_FIRST,
340 XML_TOK_TEXT_MP_FOOTER_FIRST,
341 XML_TOK_TEXT_MP_END=XML_TOK_UNKNOWN
344 enum XMLTextContourAttrTokens
346 XML_TOK_TEXT_CONTOUR_WIDTH,
347 XML_TOK_TEXT_CONTOUR_HEIGHT,
348 XML_TOK_TEXT_CONTOUR_VIEWBOX,
349 XML_TOK_TEXT_CONTOUR_POINTS,
350 XML_TOK_TEXT_CONTOUR_D,
351 XML_TOK_TEXT_CONTOUR_AUTO,
352 XML_TOK_TEXT_CONTOUR_END=XML_TOK_UNKNOWN
354 enum XMLTextType
356 XML_TEXT_TYPE_BODY,
357 XML_TEXT_TYPE_CELL,
358 XML_TEXT_TYPE_SHAPE,
359 XML_TEXT_TYPE_TEXTBOX,
360 XML_TEXT_TYPE_HEADER_FOOTER,
361 XML_TEXT_TYPE_SECTION,
362 XML_TEXT_TYPE_FOOTNOTE,
363 XML_TEXT_TYPE_CHANGED_REGION
366 #define XML_TEXT_RENAME_TYPE_FRAME 10
367 #define XML_TEXT_RENAME_TYPE_TABLE 20
369 class XMLOFF_DLLPUBLIC XMLTextImportHelper : public UniRefBase,
370 private boost::noncopyable
372 private:
373 struct Impl;
374 boost::scoped_ptr<Impl> m_pImpl;
375 /// ugly, but implementation of this is in XMLPropertyBackpatcher.cxx
376 struct BackpatcherImpl;
377 ::boost::shared_ptr<BackpatcherImpl> m_pBackpatcherImpl;
378 ::boost::shared_ptr<BackpatcherImpl> MakeBackpatcherImpl();
380 protected:
381 virtual SvXMLImportContext *CreateTableChildContext(
382 SvXMLImport& rImport,
383 sal_uInt16 nPrefix, const OUString& rLocalName,
384 const ::com::sun::star::uno::Reference<
385 ::com::sun::star::xml::sax::XAttributeList > & xAttrList );
387 // access, lazy initialization and destruction of backpatchers
388 // Code is implemented in XMLPropertyBackpatcher.cxx
389 inline XMLPropertyBackpatcher<sal_Int16>& GetFootnoteBP();
390 inline XMLPropertyBackpatcher<sal_Int16>& GetSequenceIdBP();
391 inline XMLPropertyBackpatcher< OUString> & GetSequenceNameBP();
393 public:
395 XMLTextImportHelper(
396 ::com::sun::star::uno::Reference <
397 ::com::sun::star::frame::XModel> const& rModel,
398 SvXMLImport& rImport,
399 bool const bInsertMode = false, bool const bStylesOnlyMode = false,
400 bool const bProgress = false, bool const bBlockMode = false,
401 bool const bOrganizerMode = false);
403 ~XMLTextImportHelper();
405 void SetCursor(
406 const ::com::sun::star::uno::Reference <
407 ::com::sun::star::text::XTextCursor >& rCursor );
408 void ResetCursor();
410 void SetAutoStyles( SvXMLStylesContext *pStyles );
412 SvXMLImportContext *CreateTextChildContext(
413 SvXMLImport& rImport,
414 sal_uInt16 nPrefix, const OUString& rLocalName,
415 const ::com::sun::star::uno::Reference<
416 ::com::sun::star::xml::sax::XAttributeList > & xAttrList,
417 XMLTextType eType = XML_TEXT_TYPE_SHAPE );
419 SvXMLTokenMap const& GetTextElemTokenMap();
420 SvXMLTokenMap const& GetTextPElemTokenMap();
421 SvXMLTokenMap const& GetTextPAttrTokenMap();
422 SvXMLTokenMap const& GetTextFrameAttrTokenMap();
423 SvXMLTokenMap const& GetTextContourAttrTokenMap();
424 SvXMLTokenMap const& GetTextHyperlinkAttrTokenMap();
425 SvXMLTokenMap const& GetTextMasterPageElemTokenMap();
427 const SvXMLTokenMap& GetTextNumberedParagraphAttrTokenMap();
428 const SvXMLTokenMap& GetTextListBlockAttrTokenMap();
429 const SvXMLTokenMap& GetTextListBlockElemTokenMap();
430 const SvXMLTokenMap& GetTextFieldAttrTokenMap(); // impl: txtfldi.cxx
432 ::com::sun::star::uno::Reference<
433 ::com::sun::star::text::XText > & GetText();
434 ::com::sun::star::uno::Reference<
435 ::com::sun::star::text::XTextCursor > & GetCursor();
436 ::com::sun::star::uno::Reference<
437 ::com::sun::star::text::XTextRange > & GetCursorAsRange();
439 bool IsInsertMode() const;
440 bool IsStylesOnlyMode() const;
441 bool IsBlockMode() const;
442 bool IsOrganizerMode() const;
443 bool IsProgress() const;
445 OUString ConvertStarFonts( const OUString& rChars,
446 const OUString& rStyleName,
447 sal_uInt8& rFlags,
448 sal_Bool bPara,
449 SvXMLImport& rImport ) const;
450 // insert a string without special whitespace processing enabled
451 void InsertString( const OUString& rChars );
452 // insert a string with special whitespace processing enabled
453 void InsertString( const OUString& rChars,
454 sal_Bool& rIgnoreLeadingSpace );
455 // Delete current paragraph
456 void DeleteParagraph();
458 void InsertControlCharacter( sal_Int16 nControl );
459 void InsertTextContent( ::com::sun::star::uno::Reference <
460 ::com::sun::star::text::XTextContent > & xContent);
462 // Add parameter <bOutlineLevelAttrFound> (#i73509#)
463 // Add parameter <bSetListAttrs> in order to suppress the handling of the list attributes (#i80724#)
464 OUString SetStyleAndAttrs(
465 SvXMLImport& rImport,
466 const ::com::sun::star::uno::Reference <
467 ::com::sun::star::text::XTextCursor >& rCursor,
468 const OUString& rStyleName,
469 sal_Bool bPara,
470 sal_Bool bOutlineLevelAttrFound = sal_False,
471 sal_Int8 nOutlineLevel = -1,
472 sal_Bool bSetListAttrs = sal_True );
474 /** Find a suitable name for the given outline level.
475 * If rStyleName is empty, change it to a previously used or default style
476 * name for that level. Otherwise, leave rStyleName unmodified.
478 // Adjust 2nd parameter (#i69629#)
479 void FindOutlineStyleName( OUString& rStyleName,
480 sal_Int8 nOutlineLevel );
482 // Change method name to reflect change of data structure (#i69629#)
483 void AddOutlineStyleCandidate( const sal_Int8 nOutlineLevel,
484 const OUString& rStyleName );
486 void SetOutlineStyles( sal_Bool bSetEmpty );
488 void SetHyperlink(
489 SvXMLImport& rImport,
490 const ::com::sun::star::uno::Reference <
491 ::com::sun::star::text::XTextCursor >& rCursor,
492 const OUString& rHRef,
493 const OUString& rName,
494 const OUString& rTargetFrameName,
495 const OUString& rStyleName,
496 const OUString& rVisitedStyleName,
497 XMLEventsImportContext* pEvents = NULL);
498 void SetRuby(
499 SvXMLImport& rImport,
500 const ::com::sun::star::uno::Reference <
501 ::com::sun::star::text::XTextCursor >& rCursor,
502 const OUString& rStyleName,
503 const OUString& rTextStyleName,
504 const OUString& rText );
506 /// return key appropriate for use with NumberFormat property
507 /// return -1 if style is not found
508 /// (may return whether data style uses the system language)
509 sal_Int32 GetDataStyleKey( const OUString& sStyleName,
510 sal_Bool* pIsSystemLanguage = NULL );
512 const SvxXMLListStyleContext *FindAutoListStyle(
513 const OUString& rName ) const;
514 XMLPropStyleContext *FindAutoFrameStyle(
515 const OUString& rName ) const;
516 XMLPropStyleContext* FindSectionStyle(
517 const OUString& rName ) const;
518 XMLPropStyleContext* FindPageMaster(
519 const OUString& rName ) const;
521 const ::com::sun::star::uno::Reference<
522 ::com::sun::star::container::XNameContainer> & GetParaStyles() const;
524 const ::com::sun::star::uno::Reference<
525 ::com::sun::star::container::XNameContainer> & GetTextStyles() const;
527 const ::com::sun::star::uno::Reference<
528 ::com::sun::star::container::XNameContainer> &
529 GetNumberingStyles() const;
531 const ::com::sun::star::uno::Reference<
532 ::com::sun::star::container::XNameContainer> & GetFrameStyles() const;
534 const ::com::sun::star::uno::Reference<
535 ::com::sun::star::container::XNameContainer> & GetPageStyles() const;
537 const ::com::sun::star::uno::Reference<
538 ::com::sun::star::container::XIndexReplace > &
539 GetChapterNumbering() const;
541 sal_Bool HasFrameByName( const OUString& rName ) const;
542 void ConnectFrameChains( const OUString& rFrmName,
543 const OUString& rNextFrmName,
544 const ::com::sun::star::uno::Reference <
545 ::com::sun::star::beans::XPropertySet >& rFrmPropSet );
547 UniReference< SvXMLImportPropertyMapper > const&
548 GetParaImportPropertySetMapper() const;
549 UniReference< SvXMLImportPropertyMapper > const&
550 GetTextImportPropertySetMapper() const;
551 UniReference< SvXMLImportPropertyMapper > const&
552 GetSectionImportPropertySetMapper() const;
553 UniReference< SvXMLImportPropertyMapper > const&
554 GetRubyImportPropertySetMapper() const;
556 static SvXMLImportPropertyMapper *CreateShapeExtPropMapper(SvXMLImport&);
557 static SvXMLImportPropertyMapper *CreateParaExtPropMapper(SvXMLImport&);
558 static SvXMLImportPropertyMapper* CreateParaDefaultExtPropMapper(SvXMLImport&);
559 static SvXMLImportPropertyMapper* CreateTableDefaultExtPropMapper(SvXMLImport&);
560 static SvXMLImportPropertyMapper* CreateTableRowDefaultExtPropMapper(SvXMLImport&);
562 SvI18NMap& GetRenameMap();
564 /// save the start of a range reference
565 void InsertBookmarkStartRange(
566 const OUString & sName,
567 const ::com::sun::star::uno::Reference<
568 ::com::sun::star::text::XTextRange> & rRange,
569 OUString const& i_rXmlId,
570 ::boost::shared_ptr< ::xmloff::ParsedRDFaAttributes > &
571 i_rpRDFaAttributes);
573 /// process the start of a range reference
574 sal_Bool FindAndRemoveBookmarkStartRange(
575 const OUString & sName,
576 ::com::sun::star::uno::Reference<
577 ::com::sun::star::text::XTextRange> & o_rRange,
578 OUString & o_rXmlId,
579 ::boost::shared_ptr< ::xmloff::ParsedRDFaAttributes > &
580 o_rpRDFaAttributes);
582 OUString FindActiveBookmarkName();
584 void pushFieldCtx( OUString name, OUString type );
585 void popFieldCtx();
586 void addFieldParam( OUString name, OUString value );
587 void setCurrentFieldParamsTo(::com::sun::star::uno::Reference< ::com::sun::star::text::XFormField> &xFormField);
588 OUString getCurrentFieldType();
589 bool hasCurrentFieldCtx();
592 /// insert new footnote ID.
593 /// Also fixup open references from the backpatch list to this ID.
594 // Code is implemented in XMLPropertyBackpatcher.cxx
595 void InsertFootnoteID(const OUString& sXMLId, sal_Int16 nAPIId);
597 /// set the proper footnote reference ID,
598 /// or put into backpatch list if ID is unknown
599 // Code is implemented in XMLPropertyBackpatcher.cxx
600 void ProcessFootnoteReference(
601 const OUString& sXMLId,
602 const ::com::sun::star::uno::Reference<
603 ::com::sun::star::beans::XPropertySet> & xPropSet);
605 /// insert new sequence ID
606 /// Also fixup open references from backpatch list to this ID.
607 // Code is implemented in XMLPropertyBackpatcher.cxx
608 void InsertSequenceID(const OUString& sXMLId,
609 const OUString& sName,
610 sal_Int16 nAPIId);
612 /// set sequence ID or insert into backpatch list
613 // Code is implemented in XMLPropertyBackpatcher.cxx
614 void ProcessSequenceReference(
615 const OUString& sXMLId,
616 const ::com::sun::star::uno::Reference<
617 ::com::sun::star::beans::XPropertySet> & xPropSet);
619 sal_Bool IsInFrame() const;
620 virtual sal_Bool IsInHeaderFooter() const;
622 virtual ::com::sun::star::uno::Reference<
623 ::com::sun::star::beans::XPropertySet>
624 createAndInsertOLEObject( SvXMLImport& rImport,
625 const OUString& rHRef,
626 const OUString &rStyleName,
627 const OUString &rTblName,
628 sal_Int32 nWidth, sal_Int32 nHeight );
630 virtual ::com::sun::star::uno::Reference<
631 ::com::sun::star::beans::XPropertySet>
632 createAndInsertOOoLink( SvXMLImport& rImport,
633 const OUString& rHRef,
634 const OUString &rStyleName,
635 const OUString &rTblName,
636 sal_Int32 nWidth, sal_Int32 nHeight );
638 virtual ::com::sun::star::uno::Reference<
639 ::com::sun::star::beans::XPropertySet>
640 createAndInsertApplet(
641 const OUString &rName,
642 const OUString &rCode,
643 sal_Bool bMayScript,
644 const OUString& rHRef,
645 sal_Int32 nWidth, sal_Int32 nHeight );
647 virtual ::com::sun::star::uno::Reference<
648 ::com::sun::star::beans::XPropertySet>
649 createAndInsertPlugin(
650 const OUString &rMimeType,
651 const OUString& rHRef,
652 sal_Int32 nWidth, sal_Int32 nHeight );
654 virtual ::com::sun::star::uno::Reference<
655 ::com::sun::star::beans::XPropertySet>
656 createAndInsertFloatingFrame(
657 const OUString &rName,
658 const OUString &rHRef,
659 const OUString &rStyleName,
660 sal_Int32 nWidth, sal_Int32 nHeight );
662 virtual void endAppletOrPlugin(
663 const com::sun::star::uno::Reference<
664 ::com::sun::star::beans::XPropertySet> &rPropSet,
665 ::std::map < const OUString, OUString, ::comphelper::UStringLess > &rParamMap );
667 // applet helper methods
668 // implemented in sw/filter/xml/txtparai.hxx
670 // redlining helper methods
671 // (to be implemented in sw/filter/xml/txtparai.hxx)
673 virtual void RedlineAdd(
674 /// redline type (insert, del,... )
675 const OUString& rType,
676 /// use to identify this redline
677 const OUString& rId,
678 /// name of the author
679 const OUString& rAuthor,
680 /// redline comment
681 const OUString& rComment,
682 /// date+time
683 const ::com::sun::star::util::DateTime& rDateTime,
684 /// merge last paras
685 sal_Bool bMergeLastParagraph);
687 virtual ::com::sun::star::uno::Reference<
688 ::com::sun::star::text::XTextCursor> RedlineCreateText(
689 /// needed to get the document
690 ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextCursor > & rOldCursor,
691 /// ID used to RedlineAdd() call
692 const OUString& rId);
694 virtual void RedlineSetCursor(
695 /// ID used to RedlineAdd() call
696 const OUString& rId,
697 /// start or end Cursor
698 sal_Bool bStart,
699 /// range is not within <text:p>
700 sal_Bool bIsOutsideOfParagraph);
702 virtual void RedlineAdjustStartNodeCursor( sal_Bool bStart );
703 virtual void SetShowChanges( sal_Bool bShowChanges );
704 virtual void SetRecordChanges( sal_Bool bRecordChanges );
705 virtual void SetChangesProtectionKey(
706 const ::com::sun::star::uno::Sequence<sal_Int8> & rProtectionKey );
708 /// get the last open redline ID
709 OUString GetOpenRedlineId();
710 /// modify the last open redline ID
711 void SetOpenRedlineId( OUString& rId);
712 /// reset the last open redline ID
713 void ResetOpenRedlineId();
715 // #107848#
716 /** redlining : Setter to remember the fact we are inside/outside
717 * a <text:deletion> element (deleted redline section) */
718 void SetInsideDeleteContext(bool const bNew);
719 /** redlining : Getter to know if we are inside
720 * a <text:deletion> element (deleted redline section) */
721 bool IsInsideDeleteContext() const;
723 SvXMLImport & GetXMLImport();
725 XMLTextListsHelper & GetTextListHelper();
727 // forwards to TextListHelper; these are used in many places
728 /// push a list context on the list context stack
729 void PushListContext(XMLTextListBlockContext *i_pListBlock = 0);
730 /// pop the list context stack
731 void PopListContext();
733 void SetCellParaStyleDefault(OUString const& rNewValue);
734 OUString const& GetCellParaStyleDefault();
737 #endif
739 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */