diff options
author | Vladimir Glazounov <vg@openoffice.org> | 2007-04-11 12:30:01 +0000 |
---|---|---|
committer | Vladimir Glazounov <vg@openoffice.org> | 2007-04-11 12:30:01 +0000 |
commit | 2795ceb1ac93750cd4ed933db0382195cfcb388b (patch) | |
tree | ef04426043a7c6efca060a8fbac21bbb4959e08f /xmloff | |
parent | f4689a8b0d32c5f9e427c2c89ea23efa577f2c18 (diff) |
INTEGRATION: CWS hedaburemove01 (1.1.2); FILE ADDED
2007/02/09 16:09:02 vg 1.1.2.1: #72503# get rid of hedabu procedure: Moving headers to xmloff/inc/xmloff and correspondent necessary changes
Diffstat (limited to 'xmloff')
-rw-r--r-- | xmloff/inc/xmloff/styleexp.hxx | 150 | ||||
-rw-r--r-- | xmloff/inc/xmloff/txtimp.hxx | 925 | ||||
-rw-r--r-- | xmloff/inc/xmloff/txtprmap.hxx | 210 |
3 files changed, 1285 insertions, 0 deletions
diff --git a/xmloff/inc/xmloff/styleexp.hxx b/xmloff/inc/xmloff/styleexp.hxx new file mode 100644 index 000000000000..97e94a38c197 --- /dev/null +++ b/xmloff/inc/xmloff/styleexp.hxx @@ -0,0 +1,150 @@ +/************************************************************************* + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: styleexp.hxx,v $ + * + * $Revision: 1.2 $ + * + * last change: $Author: vg $ $Date: 2007-04-11 13:29:12 $ + * + * The Contents of this file are made available subject to + * the terms of GNU Lesser General Public License Version 2.1. + * + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2005 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + ************************************************************************/ +#ifndef _XMLOFF_STYLEEXP_HXX_ +#define _XMLOFF_STYLEEXP_HXX_ + +#ifndef _SAL_CONFIG_H_ +#include "sal/config.h" +#endif + +#ifndef INCLUDED_XMLOFF_DLLAPI_H +#include "xmloff/dllapi.h" +#endif + +#ifndef _RTL_USTRING_HXX_ +#include <rtl/ustring.hxx> +#endif +#ifndef _COM_SUN_STAR_UNO_REFERENCE_H_ +#include <com/sun/star/uno/Reference.h> +#endif + +#ifndef _VCL_MAPUNIT_HXX +//#include <vcl/mapunit.hxx> +#endif + +#ifndef _UNIVERSALL_REFERENCE_HXX +#include <xmloff/uniref.hxx> +#endif + +namespace com { namespace sun { namespace star +{ + namespace style + { + class XStyle; + } + namespace beans + { + class XPropertySet; + } +} } } + +class XMLPropertySetMapper; +class SvXMLExportPropertyMapper; +class SvXMLAutoStylePoolP; +class SvXMLExport; + +class XMLOFF_DLLPUBLIC XMLStyleExport : public UniRefBase +{ + SvXMLExport& rExport; +protected: + const ::rtl::OUString sIsPhysical; + const ::rtl::OUString sIsAutoUpdate; + const ::rtl::OUString sFollowStyle; + const ::rtl::OUString sNumberingStyleName; + + SvXMLExport& GetExport() { return rExport; } + const SvXMLExport& GetExport() const { return rExport; } + +private: + + const ::rtl::OUString sPoolStyleName; + + SvXMLAutoStylePoolP *pAutoStylePool; + +protected: + + virtual sal_Bool exportStyle( + const ::com::sun::star::uno::Reference< + ::com::sun::star::style::XStyle > & rStyle, + const ::rtl::OUString& rXMLFamily, + const UniReference < SvXMLExportPropertyMapper >& rPropMapper, + const ::rtl::OUString* pPrefix = 0L ); + + virtual void exportStyleAttributes( + const ::com::sun::star::uno::Reference< + ::com::sun::star::style::XStyle > & rStyle ); + + virtual void exportStyleContent( + const ::com::sun::star::uno::Reference< + ::com::sun::star::style::XStyle > & rStyle ); +public: + XMLStyleExport( + SvXMLExport& rExp, + const ::rtl::OUString& rPoolStyleName, + SvXMLAutoStylePoolP *pAutoStyleP=0 ); + virtual ~XMLStyleExport(); + +// void exportStyleFamily( +// const ::rtl::OUString& rFamily, const ::rtl::OUString& rXMLFamily, +// const UniReference < XMLPropertySetMapper >& rPropMapper, +// sal_Bool bUsed, sal_uInt16 nFamily = 0, +// const ::rtl::OUString* pPrefix = 0L); + +// void exportStyleFamily( +// const sal_Char *pFamily, const ::rtl::OUString& rXMLFamily, +// const UniReference < XMLPropertySetMapper >& rPropMapper, +// sal_Bool bUsed, sal_uInt16 nFamily = 0, +// const ::rtl::OUString* pPrefix = 0L); + + virtual sal_Bool exportDefaultStyle( + const ::com::sun::star::uno::Reference< + ::com::sun::star::beans::XPropertySet > & xPropSet, + const ::rtl::OUString& rXMLFamily, + const UniReference < SvXMLExportPropertyMapper >& rPropMapper ); + + void exportStyleFamily( + const ::rtl::OUString& rFamily, const ::rtl::OUString& rXMLFamily, + const UniReference < SvXMLExportPropertyMapper >& rPropMapper, + sal_Bool bUsed, sal_uInt16 nFamily = 0, + const ::rtl::OUString* pPrefix = 0L); + + void exportStyleFamily( + const sal_Char *pFamily, const ::rtl::OUString& rXMLFamily, + const UniReference < SvXMLExportPropertyMapper >& rPropMapper, + sal_Bool bUsed, sal_uInt16 nFamily = 0, + const ::rtl::OUString* pPrefix = 0L); +}; + +#endif diff --git a/xmloff/inc/xmloff/txtimp.hxx b/xmloff/inc/xmloff/txtimp.hxx new file mode 100644 index 000000000000..1f9b55d9befb --- /dev/null +++ b/xmloff/inc/xmloff/txtimp.hxx @@ -0,0 +1,925 @@ +/************************************************************************* + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: txtimp.hxx,v $ + * + * $Revision: 1.2 $ + * + * last change: $Author: vg $ $Date: 2007-04-11 13:29:38 $ + * + * The Contents of this file are made available subject to + * the terms of GNU Lesser General Public License Version 2.1. + * + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2005 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + ************************************************************************/ +#ifndef _XMLOFF_TEXTIMP_HXX_ +#define _XMLOFF_TEXTIMP_HXX_ + +#ifndef _SAL_CONFIG_H_ +#include "sal/config.h" +#endif + +#ifndef INCLUDED_XMLOFF_DLLAPI_H +#include "xmloff/dllapi.h" +#endif + +#ifndef _SAL_TYPES_H_ +#include "sal/types.h" +#endif + +#ifndef _COM_SUN_STAR_UNO_REFERENCE_H_ +#include <com/sun/star/uno/Reference.h> +#endif + +#include <map> +#include <vector> + +#ifndef _LIST_HXX +#include <tools/list.hxx> +#endif + +#ifndef _XMLOFF_XMLICTXT_HXX +#include <xmloff/xmlictxt.hxx> +#endif +#ifndef _XMLOFF_XMLIMPPR_HXX +#include <xmloff/xmlimppr.hxx> +#endif +#ifndef _XMLOFF_XMLTKMAP_HXX +#include <xmloff/xmltkmap.hxx> +#endif + +// functional.hxx is obsolete and should be replaced by its comphelper +// counterpart +#ifndef _COMPHELPER_STLTYPES_HXX_ +#include <comphelper/stl_types.hxx> +#endif + +#ifndef _UNIVERSALL_REFERENCE_HXX +#include <xmloff/uniref.hxx> +#endif + +class SvXMLImport; +class SvXMLStylesContext; +class XMLTextListBlockContext; +class XMLTextListItemContext; +class SvxXMLListStyleContext; +class XMLPropStyleContext; +class SvI18NMap; +class SvStringsDtor; +class XMLSectionImportContext; +class XMLFontStylesContext; +template<class A> class XMLPropertyBackpatcher; +class XMLEventsImportContext; + +namespace com { namespace sun { namespace star { +namespace text { class XText; class XTextCursor; class XTextRange; class XTextContent; } +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; } +namespace ucb { class XAnyCompare; } +} } } + +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_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_INFORMATION_0, + XML_TOK_TEXT_DOCUMENT_INFORMATION_1, + XML_TOK_TEXT_DOCUMENT_INFORMATION_2, + XML_TOK_TEXT_DOCUMENT_INFORMATION_3, + 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, + + // misc + XML_TOK_TEXTP_CHANGE_START, // avoid ambigiouty with SwXMLTextElemTokens + XML_TOK_TEXTP_CHANGE_END, // avoid ambigiouty with SwXMLTextElemTokens + XML_TOK_TEXTP_CHANGE, // avoid ambigiouty with SwXMLTextElemTokens + XML_TOK_DRAW_A, + XML_TOK_TEXT_MEASURE, + + XML_TOK_DRAW_HEADER, + XML_TOK_DRAW_FOOTER, + XML_TOK_DRAW_DATE_TIME, + + XML_TOK_TEXT_P_ELEM_END=XML_TOK_UNKNOWN +}; + +enum XMLTextPAttrTokens +{ + 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_ID, + 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 XMLTextListBlockAttrTokens +{ + XML_TOK_TEXT_LIST_BLOCK_STYLE_NAME, + XML_TOK_TEXT_LIST_BLOCK_CONTINUE_NUMBERING, + 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 +{ + SvXMLTokenMap *pTextElemTokenMap; + SvXMLTokenMap *pTextPElemTokenMap; + SvXMLTokenMap *pTextPAttrTokenMap; + SvXMLTokenMap *pTextFieldAttrTokenMap; + SvXMLTokenMap *pTextListBlockAttrTokenMap; + SvXMLTokenMap *pTextListBlockElemTokenMap; + SvXMLTokenMap *pTextFrameAttrTokenMap; + SvXMLTokenMap *pTextContourAttrTokenMap; + SvXMLTokenMap *pTextHyperlinkAttrTokenMap; + SvXMLTokenMap *pTextMasterPageElemTokenMap; + SvStringsDtor *pPrevFrmNames; + SvStringsDtor *pNextFrmNames; + + SvXMLImportContextRef xAutoStyles; + SvXMLImportContextRef xFontDecls; + SvXMLImportContextRef xListBlock; + SvXMLImportContextRef xListItem; + + XMLSectionList_Impl aSectionList; + + UniReference < SvXMLImportPropertyMapper > xParaImpPrMap; + UniReference < SvXMLImportPropertyMapper > xTextImpPrMap; + UniReference < SvXMLImportPropertyMapper > xFrameImpPrMap; + UniReference < SvXMLImportPropertyMapper > xSectionImpPrMap; + UniReference < SvXMLImportPropertyMapper > xRubyImpPrMap; + + SvI18NMap *pRenameMap; + // --> OD 2006-10-12 #i69629# - change and extend data structure: + // - data structure contains candidates of paragraph styles, which + // will be assigned to the outline style + // - data structure contains more than one candidate for each list level + // of the outline style +// ::rtl::OUString *pOutlineStyles; + ::std::vector< ::rtl::OUString >* mpOutlineStylesCandidates; + // <-- + + /// start ranges for open bookmarks + ::std::map< ::rtl::OUString, + ::com::sun::star::uno::Reference< + ::com::sun::star::text::XTextRange>, + ::comphelper::UStringLess> aBookmarkStartRanges; + + /// backpatcher for references to footnotes and endnotes + XMLPropertyBackpatcher<sal_Int16> * pFootnoteBackpatcher; + + /// backpatchers for references to sequences + XMLPropertyBackpatcher<sal_Int16> * pSequenceIdBackpatcher; + + XMLPropertyBackpatcher< ::rtl::OUString> * pSequenceNameBackpatcher; + + /// name of the last 'open' redline that started between paragraphs + ::rtl::OUString sOpenRedlineIdentifier; + + ::com::sun::star::uno::Reference < + ::com::sun::star::text::XText > xText; + ::com::sun::star::uno::Reference < + ::com::sun::star::text::XTextCursor > xCursor; + ::com::sun::star::uno::Reference < + ::com::sun::star::text::XTextRange > xCursorAsRange; + ::com::sun::star::uno::Reference < + ::com::sun::star::container::XNameContainer > xParaStyles; + ::com::sun::star::uno::Reference < + ::com::sun::star::container::XNameContainer > xTextStyles; + ::com::sun::star::uno::Reference < + ::com::sun::star::container::XNameContainer > xNumStyles; + ::com::sun::star::uno::Reference < + ::com::sun::star::container::XNameContainer > xFrameStyles; + ::com::sun::star::uno::Reference < + ::com::sun::star::container::XNameContainer > xPageStyles; + ::com::sun::star::uno::Reference< + ::com::sun::star::container::XIndexReplace > xChapterNumbering; + ::com::sun::star::uno::Reference< + ::com::sun::star::container::XNameAccess > xTextFrames; + ::com::sun::star::uno::Reference< + ::com::sun::star::container::XNameAccess > xGraphics; + ::com::sun::star::uno::Reference< + ::com::sun::star::container::XNameAccess > xObjects; + ::com::sun::star::uno::Reference< + ::com::sun::star::lang::XMultiServiceFactory > xServiceFactory; + ::com::sun::star::uno::Reference< + ::com::sun::star::ucb::XAnyCompare > xNumRuleCompare; + + SvXMLImport& rSvXMLImport; + + sal_Bool bInsertMode : 1; + sal_Bool bStylesOnlyMode : 1; + sal_Bool bBlockMode : 1; + sal_Bool bProgress : 1; + sal_Bool bOrganizerMode : 1; + sal_Bool bBodyContentStarted : 1; + + // #107848# + // One more flag to remember if we are inside a deleted redline section + sal_Bool bInsideDeleteContext : 1; + + SAL_DLLPRIVATE SvXMLTokenMap *_GetTextElemTokenMap(); + SAL_DLLPRIVATE SvXMLTokenMap *_GetTextPElemTokenMap(); + SAL_DLLPRIVATE SvXMLTokenMap *_GetTextPAttrTokenMap(); + SAL_DLLPRIVATE SvXMLTokenMap *_GetTextFrameAttrTokenMap(); + SAL_DLLPRIVATE SvXMLTokenMap *_GetTextContourAttrTokenMap(); + SAL_DLLPRIVATE SvXMLTokenMap *_GetTextHyperlinkAttrTokenMap(); + SAL_DLLPRIVATE SvXMLTokenMap *_GetTextMasterPageElemTokenMap(); + + // clean up backpatchers; to be called only by destructor + // Code is implemented in XMLPropertyBackpatcher.cxx + SAL_DLLPRIVATE void _FinitBackpatcher(); + +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: + + const ::rtl::OUString sParaStyleName; + const ::rtl::OUString sCharStyleName; + const ::rtl::OUString sHeadingStyleName; + const ::rtl::OUString sNumberingLevel; + const ::rtl::OUString sNumberingStartValue; + const ::rtl::OUString sNumberingRules; + const ::rtl::OUString sParaIsNumberingRestart; + const ::rtl::OUString sNumberingIsNumber; + const ::rtl::OUString sCurrentPresentation; + const ::rtl::OUString sSequenceNumber; + const ::rtl::OUString sSourceName; + const ::rtl::OUString sChainNextName; + const ::rtl::OUString sChainPrevName; + const ::rtl::OUString sHyperLinkURL; + const ::rtl::OUString sHyperLinkName; + const ::rtl::OUString sHyperLinkTarget; + const ::rtl::OUString sUnvisitedCharStyleName; + const ::rtl::OUString sVisitedCharStyleName; + const ::rtl::OUString sTextFrame; + const ::rtl::OUString sPageDescName; + const ::rtl::OUString sServerMap; + const ::rtl::OUString sHyperLinkEvents; + const ::rtl::OUString sContent; + const ::rtl::OUString sServiceCombinedCharacters; + const ::rtl::OUString sNumberingStyleName; + + XMLTextImportHelper( + const ::com::sun::star::uno::Reference < + ::com::sun::star::frame::XModel>& rModel, + SvXMLImport& rImport, + sal_Bool bInsertM = sal_False, sal_Bool bStylesOnlyM = sal_False, + sal_Bool bProgress = sal_False, + sal_Bool bBlockMode = sal_False, + sal_Bool bOrganizerMode = sal_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 ); + + inline const SvXMLTokenMap& GetTextElemTokenMap(); + inline const SvXMLTokenMap& GetTextPElemTokenMap(); + inline const SvXMLTokenMap& GetTextPAttrTokenMap(); + inline const SvXMLTokenMap& GetTextFrameAttrTokenMap(); + inline const SvXMLTokenMap& GetTextContourAttrTokenMap(); + inline const SvXMLTokenMap& GetTextHyperlinkAttrTokenMap(); + inline const SvXMLTokenMap& GetTextMasterPageElemTokenMap(); + + const SvXMLTokenMap& GetTextListBlockAttrTokenMap(); + const SvXMLTokenMap& GetTextListBlockElemTokenMap(); + const SvXMLTokenMap& GetTextFieldAttrTokenMap(); // impl: txtfldi.cxx + + ::com::sun::star::uno::Reference < + ::com::sun::star::text::XText > & GetText() { return xText; } + ::com::sun::star::uno::Reference < + ::com::sun::star::text::XTextCursor > & GetCursor() { return xCursor; } + ::com::sun::star::uno::Reference < + ::com::sun::star::text::XTextRange > & GetCursorAsRange() + { + return xCursorAsRange; + } + + sal_Bool IsInsertMode() { return bInsertMode; } + sal_Bool IsStylesOnlyMode() { return bStylesOnlyMode; } + sal_Bool IsBlockMode() { return bBlockMode; } + sal_Bool IsOrganizerMode() { return bOrganizerMode; } + sal_Bool IsProgress() { return bProgress; } + + XMLTextListBlockContext *GetListBlock(); + SvXMLImportContext *_GetListBlock() { return &xListBlock; } + sal_Bool IsInList() const { return xListBlock.Is(); } + void SetListBlock( XMLTextListBlockContext *pListBlock ); + void _SetListBlock( SvXMLImportContext *pListBlock ); + + XMLTextListItemContext *GetListItem(); + SvXMLImportContext *_GetListItem() { return &xListItem; } + sal_Bool HasListItem() const { return xListItem.Is(); } + void SetListItem( XMLTextListItemContext *pListItem ); + void _SetListItem( SvXMLImportContext *pListItem ); + + XMLSectionList_Impl& GetSectionList() { return aSectionList; } + + ::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); + + ::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_Int8 nOutlineLevel = -1 ); + + /** 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 + { + return xParaStyles; + } + + const ::com::sun::star::uno::Reference < + ::com::sun::star::container::XNameContainer>& GetTextStyles() const + { + return xTextStyles; + } + + const ::com::sun::star::uno::Reference < + ::com::sun::star::container::XNameContainer>& GetNumberingStyles() const + { + return xNumStyles; + } + + const ::com::sun::star::uno::Reference < + ::com::sun::star::container::XNameContainer>& GetFrameStyles() const + { + return xFrameStyles; + } + + const ::com::sun::star::uno::Reference < + ::com::sun::star::container::XNameContainer>& GetPageStyles() const + { + return xPageStyles; + } + + const ::com::sun::star::uno::Reference< + ::com::sun::star::container::XIndexReplace >& GetChapterNumbering() const + { + return xChapterNumbering; + } + + 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 ); + + const UniReference < SvXMLImportPropertyMapper >& + GetParaImportPropertySetMapper() const { return xParaImpPrMap; } + const UniReference < SvXMLImportPropertyMapper >& + GetTextImportPropertySetMapper() const { return xTextImpPrMap; } + const UniReference < SvXMLImportPropertyMapper >& + GetFrameImportPropertySetMapper() const { return xFrameImpPrMap; } + const UniReference < SvXMLImportPropertyMapper >& + GetSectionImportPropertySetMapper() const { return xSectionImpPrMap; } + const UniReference < SvXMLImportPropertyMapper >& + GetRubyImportPropertySetMapper() const { return xRubyImpPrMap; } + 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); + + /// process the start of a range reference + sal_Bool FindAndRemoveBookmarkStartRange( + ::com::sun::star::uno::Reference< + ::com::sun::star::text::XTextRange> & rRange, + const ::rtl::OUString sName); + + /// 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(sal_Bool bNew) { bInsideDeleteContext = bNew; } + sal_Bool IsInsideDeleteContext() const { return bInsideDeleteContext; } + + SvXMLImport& GetXMLImport() { return rSvXMLImport;} +}; + +inline const SvXMLTokenMap& XMLTextImportHelper::GetTextElemTokenMap() +{ + if( !pTextElemTokenMap ) + pTextElemTokenMap = _GetTextElemTokenMap(); + + return *pTextElemTokenMap; +} + +inline const SvXMLTokenMap& XMLTextImportHelper::GetTextPElemTokenMap() +{ + if( !pTextPElemTokenMap ) + pTextPElemTokenMap = _GetTextPElemTokenMap(); + + return *pTextPElemTokenMap; +} + +inline const SvXMLTokenMap& XMLTextImportHelper::GetTextPAttrTokenMap() +{ + if( !pTextPAttrTokenMap ) + pTextPAttrTokenMap = _GetTextPAttrTokenMap(); + + return *pTextPAttrTokenMap; +} + +inline const SvXMLTokenMap& XMLTextImportHelper::GetTextFrameAttrTokenMap() +{ + if( !pTextFrameAttrTokenMap ) + pTextFrameAttrTokenMap = _GetTextFrameAttrTokenMap(); + + return *pTextFrameAttrTokenMap; +} + +inline const SvXMLTokenMap& XMLTextImportHelper::GetTextContourAttrTokenMap() +{ +#if SUPD > 627 + if( !pTextContourAttrTokenMap ) + pTextContourAttrTokenMap = _GetTextContourAttrTokenMap(); + + return *pTextContourAttrTokenMap; +#else + return *_GetTextContourAttrTokenMap(); +#endif +} + +inline const SvXMLTokenMap& XMLTextImportHelper::GetTextHyperlinkAttrTokenMap() +{ + if( !pTextHyperlinkAttrTokenMap ) + pTextHyperlinkAttrTokenMap = _GetTextHyperlinkAttrTokenMap(); + + return *pTextHyperlinkAttrTokenMap; +} + +inline const SvXMLTokenMap& XMLTextImportHelper::GetTextMasterPageElemTokenMap() +{ + if( !pTextMasterPageElemTokenMap ) + pTextMasterPageElemTokenMap = _GetTextMasterPageElemTokenMap(); + + return *pTextMasterPageElemTokenMap; +} + +#endif diff --git a/xmloff/inc/xmloff/txtprmap.hxx b/xmloff/inc/xmloff/txtprmap.hxx new file mode 100644 index 000000000000..e5fc187b5aca --- /dev/null +++ b/xmloff/inc/xmloff/txtprmap.hxx @@ -0,0 +1,210 @@ +/************************************************************************* + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: txtprmap.hxx,v $ + * + * $Revision: 1.2 $ + * + * last change: $Author: vg $ $Date: 2007-04-11 13:30:01 $ + * + * The Contents of this file are made available subject to + * the terms of GNU Lesser General Public License Version 2.1. + * + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2005 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + ************************************************************************/ +#ifndef _XMLOFF_TEXTPRMAP_HXX_ +#define _XMLOFF_TEXTPRMAP_HXX_ + +#ifndef _XMLOFF_CONTEXTID_HXX_ +#include <xmloff/contextid.hxx> +#endif +#ifndef _XMLOFF_PROPERTYSETMAPPER_HXX +#include <xmloff/xmlprmap.hxx> +#endif + +#define CTF_CHARHEIGHT (XML_TEXT_CTF_START + 1) +#define CTF_CHARHEIGHT_REL (XML_TEXT_CTF_START + 2) +#define CTF_PARALEFTMARGIN (XML_TEXT_CTF_START + 3) +#define CTF_PARALEFTMARGIN_REL (XML_TEXT_CTF_START + 4) +#define CTF_PARARIGHTMARGIN (XML_TEXT_CTF_START + 5) +#define CTF_PARARIGHTMARGIN_REL (XML_TEXT_CTF_START + 6) +#define CTF_PARAFIRSTLINE (XML_TEXT_CTF_START + 7) +#define CTF_PARAFIRSTLINE_REL (XML_TEXT_CTF_START + 8) +#define CTF_PARATOPMARGIN (XML_TEXT_CTF_START + 9) +#define CTF_PARATOPMARGIN_REL (XML_TEXT_CTF_START + 10) +#define CTF_PARABOTTOMMARGIN (XML_TEXT_CTF_START + 11) +#define CTF_PARABOTTOMMARGIN_REL (XML_TEXT_CTF_START + 12) +#define CTF_ALLBORDERWIDTH (XML_TEXT_CTF_START + 13) +#define CTF_LEFTBORDERWIDTH (XML_TEXT_CTF_START + 14) +#define CTF_RIGHTBORDERWIDTH (XML_TEXT_CTF_START + 15) +#define CTF_TOPBORDERWIDTH (XML_TEXT_CTF_START + 16) +#define CTF_BOTTOMBORDERWIDTH (XML_TEXT_CTF_START + 17) +#define CTF_ALLBORDERDISTANCE (XML_TEXT_CTF_START + 18) +#define CTF_LEFTBORDERDISTANCE (XML_TEXT_CTF_START + 19) +#define CTF_RIGHTBORDERDISTANCE (XML_TEXT_CTF_START + 20) +#define CTF_TOPBORDERDISTANCE (XML_TEXT_CTF_START + 21) +#define CTF_BOTTOMBORDERDISTANCE (XML_TEXT_CTF_START + 22) +#define CTF_ALLBORDER (XML_TEXT_CTF_START + 23) +#define CTF_LEFTBORDER (XML_TEXT_CTF_START + 24) +#define CTF_RIGHTBORDER (XML_TEXT_CTF_START + 25) +#define CTF_TOPBORDER (XML_TEXT_CTF_START + 26) +#define CTF_BOTTOMBORDER (XML_TEXT_CTF_START + 27) +#define CTF_DROPCAPWHOLEWORD (XML_TEXT_CTF_START + 28) +#define CTF_DROPCAPFORMAT (XML_TEXT_CTF_START + 29) +#define CTF_DROPCAPCHARSTYLE (XML_TEXT_CTF_START + 30) +#define CTF_TABSTOP (XML_TEXT_CTF_START + 31) +#define CTF_NUMBERINGSTYLENAME (XML_TEXT_CTF_START + 32) +#define CTF_OLDTEXTBACKGROUND (XML_TEXT_CTF_START + 33) +#define CTF_FONTFAMILYNAME (XML_TEXT_CTF_START + 34) +#define CTF_FONTSTYLENAME (XML_TEXT_CTF_START + 35) +#define CTF_FONTFAMILY (XML_TEXT_CTF_START + 36) +#define CTF_FONTPITCH (XML_TEXT_CTF_START + 37) +#define CTF_FONTCHARSET (XML_TEXT_CTF_START + 38) +// (XML_TEXT_CTF_START + 39) +#define CTF_SYNCHEIGHT_MIN (XML_TEXT_CTF_START + 40) +#define CTF_FRAMEHEIGHT_ABS (XML_TEXT_CTF_START + 41) +#define CTF_FRAMEHEIGHT_REL (XML_TEXT_CTF_START + 42) +#define CTF_FRAMEHEIGHT_MIN_ABS (XML_TEXT_CTF_START + 43) +#define CTF_FRAMEHEIGHT_MIN_REL (XML_TEXT_CTF_START + 44) +#define CTF_SIZETYPE (XML_TEXT_CTF_START + 45) +#define CTF_SYNCHEIGHT (XML_TEXT_CTF_START + 46) +#define CTF_WRAP (XML_TEXT_CTF_START + 47) +#define CTF_WRAP_CONTOUR (XML_TEXT_CTF_START + 48) +#define CTF_WRAP_CONTOUR_MODE (XML_TEXT_CTF_START + 49) +#define CTF_WRAP_PARAGRAPH_ONLY (XML_TEXT_CTF_START + 50) +#define CTF_ANCHORTYPE (XML_TEXT_CTF_START + 51) +#define CTF_ANCHORPAGENUMBER (XML_TEXT_CTF_START + 52) +#define CTF_TEXTCOLUMNS (XML_TEXT_CTF_START + 53) +#define CTF_HORIZONTALPOS (XML_TEXT_CTF_START + 54) +#define CTF_HORIZONTALPOS_MIRRORED (XML_TEXT_CTF_START + 55) +#define CTF_HORIZONTALREL (XML_TEXT_CTF_START + 56) +#define CTF_HORIZONTALREL_FRAME (XML_TEXT_CTF_START + 57) +#define CTF_HORIZONTALMIRROR (XML_TEXT_CTF_START + 58) +#define CTF_VERTICALPOS (XML_TEXT_CTF_START + 59) +#define CTF_VERTICALREL (XML_TEXT_CTF_START + 60) +#define CTF_VERTICALREL_PAGE (XML_TEXT_CTF_START + 61) +#define CTF_VERTICALREL_FRAME (XML_TEXT_CTF_START + 62) +#define CTF_VERTICALREL_ASCHAR (XML_TEXT_CTF_START + 63) +#define CTF_PAGEDESCNAME (XML_TEXT_CTF_START + 64) +#define CTF_BACKGROUND_URL (XML_TEXT_CTF_START + 66) +#define CTF_BACKGROUND_POS (XML_TEXT_CTF_START + 67) +#define CTF_BACKGROUND_FILTER (XML_TEXT_CTF_START + 68) +#define CTF_CHARHEIGHT_DIFF (XML_TEXT_CTF_START + 69) +#define CTF_FONTNAME (XML_TEXT_CTF_START + 70) +#define CTF_FONTNAME_CJK (XML_TEXT_CTF_START + 71) +#define CTF_FONTFAMILYNAME_CJK (XML_TEXT_CTF_START + 72) +#define CTF_FONTSTYLENAME_CJK (XML_TEXT_CTF_START + 73) +#define CTF_FONTFAMILY_CJK (XML_TEXT_CTF_START + 74) +#define CTF_FONTPITCH_CJK (XML_TEXT_CTF_START + 75) +#define CTF_FONTCHARSET_CJK (XML_TEXT_CTF_START + 76) +#define CTF_CHARHEIGHT_CJK (XML_TEXT_CTF_START + 77) +#define CTF_CHARHEIGHT_REL_CJK (XML_TEXT_CTF_START + 78) +#define CTF_CHARHEIGHT_DIFF_CJK (XML_TEXT_CTF_START + 79) +#define CTF_FONTNAME_CTL (XML_TEXT_CTF_START + 80) +#define CTF_FONTFAMILYNAME_CTL (XML_TEXT_CTF_START + 81) +#define CTF_FONTSTYLENAME_CTL (XML_TEXT_CTF_START + 82) +#define CTF_FONTFAMILY_CTL (XML_TEXT_CTF_START + 83) +#define CTF_FONTPITCH_CTL (XML_TEXT_CTF_START + 84) +#define CTF_FONTCHARSET_CTL (XML_TEXT_CTF_START + 85) +#define CTF_CHARHEIGHT_CTL (XML_TEXT_CTF_START + 86) +#define CTF_CHARHEIGHT_REL_CTL (XML_TEXT_CTF_START + 87) +#define CTF_CHARHEIGHT_DIFF_CTL (XML_TEXT_CTF_START + 88) +#define CTF_UNDERLINE (XML_TEXT_CTF_START + 89) +#define CTF_UNDERLINE_COLOR (XML_TEXT_CTF_START + 90) +#define CTF_UNDERLINE_HASCOLOR (XML_TEXT_CTF_START + 91) +#define CTF_SECTION_FOOTNOTE_END (XML_TEXT_CTF_START + 92) +#define CTF_SECTION_FOOTNOTE_NUM_RESTART (XML_TEXT_CTF_START + 93) +#define CTF_SECTION_FOOTNOTE_NUM_RESTART_AT (XML_TEXT_CTF_START + 94) +#define CTF_SECTION_FOOTNOTE_NUM_TYPE (XML_TEXT_CTF_START + 95) +#define CTF_SECTION_FOOTNOTE_NUM_PREFIX (XML_TEXT_CTF_START + 96) +#define CTF_SECTION_FOOTNOTE_NUM_SUFFIX (XML_TEXT_CTF_START + 97) +#define CTF_SECTION_FOOTNOTE_NUM_OWN (XML_TEXT_CTF_START + 98) +#define CTF_SECTION_ENDNOTE_END (XML_TEXT_CTF_START + 99) +#define CTF_SECTION_ENDNOTE_NUM_RESTART (XML_TEXT_CTF_START + 100) +#define CTF_SECTION_ENDNOTE_NUM_RESTART_AT (XML_TEXT_CTF_START + 101) +#define CTF_SECTION_ENDNOTE_NUM_TYPE (XML_TEXT_CTF_START + 102) +#define CTF_SECTION_ENDNOTE_NUM_PREFIX (XML_TEXT_CTF_START + 103) +#define CTF_SECTION_ENDNOTE_NUM_SUFFIX (XML_TEXT_CTF_START + 104) +#define CTF_SECTION_ENDNOTE_NUM_OWN (XML_TEXT_CTF_START + 105) +#define CTF_PAGE_FOOTNOTE (XML_TEXT_CTF_START + 106) +#define CTF_FRAME_DISPLAY_SCROLLBAR (XML_TEXT_CTF_START + 107) +#define CTF_FRAME_DISPLAY_BORDER (XML_TEXT_CTF_START + 108) +#define CTF_FRAME_MARGIN_HORI (XML_TEXT_CTF_START + 109) +#define CTF_FRAME_MARGIN_VERT (XML_TEXT_CTF_START + 110) +#define CTF_COMBINED_CHARACTERS_FIELD (XML_TEXT_CTF_START + 111) +#define CTF_OLE_VIS_AREA_TOP (XML_TEXT_CTF_START + 112) +#define CTF_OLE_VIS_AREA_LEFT (XML_TEXT_CTF_START + 113) +#define CTF_OLE_VIS_AREA_WIDTH (XML_TEXT_CTF_START + 114) +#define CTF_OLE_VIS_AREA_HEIGHT (XML_TEXT_CTF_START + 115) +#define CTF_OLE_DRAW_ASPECT (XML_TEXT_CTF_START + 116) +#define CTF_HYPERLINK_URL (XML_TEXT_CTF_START + 117) +#define CTF_CHAR_STYLE_NAME (XML_TEXT_CTF_START + 118) +#define CTF_VERTICALPOS_ATCHAR (XML_TEXT_CTF_START + 119) +#define CTF_BACKGROUND_TRANSPARENCY (XML_TEXT_CTF_START + 120) +#define CTF_BACKGROUND_TRANSPARENT (XML_TEXT_CTF_START + 121) +#define CTF_KEEP_TOGETHER (XML_TEXT_CTF_START + 122) +#define CTF_FRAMEWIDTH_ABS (XML_TEXT_CTF_START + 123) +#define CTF_FRAMEWIDTH_MIN_ABS (XML_TEXT_CTF_START + 124) +#define CTF_FRAMEWIDTH_MIN_REL (XML_TEXT_CTF_START + 125) +#define CTF_FRAMEWIDTH_REL (XML_TEXT_CTF_START + 126) +#define CTF_FRAMEWIDTH_TYPE (XML_TEXT_CTF_START + 127) +#define CTF_BORDER_MODEL (XML_TEXT_CTF_START + 128) +// --> OD 2004-08-09 #i28749# - define CTF ids for positioning properties of +// shapes, because on export to OpenOffice.org file format these have to +// be handled special, if shape isn't anchored as-character. +#define CTF_SHAPE_HORIZONTALPOS (XML_TEXT_CTF_START + 129) +#define CTF_SHAPE_HORIZONTALPOS_MIRRORED (XML_TEXT_CTF_START + 130) +#define CTF_SHAPE_HORIZONTALREL (XML_TEXT_CTF_START + 131) +#define CTF_SHAPE_HORIZONTALREL_FRAME (XML_TEXT_CTF_START + 132) +#define CTF_SHAPE_HORIZONTALMIRROR (XML_TEXT_CTF_START + 133) +#define CTF_SHAPE_VERTICALPOS (XML_TEXT_CTF_START + 134) +#define CTF_SHAPE_VERTICALPOS_ATCHAR (XML_TEXT_CTF_START + 135) +#define CTF_SHAPE_VERTICALREL (XML_TEXT_CTF_START + 136) +#define CTF_SHAPE_VERTICALREL_PAGE (XML_TEXT_CTF_START + 137) +#define CTF_SHAPE_VERTICALREL_FRAME (XML_TEXT_CTF_START + 138) +// <-- +#define CTF_PARA_ADJUSTLAST (XML_TEXT_CTF_START + 139) +#define CTF_DEFAULT_OUTLINE_LEVEL (XML_TEXT_CTF_START + 140) + +#define TEXT_PROP_MAP_TEXT 0 +#define TEXT_PROP_MAP_PARA 1 +#define TEXT_PROP_MAP_FRAME 2 +#define TEXT_PROP_MAP_AUTO_FRAME 3 +#define TEXT_PROP_MAP_SECTION 4 +#define TEXT_PROP_MAP_SHAPE 5 +#define TEXT_PROP_MAP_RUBY 6 +#define TEXT_PROP_MAP_SHAPE_PARA 7 +#define TEXT_PROP_MAP_TEXT_ADDITIONAL_DEFAULTS 8 +#define TEXT_PROP_MAP_TABLE_DEFAULTS 9 +#define TEXT_PROP_MAP_TABLE_ROW_DEFAULTS 10 + +class XMLTextPropertySetMapper : public XMLPropertySetMapper +{ +public: + XMLTextPropertySetMapper( sal_uInt16 nType ); + virtual ~XMLTextPropertySetMapper(); + + static const XMLPropertyMapEntry* getPropertyMapForType( sal_uInt16 _nType ); +}; + +#endif |