summaryrefslogtreecommitdiff
path: root/xmloff/inc/xmloff/txtimp.hxx
blob: ac8ee609da1dbf1024cd3a69a279c64c8a1f1036 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
 *
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 * 
 * Copyright 2000, 2010 Oracle and/or its affiliates.
 *
 * OpenOffice.org - a multi-platform office productivity suite
 *
 * This file is part of OpenOffice.org.
 *
 * OpenOffice.org is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License version 3
 * only, as published by the Free Software Foundation.
 *
 * OpenOffice.org is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License version 3 for more details
 * (a copy is included in the LICENSE file that accompanied this code).
 *
 * You should have received a copy of the GNU Lesser General Public License
 * version 3 along with OpenOffice.org.  If not, see
 * <http://www.openoffice.org/license.html>
 * for a copy of the LGPLv3 License.
 *
 ************************************************************************/
#ifndef XMLOFF_TEXTIMP_HXX
#define XMLOFF_TEXTIMP_HXX

#include "sal/config.h"
#include "xmloff/dllapi.h"
#include "sal/types.h"
#include <com/sun/star/uno/Reference.h>

#include <map>
#include <memory>
#include <boost/utility.hpp>
#include <boost/shared_ptr.hpp>

#include <tools/list.hxx>
#include <xmloff/xmltkmap.hxx>

// functional.hxx is obsolete and should be replaced by its comphelper
// counterpart
#include <comphelper/stl_types.hxx>
#include <xmloff/uniref.hxx>


// --> OD 2008-04-25 #refactorlists#
class XMLTextListsHelper;
// <--

class SvXMLImportContext;
class SvXMLTokenMap;
class SvXMLImportPropertyMapper;
class SvXMLNamespaceMap;
class SvXMLImport;
class SvXMLStylesContext;
class XMLTextListBlockContext;
class SvxXMLListStyleContext;
class XMLPropStyleContext;
class SvI18NMap;
class XMLSectionImportContext;
class XMLFontStylesContext;
template<class A> class XMLPropertyBackpatcher;
class XMLEventsImportContext;

namespace xmloff {
    struct ParsedRDFaAttributes;
}

namespace com { namespace sun { namespace star {
namespace text {
    class XText;
    class XTextCursor;
    class XTextRange;
    class XTextContent;
    class XFormField;
}
namespace frame { class XModel; }
namespace container { class XNameContainer; class XIndexReplace; class XNameAccess; }
namespace beans { class XPropertySet; }
namespace xml { namespace sax { class XAttributeList; } }
namespace util { struct DateTime; }
namespace lang { class XMultiServiceFactory; }
} } }

enum SwXMLTextElemTokens
{
    XML_TOK_TEXT_P,
    XML_TOK_TEXT_H,
    XML_TOK_TEXT_LIST,
    XML_TOK_TEXT_FRAME_PAGE,
    XML_TOK_TABLE_TABLE,
    XML_TOK_TEXT_VARFIELD_DECLS,
    XML_TOK_TEXT_USERFIELD_DECLS,
    XML_TOK_TEXT_SEQUENCE_DECLS,
    XML_TOK_TEXT_DDE_DECLS,
    XML_TOK_DRAW_A_PAGE,
    XML_TOK_TEXT_SECTION,
    XML_TOK_TEXT_TOC,
    XML_TOK_TEXT_OBJECT_INDEX,
    XML_TOK_TEXT_TABLE_INDEX,
    XML_TOK_TEXT_ILLUSTRATION_INDEX,
    XML_TOK_TEXT_USER_INDEX,
    XML_TOK_TEXT_ALPHABETICAL_INDEX,
    XML_TOK_TEXT_BIBLIOGRAPHY_INDEX,
    XML_TOK_TEXT_INDEX_TITLE,
    XML_TOK_TEXT_TRACKED_CHANGES,
    XML_TOK_TEXT_CHANGE_START,
    XML_TOK_TEXT_CHANGE_END,
    XML_TOK_TEXT_CHANGE,
    XML_TOK_TEXT_FORMS,
    XML_TOK_TEXT_CALCULATION_SETTINGS,
    XML_TOK_TEXT_AUTOMARK,
    XML_TOK_TEXT_NUMBERED_PARAGRAPH,
    XML_TOK_TEXT_ELEM_END=XML_TOK_UNKNOWN
};

enum XMLTextPElemTokens
{
    XML_TOK_TEXT_SPAN,
    XML_TOK_TEXT_TAB_STOP,
    XML_TOK_TEXT_LINE_BREAK,
    XML_TOK_TEXT_SOFT_PAGE_BREAK,
    XML_TOK_TEXT_S,
    XML_TOK_TEXT_FRAME,
    XML_TOK_TEXT_HYPERLINK,
    XML_TOK_TEXT_RUBY,

    XML_TOK_TEXT_NOTE,
    XML_TOK_TEXT_BOOKMARK,
    XML_TOK_TEXT_BOOKMARK_START,
    XML_TOK_TEXT_BOOKMARK_END,
    XML_TOK_TEXT_REFERENCE,
    XML_TOK_TEXT_REFERENCE_START,
    XML_TOK_TEXT_REFERENCE_END,

    XML_TOK_TEXT_TOC_MARK,			// index marks
    XML_TOK_TEXT_TOC_MARK_START,
    XML_TOK_TEXT_TOC_MARK_END,
    XML_TOK_TEXT_USER_INDEX_MARK,
    XML_TOK_TEXT_USER_INDEX_MARK_START,
    XML_TOK_TEXT_USER_INDEX_MARK_END,
    XML_TOK_TEXT_ALPHA_INDEX_MARK,
    XML_TOK_TEXT_ALPHA_INDEX_MARK_START,
    XML_TOK_TEXT_ALPHA_INDEX_MARK_END,

    XML_TOK_TEXT_SENDER_FIRSTNAME,	// sender fields
    XML_TOK_TEXT_SENDER_LASTNAME,
    XML_TOK_TEXT_SENDER_INITIALS,
    XML_TOK_TEXT_SENDER_TITLE,
    XML_TOK_TEXT_SENDER_POSITION,
    XML_TOK_TEXT_SENDER_EMAIL,
    XML_TOK_TEXT_SENDER_PHONE_PRIVATE,
    XML_TOK_TEXT_SENDER_FAX,
    XML_TOK_TEXT_SENDER_COMPANY,
    XML_TOK_TEXT_SENDER_PHONE_WORK,
    XML_TOK_TEXT_SENDER_STREET,
    XML_TOK_TEXT_SENDER_CITY,
    XML_TOK_TEXT_SENDER_POSTAL_CODE,
    XML_TOK_TEXT_SENDER_COUNTRY,
    XML_TOK_TEXT_SENDER_STATE_OR_PROVINCE,

    XML_TOK_TEXT_AUTHOR_NAME,	// author fields
    XML_TOK_TEXT_AUTHOR_INITIALS,

    XML_TOK_TEXT_DATE,			// date & time fields
    XML_TOK_TEXT_TIME,

    XML_TOK_TEXT_PAGE_NUMBER,	// page number fields
    XML_TOK_TEXT_PAGE_CONTINUATION_STRING,

    XML_TOK_TEXT_VARIABLE_SET,	// variable fields
    XML_TOK_TEXT_VARIABLE_GET,
    XML_TOK_TEXT_VARIABLE_INPUT,
    XML_TOK_TEXT_USER_FIELD_GET,
    XML_TOK_TEXT_USER_FIELD_INPUT,
    XML_TOK_TEXT_SEQUENCE,
    XML_TOK_TEXT_EXPRESSION,
    XML_TOK_TEXT_TEXT_INPUT,

    XML_TOK_TEXT_DATABASE_DISPLAY,	// database fields
    XML_TOK_TEXT_DATABASE_NEXT,
    XML_TOK_TEXT_DATABASE_SELECT,
    XML_TOK_TEXT_DATABASE_ROW_NUMBER,
    XML_TOK_TEXT_DATABASE_NAME,

    XML_TOK_TEXT_DOCUMENT_CREATION_AUTHOR, //document info fields
    XML_TOK_TEXT_DOCUMENT_CREATION_DATE,
    XML_TOK_TEXT_DOCUMENT_CREATION_TIME,
    XML_TOK_TEXT_DOCUMENT_DESCRIPTION,
    XML_TOK_TEXT_DOCUMENT_PRINT_AUTHOR,
    XML_TOK_TEXT_DOCUMENT_PRINT_DATE,
    XML_TOK_TEXT_DOCUMENT_PRINT_TIME,
    XML_TOK_TEXT_DOCUMENT_TITLE,
    XML_TOK_TEXT_DOCUMENT_SUBJECT,
    XML_TOK_TEXT_DOCUMENT_KEYWORDS,
    XML_TOK_TEXT_DOCUMENT_REVISION,
    XML_TOK_TEXT_DOCUMENT_EDIT_DURATION,
    XML_TOK_TEXT_DOCUMENT_SAVE_AUTHOR,
    XML_TOK_TEXT_DOCUMENT_SAVE_DATE,
    XML_TOK_TEXT_DOCUMENT_SAVE_TIME,
    XML_TOK_TEXT_DOCUMENT_USER_DEFINED,

    XML_TOK_TEXT_PLACEHOLDER,	// misc. fields
    XML_TOK_TEXT_CONDITIONAL_TEXT,
    XML_TOK_TEXT_HIDDEN_TEXT,
    XML_TOK_TEXT_HIDDEN_PARAGRAPH,
    XML_TOK_TEXT_FILENAME,
    XML_TOK_TEXT_CHAPTER,
    XML_TOK_TEXT_TEMPLATENAME,
    XML_TOK_TEXT_WORD_COUNT,	// statistics/count fields
    XML_TOK_TEXT_PARAGRAPH_COUNT,
    XML_TOK_TEXT_TABLE_COUNT,
    XML_TOK_TEXT_CHARACTER_COUNT,
    XML_TOK_TEXT_IMAGE_COUNT,
    XML_TOK_TEXT_OBJECT_COUNT,
    XML_TOK_TEXT_PAGE_COUNT,
    XML_TOK_TEXT_GET_PAGE_VAR,
    XML_TOK_TEXT_SET_PAGE_VAR,
    XML_TOK_TEXT_MACRO,
    XML_TOK_TEXT_DDE,
    XML_TOK_TEXT_REFERENCE_REF,
    XML_TOK_TEXT_BOOKMARK_REF,
    XML_TOK_TEXT_SEQUENCE_REF,
    XML_TOK_TEXT_NOTE_REF,
    XML_TOK_TEXT_SHEET_NAME,
    XML_TOK_TEXT_BIBLIOGRAPHY_MARK,
    XML_TOK_TEXT_ANNOTATION,
    XML_TOK_TEXT_SCRIPT,
    XML_TOK_TEXT_TABLE_FORMULA,
    XML_TOK_TEXT_DROPDOWN,

    // RDF metadata
    XML_TOK_TEXT_META,
    XML_TOK_TEXT_META_FIELD,

    // misc
    XML_TOK_TEXTP_CHANGE_START,	// TEXTP avoids clash with SwXMLTextElemTokens
    XML_TOK_TEXTP_CHANGE_END,
    XML_TOK_TEXTP_CHANGE,
    XML_TOK_DRAW_A,
    XML_TOK_TEXT_MEASURE,

    XML_TOK_DRAW_HEADER,
    XML_TOK_DRAW_FOOTER,
    XML_TOK_DRAW_DATE_TIME,
    XML_TOK_TEXT_PAGE_CONTINUATION,

    XML_TOK_TEXT_FIELDMARK,
    XML_TOK_TEXT_FIELDMARK_START,
    XML_TOK_TEXT_FIELDMARK_END,

    XML_TOK_TEXT_P_ELEM_END=XML_TOK_UNKNOWN
};

enum XMLTextPAttrTokens
{
    XML_TOK_TEXT_P_XMLID,
    XML_TOK_TEXT_P_ABOUT,
    XML_TOK_TEXT_P_PROPERTY,
    XML_TOK_TEXT_P_CONTENT,
    XML_TOK_TEXT_P_DATATYPE,
    XML_TOK_TEXT_P_TEXTID,
    XML_TOK_TEXT_P_STYLE_NAME,
    XML_TOK_TEXT_P_COND_STYLE_NAME,
    XML_TOK_TEXT_P_LEVEL,
    XML_TOK_TEXT_P_CLASS_NAMES,
    XML_TOK_TEXT_P_IS_LIST_HEADER,
    XML_TOK_TEXT_P_RESTART_NUMBERING,
    XML_TOK_TEXT_P_START_VALUE,
    XML_TOK_TEXT_P_END=XML_TOK_UNKNOWN
};

enum XMLTextNumberedParagraphAttrTokens
{
    XML_TOK_TEXT_NUMBERED_PARAGRAPH_XMLID,
    XML_TOK_TEXT_NUMBERED_PARAGRAPH_LIST_ID,
    XML_TOK_TEXT_NUMBERED_PARAGRAPH_LEVEL,
    XML_TOK_TEXT_NUMBERED_PARAGRAPH_STYLE_NAME,
    XML_TOK_TEXT_NUMBERED_PARAGRAPH_CONTINUE_NUMBERING,
    XML_TOK_TEXT_NUMBERED_PARAGRAPH_START_VALUE,
    XML_TOK_TEXT_NUMBERED_PARAGRAPH_END=XML_TOK_UNKNOWN
};

enum XMLTextListBlockAttrTokens
{
    XML_TOK_TEXT_LIST_BLOCK_XMLID,
    XML_TOK_TEXT_LIST_BLOCK_STYLE_NAME,
    XML_TOK_TEXT_LIST_BLOCK_CONTINUE_NUMBERING,
    // --> OD 2008-04-22 #refactorlists#
    XML_TOK_TEXT_LIST_BLOCK_ID,
    XML_TOK_TEXT_LIST_BLOCK_CONTINUE_LIST,
    // <--
    XML_TOK_TEXT_LIST_BLOCK_END=XML_TOK_UNKNOWN
};

enum XMLTextListBlockElemTokens
{
    XML_TOK_TEXT_LIST_HEADER,
    XML_TOK_TEXT_LIST_ITEM,
    XML_TOK_TEXT_LIST_BLOCK_ELEM_END=XML_TOK_UNKNOWN
};

enum XMLTextFrameAttrTokens
{
    XML_TOK_TEXT_FRAME_STYLE_NAME,
    XML_TOK_TEXT_FRAME_NAME,
    XML_TOK_TEXT_FRAME_ANCHOR_TYPE,
    XML_TOK_TEXT_FRAME_ANCHOR_PAGE_NUMBER,
    XML_TOK_TEXT_FRAME_X,
    XML_TOK_TEXT_FRAME_Y,
    XML_TOK_TEXT_FRAME_WIDTH,
    XML_TOK_TEXT_FRAME_REL_WIDTH,
    XML_TOK_TEXT_FRAME_HEIGHT,
    XML_TOK_TEXT_FRAME_MIN_HEIGHT,
    XML_TOK_TEXT_FRAME_REL_HEIGHT,
    XML_TOK_TEXT_FRAME_NEXT_CHAIN_NAME,
    XML_TOK_TEXT_FRAME_HREF,
    XML_TOK_TEXT_FRAME_FILTER_NAME,
    XML_TOK_TEXT_FRAME_Z_INDEX,
    XML_TOK_TEXT_FRAME_TRANSFORM,
    XML_TOK_TEXT_FRAME_CLASS_ID,
    XML_TOK_TEXT_FRAME_CODE,
    XML_TOK_TEXT_FRAME_OBJECT,
    XML_TOK_TEXT_FRAME_ARCHIVE,
    XML_TOK_TEXT_FRAME_MAY_SCRIPT,
    XML_TOK_TEXT_FRAME_MIME_TYPE,
    XML_TOK_TEXT_FRAME_APPLET_NAME,
    XML_TOK_TEXT_FRAME_FRAME_NAME,
    XML_TOK_TEXT_FRAME_NOTIFY_ON_UPDATE,
    XML_TOK_TEXT_FRAME_MIN_WIDTH,
    XML_TOK_TEXT_FRAME_END=XML_TOK_UNKNOWN
};

enum XMLTextHyperlinkAttrTokens
{
    XML_TOK_TEXT_HYPERLINK_HREF,
    XML_TOK_TEXT_HYPERLINK_NAME,
    XML_TOK_TEXT_HYPERLINK_TARGET_FRAME,
    XML_TOK_TEXT_HYPERLINK_SHOW,
    XML_TOK_TEXT_HYPERLINK_STYLE_NAME,
    XML_TOK_TEXT_HYPERLINK_VIS_STYLE_NAME,
    XML_TOK_TEXT_HYPERLINK_SERVER_MAP,
    XML_TOK_TEXT_HYPERLINK_END=XML_TOK_UNKNOWN
};

enum XMLTextPageMasterElemTokens
{
    XML_TOK_TEXT_MP_HEADER,
    XML_TOK_TEXT_MP_FOOTER,
    XML_TOK_TEXT_MP_HEADER_LEFT,
    XML_TOK_TEXT_MP_FOOTER_LEFT,
    XML_TOK_TEXT_MP_END=XML_TOK_UNKNOWN
};

enum XMLTextContourAttrTokens
{
    XML_TOK_TEXT_CONTOUR_WIDTH,
    XML_TOK_TEXT_CONTOUR_HEIGHT,
    XML_TOK_TEXT_CONTOUR_VIEWBOX,
    XML_TOK_TEXT_CONTOUR_POINTS,
    XML_TOK_TEXT_CONTOUR_D,
    XML_TOK_TEXT_CONTOUR_AUTO,
    XML_TOK_TEXT_CONTOUR_END=XML_TOK_UNKNOWN
};
enum XMLTextType
{
    XML_TEXT_TYPE_BODY,
    XML_TEXT_TYPE_CELL,
    XML_TEXT_TYPE_SHAPE,
    XML_TEXT_TYPE_TEXTBOX,
    XML_TEXT_TYPE_HEADER_FOOTER,
    XML_TEXT_TYPE_SECTION,
    XML_TEXT_TYPE_FOOTNOTE,
    XML_TEXT_TYPE_CHANGED_REGION
};

#define XML_TEXT_RENAME_TYPE_FRAME 10
#define XML_TEXT_RENAME_TYPE_TABLE 20

// create type for section list, XMLSectionList_Impl
DECLARE_LIST( XMLSectionList_Impl, XMLSectionImportContext* )

class XMLOFF_DLLPUBLIC XMLTextImportHelper : public UniRefBase,
    private boost::noncopyable
{
private:
    struct Impl;
    ::std::auto_ptr<Impl> m_pImpl;
    /// ugly, but implementation of this is in XMLPropertyBackpatcher.cxx
    struct BackpatcherImpl;
    ::boost::shared_ptr<BackpatcherImpl> m_pBackpatcherImpl;
    ::boost::shared_ptr<BackpatcherImpl> MakeBackpatcherImpl();

protected:
    virtual SvXMLImportContext *CreateTableChildContext(
                SvXMLImport& rImport,
                sal_uInt16 nPrefix, const ::rtl::OUString& rLocalName,
                const ::com::sun::star::uno::Reference<
                    ::com::sun::star::xml::sax::XAttributeList > & xAttrList );

    // access, lazy initialization and destruction of backpatchers
    // Code is implemented in XMLPropertyBackpatcher.cxx
    inline XMLPropertyBackpatcher<sal_Int16>& GetFootnoteBP();
    inline XMLPropertyBackpatcher<sal_Int16>& GetSequenceIdBP();
    inline XMLPropertyBackpatcher< ::rtl::OUString> & GetSequenceNameBP();

public:

    XMLTextImportHelper(
            ::com::sun::star::uno::Reference <
                ::com::sun::star::frame::XModel> const& rModel,
            SvXMLImport& rImport,
            bool const bInsertMode = false, bool const bStylesOnlyMode = false,
            bool const bProgress = false, bool const bBlockMode = false,
            bool const bOrganizerMode = false);

    ~XMLTextImportHelper();

    void SetCursor(
            const ::com::sun::star::uno::Reference <
                ::com::sun::star::text::XTextCursor >& rCursor );
    void ResetCursor();

    void SetAutoStyles( SvXMLStylesContext *pStyles );

    void SetFontDecls( XMLFontStylesContext *pFontDecls );
    const XMLFontStylesContext *GetFontDecls() const;

    SvXMLImportContext *CreateTextChildContext(
            SvXMLImport& rImport,
            sal_uInt16 nPrefix, const ::rtl::OUString& rLocalName,
            const ::com::sun::star::uno::Reference<
                ::com::sun::star::xml::sax::XAttributeList > & xAttrList,
            XMLTextType eType = XML_TEXT_TYPE_SHAPE );

    SvXMLTokenMap const& GetTextElemTokenMap();
    SvXMLTokenMap const& GetTextPElemTokenMap();
    SvXMLTokenMap const& GetTextPAttrTokenMap();
    SvXMLTokenMap const& GetTextFrameAttrTokenMap();
    SvXMLTokenMap const& GetTextContourAttrTokenMap();
    SvXMLTokenMap const& GetTextHyperlinkAttrTokenMap();
    SvXMLTokenMap const& GetTextMasterPageElemTokenMap();

    const SvXMLTokenMap& GetTextNumberedParagraphAttrTokenMap();
    const SvXMLTokenMap& GetTextListBlockAttrTokenMap();
    const SvXMLTokenMap& GetTextListBlockElemTokenMap();
    const SvXMLTokenMap& GetTextFieldAttrTokenMap(); // impl: txtfldi.cxx

    ::com::sun::star::uno::Reference<
        ::com::sun::star::text::XText > & GetText();
    ::com::sun::star::uno::Reference<
        ::com::sun::star::text::XTextCursor > & GetCursor();
    ::com::sun::star::uno::Reference<
        ::com::sun::star::text::XTextRange > & GetCursorAsRange();

    bool IsInsertMode() const;
    bool IsStylesOnlyMode() const;
    bool IsBlockMode() const;
    bool IsOrganizerMode() const;
    bool IsProgress() const;

    XMLSectionList_Impl & GetSectionList();

    ::rtl::OUString ConvertStarFonts( const ::rtl::OUString& rChars,
                                      const ::rtl::OUString& rStyleName,
                                      sal_uInt8& rFlags,
                                      sal_Bool bPara,
                                         SvXMLImport& rImport ) const;
    // insert a string without special whitespace processing enabled
    void InsertString( const ::rtl::OUString& rChars );
    // insert a string with special whitespace processing enabled
    void InsertString( const ::rtl::OUString& rChars,
                       sal_Bool& rIgnoreLeadingSpace );
    // Delete current paragraph
    void DeleteParagraph();

    void InsertControlCharacter( sal_Int16 nControl );
    void InsertTextContent( ::com::sun::star::uno::Reference <
                            ::com::sun::star::text::XTextContent > & xContent);

    // --> OD 2007-07-25 #i73509# - add parameter <bOutlineLevelAttrFound>
    // --> OD 2007-08-17 #i80724#
    // add parameter <bSetListAttrs> in order to suppress the handling of the list attributes
    ::rtl::OUString SetStyleAndAttrs(
            SvXMLImport& rImport,
            const ::com::sun::star::uno::Reference <
                ::com::sun::star::text::XTextCursor >& rCursor,
            const ::rtl::OUString& rStyleName,
            sal_Bool bPara,
            sal_Bool bOutlineLevelAttrFound = sal_False,
            sal_Int8 nOutlineLevel = -1,
            sal_Bool bSetListAttrs = sal_True );
    // <--

    /** Find a suitable name for the given outline level.
     *  If rStyleName is empty, change it to a previously used or default style
     *  name for that level. Otherwise, leave rStyleName unmodified.
     */
    // --> OD 2006-10-12 #i69629# - adjust 2nd parameter
    void FindOutlineStyleName( ::rtl::OUString& rStyleName,
                               sal_Int8 nOutlineLevel );
    // <--

    // --> OD 2006-10-12 #i69629#
    // change method name to reflect change of data structure
    void AddOutlineStyleCandidate( const sal_Int8 nOutlineLevel,
                                   const ::rtl::OUString& rStyleName );
    // <--
    void SetOutlineStyles( sal_Bool bSetEmpty );

    void SetHyperlink(
            SvXMLImport& rImport,
            const ::com::sun::star::uno::Reference <
                ::com::sun::star::text::XTextCursor >& rCursor,
            const ::rtl::OUString& rHRef,
            const ::rtl::OUString& rName,
            const ::rtl::OUString& rTargetFrameName,
            const ::rtl::OUString& rStyleName,
            const ::rtl::OUString& rVisitedStyleName,
            XMLEventsImportContext* pEvents = NULL);
    void SetRuby(
            SvXMLImport& rImport,
            const ::com::sun::star::uno::Reference <
                ::com::sun::star::text::XTextCursor >& rCursor,
            const ::rtl::OUString& rStyleName,
            const ::rtl::OUString& rTextStyleName,
            const ::rtl::OUString& rText );

    /// return key appropriate for use with NumberFormat property
    /// return -1 if style is not found
    /// (may return whether data style uses the system language)
    sal_Int32 GetDataStyleKey( const ::rtl::OUString& sStyleName,
                               sal_Bool* pIsSystemLanguage = NULL );

    const SvxXMLListStyleContext *FindAutoListStyle(
            const ::rtl::OUString& rName ) const;
    XMLPropStyleContext *FindAutoFrameStyle(
            const ::rtl::OUString& rName ) const;
    XMLPropStyleContext* FindSectionStyle(
            const ::rtl::OUString& rName ) const;
    XMLPropStyleContext* FindPageMaster(
            const ::rtl::OUString& rName ) const;

    const ::com::sun::star::uno::Reference<
        ::com::sun::star::container::XNameContainer> & GetParaStyles() const;

    const ::com::sun::star::uno::Reference<
        ::com::sun::star::container::XNameContainer> & GetTextStyles() const;

    const ::com::sun::star::uno::Reference<
        ::com::sun::star::container::XNameContainer> &
        GetNumberingStyles() const;

    const ::com::sun::star::uno::Reference<
        ::com::sun::star::container::XNameContainer> & GetFrameStyles() const;

    const ::com::sun::star::uno::Reference<
        ::com::sun::star::container::XNameContainer> & GetPageStyles() const;

    const ::com::sun::star::uno::Reference<
        ::com::sun::star::container::XIndexReplace > &
        GetChapterNumbering() const;

    sal_Bool HasFrameByName( const ::rtl::OUString& rName ) const;
    void ConnectFrameChains( const ::rtl::OUString& rFrmName,
        const ::rtl::OUString& rNextFrmName,
        const ::com::sun::star::uno::Reference <
            ::com::sun::star::beans::XPropertySet >& rFrmPropSet );

    UniReference< SvXMLImportPropertyMapper > const&
        GetParaImportPropertySetMapper() const;
    UniReference< SvXMLImportPropertyMapper > const&
        GetTextImportPropertySetMapper() const;
    UniReference< SvXMLImportPropertyMapper > const&
        GetFrameImportPropertySetMapper() const;
    UniReference< SvXMLImportPropertyMapper > const&
        GetSectionImportPropertySetMapper() const;
    UniReference< SvXMLImportPropertyMapper > const&
        GetRubyImportPropertySetMapper() const;

    static SvXMLImportPropertyMapper *CreateShapeExtPropMapper(SvXMLImport&);
    static SvXMLImportPropertyMapper *CreateCharExtPropMapper(SvXMLImport&, XMLFontStylesContext *pFontDecls = NULL);
    static SvXMLImportPropertyMapper *CreateParaExtPropMapper(SvXMLImport&, XMLFontStylesContext *pFontDecls = NULL);
    static SvXMLImportPropertyMapper* CreateParaDefaultExtPropMapper(SvXMLImport&, XMLFontStylesContext* pFontDecls = NULL);
    static SvXMLImportPropertyMapper* CreateTableDefaultExtPropMapper(SvXMLImport&, XMLFontStylesContext* pFontDecls = NULL);
    static SvXMLImportPropertyMapper* CreateTableRowDefaultExtPropMapper(SvXMLImport&, XMLFontStylesContext* pFontDecls = NULL);

    static sal_Bool HasDrawNameAttribute(
        const ::com::sun::star::uno::Reference<
            ::com::sun::star::xml::sax::XAttributeList > & xAttrList,
        SvXMLNamespaceMap& rNamespaceMap );

    SvI18NMap& GetRenameMap();

    /// save the start of a range reference
    void InsertBookmarkStartRange(
        const ::rtl::OUString sName,
        const ::com::sun::star::uno::Reference<
                ::com::sun::star::text::XTextRange> & rRange,
        ::rtl::OUString const& i_rXmlId,
        ::boost::shared_ptr< ::xmloff::ParsedRDFaAttributes > &
            i_rpRDFaAttributes);

    /// process the start of a range reference
    sal_Bool FindAndRemoveBookmarkStartRange(
        const ::rtl::OUString sName,
        ::com::sun::star::uno::Reference<
                ::com::sun::star::text::XTextRange> & o_rRange,
        ::rtl::OUString & o_rXmlId,
        ::boost::shared_ptr< ::xmloff::ParsedRDFaAttributes > &
            o_rpRDFaAttributes);

    ::rtl::OUString FindActiveBookmarkName();
    ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > GetRangeFor(::rtl::OUString &sName);

    void pushFieldCtx( ::rtl::OUString name, ::rtl::OUString type );
    void popFieldCtx();
    void addFieldParam( ::rtl::OUString name, ::rtl::OUString value );
    void setCurrentFieldParamsTo(::com::sun::star::uno::Reference< ::com::sun::star::text::XFormField> &xFormField);
    ::rtl::OUString getCurrentFieldName();
    ::rtl::OUString getCurrentFieldType();
    bool hasCurrentFieldCtx();


    /// insert new footnote ID.
    /// Also fixup open references from the backpatch list to this ID.
    // Code is implemented in XMLPropertyBackpatcher.cxx
    void InsertFootnoteID(const ::rtl::OUString& sXMLId, sal_Int16 nAPIId);

    /// set the proper footnote reference ID,
    /// or put into backpatch list if ID is unknown
    // Code is implemented in XMLPropertyBackpatcher.cxx
    void ProcessFootnoteReference(
        const ::rtl::OUString& sXMLId,
        const ::com::sun::star::uno::Reference<
            ::com::sun::star::beans::XPropertySet> & xPropSet);

    /// insert new sequence ID
    /// Also fixup open references from backpatch list to this ID.
    // Code is implemented in XMLPropertyBackpatcher.cxx
    void InsertSequenceID(const ::rtl::OUString& sXMLId,
                          const ::rtl::OUString& sName,
                          sal_Int16 nAPIId);

    /// set sequence ID or insert into backpatch list
    // Code is implemented in XMLPropertyBackpatcher.cxx
    void ProcessSequenceReference(
        const ::rtl::OUString& sXMLId,
        const ::com::sun::star::uno::Reference<
            ::com::sun::star::beans::XPropertySet> & xPropSet);

    sal_Bool IsInFrame() const;
    virtual sal_Bool IsInHeaderFooter() const;

    virtual ::com::sun::star::uno::Reference<
        ::com::sun::star::beans::XPropertySet>
            createAndInsertOLEObject( SvXMLImport& rImport,
                                      const ::rtl::OUString& rHRef,
                                      const ::rtl::OUString &rStyleName,
                                      const ::rtl::OUString &rTblName,
                                         sal_Int32 nWidth, sal_Int32 nHeight );

    virtual ::com::sun::star::uno::Reference<
        ::com::sun::star::beans::XPropertySet>
            createAndInsertOOoLink( SvXMLImport& rImport,
                                      const ::rtl::OUString& rHRef,
                                      const ::rtl::OUString &rStyleName,
                                      const ::rtl::OUString &rTblName,
                                         sal_Int32 nWidth, sal_Int32 nHeight );

    virtual ::com::sun::star::uno::Reference<
        ::com::sun::star::beans::XPropertySet>
        createAndInsertApplet(
            const ::rtl::OUString &rName,
            const ::rtl::OUString &rCode,
            sal_Bool bMayScript,
            const ::rtl::OUString& rHRef,
            sal_Int32 nWidth, sal_Int32 nHeight );

    virtual ::com::sun::star::uno::Reference<
        ::com::sun::star::beans::XPropertySet>
        createAndInsertPlugin(
            const ::rtl::OUString &rMimeType,
            const ::rtl::OUString& rHRef,
            sal_Int32 nWidth, sal_Int32 nHeight );

    virtual ::com::sun::star::uno::Reference<
        ::com::sun::star::beans::XPropertySet>
        createAndInsertFloatingFrame(
            const ::rtl::OUString &rName,
            const ::rtl::OUString &rHRef,
            const ::rtl::OUString &rStyleName,
            sal_Int32 nWidth, sal_Int32 nHeight );

    virtual void endAppletOrPlugin(
        const com::sun::star::uno::Reference<
        ::com::sun::star::beans::XPropertySet> &rPropSet,
        ::std::map < const ::rtl::OUString, ::rtl::OUString, ::comphelper::UStringLess > &rParamMap );

    // applet helper methods
    // implemented in sw/filter/xml/txtparai.hxx

    // redlining helper methods
    // (to be implemented in sw/filter/xml/txtparai.hxx)

    virtual void RedlineAdd(
        const ::rtl::OUString& rType,		/// redline type (insert, del,... )
        const ::rtl::OUString& rId,			/// use to identify this redline
        const ::rtl::OUString& rAuthor,		/// name of the author
        const ::rtl::OUString& rComment,	/// redline comment
        const ::com::sun::star::util::DateTime& rDateTime,	/// date+time
        sal_Bool bMergeLastParagraph);      /// merge last paras
    virtual ::com::sun::star::uno::Reference<
        ::com::sun::star::text::XTextCursor> RedlineCreateText(
            ::com::sun::star::uno::Reference< 	/// needed to get the document
                    ::com::sun::star::text::XTextCursor> & rOldCursor,
            const ::rtl::OUString& rId);	/// ID used to RedlineAdd() call
    virtual void RedlineSetCursor(
        const ::rtl::OUString& rId,			/// ID used to RedlineAdd() call
        sal_Bool bStart,					/// start or end Cursor
        sal_Bool bIsOutsideOfParagraph);	/// range is not within <text:p>
    virtual void RedlineAdjustStartNodeCursor(
        sal_Bool bStart);
    virtual void SetShowChanges( sal_Bool bShowChanges );
    virtual void SetRecordChanges( sal_Bool bRecordChanges );
    virtual void SetChangesProtectionKey(
        const ::com::sun::star::uno::Sequence<sal_Int8> & rProtectionKey );

    // access to the last open redline ID:
    ::rtl::OUString GetOpenRedlineId();
    void SetOpenRedlineId( ::rtl::OUString& rId);
    void ResetOpenRedlineId();

    // #107848#
    // Access methods to the inside_deleted_section flag (redlining)
    void SetInsideDeleteContext(bool const bNew);
    bool IsInsideDeleteContext() const;

    SvXMLImport & GetXMLImport();

    // --> OD 2008-04-25 #refactorlists#
    XMLTextListsHelper & GetTextListHelper();
    // <--

    // forwards to TextListHelper; these are used in many places
    /// push a list context on the list context stack
    void PushListContext(XMLTextListBlockContext *i_pListBlock = 0);
    /// pop the list context stack
    void PopListContext();

    void SetCellParaStyleDefault(::rtl::OUString const& rNewValue);
    ::rtl::OUString const& GetCellParaStyleDefault();
};

#endif

/* vim:set shiftwidth=4 softtabstop=4 expandtab: */