diff options
Diffstat (limited to 'xmloff/inc/xmloff')
78 files changed, 14765 insertions, 0 deletions
diff --git a/xmloff/inc/xmloff/DocumentSettingsContext.hxx b/xmloff/inc/xmloff/DocumentSettingsContext.hxx new file mode 100644 index 000000000000..249d5c39ba36 --- /dev/null +++ b/xmloff/inc/xmloff/DocumentSettingsContext.hxx @@ -0,0 +1,63 @@ +/************************************************************************* + * + * 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_DOCUMENTSETTINGSCONTEXT_HXX +#define _XMLOFF_DOCUMENTSETTINGSCONTEXT_HXX + +#include "sal/config.h" +#include "xmloff/dllapi.h" +#include <xmloff/xmlictxt.hxx> +#include <com/sun/star/uno/Sequence.h> +#include <com/sun/star/beans/PropertyValue.hpp> + +#include <memory> + +struct XMLDocumentSettingsContext_Data; + +class XMLOFF_DLLPUBLIC XMLDocumentSettingsContext : public SvXMLImportContext +{ + ::std::auto_ptr< XMLDocumentSettingsContext_Data > m_pData; + +public: + XMLDocumentSettingsContext(SvXMLImport& rImport, USHORT nPrfx, const rtl::OUString& rLName, + const ::com::sun::star::uno::Reference< + ::com::sun::star::xml::sax::XAttributeList>& xAttrList); + virtual ~XMLDocumentSettingsContext(); + + virtual SvXMLImportContext *CreateChildContext( USHORT nPrefix, + const rtl::OUString& rLocalName, + const ::com::sun::star::uno::Reference< + ::com::sun::star::xml::sax::XAttributeList>& xAttrList ); + virtual void EndElement(); + +private: + XMLDocumentSettingsContext(); // never implemented + XMLDocumentSettingsContext( const XMLDocumentSettingsContext& ); // never implemented + XMLDocumentSettingsContext& operator=( const XMLDocumentSettingsContext& ); // never implemented +}; + +#endif diff --git a/xmloff/inc/xmloff/EnumPropertyHdl.hxx b/xmloff/inc/xmloff/EnumPropertyHdl.hxx new file mode 100644 index 000000000000..9c3ba6ccd482 --- /dev/null +++ b/xmloff/inc/xmloff/EnumPropertyHdl.hxx @@ -0,0 +1,52 @@ +/************************************************************************* + * + * 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_ENUMPROPERTYHANDLER_HXX +#define _XMLOFF_ENUMPROPERTYHANDLER_HXX + +#include <xmloff/xmlprhdl.hxx> +#include <com/sun/star/uno/Type.h> +#include <xmloff/xmlement.hxx> + +/** + PropertyHandler for a generic xml enumeration type: +*/ +class XMLOFF_DLLPUBLIC XMLEnumPropertyHdl : public XMLPropertyHandler +{ +private: + const SvXMLEnumMapEntry* mpEnumMap; + const ::com::sun::star::uno::Type & mrType; + +public: + XMLEnumPropertyHdl( const SvXMLEnumMapEntry* pEnumMap, const ::com::sun::star::uno::Type & rType ) : mpEnumMap( pEnumMap ), mrType( rType ) {} + virtual ~XMLEnumPropertyHdl(); + + virtual sal_Bool importXML( const ::rtl::OUString& rStrImpValue, ::com::sun::star::uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const; + virtual sal_Bool exportXML( ::rtl::OUString& rStrExpValue, const ::com::sun::star::uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const; +}; + +#endif // _XMLOFF_ENUMPROPERTYHANDLER_HXX diff --git a/xmloff/inc/xmloff/NamedBoolPropertyHdl.hxx b/xmloff/inc/xmloff/NamedBoolPropertyHdl.hxx new file mode 100644 index 000000000000..2973a7eae12a --- /dev/null +++ b/xmloff/inc/xmloff/NamedBoolPropertyHdl.hxx @@ -0,0 +1,62 @@ +/************************************************************************* + * + * 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_NAMEDBOOLPROPERTYHANDLER_HXX +#define _XMLOFF_NAMEDBOOLPROPERTYHANDLER_HXX + +#include <xmloff/xmlprhdl.hxx> +#include <xmloff/xmltoken.hxx> +#include <com/sun/star/uno/Type.h> +#include <xmloff/xmlement.hxx> + +/** + PropertyHandler for a named xml bool type: +*/ +class XMLNamedBoolPropertyHdl : public XMLPropertyHandler +{ +private: + const ::rtl::OUString maTrueStr; + const ::rtl::OUString maFalseStr; + +public: + XMLNamedBoolPropertyHdl( const ::rtl::OUString& rTrueStr, const ::rtl::OUString& rFalseStr ) : maTrueStr( rTrueStr ), maFalseStr( rFalseStr ) {} + + XMLNamedBoolPropertyHdl( + ::xmloff::token::XMLTokenEnum eTrue, + ::xmloff::token::XMLTokenEnum eFalse + ) : + maTrueStr( ::xmloff::token::GetXMLToken( eTrue ) ), + maFalseStr( ::xmloff::token::GetXMLToken( eFalse ) ) + {} + + virtual ~XMLNamedBoolPropertyHdl(); + + virtual sal_Bool importXML( const ::rtl::OUString& rStrImpValue, ::com::sun::star::uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const; + virtual sal_Bool exportXML( ::rtl::OUString& rStrExpValue, const ::com::sun::star::uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const; +}; + +#endif // _XMLOFF_NAMEDBOOLPROPERTYHANDLER_HXX diff --git a/xmloff/inc/xmloff/PageMasterStyleMap.hxx b/xmloff/inc/xmloff/PageMasterStyleMap.hxx new file mode 100644 index 000000000000..6ca1ba29f2cb --- /dev/null +++ b/xmloff/inc/xmloff/PageMasterStyleMap.hxx @@ -0,0 +1,155 @@ +/************************************************************************* + * + * 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_PAGEMASTERSTYLEMAP_HXX_ +#define _XMLOFF_PAGEMASTERSTYLEMAP_HXX_ + +#include <xmloff/maptype.hxx> +#include <xmloff/xmltypes.hxx> +#include <xmloff/contextid.hxx> + +//______________________________________________________________________________ + +#define XML_PM_TYPE_PAGESTYLELAYOUT (XML_PM_TYPES_START + 0) +#define XML_PM_TYPE_NUMFORMAT (XML_PM_TYPES_START + 1) +#define XML_PM_TYPE_NUMLETTERSYNC (XML_PM_TYPES_START + 2) +#define XML_PM_TYPE_PAPERTRAYNUMBER (XML_PM_TYPES_START + 3) +#define XML_PM_TYPE_PRINTORIENTATION (XML_PM_TYPES_START + 4) +#define XML_PM_TYPE_PRINTANNOTATIONS (XML_PM_TYPES_START + 5) +#define XML_PM_TYPE_PRINTCHARTS (XML_PM_TYPES_START + 6) +#define XML_PM_TYPE_PRINTDRAWING (XML_PM_TYPES_START + 7) +#define XML_PM_TYPE_PRINTFORMULAS (XML_PM_TYPES_START + 8) +#define XML_PM_TYPE_PRINTGRID (XML_PM_TYPES_START + 9) +#define XML_PM_TYPE_PRINTHEADERS (XML_PM_TYPES_START + 10) +#define XML_PM_TYPE_PRINTOBJECTS (XML_PM_TYPES_START + 11) +#define XML_PM_TYPE_PRINTZEROVALUES (XML_PM_TYPES_START + 12) +#define XML_PM_TYPE_PRINTPAGEORDER (XML_PM_TYPES_START + 13) +#define XML_PM_TYPE_FIRSTPAGENUMBER (XML_PM_TYPES_START + 14) +#define XML_PM_TYPE_CENTER_HORIZONTAL (XML_PM_TYPES_START + 15) +#define XML_PM_TYPE_CENTER_VERTICAL (XML_PM_TYPES_START + 16) + +// control flags +#define CTF_PM_FLAGMASK (XML_PM_CTF_START + 0x0F00) +#define CTF_PM_HEADERFLAG (XML_PM_CTF_START + 0x0100) +#define CTF_PM_FOOTERFLAG (XML_PM_CTF_START + 0x0200) +#define CTF_PM_PRINTMASK (XML_PM_CTF_START + 0x1000) +// page master +#define CTF_PM_BORDERALL (XML_PM_CTF_START + 0x0001) +#define CTF_PM_BORDERTOP (XML_PM_CTF_START + 0x0002) +#define CTF_PM_BORDERBOTTOM (XML_PM_CTF_START + 0x0003) +#define CTF_PM_BORDERLEFT (XML_PM_CTF_START + 0x0004) +#define CTF_PM_BORDERRIGHT (XML_PM_CTF_START + 0x0005) +#define CTF_PM_BORDERWIDTHALL (XML_PM_CTF_START + 0x0006) +#define CTF_PM_BORDERWIDTHTOP (XML_PM_CTF_START + 0x0007) +#define CTF_PM_BORDERWIDTHBOTTOM (XML_PM_CTF_START + 0x0008) +#define CTF_PM_BORDERWIDTHLEFT (XML_PM_CTF_START + 0x0009) +#define CTF_PM_BORDERWIDTHRIGHT (XML_PM_CTF_START + 0x000A) +#define CTF_PM_PADDINGALL (XML_PM_CTF_START + 0x000B) +#define CTF_PM_PADDINGTOP (XML_PM_CTF_START + 0x000C) +#define CTF_PM_PADDINGBOTTOM (XML_PM_CTF_START + 0x000D) +#define CTF_PM_PADDINGLEFT (XML_PM_CTF_START + 0x000E) +#define CTF_PM_PADDINGRIGHT (XML_PM_CTF_START + 0x000F) +#define CTF_PM_TEXTCOLUMNS (XML_PM_CTF_START + 0x0010) +#define CTF_PM_REGISTER_STYLE (XML_PM_CTF_START + 0x0011) +#define CTF_PM_PRINT_ANNOTATIONS (CTF_PM_PRINTMASK|(XML_PM_CTF_START + 0x0012)) +#define CTF_PM_PRINT_CHARTS (CTF_PM_PRINTMASK|(XML_PM_CTF_START + 0x0013)) +#define CTF_PM_PRINT_DRAWING (CTF_PM_PRINTMASK|(XML_PM_CTF_START + 0x0014)) +#define CTF_PM_PRINT_FORMULAS (CTF_PM_PRINTMASK|(XML_PM_CTF_START + 0x0015)) +#define CTF_PM_PRINT_GRID (CTF_PM_PRINTMASK|(XML_PM_CTF_START + 0x0016)) +#define CTF_PM_PRINT_HEADERS (CTF_PM_PRINTMASK|(XML_PM_CTF_START + 0x0017)) +#define CTF_PM_PRINT_OBJECTS (CTF_PM_PRINTMASK|(XML_PM_CTF_START + 0x0018)) +#define CTF_PM_PRINT_ZEROVALUES (CTF_PM_PRINTMASK|(XML_PM_CTF_START + 0x0019)) + +#define CTF_PM_PAGEUSAGE (XML_PM_CTF_START + 0x0031) +#define CTF_PM_GRAPHICPOSITION (XML_PM_CTF_START + 0x0032) +#define CTF_PM_GRAPHICFILTER (XML_PM_CTF_START + 0x0033) +#define CTF_PM_GRAPHICURL (XML_PM_CTF_START + 0x0034) + +#define CTF_PM_SCALETO (XML_PM_CTF_START + 0x0051) // calc specific +#define CTF_PM_SCALETOPAGES (XML_PM_CTF_START + 0x0052) +#define CTF_PM_SCALETOX (XML_PM_CTF_START + 0x0053) +#define CTF_PM_SCALETOY (XML_PM_CTF_START + 0x0054) +#define CTF_PM_STANDARD_MODE (XML_PM_CTF_START + 0x0055) +#define CTP_PM_GRID_BASE_WIDTH (XML_PM_CTF_START + 0x0056) +#define CTP_PM_GRID_SNAP_TO_CHARS (XML_PM_CTF_START + 0x0057) +// header +#define CTF_PM_HEADERBORDERALL (CTF_PM_HEADERFLAG|CTF_PM_BORDERALL) +#define CTF_PM_HEADERBORDERTOP (CTF_PM_HEADERFLAG|CTF_PM_BORDERTOP) +#define CTF_PM_HEADERBORDERBOTTOM (CTF_PM_HEADERFLAG|CTF_PM_BORDERBOTTOM) +#define CTF_PM_HEADERBORDERLEFT (CTF_PM_HEADERFLAG|CTF_PM_BORDERLEFT) +#define CTF_PM_HEADERBORDERRIGHT (CTF_PM_HEADERFLAG|CTF_PM_BORDERRIGHT) +#define CTF_PM_HEADERBORDERWIDTHALL (CTF_PM_HEADERFLAG|CTF_PM_BORDERWIDTHALL) +#define CTF_PM_HEADERBORDERWIDTHTOP (CTF_PM_HEADERFLAG|CTF_PM_BORDERWIDTHTOP) +#define CTF_PM_HEADERBORDERWIDTHBOTTOM (CTF_PM_HEADERFLAG|CTF_PM_BORDERWIDTHBOTTOM) +#define CTF_PM_HEADERBORDERWIDTHLEFT (CTF_PM_HEADERFLAG|CTF_PM_BORDERWIDTHLEFT) +#define CTF_PM_HEADERBORDERWIDTHRIGHT (CTF_PM_HEADERFLAG|CTF_PM_BORDERWIDTHRIGHT) +#define CTF_PM_HEADERPADDINGALL (CTF_PM_HEADERFLAG|CTF_PM_PADDINGALL) +#define CTF_PM_HEADERPADDINGTOP (CTF_PM_HEADERFLAG|CTF_PM_PADDINGTOP) +#define CTF_PM_HEADERPADDINGBOTTOM (CTF_PM_HEADERFLAG|CTF_PM_PADDINGBOTTOM) +#define CTF_PM_HEADERPADDINGLEFT (CTF_PM_HEADERFLAG|CTF_PM_PADDINGLEFT) +#define CTF_PM_HEADERPADDINGRIGHT (CTF_PM_HEADERFLAG|CTF_PM_PADDINGRIGHT) +#define CTF_PM_HEADERHEIGHT (CTF_PM_HEADERFLAG|(XML_PM_CTF_START + 0x0031)) +#define CTF_PM_HEADERMINHEIGHT (CTF_PM_HEADERFLAG|(XML_PM_CTF_START + 0x0032)) +#define CTF_PM_HEADERDYNAMIC (CTF_PM_HEADERFLAG|(XML_PM_CTF_START + 0x0033)) +#define CTF_PM_HEADERGRAPHICPOSITION (CTF_PM_HEADERFLAG|(XML_PM_CTF_START + 0x0034)) +#define CTF_PM_HEADERGRAPHICFILTER (CTF_PM_HEADERFLAG|(XML_PM_CTF_START + 0x0035)) +#define CTF_PM_HEADERGRAPHICURL (CTF_PM_HEADERFLAG|(XML_PM_CTF_START + 0x0036)) +// footer +#define CTF_PM_FOOTERBORDERALL (CTF_PM_FOOTERFLAG|CTF_PM_BORDERALL) +#define CTF_PM_FOOTERBORDERTOP (CTF_PM_FOOTERFLAG|CTF_PM_BORDERTOP) +#define CTF_PM_FOOTERBORDERBOTTOM (CTF_PM_FOOTERFLAG|CTF_PM_BORDERBOTTOM) +#define CTF_PM_FOOTERBORDERLEFT (CTF_PM_FOOTERFLAG|CTF_PM_BORDERLEFT) +#define CTF_PM_FOOTERBORDERRIGHT (CTF_PM_FOOTERFLAG|CTF_PM_BORDERRIGHT) +#define CTF_PM_FOOTERBORDERWIDTHALL (CTF_PM_FOOTERFLAG|CTF_PM_BORDERWIDTHALL) +#define CTF_PM_FOOTERBORDERWIDTHTOP (CTF_PM_FOOTERFLAG|CTF_PM_BORDERWIDTHTOP) +#define CTF_PM_FOOTERBORDERWIDTHBOTTOM (CTF_PM_FOOTERFLAG|CTF_PM_BORDERWIDTHBOTTOM) +#define CTF_PM_FOOTERBORDERWIDTHLEFT (CTF_PM_FOOTERFLAG|CTF_PM_BORDERWIDTHLEFT) +#define CTF_PM_FOOTERBORDERWIDTHRIGHT (CTF_PM_FOOTERFLAG|CTF_PM_BORDERWIDTHRIGHT) +#define CTF_PM_FOOTERPADDINGALL (CTF_PM_FOOTERFLAG|CTF_PM_PADDINGALL) +#define CTF_PM_FOOTERPADDINGTOP (CTF_PM_FOOTERFLAG|CTF_PM_PADDINGTOP) +#define CTF_PM_FOOTERPADDINGBOTTOM (CTF_PM_FOOTERFLAG|CTF_PM_PADDINGBOTTOM) +#define CTF_PM_FOOTERPADDINGLEFT (CTF_PM_FOOTERFLAG|CTF_PM_PADDINGLEFT) +#define CTF_PM_FOOTERPADDINGRIGHT (CTF_PM_FOOTERFLAG|CTF_PM_PADDINGRIGHT) +#define CTF_PM_FOOTERHEIGHT (CTF_PM_FOOTERFLAG|(XML_PM_CTF_START + 0x0031)) +#define CTF_PM_FOOTERMINHEIGHT (CTF_PM_FOOTERFLAG|(XML_PM_CTF_START + 0x0032)) +#define CTF_PM_FOOTERDYNAMIC (CTF_PM_FOOTERFLAG|(XML_PM_CTF_START + 0x0033)) +#define CTF_PM_FOOTERGRAPHICPOSITION (CTF_PM_FOOTERFLAG|(XML_PM_CTF_START + 0x0034)) +#define CTF_PM_FOOTERGRAPHICFILTER (CTF_PM_FOOTERFLAG|(XML_PM_CTF_START + 0x0035)) +#define CTF_PM_FOOTERGRAPHICURL (CTF_PM_FOOTERFLAG|(XML_PM_CTF_START + 0x0036)) +#define CTF_PM_FTN_HEIGTH (XML_PM_CTF_START + 0x0060) +#define CTF_PM_FTN_LINE_WEIGTH (XML_PM_CTF_START + 0x0061) +#define CTF_PM_FTN_LINE_COLOR (XML_PM_CTF_START + 0x0062) +#define CTF_PM_FTN_LINE_WIDTH (XML_PM_CTF_START + 0x0063) +#define CTF_PM_FTN_LINE_ADJUST (XML_PM_CTF_START + 0x0064) +#define CTF_PM_FTN_LINE_DISTANCE (XML_PM_CTF_START + 0x0065) +#define CTF_PM_FTN_DISTANCE (XML_PM_CTF_START + 0x0066) + +extern const XMLPropertyMapEntry aXMLPageMasterStyleMap[]; +extern const XMLPropertyMapEntry aXMLPageMasterHeaderImportStyleMap[]; +extern const XMLPropertyMapEntry aXMLPageMasterFooterImportStyleMap[]; + +#endif diff --git a/xmloff/inc/xmloff/ProgressBarHelper.hxx b/xmloff/inc/xmloff/ProgressBarHelper.hxx new file mode 100644 index 000000000000..b89134f595a5 --- /dev/null +++ b/xmloff/inc/xmloff/ProgressBarHelper.hxx @@ -0,0 +1,78 @@ +/************************************************************************* + * + * 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_PROGRESSBARHELPER_HXX +#define _XMLOFF_PROGRESSBARHELPER_HXX + +#include "sal/config.h" +#include "xmloff/dllapi.h" +#include <com/sun/star/task/XStatusIndicator.hpp> +#include <com/sun/star/frame/XModel.hpp> + +#define XML_PROGRESSRANGE "ProgressRange" +#define XML_PROGRESSMAX "ProgressMax" +#define XML_PROGRESSCURRENT "ProgressCurrent" +#define XML_PROGRESSREPEAT "ProgressRepeat" + +class XMLOFF_DLLPUBLIC ProgressBarHelper +{ + ::com::sun::star::uno::Reference < ::com::sun::star::task::XStatusIndicator > xStatusIndicator; + sal_Int32 nRange; + sal_Int32 nReference; + sal_Int32 nValue; + double fOldPercent; + sal_Bool bStrict; + // #96469#; if the value goes over the Range the progressbar starts again + sal_Bool bRepeat; + +#ifdef DBG_UTIL + sal_Bool bFailure; +#endif +public: + ProgressBarHelper(const ::com::sun::star::uno::Reference < ::com::sun::star::task::XStatusIndicator>& xStatusIndicator, + const sal_Bool bStrict); + ~ProgressBarHelper(); + + void SetText(::rtl::OUString& rText) { if (xStatusIndicator.is()) xStatusIndicator->setText(rText); } + void SetRange(sal_Int32 nVal) { nRange = nVal; } + void SetReference(sal_Int32 nVal) { nReference = nVal; } + void SetValue(sal_Int32 nValue); + void SetRepeat(sal_Bool bValue) { bRepeat = bValue; } + inline void Increment(sal_Int32 nInc = 1) { SetValue( nValue+nInc ); } + void End() { if (xStatusIndicator.is()) xStatusIndicator->end(); } + + // set the new reference and returns the new value which gives the + // Progress Bar the sam position as before + sal_Int32 ChangeReference(sal_Int32 nNewReference); + + sal_Int32 GetReference() { return nReference; } + sal_Int32 GetValue() { return nValue; } + sal_Bool GetRepeat() { return bRepeat; } +}; + +#endif + diff --git a/xmloff/inc/xmloff/PropertySetInfoHash.hxx b/xmloff/inc/xmloff/PropertySetInfoHash.hxx new file mode 100644 index 000000000000..a789b99912f2 --- /dev/null +++ b/xmloff/inc/xmloff/PropertySetInfoHash.hxx @@ -0,0 +1,65 @@ +/************************************************************************* + * + * 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_PROPERTYSETINFOHASH_HXX +#define _XMLOFF_PROPERTYSETINFOHASH_HXX + +#include <xmloff/PropertySetInfoKey.hxx> + +#include <string.h> +#include <memory> + +struct PropertySetInfoHash +{ + inline size_t operator()( const PropertySetInfoKey& r ) const; + inline bool operator()( const PropertySetInfoKey& r1, + const PropertySetInfoKey& r2 ) const; +}; + +inline size_t PropertySetInfoHash::operator()( + const PropertySetInfoKey& r ) const +{ + const sal_Int32* pBytesAsInt32Array = + (const sal_Int32*)r.aImplementationId.getConstArray(); + sal_Int32 nId32 = pBytesAsInt32Array[0] ^ + pBytesAsInt32Array[1] ^ + pBytesAsInt32Array[2] ^ + pBytesAsInt32Array[3]; + return (size_t)nId32 ^ (size_t)r.xPropInfo.get(); +} + +inline bool PropertySetInfoHash::operator()( + const PropertySetInfoKey& r1, + const PropertySetInfoKey& r2 ) const +{ + if( r1.xPropInfo != r2.xPropInfo ) + return sal_False; + + const sal_Int8* pId1 = r1.aImplementationId.getConstArray(); + const sal_Int8* pId2 = r2.aImplementationId.getConstArray(); + return memcmp( pId1, pId2, 16 * sizeof( sal_Int8 ) ) == 0; +} +#endif diff --git a/xmloff/inc/xmloff/PropertySetInfoKey.hxx b/xmloff/inc/xmloff/PropertySetInfoKey.hxx new file mode 100644 index 000000000000..725f5dff060d --- /dev/null +++ b/xmloff/inc/xmloff/PropertySetInfoKey.hxx @@ -0,0 +1,67 @@ +/************************************************************************* + * + * 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_PROPERTYSETINFOKEY_HXX +#define _XMLOFF_PROPERTYSETINFOKEY_HXX + +#include <osl/diagnose.h> +#include <com/sun/star/uno/Sequence.hxx> + +namespace com { namespace sun { namespace star { + namespace beans { class XPropertySetInfo; } +} } } + + +struct PropertySetInfoKey +{ + ::com::sun::star::uno::Reference < + ::com::sun::star::beans::XPropertySetInfo > xPropInfo; + ::com::sun::star::uno::Sequence < sal_Int8 > aImplementationId; + + inline PropertySetInfoKey(); + inline PropertySetInfoKey( + const ::com::sun::star::uno::Reference < + ::com::sun::star::beans::XPropertySetInfo >& rPropInfo, + const ::com::sun::star::uno::Sequence < sal_Int8 >& rImplId ); +}; + +inline PropertySetInfoKey::PropertySetInfoKey() +{ + OSL_ENSURE( aImplementationId.getLength()==16, "illegal constructor call" ); +} + +inline PropertySetInfoKey::PropertySetInfoKey( + const ::com::sun::star::uno::Reference < + ::com::sun::star::beans::XPropertySetInfo >& rPropInfo, + const ::com::sun::star::uno::Sequence < sal_Int8 >& rImplId ) : + xPropInfo( rPropInfo ), + aImplementationId( rImplId ) +{ + OSL_ENSURE( rPropInfo.is(), "prop info missing" ); + OSL_ENSURE( aImplementationId.getLength()==16, "invalid implementation id" ); +} + +#endif diff --git a/xmloff/inc/xmloff/SchXMLExportHelper.hxx b/xmloff/inc/xmloff/SchXMLExportHelper.hxx new file mode 100644 index 000000000000..bf60d44d63fd --- /dev/null +++ b/xmloff/inc/xmloff/SchXMLExportHelper.hxx @@ -0,0 +1,73 @@ +/************************************************************************* + * + * 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_SCH_XMLEXPORTHELPER_HXX_ +#define _XMLOFF_SCH_XMLEXPORTHELPER_HXX_ + +#include "sal/config.h" +#include "xmloff/dllapi.h" +#include "sal/types.h" +#include <xmloff/uniref.hxx> +#include <rtl/ustrbuf.hxx> +#include <com/sun/star/util/XStringMapping.hpp> +#include <com/sun/star/awt/Size.hpp> +#include <com/sun/star/awt/Point.hpp> +#include <xmloff/xmlprmap.hxx> + +#include <queue> +#include <vector> + +class SvXMLAutoStylePoolP; +class SvXMLExport; +class SchXMLExportHelper_Impl; + +/** With this class you can export a <chart:chart> element containing + its data as <table:table> element or without internal table. In + the latter case you have to provide a table address mapper if the + cell addressing set at the document is not in XML format. + */ +class XMLOFF_DLLPUBLIC SchXMLExportHelper : public UniRefBase +{ +public: + SchXMLExportHelper( SvXMLExport& rExport, + SvXMLAutoStylePoolP& rASPool ); + + virtual ~SchXMLExportHelper(); + + /// returns the string corresponding to the current FileFormat CLSID for Chart + const rtl::OUString& getChartCLSID(); + +private: + SchXMLExportHelper(); // not defined + SchXMLExportHelper(SchXMLExportHelper &); // not defined + void operator =(SchXMLExportHelper &); // not defined + +private: + SchXMLExportHelper_Impl* m_pImpl; + friend class SchXMLExport; +}; + +#endif // _XMLOFF_SCH_XMLEXPORTHELPER_HXX_ diff --git a/xmloff/inc/xmloff/SchXMLImportHelper.hxx b/xmloff/inc/xmloff/SchXMLImportHelper.hxx new file mode 100644 index 000000000000..03fa8c8e16c0 --- /dev/null +++ b/xmloff/inc/xmloff/SchXMLImportHelper.hxx @@ -0,0 +1,169 @@ +/************************************************************************* + * + * 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_SCH_XMLIMPORTHELPER_HXX_ +#define _XMLOFF_SCH_XMLIMPORTHELPER_HXX_ + +#include <xmloff/uniref.hxx> +#include <xmloff/families.hxx> +#include <com/sun/star/util/XStringMapping.hpp> +#include <com/sun/star/chart/XChartDocument.hpp> + +namespace com { namespace sun { namespace star { + namespace frame { + class XModel; + } + namespace task { + class XStatusIndicator; + } + namespace xml { + namespace sax { + class XAttributeList; + } + } + namespace chart2 { + namespace data { + class XDataProvider; + class XLabeledDataSequence; + } + class XChartDocument; + class XDataSeries; + } +}}} + +class SvXMLUnitConverter; +class SvXMLStylesContext; +class XMLChartImportPropertyMapper; +class SvXMLTokenMap; +class SvXMLImportContext; +class SvXMLImport; + +// ======================================== + +/** With this class you can import a <chart:chart> element containing + its data as <table:table> element or without internal table. In + the latter case you have to provide a table address mapper that + converts table addresses in XML format to the appropriate application + format. + */ +class SchXMLImportHelper : public UniRefBase +{ +private: + com::sun::star::uno::Reference< com::sun::star::chart::XChartDocument > mxChartDoc; + SvXMLStylesContext* mpAutoStyles; + + SvXMLTokenMap* mpChartDocElemTokenMap; + SvXMLTokenMap* mpTableElemTokenMap; + SvXMLTokenMap* mpChartElemTokenMap; + SvXMLTokenMap* mpPlotAreaElemTokenMap; + SvXMLTokenMap* mpSeriesElemTokenMap; + SvXMLTokenMap* mpAxisElemTokenMap; + + SvXMLTokenMap* mpChartAttrTokenMap; + SvXMLTokenMap* mpPlotAreaAttrTokenMap; + SvXMLTokenMap* mpAxisAttrTokenMap; + SvXMLTokenMap* mpLegendAttrTokenMap; + SvXMLTokenMap* mpAutoStyleAttrTokenMap; + SvXMLTokenMap* mpCellAttrTokenMap; + SvXMLTokenMap* mpSeriesAttrTokenMap; + SvXMLTokenMap* mpRegEquationAttrTokenMap; + +public: + + SchXMLImportHelper(); + ~SchXMLImportHelper(); + + /** get the context for reading the <chart:chart> element with subelements. + The result is stored in the XModel given if it also implements + XChartDocument + */ + SvXMLImportContext* CreateChartContext( + SvXMLImport& rImport, + sal_uInt16 nPrefix, const rtl::OUString& rLocalName, + const com::sun::star::uno::Reference< + com::sun::star::frame::XModel > xChartModel, + const com::sun::star::uno::Reference< + com::sun::star::xml::sax::XAttributeList >& xAttrList ); + + /** set the auto-style context that will be used to retrieve auto-styles + used inside the following <chart:chart> element to parse + */ + void SetAutoStylesContext( SvXMLStylesContext* pAutoStyles ) { mpAutoStyles = pAutoStyles; } + SvXMLStylesContext* GetAutoStylesContext() const { return mpAutoStyles; } + + const com::sun::star::uno::Reference< + com::sun::star::chart::XChartDocument >& GetChartDocument() + { return mxChartDoc; } + + const SvXMLTokenMap& GetDocElemTokenMap(); + const SvXMLTokenMap& GetTableElemTokenMap(); + const SvXMLTokenMap& GetChartElemTokenMap(); + const SvXMLTokenMap& GetPlotAreaElemTokenMap(); + const SvXMLTokenMap& GetSeriesElemTokenMap(); + const SvXMLTokenMap& GetAxisElemTokenMap(); + + const SvXMLTokenMap& GetChartAttrTokenMap(); + const SvXMLTokenMap& GetPlotAreaAttrTokenMap(); + const SvXMLTokenMap& GetAxisAttrTokenMap(); + const SvXMLTokenMap& GetLegendAttrTokenMap(); + const SvXMLTokenMap& GetAutoStyleAttrTokenMap(); + const SvXMLTokenMap& GetCellAttrTokenMap(); + const SvXMLTokenMap& GetSeriesAttrTokenMap(); + const SvXMLTokenMap& GetRegEquationAttrTokenMap(); + + static sal_uInt16 GetChartFamilyID() { return XML_STYLE_FAMILY_SCH_CHART_ID; } + + /** @param bPushLastChartType If </FALSE>, in case a new chart type has to + be added (because it does not exist yet), it is appended at the + end of the chart-type container. When </TRUE>, a new chart type + is added at one position before the last one, i.e. the formerly + last chart type is pushed back, so that it remains the last one. + + This is needed when the global chart type is set to type A, but + the first series has type B. Then B should appear before A (done + by passing true). Once a series of type A has been read, + following new chart types are again be added at the end (by + passing false). + */ + static ::com::sun::star::uno::Reference< + ::com::sun::star::chart2::XDataSeries > GetNewDataSeries( + const ::com::sun::star::uno::Reference< + ::com::sun::star::chart2::XChartDocument > & xDoc, + sal_Int32 nCoordinateSystemIndex, + const ::rtl::OUString & rChartTypeName, + bool bPushLastChartType = false ); + + static void DeleteDataSeries( + const ::com::sun::star::uno::Reference< + ::com::sun::star::chart2::XDataSeries >& xSeries, + const ::com::sun::star::uno::Reference< + ::com::sun::star::chart2::XChartDocument > & xDoc ); + + static ::com::sun::star::uno::Reference< + ::com::sun::star::chart2::data::XLabeledDataSequence > GetNewLabeledDataSequence(); +}; + +#endif // _XMLOFF_SCH_XMLIMPORTHELPER_HXX_ diff --git a/xmloff/inc/xmloff/SettingsExportHelper.hxx b/xmloff/inc/xmloff/SettingsExportHelper.hxx new file mode 100644 index 000000000000..63c7d9f5df54 --- /dev/null +++ b/xmloff/inc/xmloff/SettingsExportHelper.hxx @@ -0,0 +1,111 @@ +/************************************************************************* + * + * 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_SETTINGSEXPORTHELPER_HXX +#define _XMLOFF_SETTINGSEXPORTHELPER_HXX + +#include "xmloff/dllapi.h" + +#include <com/sun/star/awt/Rectangle.hpp> +#include <com/sun/star/formula/SymbolDescriptor.hpp> +#include <com/sun/star/util/XStringSubstitution.hpp> +#include <xmloff/xmlexp.hxx> + +namespace com +{ + namespace sun { namespace star { + namespace container { class XNameAccess; class XIndexAccess; } + namespace util { struct DateTime; } + } } +} + +namespace xmloff +{ + class XMLSettingsExportContext; +} + +class XMLOFF_DLLPUBLIC XMLSettingsExportHelper +{ + ::xmloff::XMLSettingsExportContext& m_rContext; + + ::com::sun::star::uno::Reference< ::com::sun::star::util::XStringSubstitution > mxStringSubsitution; + + const rtl::OUString msPrinterIndependentLayout; + const rtl::OUString msColorTableURL; + const rtl::OUString msLineEndTableURL; + const rtl::OUString msHatchTableURL; + const rtl::OUString msDashTableURL; + const rtl::OUString msGradientTableURL; + const rtl::OUString msBitmapTableURL; + + void ManipulateSetting( com::sun::star::uno::Any& rAny, const rtl::OUString& rName ) const; + + void CallTypeFunction(const com::sun::star::uno::Any& rAny, + const rtl::OUString& rName) const; + + void exportBool(const sal_Bool bValue, const rtl::OUString& rName) const; + void exportByte(const sal_Int8 nValue, const rtl::OUString& rName) const; + void exportShort(const sal_Int16 nValue, const rtl::OUString& rName) const; + void exportInt(const sal_Int32 nValue, const rtl::OUString& rName) const; + void exportLong(const sal_Int64 nValue, const rtl::OUString& rName) const; + void exportDouble(const double fValue, const rtl::OUString& rName) const; + void exportString(const rtl::OUString& sValue, const rtl::OUString& rName) const; + void exportDateTime(const com::sun::star::util::DateTime& aValue, const rtl::OUString& rName) const; + void exportSequencePropertyValue( + const com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue>& aProps, + const rtl::OUString& rName) const; + void exportbase64Binary( + const com::sun::star::uno::Sequence<sal_Int8>& aProps, + const rtl::OUString& rName) const; + void exportMapEntry(const com::sun::star::uno::Any& rAny, + const rtl::OUString& rName, + const sal_Bool bNameAccess) const; + void exportNameAccess( + const com::sun::star::uno::Reference<com::sun::star::container::XNameAccess>& aNamed, + const rtl::OUString& rName) const; + void exportIndexAccess( + const com::sun::star::uno::Reference<com::sun::star::container::XIndexAccess> aIndexed, + const rtl::OUString rName) const; + + void exportSymbolDescriptors( + const com::sun::star::uno::Sequence < com::sun::star::formula::SymbolDescriptor > &rProps, + const rtl::OUString rName) const; + void exportForbiddenCharacters( + const com::sun::star::uno::Any &rAny, + const rtl::OUString rName) const; + +public: + XMLSettingsExportHelper( ::xmloff::XMLSettingsExportContext& i_rContext ); + ~XMLSettingsExportHelper(); + + void exportAllSettings( + const com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue>& aProps, + const rtl::OUString& rName) const; +}; + +#endif + diff --git a/xmloff/inc/xmloff/SinglePropertySetInfoCache.hxx b/xmloff/inc/xmloff/SinglePropertySetInfoCache.hxx new file mode 100644 index 000000000000..e419817d5480 --- /dev/null +++ b/xmloff/inc/xmloff/SinglePropertySetInfoCache.hxx @@ -0,0 +1,79 @@ +/************************************************************************* + * + * 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_SINGEPROPERTYSETINFOCACHE_HXX +#define _XMLOFF_SINGEPROPERTYSETINFOCACHE_HXX + +#include <com/sun/star/beans/XPropertySet.hpp> + +#include <hash_map> +#include <xmloff/PropertySetInfoHash.hxx> + +typedef std::hash_map +< + PropertySetInfoKey, + sal_Bool, + PropertySetInfoHash, + PropertySetInfoHash +> +SinglePropertySetInfoMap_Impl; + +class SinglePropertySetInfoCache : private SinglePropertySetInfoMap_Impl +{ + ::rtl::OUString sName; + +public: + + inline SinglePropertySetInfoCache( const ::rtl::OUString& rName ); + ~SinglePropertySetInfoCache() {}; + + sal_Bool hasProperty( + const ::com::sun::star::uno::Reference< + ::com::sun::star::beans::XPropertySet >& rPropSet, + ::com::sun::star::uno::Reference< + ::com::sun::star::beans::XPropertySetInfo >& rPropSetInfo ); + inline sal_Bool hasProperty( + const ::com::sun::star::uno::Reference< + ::com::sun::star::beans::XPropertySet>& rPropSet ); +}; + +inline SinglePropertySetInfoCache::SinglePropertySetInfoCache( + const ::rtl::OUString& rName ) : + sName( rName ) +{ +} + +inline sal_Bool SinglePropertySetInfoCache::hasProperty( + const ::com::sun::star::uno::Reference< + ::com::sun::star::beans::XPropertySet>& rPropSet ) +{ + ::com::sun::star::uno::Reference< + ::com::sun::star::beans::XPropertySetInfo > xInfo; + return hasProperty( rPropSet, xInfo ); +} + +#endif diff --git a/xmloff/inc/xmloff/WordWrapPropertyHdl.hxx b/xmloff/inc/xmloff/WordWrapPropertyHdl.hxx new file mode 100644 index 000000000000..0a0095d79f17 --- /dev/null +++ b/xmloff/inc/xmloff/WordWrapPropertyHdl.hxx @@ -0,0 +1,53 @@ +/************************************************************************* + * + * 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_WORDWRAPPROPERTYHANDLER_HXX +#define _XMLOFF_WORDWRAPPROPERTYHANDLER_HXX + +#include <xmloff/xmlprhdl.hxx> +#include <xmloff/xmltoken.hxx> +#include <com/sun/star/uno/Type.h> +#include <xmloff/xmlement.hxx> + +/** + PropertyHandler for a named xml bool type: +*/ +class SvXMLImport; +class XMLWordWrapPropertyHdl : public XMLPropertyHandler +{ +private: + SvXMLImport* mpImport; + +public: + XMLWordWrapPropertyHdl( SvXMLImport* pImport ); + virtual ~XMLWordWrapPropertyHdl(); + + virtual sal_Bool importXML( const ::rtl::OUString& rStrImpValue, ::com::sun::star::uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const; + virtual sal_Bool exportXML( ::rtl::OUString& rStrExpValue, const ::com::sun::star::uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const; +}; + +#endif // _XMLOFF_NAMEDBOOLPROPERTYHANDLER_HXX diff --git a/xmloff/inc/xmloff/XMLBase64ImportContext.hxx b/xmloff/inc/xmloff/XMLBase64ImportContext.hxx new file mode 100644 index 000000000000..b2e5a4d1913b --- /dev/null +++ b/xmloff/inc/xmloff/XMLBase64ImportContext.hxx @@ -0,0 +1,64 @@ +/************************************************************************* + * + * 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_XMLBASE64IMPORTCONTEXT_HXX +#define _XMLOFF_XMLBASE64IMPORTCONTEXT_HXX + +#include "sal/config.h" +#include "xmloff/dllapi.h" +#include <com/sun/star/xml/sax/XDocumentHandler.hpp> +#include <xmloff/xmlictxt.hxx> + +namespace com { namespace sun { namespace star { namespace io { + class XOutputStream; } } } } + +class XMLOFF_DLLPUBLIC XMLBase64ImportContext : public SvXMLImportContext +{ + ::com::sun::star::uno::Reference< + ::com::sun::star::io::XOutputStream > xOut; + ::rtl::OUString sBase64CharsLeft; + +public: + TYPEINFO(); + + XMLBase64ImportContext( SvXMLImport& rImport, USHORT nPrfx, + const ::rtl::OUString& rLName, + const ::com::sun::star::uno::Reference< + ::com::sun::star::xml::sax::XAttributeList >& xAttrList, + const ::com::sun::star::uno::Reference< + ::com::sun::star::io::XOutputStream >& rOut ); + + virtual ~XMLBase64ImportContext(); + + virtual void EndElement(); + + virtual void Characters( const ::rtl::OUString& rChars ); + +}; + +#endif // _XMLOFF_XMLBASE64IMPORTCONTEXT_HXX + diff --git a/xmloff/inc/xmloff/XMLCharContext.hxx b/xmloff/inc/xmloff/XMLCharContext.hxx new file mode 100644 index 000000000000..a649f88b77c6 --- /dev/null +++ b/xmloff/inc/xmloff/XMLCharContext.hxx @@ -0,0 +1,71 @@ +/************************************************************************* + * + * 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 INCLUDED__XMLOFF_CHARCONTEXT_HXX +#define INCLUDED__XMLOFF_CHARCONTEXT_HXX + +#include "xmloff/dllapi.h" +#include <com/sun/star/uno/Reference.h> +#include "xmlictxt.hxx" + +class XMLOFF_DLLPUBLIC XMLCharContext : public SvXMLImportContext +{ + XMLCharContext(const XMLCharContext&); + void operator =(const XMLCharContext&); +protected: + sal_Int16 m_nControl; + sal_uInt16 m_nCount; + sal_Unicode m_c; +public: + + TYPEINFO(); + + XMLCharContext( + SvXMLImport& rImport, + sal_uInt16 nPrfx, + const ::rtl::OUString& rLName, + const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList > & xAttrList, + sal_Unicode c, + sal_Bool bCount ); + XMLCharContext( + SvXMLImport& rImport, + sal_uInt16 nPrfx, + const ::rtl::OUString& rLName, + const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList > & xAttrList, + sal_Int16 nControl ); + + virtual ~XMLCharContext(); + + // EndElement is called before a context will be destructed, but + // after a elements context has been parsed. It may be used for actions + // that require virtual methods. The default is to do nothing. + virtual void EndElement(); + + virtual void InsertControlCharacter(sal_Int16 _nControl); + virtual void InsertString(const ::rtl::OUString& _sString); +}; +// --------------------------------------------------------------------- +#endif // INCLUDED__XMLOFF_CHARCONTEXT_HXX diff --git a/xmloff/inc/xmloff/XMLConstantsPropertyHandler.hxx b/xmloff/inc/xmloff/XMLConstantsPropertyHandler.hxx new file mode 100644 index 000000000000..591447ba57d5 --- /dev/null +++ b/xmloff/inc/xmloff/XMLConstantsPropertyHandler.hxx @@ -0,0 +1,69 @@ +/************************************************************************* + * + * 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_XMLCONSTANTSPROPERTYHANDLER_HXX +#define _XMLOFF_XMLCONSTANTSPROPERTYHANDLER_HXX + +#include "sal/config.h" +#include "xmloff/dllapi.h" +#include <xmloff/xmlprhdl.hxx> +#include <xmloff/xmltoken.hxx> + +struct SvXMLEnumMapEntry; + +/////////////////////////////////////////////////////////////////////////// +// +/** Abstract base-class for different XML-types. Derivations of this class + knows how to compare, im/export a special XML-type +*/ +class XMLOFF_DLLPUBLIC XMLConstantsPropertyHandler: public XMLPropertyHandler +{ + const SvXMLEnumMapEntry *pMap; + const enum ::xmloff::token::XMLTokenEnum eDefault; + +public: + + XMLConstantsPropertyHandler( const SvXMLEnumMapEntry *pM, + enum ::xmloff::token::XMLTokenEnum eDflt); + + // Just needed for virtual destruction + virtual ~XMLConstantsPropertyHandler(); + + /// Imports the given value in cas of the given XML-data-type + virtual sal_Bool importXML( + const ::rtl::OUString& rStrImpValue, + ::com::sun::star::uno::Any& rValue, + const SvXMLUnitConverter& rUnitConverter ) const; + + /// Exports the given value in cas of the given XML-data-type + virtual sal_Bool exportXML( + ::rtl::OUString& rStrExpValue, + const ::com::sun::star::uno::Any& rValue, + const SvXMLUnitConverter& rUnitConverter ) const; +}; + +#endif // _XMLOFF_XMLCONSTANTSPROPERTYHANDLER_HXX diff --git a/xmloff/inc/xmloff/XMLEventExport.hxx b/xmloff/inc/xmloff/XMLEventExport.hxx new file mode 100644 index 000000000000..b0ec63b45b35 --- /dev/null +++ b/xmloff/inc/xmloff/XMLEventExport.hxx @@ -0,0 +1,139 @@ +/************************************************************************* + * + * 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_XMLEVENTEXPORT_HXX +#define _XMLOFF_XMLEVENTEXPORT_HXX + +#include "sal/config.h" +#include "xmloff/dllapi.h" +#include "sal/types.h" +#include <com/sun/star/uno/Sequence.hxx> +#include <com/sun/star/uno/Reference.hxx> +#include <rtl/ustring.hxx> +#include <xmloff/xmlevent.hxx> + +#include <map> + +class SvXMLExport; +namespace com { namespace sun { namespace star { + namespace document { class XEventsSupplier; } + namespace container { class XNameReplace; } + namespace container { class XNameAccess; } + namespace beans { struct PropertyValue; } +} } } + +typedef ::std::map< ::rtl::OUString, XMLEventExportHandler* > HandlerMap; +typedef ::std::map< ::rtl::OUString, XMLEventName > NameMap; + +/** + * Export instances of EventsSupplier services. To use this class you + * must fulfill two conditions: + * + * 1) provide a translation from the API event names to XML event + * names + * 2) Register XMLEventExportHandler instances for all script types + * that you would like to export. + * + * The Export()-Methods all have a bUseWhitespace parameter that + * causes the exported elements to be surrounded by whitespace, which + * in turn causes the elements to be indented properly. By default, + * whitespace is used, but it may not be called for in all cases (e.g + * events attached to hyperlink within a paragraph.) + */ +class XMLOFF_DLLPUBLIC XMLEventExport +{ + const ::rtl::OUString sEventType; + + SvXMLExport& rExport; + + HandlerMap aHandlerMap; + NameMap aNameTranslationMap; + + bool bExtNamespace; + +public: + XMLEventExport(SvXMLExport& rExport, + const XMLEventNameTranslation* pTranslationTable = NULL); + ~XMLEventExport(); + + /// register an EventExportHandler for a particular script type + /// + /// The handlers will be deleted when the object is destroyed, hence + /// no pointers to a handler registered with AddHandler() should be + /// held by anyone. + void AddHandler( const ::rtl::OUString& rName, + XMLEventExportHandler* rHandler ); + + /// register additional event names + void AddTranslationTable( const XMLEventNameTranslation* pTransTable ); + + /// export the events (calls EventExport::Export(Reference<XNameAcess>) ) + void Export( ::com::sun::star::uno::Reference< + ::com::sun::star::document::XEventsSupplier> & xAccess, + sal_Bool bUseWhitespace = sal_True); + + /// export the events (calls EventExport::Export(Reference<XNameAcess>) ) + void Export( ::com::sun::star::uno::Reference< + ::com::sun::star::container::XNameReplace> & xAccess, + sal_Bool bUseWhitespace = sal_True); + + /// export the events (writes <office:events> element) + void Export( ::com::sun::star::uno::Reference< + ::com::sun::star::container::XNameAccess> & xAccess, + sal_Bool bUseWhitespace = sal_True); + + /// export the events, but write <officeooo:events> element + /// (for new file format additions) + void ExportExt( ::com::sun::star::uno::Reference< + ::com::sun::star::container::XNameAccess> & xAccess, + sal_Bool bUseWhitespace = sal_True); + + /// export a single event (writes <office:events> element) + void ExportSingleEvent( + ::com::sun::star::uno::Sequence< + ::com::sun::star::beans::PropertyValue>& rEventValues, + const ::rtl::OUString& rApiEventName, + sal_Bool bUseWhitespace = sal_True ); + +private: + + /// export one event (start container-element if necessary) + SAL_DLLPRIVATE void ExportEvent( + ::com::sun::star::uno::Sequence< + ::com::sun::star::beans::PropertyValue>& rEventValues, + const XMLEventName& rXmlEventName, + sal_Bool bUseWhitespace, + sal_Bool& rExported); + + /// export the start element + SAL_DLLPRIVATE void StartElement(sal_Bool bUseWhitespace); + + /// export the end element + SAL_DLLPRIVATE void EndElement(sal_Bool bUseWhitespace); +}; + +#endif diff --git a/xmloff/inc/xmloff/XMLEventsImportContext.hxx b/xmloff/inc/xmloff/XMLEventsImportContext.hxx new file mode 100644 index 000000000000..851fd2154eb3 --- /dev/null +++ b/xmloff/inc/xmloff/XMLEventsImportContext.hxx @@ -0,0 +1,138 @@ +/************************************************************************* + * + * 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_XMLEVENTSIMPORTCONTEXT_HXX +#define _XMLOFF_XMLEVENTSIMPORTCONTEXT_HXX + +#include "sal/config.h" +#include "xmloff/dllapi.h" +#include <com/sun/star/uno/Reference.hxx> +#include <com/sun/star/uno/Sequence.hxx> +#include <xmloff/xmlictxt.hxx> +#include <xmloff/xmlevent.hxx> + +#include <map> +#include <vector> + +namespace com { namespace sun { namespace star { + namespace xml { namespace sax { class XAttributeList; } } + namespace beans { struct PropertyValue; } + namespace container { class XNameReplace; } + namespace document { class XEventsSupplier; } +} } } +namespace rtl { class OUString; } + +typedef ::std::pair< + ::rtl::OUString, + ::com::sun::star::uno::Sequence< + ::com::sun::star::beans::PropertyValue> > EventNameValuesPair; + +typedef ::std::vector< EventNameValuesPair > EventsVector; + +/** + * Import <script:events> element. + * + * The import context usually sets the events immediatly at the event + * XNameReplace. If none was given on construction, it operates in + * delayed mode: All events are collected and may then be set + * with the setEvents() method. + */ +class XMLOFF_DLLPUBLIC XMLEventsImportContext : public SvXMLImportContext +{ +protected: + // the event XNameReplace; may be empty + ::com::sun::star::uno::Reference< + ::com::sun::star::container::XNameReplace> xEvents; + + // if no XNameReplace is given, use this vector to collect events + EventsVector aCollectEvents; + +public: + + TYPEINFO(); + + XMLEventsImportContext( + SvXMLImport& rImport, + sal_uInt16 nPrfx, + const ::rtl::OUString& rLocalName); + + XMLEventsImportContext( + SvXMLImport& rImport, + sal_uInt16 nPrfx, + const ::rtl::OUString& rLocalName, + const ::com::sun::star::uno::Reference< + ::com::sun::star::document::XEventsSupplier> & xEventsSupplier); + + XMLEventsImportContext( + SvXMLImport& rImport, + sal_uInt16 nPrfx, + const ::rtl::OUString& rLocalName, + const ::com::sun::star::uno::Reference< + ::com::sun::star::container::XNameReplace> & xNameRepl); + + ~XMLEventsImportContext(); + + void AddEventValues( + const ::rtl::OUString& rEventName, + const ::com::sun::star::uno::Sequence< + ::com::sun::star::beans::PropertyValue> & rValues); + + /// if the import operates in delayed mode, you can use this method + /// to set all events that have been read on the XEventsSupplier + void SetEvents( + const ::com::sun::star::uno::Reference< + ::com::sun::star::document::XEventsSupplier> & xEventsSupplier); + + /// if the import operates in delayed mode, you can use this method + /// to set all events that have been read on the XNameReplace + void SetEvents( + const ::com::sun::star::uno::Reference< + ::com::sun::star::container::XNameReplace> & xNameRepl); + + /// if the import operates indelayed mode, you can use this method + /// to obtain the value sequence for a specific event + sal_Bool GetEventSequence( + const ::rtl::OUString& rName, + ::com::sun::star::uno::Sequence< + ::com::sun::star::beans::PropertyValue> & rSequence ); + +protected: + + virtual void StartElement( + const ::com::sun::star::uno::Reference< + ::com::sun::star::xml::sax::XAttributeList> & xAttrList); + + virtual void EndElement(); + + virtual SvXMLImportContext *CreateChildContext( + sal_uInt16 nPrefix, + const ::rtl::OUString& rLocalName, + const ::com::sun::star::uno::Reference< + ::com::sun::star::xml::sax::XAttributeList> & xAttrList ); +}; + +#endif diff --git a/xmloff/inc/xmloff/XMLFontAutoStylePool.hxx b/xmloff/inc/xmloff/XMLFontAutoStylePool.hxx new file mode 100644 index 000000000000..b0ae5eed1e0d --- /dev/null +++ b/xmloff/inc/xmloff/XMLFontAutoStylePool.hxx @@ -0,0 +1,75 @@ +/************************************************************************* + * + * 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_XMLFONTAUTOSTYLEPOOL_HXX +#define _XMLOFF_XMLFONTAUTOSTYLEPOOL_HXX + +#include "sal/config.h" +#include "xmloff/dllapi.h" +#include <rtl/ustring.hxx> +#include <xmloff/uniref.hxx> + +class XMLFontAutoStylePool_Impl; +class XMLFontAutoStylePoolNames_Impl; +class SvXMLExport; + +class XMLOFF_DLLPUBLIC XMLFontAutoStylePool : public UniRefBase +{ + SvXMLExport& rExport; + + XMLFontAutoStylePool_Impl *pPool; + XMLFontAutoStylePoolNames_Impl *pNames; + sal_uInt32 nName; + +protected: + + SvXMLExport& GetExport() { return rExport; } + +public: + + XMLFontAutoStylePool( SvXMLExport& rExport ); + ~XMLFontAutoStylePool(); + + ::rtl::OUString Add( + const ::rtl::OUString& rFamilyName, + const ::rtl::OUString& rStyleName, + sal_Int16 nFamily, + sal_Int16 nPitch, + rtl_TextEncoding eEnc ); + + ::rtl::OUString Find( + const ::rtl::OUString& rFamilyName, + const ::rtl::OUString& rStyleName, + sal_Int16 nFamily, + sal_Int16 nPitch, + rtl_TextEncoding eEnc )const; + ::rtl::OUString Find( const ::rtl::OUString& rInternalName ) const; + + void exportXML(); +}; + +#endif // _XMLOFF_XMLFONTAUTOSTYLEPOOL_HXX diff --git a/xmloff/inc/xmloff/XMLFontStylesContext.hxx b/xmloff/inc/xmloff/XMLFontStylesContext.hxx new file mode 100644 index 000000000000..2e9c58e50e17 --- /dev/null +++ b/xmloff/inc/xmloff/XMLFontStylesContext.hxx @@ -0,0 +1,99 @@ +/************************************************************************* + * + * 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_XMLFONTSTYLESCONTEXT_HXX_ +#define _XMLOFF_XMLFONTSTYLESCONTEXT_HXX_ + +#include "sal/config.h" +#include "xmloff/dllapi.h" + +#ifndef __SGI_STL_VECTOR +#include <vector> +#endif + +#ifndef _XMLOFF_XMLSTYLE_HXX_ +#include <xmloff/xmlstyle.hxx> +#endif + +struct XMLPropertyState; +class SvXMLTokenMap; +class XMLFontFamilyNamePropHdl; +class XMLFontFamilyPropHdl; +class XMLFontPitchPropHdl; +class XMLFontEncodingPropHdl; + +class XMLOFF_DLLPUBLIC XMLFontStylesContext : public SvXMLStylesContext +{ + XMLFontFamilyNamePropHdl *pFamilyNameHdl; + XMLFontFamilyPropHdl *pFamilyHdl; + XMLFontPitchPropHdl *pPitchHdl; + XMLFontEncodingPropHdl *pEncHdl; + + SvXMLTokenMap *pFontStyleAttrTokenMap; + + rtl_TextEncoding eDfltEncoding; + +protected: + + virtual SvXMLStyleContext *CreateStyleChildContext( sal_uInt16 nPrefix, + const ::rtl::OUString& rLocalName, + const ::com::sun::star::uno::Reference< + ::com::sun::star::xml::sax::XAttributeList > & xAttrList ); + +public: + + TYPEINFO(); + + XMLFontStylesContext( SvXMLImport& rImport, sal_uInt16 nPrfx, + const ::rtl::OUString& rLName, + const ::com::sun::star::uno::Reference< + ::com::sun::star::xml::sax::XAttributeList > & xAttrList, + rtl_TextEncoding eDfltEnc ); + virtual ~XMLFontStylesContext(); + + const SvXMLTokenMap& GetFontStyleAttrTokenMap() const + { + return *pFontStyleAttrTokenMap; + } + + sal_Bool FillProperties( const ::rtl::OUString& rName, + ::std::vector< XMLPropertyState > &rProps, + sal_Int32 nFamilyNameIdx, + sal_Int32 nStyleNameIdx, + sal_Int32 nFamilyIdx, + sal_Int32 nPitchIdx, + sal_Int32 nCharsetIdx ) const; + + rtl_TextEncoding GetDfltCharset() const { return eDfltEncoding; } + + XMLFontFamilyNamePropHdl& GetFamilyNameHdl() const { return *pFamilyNameHdl; } + XMLFontFamilyPropHdl& GetFamilyHdl() const { return *pFamilyHdl; } + XMLFontPitchPropHdl& GetPitchHdl() const { return *pPitchHdl; } + XMLFontEncodingPropHdl& GetEncodingHdl() const { return *pEncHdl; } + +}; + +#endif diff --git a/xmloff/inc/xmloff/XMLGraphicsDefaultStyle.hxx b/xmloff/inc/xmloff/XMLGraphicsDefaultStyle.hxx new file mode 100644 index 000000000000..88d9f161013e --- /dev/null +++ b/xmloff/inc/xmloff/XMLGraphicsDefaultStyle.hxx @@ -0,0 +1,63 @@ +/************************************************************************* + * + * 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_XMLGRAPHICSDEFAULTSTYLE_HXX +#define _XMLOFF_XMLGRAPHICSDEFAULTSTYLE_HXX + +#include "sal/config.h" +#include "xmloff/dllapi.h" +#include <xmloff/prstylei.hxx> + +namespace com { namespace sun { namespace star { namespace container +{ + class XNameContainer; +} } } } + +class XMLOFF_DLLPUBLIC XMLGraphicsDefaultStyle : public XMLPropStyleContext +{ +public: + TYPEINFO(); + + XMLGraphicsDefaultStyle( SvXMLImport& rImport, sal_uInt16 nPrfx, + const ::rtl::OUString& rLName, + const ::com::sun::star::uno::Reference< + ::com::sun::star::xml::sax::XAttributeList >& xAttrList, + SvXMLStylesContext& rStyles); + + virtual ~XMLGraphicsDefaultStyle(); + + virtual SvXMLImportContext *CreateChildContext( + sal_uInt16 nPrefix, + const ::rtl::OUString& rLocalName, + const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList > & xAttrList ); + + // This method is called for every default style + virtual void SetDefaults(); +}; + +#endif // _XMLOFF_XMLGRAPHICSDEFAULTSTYLE_HXX + diff --git a/xmloff/inc/xmloff/XMLPageExport.hxx b/xmloff/inc/xmloff/XMLPageExport.hxx new file mode 100644 index 000000000000..88eb74dfd54c --- /dev/null +++ b/xmloff/inc/xmloff/XMLPageExport.hxx @@ -0,0 +1,114 @@ +/************************************************************************* + * + * 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_XMLPAGEEXPORT_HXX +#define _XMLOFF_XMLPAGEEXPORT_HXX + +#include "sal/config.h" +#include "xmloff/dllapi.h" +#include "sal/types.h" +#include <rtl/ustring.hxx> +#ifndef __SGI_STL_VECTOR +#include <vector> +#endif +#include <xmloff/attrlist.hxx> +#include <xmloff/uniref.hxx> +#include <com/sun/star/container/XIndexAccess.hpp> + +namespace com { namespace sun { namespace star { + namespace style { class XStyle; } + namespace container { class XIndexReplace; class XNameAccess;} + namespace beans { class XPropertySet; } +} } } + +class SvXMLExport; +class XMLPropertyHandlerFactory; +class XMLPropertySetMapper; +class SvXMLExportPropertyMapper; + +//______________________________________________________________________________ + +struct XMLPageExportNameEntry +{ + ::rtl::OUString sPageMasterName; + ::rtl::OUString sStyleName; +}; + +//______________________________________________________________________________ + +class XMLOFF_DLLPUBLIC XMLPageExport : public UniRefBase +{ + SvXMLExport& rExport; + + const ::rtl::OUString sIsPhysical; + const ::rtl::OUString sFollowStyle; + + ::com::sun::star::uno::Reference< + ::com::sun::star::container::XNameAccess > xPageStyles; + + ::std::vector< XMLPageExportNameEntry > aNameVector; + SAL_DLLPRIVATE sal_Bool findPageMasterName( const ::rtl::OUString& rStyleName, ::rtl::OUString& rPMName ) const; + + UniReference < XMLPropertyHandlerFactory > xPageMasterPropHdlFactory; + UniReference < XMLPropertySetMapper > xPageMasterPropSetMapper; + UniReference < SvXMLExportPropertyMapper > xPageMasterExportPropMapper; + +protected: + + SvXMLExport& GetExport() { return rExport; } + + virtual void collectPageMasterAutoStyle( + const ::com::sun::star::uno::Reference < + ::com::sun::star::beans::XPropertySet > & rPropSet, + ::rtl::OUString& rPageMasterName ); + + virtual void exportMasterPageContent( + const ::com::sun::star::uno::Reference < + ::com::sun::star::beans::XPropertySet > & rPropSet, + sal_Bool bAutoStyles ); + + sal_Bool exportStyle( + const ::com::sun::star::uno::Reference< + ::com::sun::star::style::XStyle >& rStyle, + sal_Bool bAutoStyles ); + + void exportStyles( sal_Bool bUsed, sal_Bool bAutoStyles ); + +public: + XMLPageExport( SvXMLExport& rExp ); + ~XMLPageExport(); + + void collectAutoStyles( sal_Bool bUsed ) { exportStyles( bUsed, sal_True ); } + void exportAutoStyles(); + void exportMasterStyles( sal_Bool bUsed ) { exportStyles( bUsed, sal_False ); } + + //text grid enhancement for better CJK support + void exportDefaultStyle(); +}; + +#endif // _XMLOFF_XMLTEXTMASTERPAGEEXPORT_HXX + diff --git a/xmloff/inc/xmloff/XMLSettingsExportContext.hxx b/xmloff/inc/xmloff/XMLSettingsExportContext.hxx new file mode 100644 index 000000000000..d3e0b6a8c5ee --- /dev/null +++ b/xmloff/inc/xmloff/XMLSettingsExportContext.hxx @@ -0,0 +1,66 @@ +/************************************************************************* +* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +* +* Copyright 2009 by Sun Microsystems, Inc. +* +* 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 XML_SETTINGS_EXPORT_CONTEXT_HXX +#define XML_SETTINGS_EXPORT_CONTEXT_HXX + +/** === begin UNO includes === **/ +#include <com/sun/star/lang/XMultiServiceFactory.hpp> +/** === end UNO includes === **/ + +#include "xmloff/xmltoken.hxx" + +//........................................................................ +namespace xmloff +{ +//........................................................................ + + //==================================================================== + //= XMLExporter + //==================================================================== + class SAL_NO_VTABLE XMLSettingsExportContext + { + public: + virtual void AddAttribute( enum ::xmloff::token::XMLTokenEnum i_eName, + const ::rtl::OUString& i_rValue ) = 0; + virtual void AddAttribute( enum ::xmloff::token::XMLTokenEnum i_eName, + enum ::xmloff::token::XMLTokenEnum i_eValue ) = 0; + + virtual void StartElement( enum ::xmloff::token::XMLTokenEnum i_eName, + const sal_Bool i_bIgnoreWhitespace ) = 0; + virtual void EndElement( const sal_Bool i_bIgnoreWhitespace ) = 0; + + virtual void Characters( const ::rtl::OUString& i_rCharacters ) = 0; + + virtual ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > + GetServiceFactory() const = 0; + + }; + +//........................................................................ +} // namespace xmloff +//........................................................................ + +#endif // XML_SETTINGS_EXPORT_CONTEXT_HXX diff --git a/xmloff/inc/xmloff/XMLShapeStyleContext.hxx b/xmloff/inc/xmloff/XMLShapeStyleContext.hxx new file mode 100644 index 000000000000..f14d3af5c91d --- /dev/null +++ b/xmloff/inc/xmloff/XMLShapeStyleContext.hxx @@ -0,0 +1,76 @@ +/************************************************************************* + * + * 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_XMLSHAPESTYLECONTEXT_HXX +#define _XMLOFF_XMLSHAPESTYLECONTEXT_HXX + +#include "sal/config.h" +#include "xmloff/dllapi.h" +#include <xmloff/prstylei.hxx> +#include <xmloff/families.hxx> + +class SvXMLImport; + +////////////////////////////////////////////////////////////////////////////// +// style:style context + +class XMLOFF_DLLPUBLIC XMLShapeStyleContext: public XMLPropStyleContext +{ +protected: + ::rtl::OUString m_sControlDataStyleName; + ::rtl::OUString m_sListStyleName; + sal_Bool m_bIsNumRuleAlreadyConverted; + +protected: + virtual void SetAttribute( sal_uInt16 nPrefixKey, + const ::rtl::OUString& rLocalName, + const ::rtl::OUString& rValue ); +public: + TYPEINFO(); + + XMLShapeStyleContext( + SvXMLImport& rImport, + sal_uInt16 nPrfx, + const rtl::OUString& rLName, + const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList >& xAttrList, + SvXMLStylesContext& rStyles, + sal_uInt16 nFamily = XML_STYLE_FAMILY_SD_GRAPHICS_ID); + virtual ~XMLShapeStyleContext(); + + SvXMLImportContext * CreateChildContext( + sal_uInt16 nPrefix, + const ::rtl::OUString& rLocalName, + const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList > & xAttrList ); + + virtual void Finish( sal_Bool bOverwrite ); + + virtual void FillPropertySet( + const ::com::sun::star::uno::Reference< + ::com::sun::star::beans::XPropertySet > & rPropSet ); +}; + +#endif // _XMLOFF_XMLSHAPESTYLECONTEXT_HXX diff --git a/xmloff/inc/xmloff/XMLStringVector.hxx b/xmloff/inc/xmloff/XMLStringVector.hxx new file mode 100644 index 000000000000..fe3181a8b530 --- /dev/null +++ b/xmloff/inc/xmloff/XMLStringVector.hxx @@ -0,0 +1,39 @@ +/************************************************************************* + * + * 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_XMLSTRINGVECTOR_HXX +#define _XMLOFF_XMLSTRINGVECTOR_HXX + +#include <rtl/ustring.hxx> + +#include <vector> + +typedef ::std::vector < ::rtl::OUString> XMLStringVector; + + +#endif // _XMLOFF_XMLSTRINGVECTOR_HXX + diff --git a/xmloff/inc/xmloff/XMLTextMasterPageContext.hxx b/xmloff/inc/xmloff/XMLTextMasterPageContext.hxx new file mode 100644 index 000000000000..ff51c96f0092 --- /dev/null +++ b/xmloff/inc/xmloff/XMLTextMasterPageContext.hxx @@ -0,0 +1,92 @@ +/************************************************************************* + * + * 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_TEXTMASTERPAGECONTEXT_HXX_ +#define _XMLOFF_TEXTMASTERPAGECONTEXT_HXX_ + +#include "sal/config.h" +#include "xmloff/dllapi.h" +#include "sal/types.h" + +#ifndef _XMLOFF_XMLSTYLE_HXX_ +#include <xmloff/xmlstyle.hxx> +#endif + +namespace com { namespace sun { namespace star { + namespace style { class XStyle; } +} } } + +class XMLOFF_DLLPUBLIC XMLTextMasterPageContext : public SvXMLStyleContext +{ + const ::rtl::OUString sIsPhysical; + const ::rtl::OUString sPageStyleLayout; + const ::rtl::OUString sFollowStyle; + ::rtl::OUString sFollow; + ::rtl::OUString sPageMasterName; + + ::com::sun::star::uno::Reference < ::com::sun::star::style::XStyle > xStyle; + + sal_Bool bInsertHeader; + sal_Bool bInsertFooter; + sal_Bool bInsertHeaderLeft; + sal_Bool bInsertFooterLeft; + sal_Bool bHeaderInserted; + sal_Bool bFooterInserted; + sal_Bool bHeaderLeftInserted; + sal_Bool bFooterLeftInserted; + + SAL_DLLPRIVATE ::com::sun::star::uno::Reference < + ::com::sun::star::style::XStyle > Create(); +protected: + ::com::sun::star::uno::Reference < + ::com::sun::star::style::XStyle > GetStyle() { return xStyle; } +public: + + TYPEINFO(); + + XMLTextMasterPageContext( SvXMLImport& rImport, sal_uInt16 nPrfx, + const ::rtl::OUString& rLName, + const ::com::sun::star::uno::Reference< + ::com::sun::star::xml::sax::XAttributeList > & xAttrList, + sal_Bool bOverwrite ); + virtual ~XMLTextMasterPageContext(); + + virtual SvXMLImportContext *CreateChildContext( + sal_uInt16 nPrefix, + const ::rtl::OUString& rLocalName, + const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList > & xAttrList ); + + virtual SvXMLImportContext *CreateHeaderFooterContext( + sal_uInt16 nPrefix, + const ::rtl::OUString& rLocalName, + const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList > & xAttrList, + const sal_Bool bFooter, + const sal_Bool bLeft ); + + virtual void Finish( sal_Bool bOverwrite ); +}; + +#endif diff --git a/xmloff/inc/xmloff/XMLTextMasterPageExport.hxx b/xmloff/inc/xmloff/XMLTextMasterPageExport.hxx new file mode 100644 index 000000000000..32d6c15e4d98 --- /dev/null +++ b/xmloff/inc/xmloff/XMLTextMasterPageExport.hxx @@ -0,0 +1,71 @@ +/************************************************************************* + * + * 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_XMLTEXTMASTERPAGEEXPORT_HXX +#define _XMLOFF_XMLTEXTMASTERPAGEEXPORT_HXX + +#include "sal/config.h" +#include "xmloff/dllapi.h" +#include <rtl/ustring.hxx> +#include <xmloff/attrlist.hxx> +#include <xmloff/XMLPageExport.hxx> + +namespace com { namespace sun { namespace star { + namespace text { class XText; } +} } } + +class XMLOFF_DLLPUBLIC XMLTextMasterPageExport : public XMLPageExport +{ + const ::rtl::OUString sHeaderText; + const ::rtl::OUString sHeaderOn; + const ::rtl::OUString sHeaderShareContent; + const ::rtl::OUString sHeaderTextLeft; + + const ::rtl::OUString sFooterText; + const ::rtl::OUString sFooterOn; + const ::rtl::OUString sFooterShareContent; + const ::rtl::OUString sFooterTextLeft; + +protected: + + virtual void exportHeaderFooterContent( + const ::com::sun::star::uno::Reference< + ::com::sun::star::text::XText >& rText, + sal_Bool bAutoStyles, sal_Bool bExportParagraph = sal_True ); + + virtual void exportMasterPageContent( + const ::com::sun::star::uno::Reference < + ::com::sun::star::beans::XPropertySet > & rPropSet, + sal_Bool bAutoStyles ); + +public: + XMLTextMasterPageExport( SvXMLExport& rExp ); + ~XMLTextMasterPageExport(); +}; + +#endif // _XMLOFF_XMLTEXTMASTERPAGEEXPORT_HXX + diff --git a/xmloff/inc/xmloff/XMLTextMasterStylesContext.hxx b/xmloff/inc/xmloff/XMLTextMasterStylesContext.hxx new file mode 100644 index 000000000000..8682321d8a6a --- /dev/null +++ b/xmloff/inc/xmloff/XMLTextMasterStylesContext.hxx @@ -0,0 +1,62 @@ +/************************************************************************* + * + * 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_XMLTEXTMASTERSTYLESCONTEXT_HXX +#define _XMLOFF_XMLTEXTMASTERSTYLESCONTEXT_HXX + +#include "sal/config.h" +#include "xmloff/dllapi.h" +#include <xmloff/xmlstyle.hxx> + +class XMLOFF_DLLPUBLIC XMLTextMasterStylesContext : public SvXMLStylesContext +{ +protected: + virtual SvXMLStyleContext *CreateStyleChildContext( sal_uInt16 nPrefix, + const ::rtl::OUString& rLocalName, + const ::com::sun::star::uno::Reference< + ::com::sun::star::xml::sax::XAttributeList > & xAttrList ); + + virtual SvXMLStyleContext *CreateStyleStyleChildContext( sal_uInt16 nFamily, + sal_uInt16 nPrefix, const ::rtl::OUString& rLocalName, + const ::com::sun::star::uno::Reference< + ::com::sun::star::xml::sax::XAttributeList > & xAttrList ); + + virtual sal_Bool InsertStyleFamily( sal_uInt16 nFamily ) const; + +public: + TYPEINFO(); + + XMLTextMasterStylesContext( SvXMLImport& rImport, sal_uInt16 nPrfx, + const ::rtl::OUString& rLName, + const ::com::sun::star::uno::Reference< + ::com::sun::star::xml::sax::XAttributeList > & xAttrList); + + virtual ~XMLTextMasterStylesContext(); +}; + +#endif // _XMLOFF_XMLTEXTMASTERSTYLECONTEXT_HXX + diff --git a/xmloff/inc/xmloff/XMLTextShapeStyleContext.hxx b/xmloff/inc/xmloff/XMLTextShapeStyleContext.hxx new file mode 100644 index 000000000000..b7431cf9e15a --- /dev/null +++ b/xmloff/inc/xmloff/XMLTextShapeStyleContext.hxx @@ -0,0 +1,72 @@ +/************************************************************************* + * + * 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_XMLTEXTSHAPESTYLECONTEXT_HXX_ +#define _XMLOFF_XMLTEXTSHAPESTYLECONTEXT_HXX_ + +#include "sal/config.h" +#include "xmloff/dllapi.h" +#include <xmloff/XMLShapeStyleContext.hxx> + +class XMLOFF_DLLPUBLIC XMLTextShapeStyleContext : public XMLShapeStyleContext +{ + const ::rtl::OUString sIsAutoUpdate; + + sal_Bool bAutoUpdate : 1; + + SvXMLImportContextRef xEventContext; + +protected: + + virtual void SetAttribute( sal_uInt16 nPrefixKey, + const ::rtl::OUString& rLocalName, + const ::rtl::OUString& rValue ); + +public: + + TYPEINFO(); + + XMLTextShapeStyleContext( SvXMLImport& rImport, sal_uInt16 nPrfx, + const ::rtl::OUString& rLName, + const ::com::sun::star::uno::Reference< + ::com::sun::star::xml::sax::XAttributeList > & xAttrList, + SvXMLStylesContext& rStyles, sal_uInt16 nFamily, + sal_Bool bDefaultStyle = sal_False ); + virtual ~XMLTextShapeStyleContext(); + + virtual SvXMLImportContext *CreateChildContext( + sal_uInt16 nPrefix, + const ::rtl::OUString& rLocalName, + const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList > & xAttrList ); + + sal_Bool IsAutoUpdate() const { return bAutoUpdate; } + + virtual void CreateAndInsert( sal_Bool bOverwrite ); + + virtual void Finish( sal_Bool bOverwrite ); +}; + +#endif diff --git a/xmloff/inc/xmloff/XMLTextTableContext.hxx b/xmloff/inc/xmloff/XMLTextTableContext.hxx new file mode 100644 index 000000000000..e3d7e77087bb --- /dev/null +++ b/xmloff/inc/xmloff/XMLTextTableContext.hxx @@ -0,0 +1,59 @@ +/************************************************************************* + * + * 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 _XMLTEXTTABLECONTEXT_HXX +#define _XMLTEXTTABLECONTEXT_HXX + +#include "sal/config.h" +#include "xmloff/dllapi.h" +#include <xmloff/xmlictxt.hxx> +#include <com/sun/star/uno/Reference.h> + +namespace com { namespace sun { namespace star { + namespace text { class XTextContent; } +} } } + +#define XML_TEXT_FRAME_TEXTBOX 1 +#define XML_TEXT_FRAME_GRAPHIC 2 + +class XMLOFF_DLLPUBLIC XMLTextTableContext : public SvXMLImportContext +{ + +public: + + TYPEINFO(); + + XMLTextTableContext( SvXMLImport& rImport, + sal_uInt16 nPrfx, + const ::rtl::OUString& rLName ); + virtual ~XMLTextTableContext(); + + virtual ::com::sun::star::uno::Reference < + ::com::sun::star::text::XTextContent > GetXTextContent() const = 0; +}; + +#endif diff --git a/xmloff/inc/xmloff/animexp.hxx b/xmloff/inc/xmloff/animexp.hxx new file mode 100644 index 000000000000..6fc0a6b5b089 --- /dev/null +++ b/xmloff/inc/xmloff/animexp.hxx @@ -0,0 +1,52 @@ +/************************************************************************* + * + * 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_ANIMEXP_HXX +#define _XMLOFF_ANIMEXP_HXX + +#include <com/sun/star/drawing/XShape.hpp> +#include <xmloff/uniref.hxx> + +class AnimExpImpl; +class SvXMLExport; +class XMLShapeExport; + +class XMLAnimationsExporter : public UniRefBase +{ + AnimExpImpl* mpImpl; + +public: + XMLAnimationsExporter( XMLShapeExport* pShapeExp ); + virtual ~XMLAnimationsExporter(); + + void prepare( ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > xShape, SvXMLExport& rExport ); + void collect( ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > xShape, SvXMLExport& rExport ); + void exportAnimations( SvXMLExport& rExport ); +}; + +#endif // _XMLOFF_ANIMEXP_HXX + diff --git a/xmloff/inc/xmloff/attrlist.hxx b/xmloff/inc/xmloff/attrlist.hxx new file mode 100644 index 000000000000..dedd2d22656a --- /dev/null +++ b/xmloff/inc/xmloff/attrlist.hxx @@ -0,0 +1,93 @@ +/************************************************************************* + * + * 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_ATTRLIST_HXX +#define _XMLOFF_ATTRLIST_HXX + +#include "sal/config.h" +#include "xmloff/dllapi.h" +#include <com/sun/star/util/XCloneable.hpp> +#include <com/sun/star/xml/sax/SAXParseException.hpp> +#include <com/sun/star/xml/sax/XExtendedDocumentHandler.hpp> +#include <com/sun/star/xml/sax/SAXException.hpp> +#include <com/sun/star/xml/sax/XDocumentHandler.hpp> +#include <com/sun/star/xml/sax/XAttributeList.hpp> +#include <com/sun/star/xml/sax/XLocator.hpp> +#include <com/sun/star/lang/XUnoTunnel.hpp> + +#include <cppuhelper/implbase3.hxx> + +struct SvXMLAttributeList_Impl; + +class XMLOFF_DLLPUBLIC SvXMLAttributeList : public ::cppu::WeakImplHelper3< + ::com::sun::star::xml::sax::XAttributeList, + ::com::sun::star::util::XCloneable, + ::com::sun::star::lang::XUnoTunnel> +{ + SvXMLAttributeList_Impl *m_pImpl; + +public: + SvXMLAttributeList(); + SvXMLAttributeList( const SvXMLAttributeList& ); + SvXMLAttributeList( const ::com::sun::star::uno::Reference< + ::com::sun::star::xml::sax::XAttributeList> & rAttrList ); + ~SvXMLAttributeList(); + + static const ::com::sun::star::uno::Sequence< sal_Int8 > & getUnoTunnelId() throw(); + static SvXMLAttributeList* getImplementation( ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > ) throw(); + + // XUnoTunnel + virtual sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& aIdentifier ) throw(::com::sun::star::uno::RuntimeException); + + // ::com::sun::star::xml::sax::XAttributeList + virtual sal_Int16 SAL_CALL getLength(void) throw( ::com::sun::star::uno::RuntimeException ); + virtual ::rtl::OUString SAL_CALL getNameByIndex(sal_Int16 i) throw( ::com::sun::star::uno::RuntimeException ); + virtual ::rtl::OUString SAL_CALL getTypeByIndex(sal_Int16 i) throw( ::com::sun::star::uno::RuntimeException ); + virtual ::rtl::OUString SAL_CALL getTypeByName(const ::rtl::OUString& aName) throw( ::com::sun::star::uno::RuntimeException ); + virtual ::rtl::OUString SAL_CALL getValueByIndex(sal_Int16 i) throw( ::com::sun::star::uno::RuntimeException ); + virtual ::rtl::OUString SAL_CALL getValueByName(const ::rtl::OUString& aName) throw( ::com::sun::star::uno::RuntimeException ); + + // ::com::sun::star::util::XCloneable + virtual ::com::sun::star::uno::Reference< ::com::sun::star::util::XCloneable > SAL_CALL createClone() throw( ::com::sun::star::uno::RuntimeException ); + + // methods that are not contained in any interface + void AddAttribute( const ::rtl::OUString &sName , const ::rtl::OUString &sValue ); + void Clear(); + void RemoveAttribute( const ::rtl::OUString sName ); + void SetAttributeList( const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList > & ); + void AppendAttributeList( const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList > & ); + void SetValueByIndex( sal_Int16 i, const ::rtl::OUString& rValue ); + void RemoveAttributeByIndex( sal_Int16 i ); + void RenameAttributeByIndex( sal_Int16 i, const ::rtl::OUString& rNewName ); + sal_Int16 GetIndexByName( const ::rtl::OUString& rName ) const; + + private: + const ::rtl::OUString sType; // "CDATA" +}; + + +#endif // _XMLOFF_ATTRLIST_HXX diff --git a/xmloff/inc/xmloff/contextid.hxx b/xmloff/inc/xmloff/contextid.hxx new file mode 100644 index 000000000000..2b96c91187ba --- /dev/null +++ b/xmloff/inc/xmloff/contextid.hxx @@ -0,0 +1,54 @@ +/************************************************************************* + * + * 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_CONTEXTID_HXX_ +#define _XMLOFF_CONTEXTID_HXX_ + +/** These defines determine the unique ids for XML style-context-id's + used in the SvXMLAutoStylePoolP. + */ + +#define XML_SC_CTF_START 0x00001000 +#define XML_SD_CTF_START 0x00002000 +#define XML_TEXT_CTF_START 0x00003000 +#define XML_SCH_CTF_START 0x00004000 +#define XML_PM_CTF_START 0x00005000 // page master +#define XML_FORM_CTF_START 0x00006000 +#define XML_DB_CTF_START 0x00007000 + + +#define CTF_SD_CONTROL_SHAPE_DATA_STYLE ( XML_SD_CTF_START + 1 ) +#define CTF_SD_NUMBERINGRULES_NAME ( XML_SD_CTF_START + 2 ) +#define CTF_SD_SHAPE_PARA_ADJUST ( XML_SD_CTF_START + 3 ) + +#define CTF_FORMS_DATA_STYLE ( XML_FORM_CTF_START + 0 ) + +/** use together with MID_FLAG_NO_PROPERTY to import the specified + attribute into the alien attribute container */ + +#define CTF_ALIEN_ATTRIBUTE_IMPORT 0x00007fff + +#endif // _XMLOFF_CONTEXTID_HXX_ diff --git a/xmloff/inc/xmloff/controlpropertyhdl.hxx b/xmloff/inc/xmloff/controlpropertyhdl.hxx new file mode 100644 index 000000000000..ae990c3771ae --- /dev/null +++ b/xmloff/inc/xmloff/controlpropertyhdl.hxx @@ -0,0 +1,143 @@ +/************************************************************************* + * + * 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_FORMS_CONTROLPROPERTYHDL_HXX_ +#define _XMLOFF_FORMS_CONTROLPROPERTYHDL_HXX_ + +#include "sal/config.h" +#include "xmloff/dllapi.h" +#include <xmloff/prhdlfac.hxx> +#include <vos/ref.hxx> +#include <rtl/ustring.hxx> +#include <xmloff/xmlexppr.hxx> +#include <xmloff/XMLConstantsPropertyHandler.hxx> + +struct SvXMLEnumMapEntry; +class Color; +//......................................................................... +namespace xmloff +{ +//......................................................................... + + class IFormsExportContext; + class OFormLayerXMLImport_Impl; + + //===================================================================== + //= ORotationAngleHandler + //===================================================================== + class ORotationAngleHandler : public XMLPropertyHandler + { + public: + ORotationAngleHandler(); + + virtual sal_Bool importXML( const ::rtl::OUString& _rStrImpValue, ::com::sun::star::uno::Any& _rValue, const SvXMLUnitConverter& _rUnitConverter ) const; + virtual sal_Bool exportXML( ::rtl::OUString& _rStrExpValue, const ::com::sun::star::uno::Any& _rValue, const SvXMLUnitConverter& _rUnitConverter ) const; + }; + + //===================================================================== + //= OFontWidthHandler + //===================================================================== + class OFontWidthHandler : public XMLPropertyHandler + { + public: + OFontWidthHandler(); + + virtual sal_Bool importXML( const ::rtl::OUString& _rStrImpValue, ::com::sun::star::uno::Any& _rValue, const SvXMLUnitConverter& _rUnitConverter ) const; + virtual sal_Bool exportXML( ::rtl::OUString& _rStrExpValue, const ::com::sun::star::uno::Any& _rValue, const SvXMLUnitConverter& _rUnitConverter ) const; + }; + + //===================================================================== + //= OControlBorderHandlerBase + //===================================================================== + class OControlBorderHandler : public XMLPropertyHandler + { + public: + enum BorderFacet + { + STYLE, + COLOR + }; + + OControlBorderHandler( const BorderFacet _eFacet ); + + virtual sal_Bool importXML( const ::rtl::OUString& _rStrImpValue, ::com::sun::star::uno::Any& _rValue, const SvXMLUnitConverter& _rUnitConverter ) const; + virtual sal_Bool exportXML( ::rtl::OUString& _rStrExpValue, const ::com::sun::star::uno::Any& _rValue, const SvXMLUnitConverter& _rUnitConverter ) const; + + private: + BorderFacet m_eFacet; + }; + + //===================================================================== + //= OControlTextEmphasisHandler + //===================================================================== + class OControlTextEmphasisHandler : public XMLPropertyHandler + { + public: + OControlTextEmphasisHandler(); + + virtual sal_Bool importXML( const ::rtl::OUString& _rStrImpValue, ::com::sun::star::uno::Any& _rValue, const SvXMLUnitConverter& _rUnitConverter ) const; + virtual sal_Bool exportXML( ::rtl::OUString& _rStrExpValue, const ::com::sun::star::uno::Any& _rValue, const SvXMLUnitConverter& _rUnitConverter ) const; + }; + + //===================================================================== + //= ImageScaleModeHandler + //===================================================================== + class XMLOFF_DLLPUBLIC ImageScaleModeHandler : public XMLConstantsPropertyHandler + { + public: + ImageScaleModeHandler(); + }; + + //===================================================================== + //= OControlPropertyHandlerFactory + //===================================================================== + class XMLOFF_DLLPUBLIC OControlPropertyHandlerFactory : public XMLPropertyHandlerFactory + { + protected: + mutable XMLConstantsPropertyHandler* m_pTextAlignHandler; + mutable OControlBorderHandler* m_pControlBorderStyleHandler; + mutable OControlBorderHandler* m_pControlBorderColorHandler; + mutable ORotationAngleHandler* m_pRotationAngleHandler; + mutable OFontWidthHandler* m_pFontWidthHandler; + mutable XMLConstantsPropertyHandler* m_pFontEmphasisHandler; + mutable XMLConstantsPropertyHandler* m_pFontReliefHandler; + + protected: + virtual ~OControlPropertyHandlerFactory(); + + public: + OControlPropertyHandlerFactory(); + + virtual const XMLPropertyHandler* GetPropertyHandler(sal_Int32 _nType) const; + }; + +//......................................................................... +} // namespace xmloff +//......................................................................... + +#endif // _XMLOFF_FORMS_CONTROLPROPERTYHDL_HXX_ + diff --git a/xmloff/inc/xmloff/dllapi.h b/xmloff/inc/xmloff/dllapi.h new file mode 100644 index 000000000000..e1802baf6461 --- /dev/null +++ b/xmloff/inc/xmloff/dllapi.h @@ -0,0 +1,40 @@ +/************************************************************************* + * + * 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 INCLUDED_XMLOFF_DLLAPI_H +#define INCLUDED_XMLOFF_DLLAPI_H + +#include "sal/config.h" +#include "sal/types.h" + +#if defined XMLOFF_DLLIMPLEMENTATION +#define XMLOFF_DLLPUBLIC SAL_DLLPUBLIC_EXPORT +#else +#define XMLOFF_DLLPUBLIC SAL_DLLPUBLIC_IMPORT +#endif + +#endif diff --git a/xmloff/inc/xmloff/families.hxx b/xmloff/inc/xmloff/families.hxx new file mode 100644 index 000000000000..65f1f6d8cc6a --- /dev/null +++ b/xmloff/inc/xmloff/families.hxx @@ -0,0 +1,116 @@ +/************************************************************************* + * + * 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_FAMILIES_HXX_ +#define _XMLOFF_FAMILIES_HXX_ + +/** These defines determine the unique ids for XML style-families + used in the SvXMLAutoStylePoolP. + */ + +// Misc (Pool) +// reserved: 0..99 +#define XML_STYLE_FAMILY_DATA_STYLE 0 +#define XML_STYLE_FAMILY_DATA_STYLE_NAME "data-style" +#define XML_STYLE_FAMILY_PAGE_MASTER 1 +#define XML_STYLE_FAMILY_PAGE_MASTER_NAME "page-layout" +#define XML_STYLE_FAMILY_PAGE_MASTER_PREFIX "pm" +#define XML_STYLE_FAMILY_MASTER_PAGE 2 + +// Text +// reserved: 100..199 +#define XML_STYLE_FAMILY_TEXT_PARAGRAPH 100 +#define XML_STYLE_FAMILY_TEXT_TEXT 101 +#define XML_STYLE_FAMILY_TEXT_LIST 102 +#define XML_STYLE_FAMILY_TEXT_OUTLINE 103 +#define XML_STYLE_FAMILY_TEXT_FOOTNOTECONFIG 105 +#define XML_STYLE_FAMILY_TEXT_ENDNOTECONFIG 106 +#define XML_STYLE_FAMILY_TEXT_SECTION 107 +#define XML_STYLE_FAMILY_TEXT_FRAME 108 // export only +#define XML_STYLE_FAMILY_TEXT_RUBY 109 +#define XML_STYLE_FAMILY_TEXT_BIBLIOGRAPHYCONFIG 110 +#define XML_STYLE_FAMILY_TEXT_LINENUMBERINGCONFIG 111 + +// Table +// reserved: 200..299 +#define XML_STYLE_FAMILY_TABLE_TABLE 200 +#define XML_STYLE_FAMILY_TABLE_TABLE_STYLES_NAME "table" +#define XML_STYLE_FAMILY_TABLE_TABLE_STYLES_PREFIX "ta" +#define XML_STYLE_FAMILY_TABLE_COLUMN 202 +#define XML_STYLE_FAMILY_TABLE_COLUMN_STYLES_NAME "table-column" +#define XML_STYLE_FAMILY_TABLE_COLUMN_STYLES_PREFIX "co" +#define XML_STYLE_FAMILY_TABLE_ROW 203 +#define XML_STYLE_FAMILY_TABLE_ROW_STYLES_NAME "table-row" +#define XML_STYLE_FAMILY_TABLE_ROW_STYLES_PREFIX "ro" +#define XML_STYLE_FAMILY_TABLE_CELL 204 +#define XML_STYLE_FAMILY_TABLE_CELL_STYLES_NAME "table-cell" +#define XML_STYLE_FAMILY_TABLE_CELL_STYLES_PREFIX "ce" +#define XML_STYLE_FAMILY_TABLE_TEMPLATE_ID 205 + +// Impress/Draw +// reserved: 300..399 +#define XML_STYLE_FAMILY_SD_GRAPHICS_ID 300 +#define XML_STYLE_FAMILY_SD_GRAPHICS_NAME "graphic" +#define XML_STYLE_FAMILY_SD_GRAPHICS_PREFIX "gr" + +#define XML_STYLE_FAMILY_SD_PRESENTATION_ID 301 +#define XML_STYLE_FAMILY_SD_PRESENTATION_NAME "presentation" +#define XML_STYLE_FAMILY_SD_PRESENTATION_PREFIX "pr" +// families for derived from SvXMLStyleContext +#define XML_STYLE_FAMILY_SD_PAGEMASTERCONEXT_ID 302 +#define XML_STYLE_FAMILY_SD_PAGEMASTERSTYLECONEXT_ID 306 +#define XML_STYLE_FAMILY_SD_PRESENTATIONPAGELAYOUT_ID 303 +// family for draw pool +#define XML_STYLE_FAMILY_SD_POOL_ID 304 +#define XML_STYLE_FAMILY_SD_POOL_NAME "default" +// family for presentation drawpage properties +#define XML_STYLE_FAMILY_SD_DRAWINGPAGE_ID 305 +#define XML_STYLE_FAMILY_SD_DRAWINGPAGE_NAME "drawing-page" +#define XML_STYLE_FAMILY_SD_DRAWINGPAGE_PREFIX "dp" + +#define XML_STYLE_FAMILY_SD_GRADIENT_ID 306 +#define XML_STYLE_FAMILY_SD_HATCH_ID 307 +#define XML_STYLE_FAMILY_SD_FILL_IMAGE_ID 308 +#define XML_STYLE_FAMILY_SD_MARKER_ID 309 +#define XML_STYLE_FAMILY_SD_STROKE_DASH_ID 310 + +// Chart +// reserved: 400..499 +#define XML_STYLE_FAMILY_SCH_CHART_ID 400 +#define XML_STYLE_FAMILY_SCH_CHART_NAME "chart" +#define XML_STYLE_FAMILY_SCH_CHART_PREFIX "ch" + +// Math +// reserved: 500..599 + + +// Forms/Controls +// reserved 600..649 +#define XML_STYLE_FAMILY_CONTROL_ID 600 +#define XML_STYLE_FAMILY_CONTROL_NAME "control" +#define XML_STYLE_FAMILY_CONTROL_PREFIX "ctrl" + +#endif // _XMLOFF_FAMILIES_HXX_ diff --git a/xmloff/inc/xmloff/formlayerexport.hxx b/xmloff/inc/xmloff/formlayerexport.hxx new file mode 100644 index 000000000000..c9325139474f --- /dev/null +++ b/xmloff/inc/xmloff/formlayerexport.hxx @@ -0,0 +1,212 @@ +/************************************************************************* + * + * 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_FORMLAYEREXPORT_HXX_ +#define _XMLOFF_FORMLAYEREXPORT_HXX_ + +#include "sal/config.h" +#include "xmloff/dllapi.h" +#include <vos/refernce.hxx> +#include <com/sun/star/drawing/XDrawPage.hpp> +#include <com/sun/star/container/XIndexAccess.hpp> +#include <com/sun/star/beans/XPropertySet.hpp> +#include <com/sun/star/frame/XModel.hpp> +#include <vos/ref.hxx> +#include <xmloff/xmlexppr.hxx> + +namespace com { namespace sun { namespace star { namespace awt { + class XControlModel; +} } } } + +class SvXMLExport; +//......................................................................... +namespace xmloff +{ +//......................................................................... + + class OFormLayerXMLExport_Impl; + class OFormsRootExport; + + //===================================================================== + //= OFormLayerXMLExport + //===================================================================== + /** provides functionallity for exporting a complete form layer. + */ + class XMLOFF_DLLPUBLIC OFormLayerXMLExport + :public ::vos::OReference + { + protected: + /// our export context + SvXMLExport& m_rContext; + // impl class + OFormLayerXMLExport_Impl* m_pImpl; + + protected: + ~OFormLayerXMLExport(); + + public: + OFormLayerXMLExport(SvXMLExport& _rContext); + + /** initial the object + + <p>To be called if you want to reuse the same object for exportin different documents.</p> + + <p>You don't need to call this if you just constructed the object, in this case it is already + initialized..</p> + */ + void initialize(); + + /** initializes some internal structures for fast access to the given page + + <p>This method has to be called before you use getControlId for controls on the given page. + This way a performance optimization can be done for faster access to the control ids</p> + + @return + <TRUE/> if the page has been examined before. If <FALSE/> is returned, this is a serious error. + + @see getControlId + @see examineForms + */ + sal_Bool seekPage( + const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XDrawPage >& _rxDrawPage); + + /** get the id for the given control + + <p>The page the control belongs to must have been examined and sought to.</p> + + @param _rxControl + the control which's id should be retrieved. Must not be <NULL/>. + + @see examineForms + @see seekPage + + */ + ::rtl::OUString getControlId( + const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& _rxControl); + + /** retrieves the style name for the control's number style. + + <p>For performance reasons, this method is allowed to be called for any controls, even those which + do not have a number style. In this case, an empty string is returned.</p> + + @param _rxControl + the control which's id should be retrieved. Must not be <NULL/>. + + @see examineForms + @see seekPage + */ + ::rtl::OUString getControlNumberStyle( + const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& _rxControl ); + + /** examines the forms collection given. + + <p>This method will collect all form layer related data of the given draw page</p> + + @param _rxDrawPage + the draw page to examine. The object will be queried for a <type scope="com.sun.star.form">XFormsSupplier</type> + interface to obtain the forms container. + */ + void examineForms(const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XDrawPage >& _rxDrawPage); + + /** exports the structure of a form layer + + <p>This method does not export styles (e.g. font properties of the controls), or any references + external instances may have to the control models contained in the form layer (e.g. uno control + shapes in the drawing layer may have such references)</p> + + <p>No top level element describing the whole collection is inserted. I.e. if within your document, you + expect the the forms collection to be stored like + <listing> + <Forms> + .... // all the forms stuff here + </Forms> + </listing> + you have to start the Forms element yourself.</p> + + @param _rxDrawPage + the draw page to examine. The object will be queried for a <type scope="com.sun.star.form">XFormsSupplier</type> + interface to obtain the forms container. + */ + void exportForms(const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XDrawPage >& _rxDrawPage); + + /** exports the XForms model data + */ + void exportXForms() const; + + /** determines whether the given page contains logical forms + */ + bool pageContainsForms( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XDrawPage >& _rxDrawPage ) const; + + /** determines whether the given page contains XForm instances + */ + bool documentContainsXForms() const; + + /// retrieves the property mapper for control styles + ::vos::ORef< SvXMLExportPropertyMapper > getStylePropertyMapper(); + + /** exports the controls number styles + */ + void exportControlNumberStyles(); + + /** exports the automatic controls number styles + */ + void exportAutoControlNumberStyles(); + + /** exports the auto-styles collected during the examineForms calls + */ + void exportAutoStyles(); + + /** exclude the given control (model) from export. + + <p>If your document contains form controls which are not to be exported for whatever reason, + you need to announce the models of these controls (can be retrieved from XControlShape::getControl) + to the form layer exporter.<br/> + Of course you have to do this before calling <member>exportForms</member></p> + */ + void excludeFromExport( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel > _rxControl ); + }; + + //========================================================================= + //= OOfficeFormsExport + //========================================================================= + /// export helper for the office::forms element + class XMLOFF_DLLPUBLIC OOfficeFormsExport + { + private: + OFormsRootExport* m_pImpl; + + public: + OOfficeFormsExport( SvXMLExport& _rExp ); + ~OOfficeFormsExport(); + }; + +//......................................................................... +} // namespace xmloff +//......................................................................... + +#endif // _XMLOFF_FORMLAYEREXPORT_HXX_ + diff --git a/xmloff/inc/xmloff/formlayerimport.hxx b/xmloff/inc/xmloff/formlayerimport.hxx new file mode 100644 index 000000000000..36a2a87a7ad3 --- /dev/null +++ b/xmloff/inc/xmloff/formlayerimport.hxx @@ -0,0 +1,171 @@ +/************************************************************************* + * + * 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_FORMLAYERIMPORT_HXX_ +#define _XMLOFF_FORMLAYERIMPORT_HXX_ + +#include "sal/config.h" +#include "xmloff/dllapi.h" +#include <vos/refernce.hxx> +#include <com/sun/star/drawing/XDrawPage.hpp> +#include <com/sun/star/xml/sax/XAttributeList.hpp> +#include <com/sun/star/beans/XPropertySet.hpp> +#include <vos/ref.hxx> +#include <xmloff/xmlimppr.hxx> + +class SvXMLImport; +class SvXMLImportContext; +class SvXMLStylesContext; +class XMLPropStyleContext; + +//......................................................................... +namespace xmloff +{ +//......................................................................... + + //===================================================================== + //= OFormLayerXMLImport + //===================================================================== + class OFormLayerXMLImport_Impl; + /** allows you to import a <form:form> element + */ + class XMLOFF_DLLPUBLIC OFormLayerXMLImport + :public ::vos::OReference + { + OFormLayerXMLImport_Impl* m_pImpl; + + public: + OFormLayerXMLImport(SvXMLImport& _rImporter); + ~OFormLayerXMLImport(); + + /** retrieves the property mapper form form related auto styles. + */ + ::vos::ORef< SvXMLImportPropertyMapper > + getStylePropertyMapper() const; + + /** start importing the forms of the given page + + <p>starting the import of a new page (by using this method) invalidates the current page position + you may have set with <method>seekPage</method>.</p> + + @see endPage + @see seekPage + */ + void startPage( + const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XDrawPage >& _rxDrawPage); + + /** creates an import context for the office:forms element + */ + SvXMLImportContext* createOfficeFormsContext( + SvXMLImport& _rImport, + sal_uInt16 _nPrefix, + const rtl::OUString& _rLocalName); + + /** create an <type>SvXMLImportContext</type> instance which is able to import the <form:form> + element. + + <p>You must have called <method>startPage</method> before you can create such an import context.</p> + + @see startPage + @see endPage + */ + SvXMLImportContext* createContext( + const sal_uInt16 _nPrefix, + const rtl::OUString& _rLocalName, + const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& _rxAttribs); + + /** lookup a control given by id. + + <p>The control must be part of the page which is currently beeing imported, or you must have used + seekPage for the page which the control belongs to.</p> + + <p>(And, of course, the control must have been imported already at the moment you call this.)</p> + + @see startPage + @see seekPage + */ + ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > + lookupControl(const ::rtl::OUString& _rId); + + /** end importing the forms of the current page + + <p>You must call this method if you want the import to be finished correctly. Without calling + it, you will lose information.</p> + + @see startPage + @see seekPage + */ + void endPage(); + + /** seek to the given page. + + <p>This method should be used if you want to call lookupControl outside of a startPage-endPage frame.</p> + + <p>You can't seek to a page which hasn't been imported yet. This means that you must have called + <method>endPage</method> for the page in question.</p> + + <p>The "current page" position you have set with this method is invalidated as soon as you call + <method>startPage</method> for a new page.</p> + + <p>You should not call seekPage while importing a page (i.e. between startPage and endPage). This will + smash this other page beeing imported (seeking back to it will not help you :).</p> + + @see lookupControl + */ + void seekPage( + const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XDrawPage >& _rxDrawPage); + + /** announces the auto-style context to the form importer + */ + void setAutoStyleContext(SvXMLStylesContext* _pNewContext); + + /** sets the given number style on the given control + @param _rxControlModel + the control model which's style is to be set + @param _rControlNumerStyleName + the style name for the control's number style + */ + void applyControlNumberStyle( + const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& _rxControlModel, + const ::rtl::OUString& _rControlNumerStyleName + ); + + /** to be called when the document has been completely imported + + <p>For some documents (currently: only some spreadsheet documents) it's necessary + do to a post processing, since not all information from the file can be processed + if the document is not completed, yet.</p> + */ + void documentDone( ); + }; + +//......................................................................... +} // namespace xmloff +//......................................................................... + +#endif // _XMLOFF_FORMLAYERIMPORT_HXX_ + diff --git a/xmloff/inc/xmloff/formsimp.hxx b/xmloff/inc/xmloff/formsimp.hxx new file mode 100644 index 000000000000..86e62015294f --- /dev/null +++ b/xmloff/inc/xmloff/formsimp.hxx @@ -0,0 +1,49 @@ +/************************************************************************* + * + * 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_FORMSIMP_HXX +#define _XMLOFF_FORMSIMP_HXX + +#include <xmloff/xmlictxt.hxx> + +////////////////////////////////////////////////////////////////////////////// +// presentations:animations + +class XMLFormsContext : public SvXMLImportContext +{ +public: + TYPEINFO(); + + XMLFormsContext( SvXMLImport& rImport, sal_uInt16 nPrfx, const rtl::OUString& rLocalName); + virtual ~XMLFormsContext(); + + virtual SvXMLImportContext * CreateChildContext( USHORT nPrefix, const ::rtl::OUString& rLocalName, + const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList ); +}; + +#endif // _XMLOFF_ANIMIMP_HXX + diff --git a/xmloff/inc/xmloff/maptype.hxx b/xmloff/inc/xmloff/maptype.hxx new file mode 100644 index 000000000000..c956a9d77141 --- /dev/null +++ b/xmloff/inc/xmloff/maptype.hxx @@ -0,0 +1,74 @@ +/************************************************************************* + * + * 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_PROPMAPPINGTYPES_HXX +#define _XMLOFF_PROPMAPPINGTYPES_HXX + +#include <tools/solar.h> +#include <com/sun/star/uno/Any.hxx> +#include <xmloff/xmltoken.hxx> +#include <unotools/saveopt.hxx> + +/////////////////////////////////////////////////////////////////////////// +// +/** Represents a property with its API-name, its XML-name and the type of + its value. +*/ +struct XMLPropertyMapEntry +{ + const sal_Char* msApiName; /// Property-Name + sal_Int32 nApiNameLength; /// length of property name + sal_uInt16 mnNameSpace; /** declares the Namespace in wich this + property exists */ + enum ::xmloff::token::XMLTokenEnum meXMLName; /// XML-Name + sal_Int32 mnType; /** Bit 0..23 : XML-Type of its value + Bit 24..31: The flags specifies + additional rules how + to im/export the porperty */ + sal_Int16 mnContextId; /// User defined id for context filtering + SvtSaveOptions::ODFDefaultVersion mnEarliestODFVersionForExport;// no export when the used ODF version is lower than this +}; + +/////////////////////////////////////////////////////////////////////////// +// +/** Smart struct to transport an Any with an index to the appropriate + property-name +*/ +struct XMLPropertyState +{ + sal_Int32 mnIndex; + ::com::sun::star::uno::Any maValue; + + XMLPropertyState( sal_Int32 nIndex ) + : mnIndex( nIndex ) {} + XMLPropertyState( sal_Int32 nIndex, const ::com::sun::star::uno::Any& rValue ) + : mnIndex( nIndex ), maValue( rValue ) {} + XMLPropertyState( const XMLPropertyState& rPropState ) + : mnIndex( rPropState.mnIndex ), maValue( rPropState.maValue ) {} +}; + +#endif // _XMLOFF_PROPMAPPINGTYPES_HXX diff --git a/xmloff/inc/xmloff/nmspmap.hxx b/xmloff/inc/xmloff/nmspmap.hxx new file mode 100644 index 000000000000..6869820d82b1 --- /dev/null +++ b/xmloff/inc/xmloff/nmspmap.hxx @@ -0,0 +1,185 @@ +/************************************************************************* + * + * 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_NMSPMAP_HXX +#define _XMLOFF_NMSPMAP_HXX + +#include "sal/config.h" +#include "xmloff/dllapi.h" +#include "sal/types.h" +#include <rtl/ustring.hxx> +#include <hash_map> +#ifndef __SGI_STL_MAP +#include <map> +#endif +#include <vos/ref.hxx> +#include <cppuhelper/weak.hxx> + +#include <limits.h> + +const sal_uInt16 XML_NAMESPACE_XMLNS = (USHRT_MAX-2); +const sal_uInt16 XML_NAMESPACE_NONE = (USHRT_MAX-1); +const sal_uInt16 XML_NAMESPACE_UNKNOWN = (USHRT_MAX); +const sal_uInt16 XML_NAMESPACE_UNKNOWN_FLAG = 0x8000; + +class NameSpaceEntry : public cppu::OWeakObject +{ +public: + // sName refers to the full namespace name + ::rtl::OUString sName; + // sPrefix is the prefix used to declare a given item to be from a given namespace + ::rtl::OUString sPrefix; + // nKey is the unique identifier of a namespace + sal_uInt16 nKey; +}; + +struct OUStringEqFunc +{ + sal_Bool operator()( const rtl::OUString &r1, + const rtl::OUString &r2) const + { + return r1 == r2; + } +}; + +struct uInt32lt +{ + sal_Bool operator()( const sal_uInt32 &r1, + const sal_uInt32 &r2) const + { + return r1 < r2; + } +}; +typedef ::std::pair < sal_uInt16, const ::rtl::OUString* > QNamePair; + +struct QNamePairHash +{ + size_t operator()( const QNamePair &r1 ) const + { + return (size_t) r1.second->hashCode() + r1.first; + } +}; +struct QNamePairEq +{ + bool operator()( const QNamePair &r1, + const QNamePair &r2 ) const + { + return r1.first == r2.first && *(r1.second) == *(r2.second); + } +}; + +typedef ::std::hash_map < QNamePair, ::rtl::OUString, QNamePairHash, QNamePairEq > QNameCache; +typedef ::std::hash_map < ::rtl::OUString, ::vos::ORef <NameSpaceEntry >, rtl::OUStringHash, OUStringEqFunc > NameSpaceHash; +typedef ::std::map < sal_uInt16, ::vos::ORef < NameSpaceEntry >, uInt32lt > NameSpaceMap; + +class XMLOFF_DLLPUBLIC SvXMLNamespaceMap +{ + const ::rtl::OUString sXMLNS; + const ::rtl::OUString sEmpty; + + NameSpaceHash aNameHash, aNameCache; + NameSpaceMap aNameMap; + QNameCache aQNameCache; + SAL_DLLPRIVATE sal_uInt16 _Add( const rtl::OUString& rPrefix, const rtl::OUString &rName, sal_uInt16 nKey ); + +public: + + SvXMLNamespaceMap(); + ~SvXMLNamespaceMap(); + + SvXMLNamespaceMap( const SvXMLNamespaceMap& ); + + void operator =( const SvXMLNamespaceMap& rCmp ); + int operator ==( const SvXMLNamespaceMap& rCmp ) const; + + sal_uInt16 Add( const ::rtl::OUString& rPrefix, + const ::rtl::OUString& rName, + sal_uInt16 nKey = XML_NAMESPACE_UNKNOWN ); + sal_uInt16 AddIfKnown( const ::rtl::OUString& rPrefix, + const ::rtl::OUString& rName ); + + sal_uInt16 GetKeyByName( const ::rtl::OUString& rName ) const; + const ::rtl::OUString& GetNameByKey( sal_uInt16 nKey ) const; + + sal_uInt16 GetKeyByPrefix( const ::rtl::OUString& rPrefix ) const; + const ::rtl::OUString& GetPrefixByKey( sal_uInt16 nKey ) const; + + ::rtl::OUString GetQNameByKey( sal_uInt16 nKey, + const ::rtl::OUString& rLocalName, + sal_Bool bCache = sal_True) const; + + ::rtl::OUString GetAttrNameByKey( sal_uInt16 nKey ) const; + + /* This will replace the version with the unused 5th default parameter */ + sal_uInt16 _GetKeyByAttrName( const ::rtl::OUString& rAttrName, + ::rtl::OUString *pPrefix, + ::rtl::OUString *pLocalName, + ::rtl::OUString *pNamespace = 0, + sal_Bool bCache = sal_True) const; + + /* This will replace the version with the unused 3rd default parameter */ + sal_uInt16 _GetKeyByAttrName( const ::rtl::OUString& rAttrName, + ::rtl::OUString *pLocalName = 0, + sal_Bool bCache = sal_True) const; + + sal_uInt16 GetFirstKey() const; + sal_uInt16 GetNextKey( sal_uInt16 nOldKey ) const; + + /* Give access to all namespace definitions, including multiple entries + for the same key (needed for saving sheets separately in Calc). + This might be replaced by a better interface later. */ + const NameSpaceHash& GetAllEntries() const { return aNameHash; } + + static sal_Bool NormalizeOasisURN( ::rtl::OUString& rName ); + static sal_Bool NormalizeW3URI( ::rtl::OUString& rName ); + static sal_Bool NormalizeURI( ::rtl::OUString& rName ); + +/* deprecated */ sal_Bool AddAtIndex( sal_uInt16 nIdx, const ::rtl::OUString& rPrefix, + const ::rtl::OUString& rName, sal_uInt16 nKey = XML_NAMESPACE_UNKNOWN ); +/* deprecated */ sal_Bool AddAtIndex( sal_uInt16 nIdx, const sal_Char *pPrefix, + const sal_Char *pName, sal_uInt16 nKey = XML_NAMESPACE_UNKNOWN ); +/* deprecated */ sal_uInt16 GetIndexByKey( sal_uInt16 nKey ) const; +/* deprecated */ sal_uInt16 GetKeyByIndex( sal_uInt16 nIdx ) const; +/* deprecated */ sal_uInt16 GetIndexByPrefix( const ::rtl::OUString& rPrefix ) const; +/* deprecated */ sal_uInt16 GetFirstIndex() const; +/* deprecated */ sal_uInt16 GetNextIndex( sal_uInt16 nOldIdx ) const; +/* deprecated */ const ::rtl::OUString& GetPrefixByIndex( sal_uInt16 nIdx ) const; +/* deprecated */ const ::rtl::OUString& GetNameByIndex( sal_uInt16 nIdx ) const; +/* deprecated */ ::rtl::OUString GetAttrNameByIndex( sal_uInt16 nIdx ) const; +/* deprecated */ ::rtl::OUString GetQNameByIndex( sal_uInt16 nIdx, + const ::rtl::OUString& rLocalName ) const; +/* deprecated */ sal_uInt16 GetKeyByAttrName( const ::rtl::OUString& rAttrName, + ::rtl::OUString *pPrefix, + ::rtl::OUString *pLocalName, + ::rtl::OUString *pNamespace=0, + sal_uInt16 nIdxGuess = USHRT_MAX ) const; +/* deprecated */ sal_uInt16 GetKeyByAttrName( const ::rtl::OUString& rAttrName, + ::rtl::OUString *pLocalName = 0, + sal_uInt16 nIdxGuess = USHRT_MAX ) const; +}; + +#endif // _XMLOFF_NMSPMAP_HXX diff --git a/xmloff/inc/xmloff/odffields.hxx b/xmloff/inc/xmloff/odffields.hxx new file mode 100644 index 000000000000..2be06b578acd --- /dev/null +++ b/xmloff/inc/xmloff/odffields.hxx @@ -0,0 +1,56 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: $ + * $Revision: $ + * + * 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. + * + ************************************************************************/ + +/* + * Copyright 2008 by Novell, Inc. + */ + +#ifndef _ODFFIELDS_HXX +#define _ODFFIELDS_HXX + + +#define ODF_FORMTEXT "vnd.oasis.opendocument.field.FORMTEXT" + +#define ODF_FORMCHECKBOX "vnd.oasis.opendocument.field.FORMCHECKBOX" +#define ODF_FORMCHECKBOX_HELPTEXT "Checkbox_HelpText" +#define ODF_FORMCHECKBOX_NAME "Checkbox_Name" +#define ODF_FORMCHECKBOX_RESULT "Checkbox_Checked" + +#define ODF_FORMDROPDOWN "vnd.oasis.opendocument.field.FORMDROPDOWN" +#define ODF_FORMDROPDOWN_LISTENTRY "Dropdown_ListEntry" +#define ODF_FORMDROPDOWN_RESULT "Dropdown_Selected" + +#define ODF_TOC "vnd.oasis.opendocument.field.TOC" + +#define ODF_HYPERLINK "vnd.oasis.opendocument.field.HYPERLINK" + +#define ODF_PAGEREF "vnd.oasis.opendocument.field.PAGEREF" + +#endif /* _ODFFIELDS_HXX */ diff --git a/xmloff/inc/xmloff/prhdlfac.hxx b/xmloff/inc/xmloff/prhdlfac.hxx new file mode 100644 index 000000000000..162c95642351 --- /dev/null +++ b/xmloff/inc/xmloff/prhdlfac.hxx @@ -0,0 +1,111 @@ +/************************************************************************* + * + * 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_PROPERTYHANDLERFACTORY_HXX +#define _XMLOFF_PROPERTYHANDLERFACTORY_HXX + +#include "sal/config.h" +#include "xmloff/dllapi.h" +#include "sal/types.h" + +#ifndef __SGI_STL_MAP +#include <map> +#endif +#include <xmloff/uniref.hxx> +#include <xmloff/xmlprhdl.hxx> + +/** + This class is a base-class to create XMLPropertyHandler. + It creates PropertyHandler for given XML-types and store + them in an internal cache. They'll be deleted at destruction- + time. + For create your own PropertyHandler for specific XML-types + you have to override the virtual method GetPropertyHandler + ( see below ). +*/ +class XMLOFF_DLLPUBLIC XMLPropertyHandlerFactory : public UniRefBase +{ +public: + virtual ~XMLPropertyHandlerFactory(); + + /** + This method retrieves a PropertyHandler for the given XML-type. + To extend this method for more XML-types override this method + like the example below. If you call the method of the base-class + you get propertyhandler for basic-XML-types ( e.g. for color, percent, ... ). + Afetr that you could create your new XML-types. After creating a new type + you have to put the pointer into the cache via the method + PutHdlCache( sal_Int32 , XMLPropertyHandler* ). + + virtual const XMLPropertyHandler* GetPropertyHandler( sal_Int32 nType ) const + { + XMLPropertyHandler* pHdl = XMLPropertyHandlerFactory::GetPropertyHandler( nType ); + + if( !pHdl ) + { + switch( nType ) + { + case XML_TYPE_XYZ : + pHdl = new XML_xyz_PropHdl; + break; + case ... + : + : + } + + if( pHdl ) + PutHdlCache( nType, pHdl ); + } + + return pHdl; + } + */ + virtual const XMLPropertyHandler* GetPropertyHandler( sal_Int32 nType ) const; + + /** helper method to statically create a property handler; this will not + * use the handler cache. This method should only be called in special + * circumstances; calling GetPropertyHandler is almost always + * preferable. */ + static const XMLPropertyHandler* CreatePropertyHandler( sal_Int32 nType ); + +protected: + /** Retrieves a PropertyHandler from the internal cache */ + XMLPropertyHandler* GetHdlCache( sal_Int32 nType ) const; + /** Puts a PropertyHandler into the internal cache */ + void PutHdlCache( sal_Int32 nType, const XMLPropertyHandler* pHdl ) const; + +private: + /** Retrieves ( creates if necessary ) PropertyHandler for + basic XML-types */ + SAL_DLLPRIVATE const XMLPropertyHandler* GetBasicHandler( sal_Int32 nType ) + const; + + typedef ::std::map< sal_Int32, XMLPropertyHandler* > CacheMap; + CacheMap maHandlerCache; +}; + +#endif // _XMLOFF_PROPERTYHANDLERFACTORY_HXX diff --git a/xmloff/inc/xmloff/prstylei.hxx b/xmloff/inc/xmloff/prstylei.hxx new file mode 100644 index 000000000000..8dfe1dfaddaf --- /dev/null +++ b/xmloff/inc/xmloff/prstylei.hxx @@ -0,0 +1,109 @@ +/************************************************************************* + * + * 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_PRSTYLEI_HXX_ +#define _XMLOFF_PRSTYLEI_HXX_ + +#include "sal/config.h" +#include "xmloff/dllapi.h" +#include "sal/types.h" +#include <com/sun/star/style/XStyle.hpp> +#ifndef __SGI_STL_VECTOR +#include <vector> +#endif +#ifndef _XMLOFF_XMLSTYLE_HXX_ +#include <xmloff/xmlstyle.hxx> +#endif + +struct XMLPropertyState; +class SvXMLStylesContext; + +namespace com { namespace sun { namespace star { + namespace beans { class XPropertySet; } +} } } + +class XMLOFF_DLLPUBLIC XMLPropStyleContext : public SvXMLStyleContext +{ + const ::rtl::OUString msIsPhysical; + const ::rtl::OUString msFollowStyle; + ::std::vector< XMLPropertyState > maProperties; + ::com::sun::star::uno::Reference < ::com::sun::star::style::XStyle > mxStyle; + SvXMLImportContextRef mxStyles; + + SAL_DLLPRIVATE XMLPropStyleContext(XMLPropStyleContext &); // not defined + SAL_DLLPRIVATE void operator =(XMLPropStyleContext &); // not defined + +protected: + + virtual void SetAttribute( sal_uInt16 nPrefixKey, + const ::rtl::OUString& rLocalName, + const ::rtl::OUString& rValue ); + SvXMLStylesContext *GetStyles() { return (SvXMLStylesContext *)&mxStyles; } + ::std::vector< XMLPropertyState > & GetProperties() { return maProperties; } + + // This methos my be overloaded to create a new style. Its called by + // CreateInsert to create a style if a style with the requested family and + // name couldn't be found. The st + virtual ::com::sun::star::uno::Reference < + ::com::sun::star::style::XStyle > Create(); + +public: + + TYPEINFO(); + + XMLPropStyleContext( SvXMLImport& rImport, sal_uInt16 nPrfx, + const ::rtl::OUString& rLName, + const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList > & xAttrList, + SvXMLStylesContext& rStyles, sal_uInt16 nFamily = 0, + sal_Bool bDefaultStyle=sal_False ); + virtual ~XMLPropStyleContext(); + + virtual SvXMLImportContext *CreateChildContext( + sal_uInt16 nPrefix, + const ::rtl::OUString& rLocalName, + const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList > & xAttrList ); + + virtual void FillPropertySet( + const ::com::sun::star::uno::Reference< + ::com::sun::star::beans::XPropertySet > & rPropSet ); + + const SvXMLStylesContext *GetStyles() const { return (const SvXMLStylesContext *)&mxStyles; } + const ::std::vector< XMLPropertyState > & GetProperties() const { return maProperties; } + + const ::com::sun::star::uno::Reference < + ::com::sun::star::style::XStyle >& + GetStyle() const { return mxStyle; } + void SetStyle( + const ::com::sun::star::uno::Reference< + ::com::sun::star::style::XStyle >& xStl) { mxStyle = xStl; } + + virtual void SetDefaults(); + + virtual void CreateAndInsert( sal_Bool bOverwrite ); + virtual void Finish( sal_Bool bOverwrite ); +}; + +#endif diff --git a/xmloff/inc/xmloff/shapeexport.hxx b/xmloff/inc/xmloff/shapeexport.hxx new file mode 100644 index 000000000000..e583a208fd83 --- /dev/null +++ b/xmloff/inc/xmloff/shapeexport.hxx @@ -0,0 +1,342 @@ +/************************************************************************* + * + * 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_SHAPEEXPORT_HXX_ +#define _XMLOFF_SHAPEEXPORT_HXX_ + +#include "sal/config.h" +#include "xmloff/dllapi.h" +#include "sal/types.h" + +#include <rtl/ref.hxx> +#include <rtl/ustring.hxx> +#include <rtl/ustrbuf.hxx> +#include <xmloff/uniref.hxx> + +#include <com/sun/star/drawing/XShape.hpp> +#include <com/sun/star/drawing/XShapes.hpp> +#include <com/sun/star/awt/Point.hpp> +#include <com/sun/star/beans/PropertyValue.hpp> + +#include <map> +#include <xmloff/xmlprmap.hxx> +#include <xmloff/xmlexppr.hxx> +#include <xmloff/animexp.hxx> +#include <xmloff/families.hxx> + +#include "xmloff/table/XMLTableExport.hxx" + +// shape export features are bits used for the nFeature +// parameter of XMLShapeExport::exportShape + +#define SEF_EXPORT_X 0x0001 +#define SEF_EXPORT_Y 0x0002 +#define SEF_EXPORT_POSITION 0x0003 + +#define SEF_EXPORT_WIDTH 0x0004 +#define SEF_EXPORT_HEIGHT 0x0008 +#define SEF_EXPORT_SIZE 0x000c + +// when you set this flag a chart does NOT export its own data as table element +#define SEF_EXPORT_NO_CHART_DATA 0x0010 + +// When setting the flag below no ignorableWhiteSpace will be called around +// the drawing object elements +#define SEF_EXPORT_NO_WS 0x0020 + +// When setting the flag below a callout shape is exported as office:annotation +#define SEF_EXPORT_ANNOTATION 0x0040 + +#define SEF_DEFAULT SEF_EXPORT_POSITION|SEF_EXPORT_SIZE + +enum XmlShapeType +{ + XmlShapeTypeUnknown, // not known + + XmlShapeTypeDrawRectangleShape, // "com.sun.star.drawing.RectangleShape" + XmlShapeTypeDrawEllipseShape, // "com.sun.star.drawing.EllipseShape" + XmlShapeTypeDrawControlShape, // "com.sun.star.drawing.ControlShape" + XmlShapeTypeDrawConnectorShape, // "com.sun.star.drawing.ConnectorShape" + XmlShapeTypeDrawMeasureShape, // "com.sun.star.drawing.MeasureShape" + XmlShapeTypeDrawLineShape, // "com.sun.star.drawing.LineShape" + XmlShapeTypeDrawPolyPolygonShape, // "com.sun.star.drawing.PolyPolygonShape" + XmlShapeTypeDrawPolyLineShape, // "com.sun.star.drawing.PolyLineShape" + XmlShapeTypeDrawOpenBezierShape, // "com.sun.star.drawing.OpenBezierShape" + XmlShapeTypeDrawClosedBezierShape, // "com.sun.star.drawing.ClosedBezierShape" + XmlShapeTypeDrawGraphicObjectShape, // "com.sun.star.drawing.GraphicObjectShape" + XmlShapeTypeDrawGroupShape, // "com.sun.star.drawing.GroupShape" + XmlShapeTypeDrawTextShape, // "com.sun.star.drawing.TextShape" + XmlShapeTypeDrawOLE2Shape, // "com.sun.star.drawing.OLE2Shape" + XmlShapeTypeDrawChartShape, // embedded com.sun.star.chart + XmlShapeTypeDrawSheetShape, // embedded com.sun.star.sheet + XmlShapeTypeDrawPageShape, // "com.sun.star.drawing.PageShape" + XmlShapeTypeDrawFrameShape, // "com.sun.star.drawing.FrameShape" + XmlShapeTypeDrawCaptionShape, // "com.sun.star.drawing.CaptionShape" + XmlShapeTypeDrawAppletShape, // "com.sun.star.drawing.AppletShape" + XmlShapeTypeDrawPluginShape, // "com.sun.star.drawing.PlugginShape" + + XmlShapeTypeDraw3DSceneObject, // "com.sun.star.drawing.Shape3DSceneObject" + XmlShapeTypeDraw3DCubeObject, // "com.sun.star.drawing.Shape3DCubeObject" + XmlShapeTypeDraw3DSphereObject, // "com.sun.star.drawing.Shape3DSphereObject" + XmlShapeTypeDraw3DLatheObject, // "com.sun.star.drawing.Shape3DLatheObject" + XmlShapeTypeDraw3DExtrudeObject, // "com.sun.star.drawing.Shape3DExtrudeObject" + + XmlShapeTypePresTitleTextShape, // "com.sun.star.presentation.TitleTextShape" + XmlShapeTypePresOutlinerShape, // "com.sun.star.presentation.OutlinerShape" + XmlShapeTypePresSubtitleShape, // "com.sun.star.presentation.SubtitleShape" + XmlShapeTypePresGraphicObjectShape, // "com.sun.star.presentation.GraphicObjectShape" + XmlShapeTypePresPageShape, // "com.sun.star.presentation.PageShape" + XmlShapeTypePresOLE2Shape, // "com.sun.star.presentation.OLE2Shape" + XmlShapeTypePresChartShape, // "com.sun.star.presentation.ChartShape" + XmlShapeTypePresSheetShape, // "com.sun.star.presentation.CalcShape" + XmlShapeTypePresTableShape, // "com.sun.star.presentation.TableShape" + XmlShapeTypePresOrgChartShape, // "com.sun.star.presentation.OrgChartShape" + XmlShapeTypePresNotesShape, // "com.sun.star.presentation.NotesShape" + XmlShapeTypeHandoutShape, // "com.sun.star.presentation.HandoutShape" + + XmlShapeTypePresHeaderShape, // "com.sun.star.presentation.HeaderShape" + XmlShapeTypePresFooterShape, // "com.sun.star.presentation.FooterShape" + XmlShapeTypePresSlideNumberShape, // "com.sun.star.presentation.SlideNumberShape" + XmlShapeTypePresDateTimeShape, // "com.sun.star.presentation.DateTimeShape" + + XmlShapeTypeDrawCustomShape, // "com.sun.star.drawing.CustomShape" + XmlShapeTypeDrawMediaShape, // "com.sun.star.drawing.MediaShape" + XmlShapeTypePresMediaShape, // "com.sun.star.presentation.MediaShape" + + XmlShapeTypeDrawTableShape, // "com.sun.star.drawing.TableShape" + + XmlShapeTypeNotYetSet +}; + +/** caches style and type info after a collectShapeAutostyle for later use in exportShape */ +struct ImplXMLShapeExportInfo +{ + rtl::OUString msStyleName; + rtl::OUString msTextStyleName; + sal_Int32 mnFamily; + XmlShapeType meShapeType; + + com::sun::star::uno::Reference< com::sun::star::drawing::XShape > xCustomShapeReplacement; + + ImplXMLShapeExportInfo() : mnFamily( XML_STYLE_FAMILY_SD_GRAPHICS_ID ), meShapeType( XmlShapeTypeNotYetSet ) {} +}; + +/** a vector for shape style and type cache information */ +typedef std::vector< ImplXMLShapeExportInfo > ImplXMLShapeExportInfoVector; + +/** a map to store all cache data for already collected XShapes */ +typedef std::map< com::sun::star::uno::Reference < com::sun::star::drawing::XShapes >, ImplXMLShapeExportInfoVector > ShapesInfos; + +////////////////////////////////////////////////////////////////////////////// +// predeclarations + +class SvXMLExport; +class SvXMLExportPropertyMapper; + +namespace basegfx +{ + class B2DTuple; + class B2DHomMatrix; +} // end of namespace basegfx + +class XMLOFF_DLLPUBLIC XMLShapeExport : public UniRefBase +{ +private: + + SvXMLExport& mrExport; + UniReference< XMLPropertyHandlerFactory > mxSdPropHdlFactory; + UniReference< SvXMLExportPropertyMapper > mxPropertySetMapper; + UniReference< XMLAnimationsExporter > mxAnimationsExporter; + sal_Int32 mnNextUniqueShapeId; + ShapesInfos maShapesInfos; + ShapesInfos::iterator maCurrentShapesIter; + sal_Bool mbExportLayer; + ImplXMLShapeExportInfoVector maShapeInfos; + ImplXMLShapeExportInfoVector::iterator maCurrentInfo; + rtl::OUString msPresentationStylePrefix; + + // #88546# possibility to swich progress bar handling on/off + sal_Bool mbHandleProgressBar; + + rtl::Reference< XMLTableExport > mxShapeTableExport; + +protected: + SvXMLExport& GetExport() { return mrExport; } + const SvXMLExport& GetExport() const { return mrExport; } +private: + + SAL_DLLPRIVATE UniReference< SvXMLExportPropertyMapper > GetPropertySetMapper() const { return mxPropertySetMapper; } + + const rtl::OUString msZIndex; + const rtl::OUString msPrintable; + const rtl::OUString msVisible; + + const rtl::OUString msEmptyPres; + const rtl::OUString msModel; + const rtl::OUString msStartShape; + const rtl::OUString msEndShape; + const rtl::OUString msOnClick; +#ifdef ISSUE66550_HLINK_FOR_SHAPES + const rtl::OUString msOnAction; + const rtl::OUString msAction; + const rtl::OUString msURL; +#endif + const rtl::OUString msEventType; + const rtl::OUString msPresentation; + const rtl::OUString msMacroName; + const rtl::OUString msScript; + const rtl::OUString msLibrary; + const rtl::OUString msClickAction; + const rtl::OUString msBookmark; + const rtl::OUString msEffect; + const rtl::OUString msPlayFull; + const rtl::OUString msVerb; + const rtl::OUString msSoundURL; + const rtl::OUString msSpeed; + const rtl::OUString msStarBasic; + + rtl::OUStringBuffer msBuffer; + + SAL_DLLPRIVATE void ImpCalcShapeType(const com::sun::star::uno::Reference< com::sun::star::drawing::XShape >& xShape, XmlShapeType& eShapeType); + + SAL_DLLPRIVATE void ImpExportNewTrans(const com::sun::star::uno::Reference< com::sun::star::beans::XPropertySet >& xPropSet, sal_Int32 nFeatures, com::sun::star::awt::Point* pRefPoint); + SAL_DLLPRIVATE void ImpExportNewTrans_GetB2DHomMatrix(::basegfx::B2DHomMatrix& rMatrix, const com::sun::star::uno::Reference< com::sun::star::beans::XPropertySet >& xPropSet); + SAL_DLLPRIVATE void ImpExportNewTrans_DecomposeAndRefPoint(const ::basegfx::B2DHomMatrix& rMat, ::basegfx::B2DTuple& rTRScale, double& fTRShear, double& fTRRotate, ::basegfx::B2DTuple& rTRTranslate, com::sun::star::awt::Point* pRefPoint); + SAL_DLLPRIVATE void ImpExportNewTrans_FeaturesAndWrite(::basegfx::B2DTuple& rTRScale, double fTRShear, double fTRRotate, ::basegfx::B2DTuple& rTRTranslate, const sal_Int32 nFeatures); + SAL_DLLPRIVATE sal_Bool ImpExportPresentationAttributes( const com::sun::star::uno::Reference< com::sun::star::beans::XPropertySet >& xPropSet, const rtl::OUString& rClass ); + SAL_DLLPRIVATE void ImpExportText( const com::sun::star::uno::Reference< com::sun::star::drawing::XShape >& xShape ); + SAL_DLLPRIVATE void ImpExportEvents( const com::sun::star::uno::Reference< com::sun::star::drawing::XShape >& xShape ); + SAL_DLLPRIVATE void ImpExportDescription( const com::sun::star::uno::Reference< com::sun::star::drawing::XShape >& xShape ); // #i68101# + SAL_DLLPRIVATE void ImpExportGluePoints( const com::sun::star::uno::Reference< com::sun::star::drawing::XShape >& xShape ); + + // single shape exporters + SAL_DLLPRIVATE void ImpExportGroupShape( const com::sun::star::uno::Reference< com::sun::star::drawing::XShape >& xShape, XmlShapeType eShapeType, sal_Int32 nFeatures = SEF_DEFAULT, com::sun::star::awt::Point* pRefPoint = NULL ); + SAL_DLLPRIVATE void ImpExport3DSceneShape( const com::sun::star::uno::Reference< com::sun::star::drawing::XShape >& xShape, XmlShapeType eShapeType, sal_Int32 nFeatures = SEF_DEFAULT, com::sun::star::awt::Point* pRefPoint = NULL ); + SAL_DLLPRIVATE void ImpExportRectangleShape( const com::sun::star::uno::Reference< com::sun::star::drawing::XShape >& xShape, XmlShapeType eShapeType, sal_Int32 nFeatures = SEF_DEFAULT, com::sun::star::awt::Point* pRefPoint = NULL ); + SAL_DLLPRIVATE void ImpExportLineShape(const com::sun::star::uno::Reference< com::sun::star::drawing::XShape >& xShape, XmlShapeType eShapeType, sal_Int32 nFeatures = SEF_DEFAULT, com::sun::star::awt::Point* pRefPoint = NULL ); + SAL_DLLPRIVATE void ImpExportEllipseShape(const com::sun::star::uno::Reference< com::sun::star::drawing::XShape >& xShape, XmlShapeType eShapeType, sal_Int32 nFeatures = SEF_DEFAULT, com::sun::star::awt::Point* pRefPoint = NULL ); + SAL_DLLPRIVATE void ImpExportPolygonShape(const com::sun::star::uno::Reference< com::sun::star::drawing::XShape >& xShape, XmlShapeType eShapeType, sal_Int32 nFeatures = SEF_DEFAULT, com::sun::star::awt::Point* pRefPoint = NULL ); + SAL_DLLPRIVATE void ImpExportTextBoxShape(const com::sun::star::uno::Reference< com::sun::star::drawing::XShape >& xShape, XmlShapeType eShapeType, sal_Int32 nFeatures = SEF_DEFAULT, com::sun::star::awt::Point* pRefPoint = NULL ); + SAL_DLLPRIVATE void ImpExportGraphicObjectShape(const com::sun::star::uno::Reference< com::sun::star::drawing::XShape >& xShape, XmlShapeType eShapeType, sal_Int32 nFeatures = SEF_DEFAULT, com::sun::star::awt::Point* pRefPoint = NULL ); + SAL_DLLPRIVATE void ImpExportChartShape(const com::sun::star::uno::Reference< com::sun::star::drawing::XShape >& xShape, XmlShapeType eShapeType, sal_Int32 nFeatures = SEF_DEFAULT, com::sun::star::awt::Point* pRefPoint = NULL, SvXMLAttributeList* pAttrList = NULL ); + SAL_DLLPRIVATE void ImpExportControlShape(const com::sun::star::uno::Reference< com::sun::star::drawing::XShape >& xShape, XmlShapeType eShapeType, sal_Int32 nFeatures = SEF_DEFAULT, com::sun::star::awt::Point* pRefPoint = NULL ); + SAL_DLLPRIVATE void ImpExportConnectorShape(const com::sun::star::uno::Reference< com::sun::star::drawing::XShape >& xShape, XmlShapeType eShapeType, sal_Int32 nFeatures = SEF_DEFAULT, com::sun::star::awt::Point* pRefPoint = NULL ); + SAL_DLLPRIVATE void ImpExportMeasureShape(const com::sun::star::uno::Reference< com::sun::star::drawing::XShape >& xShape, XmlShapeType eShapeType, sal_Int32 nFeatures = SEF_DEFAULT, com::sun::star::awt::Point* pRefPoint = NULL ); + SAL_DLLPRIVATE void ImpExportOLE2Shape(const com::sun::star::uno::Reference< com::sun::star::drawing::XShape >& xShape, XmlShapeType eShapeType, sal_Int32 nFeatures = SEF_DEFAULT, com::sun::star::awt::Point* pRefPoint = NULL, SvXMLAttributeList* pAttrList = NULL ); + SAL_DLLPRIVATE void ImpExportPageShape(const com::sun::star::uno::Reference< com::sun::star::drawing::XShape >& xShape, XmlShapeType eShapeType, sal_Int32 nFeatures = SEF_DEFAULT, com::sun::star::awt::Point* pRefPoint = NULL ); + SAL_DLLPRIVATE void ImpExportCaptionShape(const com::sun::star::uno::Reference< com::sun::star::drawing::XShape >& xShape, XmlShapeType eShapeType, sal_Int32 nFeatures = SEF_DEFAULT, com::sun::star::awt::Point* pRefPoint = NULL ); + SAL_DLLPRIVATE void ImpExport3DShape(const com::sun::star::uno::Reference< com::sun::star::drawing::XShape >& xShape, XmlShapeType eShapeType, sal_Int32 nFeatures = SEF_DEFAULT, com::sun::star::awt::Point* pRefPoint = NULL ); + SAL_DLLPRIVATE void ImpExportFrameShape( const com::sun::star::uno::Reference< com::sun::star::drawing::XShape >& xShape, XmlShapeType eShapeType, sal_Int32 nFeatures = SEF_DEFAULT, com::sun::star::awt::Point* pRefPoint = NULL ); + SAL_DLLPRIVATE void ImpExportPluginShape( const com::sun::star::uno::Reference< com::sun::star::drawing::XShape >& xShape, XmlShapeType eShapeType, sal_Int32 nFeatures = SEF_DEFAULT, com::sun::star::awt::Point* pRefPoint = NULL ); + SAL_DLLPRIVATE void ImpExportAppletShape( const com::sun::star::uno::Reference< com::sun::star::drawing::XShape >& xShape, XmlShapeType eShapeType, sal_Int32 nFeatures = SEF_DEFAULT, com::sun::star::awt::Point* pRefPoint = NULL ); + SAL_DLLPRIVATE void ImpExportCustomShape( const com::sun::star::uno::Reference< com::sun::star::drawing::XShape >& xShape, XmlShapeType eShapeType, sal_Int32 nFeatures = SEF_DEFAULT, com::sun::star::awt::Point* pRefPoint = NULL ); + SAL_DLLPRIVATE void ImpExportMediaShape( const com::sun::star::uno::Reference< com::sun::star::drawing::XShape >& xShape, XmlShapeType eShapeType, sal_Int32 nFeatures = SEF_DEFAULT, com::sun::star::awt::Point* pRefPoint = NULL ); + SAL_DLLPRIVATE void ImpExportTableShape(const com::sun::star::uno::Reference< com::sun::star::drawing::XShape >& xShape, XmlShapeType eShapeType, sal_Int32 nFeatures = SEF_DEFAULT, com::sun::star::awt::Point* pRefPoint = NULL ); +public: + XMLShapeExport(SvXMLExport& rExp, SvXMLExportPropertyMapper *pExtMapper=0 ); + virtual ~XMLShapeExport(); + + // This method collects all automatic styles for the given XShape + void collectShapeAutoStyles( + const com::sun::star::uno::Reference < com::sun::star::drawing::XShape >& xShape); + + // This method exports the given XShape + void exportShape( + const com::sun::star::uno::Reference < com::sun::star::drawing::XShape >& xShape, + sal_Int32 nFeatures = SEF_DEFAULT, + com::sun::star::awt::Point* pRefPoint = NULL, + SvXMLAttributeList* pAttrList = NULL + ); + + // This method collects all automatic styles for the shapes inside the given XShapes collection + void collectShapesAutoStyles( + const com::sun::star::uno::Reference < com::sun::star::drawing::XShapes >& xShapes); + + // This method exports all XShape inside the given XShapes collection + void exportShapes( + const com::sun::star::uno::Reference < com::sun::star::drawing::XShapes >& xShapes, + sal_Int32 nFeatures = SEF_DEFAULT, + com::sun::star::awt::Point* pRefPoint = NULL + ); + + /** initializes some internal structures for fast access to the given XShapes collection + + <p>This method has to be called before you use exportShape or collectShapeAutoStyles. + It is automaticly called if you use collectShapesAutoStyles and exportShapes. + + @see collectShapeAutoStyles + @see exportShape + @see collectShapesAutoStyles + @see exportShapes + */ + void seekShapes( + const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes >& xShapes ) throw(); + + void exportAutoStyles(); + + /** sets a new reference to an XMLAnimationExporter. + If this is a non NULL reference, the animation information from all shapes given to exportShape() + from now on are collected. + */ + void setAnimationsExporter( UniReference< XMLAnimationsExporter > xAnimExport ) { mxAnimationsExporter = xAnimExport; } + + /** returns the last set XMLAnimationExport */ + UniReference< XMLAnimationsExporter > getAnimationsExporter() const { return mxAnimationsExporter; } + + /// returns the export property mapper for external chaining + static SvXMLExportPropertyMapper* CreateShapePropMapper( SvXMLExport& rExport ); + + void enableLayerExport( sal_Bool bEnable = sal_True ) { mbExportLayer = bEnable; } + sal_Bool IsLayerExportEnabled() const { return mbExportLayer; } + + // #88546# + /** defines if the export should increment the progress bar or not */ + void enableHandleProgressBar( sal_Bool bEnable = sal_True ) { mbHandleProgressBar = bEnable; } + sal_Bool IsHandleProgressBarEnabled() const { return mbHandleProgressBar; } + + void setPresentationStylePrefix( const rtl::OUString& rPrefix ) { msPresentationStylePrefix = rPrefix; } + + /** helper for chart that adds all attributes of a 3d scene element to the export */ + void export3DSceneAttributes( const com::sun::star::uno::Reference< com::sun::star::beans::XPropertySet >& xPropSet ); + + /** helper for chart that exports all lamps from the propertyset */ + void export3DLamps( const com::sun::star::uno::Reference< com::sun::star::beans::XPropertySet >& xPropSet ); + + /** sj: replacing CustomShapes with standard objects that are also supported in OpenOffice.org format */ + com::sun::star::uno::Reference < com::sun::star::drawing::XShape > checkForCustomShapeReplacement( + const com::sun::star::uno::Reference < com::sun::star::drawing::XShape >& ); + + /** helper to export the style for graphic defaults */ + void ExportGraphicDefaults(); + + /** is called before a shape element for the given XShape is exported */ + virtual void onExport( const com::sun::star::uno::Reference < com::sun::star::drawing::XShape >& xShape ); + + const rtl::Reference< XMLTableExport >& GetShapeTableExport(); +}; + + +#endif diff --git a/xmloff/inc/xmloff/shapeimport.hxx b/xmloff/inc/xmloff/shapeimport.hxx new file mode 100644 index 000000000000..f51f46a95e4d --- /dev/null +++ b/xmloff/inc/xmloff/shapeimport.hxx @@ -0,0 +1,439 @@ +/************************************************************************* + * + * 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_SHAPEIMPORT_HXX_ +#define _XMLOFF_SHAPEIMPORT_HXX_ + +#include "sal/config.h" +#include "xmloff/dllapi.h" +#include <com/sun/star/beans/XPropertySet.hpp> +#include <com/sun/star/frame/XModel.hpp> +#include <com/sun/star/xml/sax/XAttributeList.hpp> +#include <com/sun/star/drawing/XShapes.hpp> +#include <com/sun/star/drawing/HomogenMatrix.hpp> +#include <com/sun/star/drawing/ProjectionMode.hpp> +#include <com/sun/star/drawing/ShadeMode.hpp> +#include <tools/color.hxx> +#include <xmloff/uniref.hxx> +#include <xmloff/xmlictxt.hxx> + +#include "xmloff/table/XMLTableImport.hxx" +#include <basegfx/vector/b3dvector.hxx> + +class SvXMLImport; +class SvXMLImportContext; +class SvXMLTokenMap; +class SvXMLStylesContext; +class XMLSdPropHdlFactory; +class XMLPropertySetMapper; +class SvXMLImportPropertyMapper; + +////////////////////////////////////////////////////////////////////////////// + +enum SdXMLGroupShapeElemTokenMap +{ + XML_TOK_GROUP_GROUP, + XML_TOK_GROUP_RECT, + XML_TOK_GROUP_LINE, + XML_TOK_GROUP_CIRCLE, + XML_TOK_GROUP_ELLIPSE, + XML_TOK_GROUP_POLYGON, + XML_TOK_GROUP_POLYLINE, + XML_TOK_GROUP_PATH, + + XML_TOK_GROUP_CONTROL, + XML_TOK_GROUP_CONNECTOR, + XML_TOK_GROUP_MEASURE, + XML_TOK_GROUP_PAGE, + XML_TOK_GROUP_CAPTION, + + XML_TOK_GROUP_CHART, + XML_TOK_GROUP_3DSCENE, + + XML_TOK_GROUP_FRAME, + + XML_TOK_GROUP_CUSTOM_SHAPE, + + XML_TOK_GROUP_ANNOTATION, + + XML_TOK_GROUP_A, + + XML_TOK_GROUP_LAST +}; + +enum SdXMLFrameShapeElemTokenMap +{ + XML_TOK_FRAME_TEXT_BOX, + XML_TOK_FRAME_IMAGE, + XML_TOK_FRAME_OBJECT, + XML_TOK_FRAME_OBJECT_OLE, + XML_TOK_FRAME_PLUGIN, + XML_TOK_FRAME_FRAME, + XML_TOK_FRAME_FLOATING_FRAME, + XML_TOK_FRAME_APPLET, + XML_TOK_FRAME_TABLE, + + XML_TOK_FRAME_LAST +}; + +enum SdXML3DSceneShapeElemTokenMap +{ + XML_TOK_3DSCENE_3DSCENE, + XML_TOK_3DSCENE_3DCUBE, + XML_TOK_3DSCENE_3DSPHERE, + XML_TOK_3DSCENE_3DLATHE, + XML_TOK_3DSCENE_3DEXTRUDE, + + XML_TOK_3DSCENE_LAST +}; + +enum SdXMLShapeAttrTokenMap +{ + XML_TOK_SHAPE_NAME, + XML_TOK_SHAPE_DRAWSTYLE_NAME_GRAPHICS, + XML_TOK_SHAPE_PRESENTATION_CLASS, + XML_TOK_SHAPE_DRAWSTYLE_NAME_PRESENTATION, + XML_TOK_SHAPE_TRANSFORM, + XML_TOK_SHAPE_IS_PLACEHOLDER, + XML_TOK_SHAPE_IS_USER_TRANSFORMED +}; + +enum SdXML3DObjectAttrTokenMap +{ + XML_TOK_3DOBJECT_DRAWSTYLE_NAME, + XML_TOK_3DOBJECT_TRANSFORM +}; + +enum SdXML3DPolygonBasedAttrTokenMap +{ + XML_TOK_3DPOLYGONBASED_VIEWBOX, + XML_TOK_3DPOLYGONBASED_D +}; + +enum SdXML3DCubeObjectAttrTokenMap +{ + XML_TOK_3DCUBEOBJ_MINEDGE, + XML_TOK_3DCUBEOBJ_MAXEDGE +}; + +enum SdXML3DSphereObjectAttrTokenMap +{ + XML_TOK_3DSPHEREOBJ_CENTER, + XML_TOK_3DSPHEREOBJ_SIZE +}; + +enum SdXMLPolygonShapeAttrTokenMap +{ + XML_TOK_POLYGONSHAPE_VIEWBOX, + XML_TOK_POLYGONSHAPE_POINTS +}; + +enum SdXMLPathShapeAttrTokenMap +{ + XML_TOK_PATHSHAPE_VIEWBOX, + XML_TOK_PATHSHAPE_D +}; + +enum SdXML3DSceneShapeAttrTokenMap +{ + XML_TOK_3DSCENESHAPE_TRANSFORM, + XML_TOK_3DSCENESHAPE_VRP, + XML_TOK_3DSCENESHAPE_VPN, + XML_TOK_3DSCENESHAPE_VUP, + XML_TOK_3DSCENESHAPE_PROJECTION, + XML_TOK_3DSCENESHAPE_DISTANCE, + XML_TOK_3DSCENESHAPE_FOCAL_LENGTH, + XML_TOK_3DSCENESHAPE_SHADOW_SLANT, + XML_TOK_3DSCENESHAPE_SHADE_MODE, + XML_TOK_3DSCENESHAPE_AMBIENT_COLOR, + XML_TOK_3DSCENESHAPE_LIGHTING_MODE +}; + +enum SdXML3DLightAttrTokenMap +{ + XML_TOK_3DLIGHT_DIFFUSE_COLOR, + XML_TOK_3DLIGHT_DIRECTION, + XML_TOK_3DLIGHT_ENABLED, + XML_TOK_3DLIGHT_SPECULAR +}; + +////////////////////////////////////////////////////////////////////////////// +// dr3d:3dlight context + +class SdXML3DLightContext: public SvXMLImportContext +{ + // local parameters which need to be read + Color maDiffuseColor; + ::basegfx::B3DVector maDirection; + BOOL mbEnabled; + BOOL mbSpecular; + +public: + SdXML3DLightContext( + SvXMLImport& rImport, + sal_uInt16 nPrfx, + const rtl::OUString& rLName, + const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList >& xAttrList); + virtual ~SdXML3DLightContext(); + + const Color& GetDiffuseColor() { return maDiffuseColor; } + const ::basegfx::B3DVector& GetDirection() { return maDirection; } + BOOL GetEnabled() { return mbEnabled; } + BOOL GetSpecular() { return mbSpecular; } +}; + +////////////////////////////////////////////////////////////////////////////// + +DECLARE_LIST(Imp3DLightList, SdXML3DLightContext*) + +class SdXML3DSceneAttributesHelper +{ +protected: + SvXMLImport& mrImport; + + // list for local light contexts + Imp3DLightList maList; + + // local parameters which need to be read + com::sun::star::drawing::HomogenMatrix mxHomMat; + BOOL mbSetTransform; + + com::sun::star::drawing::ProjectionMode mxPrjMode; + sal_Int32 mnDistance; + sal_Int32 mnFocalLength; + sal_Int32 mnShadowSlant; + com::sun::star::drawing::ShadeMode mxShadeMode; + Color maAmbientColor; + BOOL mbLightingMode; + + ::basegfx::B3DVector maVRP; + ::basegfx::B3DVector maVPN; + ::basegfx::B3DVector maVUP; + BOOL mbVRPUsed; + BOOL mbVPNUsed; + BOOL mbVUPUsed; + +public: + SdXML3DSceneAttributesHelper( SvXMLImport& rImporter ); + ~SdXML3DSceneAttributesHelper(); + + /** creates a 3d ligth context and adds it to the internal list for later processing */ + SvXMLImportContext * create3DLightContext( sal_uInt16 nPrfx, const rtl::OUString& rLName, const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList >& xAttrList); + + /** this should be called for each scene attribute */ + void processSceneAttribute( sal_uInt16 nPrefix, const ::rtl::OUString& rLocalName, const ::rtl::OUString& rValue ); + + /** this sets the scene attributes at this propertyset */ + void setSceneAttributes( const com::sun::star::uno::Reference< com::sun::star::beans::XPropertySet >& xPropSet ); +}; + +////////////////////////////////////////////////////////////////////////////// + +class SvXMLShapeContext : public SvXMLImportContext +{ +protected: + com::sun::star::uno::Reference< com::sun::star::drawing::XShape > mxShape; + sal_Bool mbTemporaryShape; + rtl::OUString msHyperlink; + +public: + SvXMLShapeContext( SvXMLImport& rImp, USHORT nPrfx, + const ::rtl::OUString& rLName, sal_Bool bTemporaryShape ) : SvXMLImportContext( rImp, nPrfx, rLName ), mbTemporaryShape(bTemporaryShape) {} + + TYPEINFO(); + + const com::sun::star::uno::Reference< com::sun::star::drawing::XShape >& getShape() const { return mxShape; } + + void setHyperlink( const ::rtl::OUString& rHyperlink ); +}; + +////////////////////////////////////////////////////////////////////////////// + +class ShapeSortContext; +struct XMLShapeImportHelperImpl; +struct XMLShapeImportPageContextImpl; + +class XMLOFF_DLLPUBLIC XMLShapeImportHelper : public UniRefBase +{ + XMLShapeImportHelperImpl* mpImpl; + + XMLShapeImportPageContextImpl* mpPageContext; + + com::sun::star::uno::Reference< com::sun::star::frame::XModel > mxModel; + + // PropertySetMappers and factory + XMLSdPropHdlFactory* mpSdPropHdlFactory; + SvXMLImportPropertyMapper* mpPropertySetMapper; + SvXMLImportPropertyMapper* mpPresPagePropsMapper; + + // contexts for Style and AutoStyle import + SvXMLStylesContext* mpStylesContext; + SvXMLStylesContext* mpAutoStylesContext; + + // contexts for xShape contents TokenMaps + SvXMLTokenMap* mpGroupShapeElemTokenMap; + SvXMLTokenMap* mpFrameShapeElemTokenMap; + SvXMLTokenMap* mp3DSceneShapeElemTokenMap; + SvXMLTokenMap* mp3DObjectAttrTokenMap; + SvXMLTokenMap* mp3DPolygonBasedAttrTokenMap; + SvXMLTokenMap* mp3DCubeObjectAttrTokenMap; + SvXMLTokenMap* mp3DSphereObjectAttrTokenMap; + SvXMLTokenMap* mp3DSceneShapeAttrTokenMap; + SvXMLTokenMap* mp3DLightAttrTokenMap; + SvXMLTokenMap* mpPathShapeAttrTokenMap; + SvXMLTokenMap* mpPolygonShapeAttrTokenMap; + + const ::rtl::OUString msStartShape; + const ::rtl::OUString msEndShape; + const ::rtl::OUString msStartGluePointIndex; + const ::rtl::OUString msEndGluePointIndex; + + rtl::Reference< XMLTableImport > mxShapeTableImport; + +protected: + SvXMLImport& mrImporter; + +public: + XMLShapeImportHelper( SvXMLImport& rImporter, + const com::sun::star::uno::Reference< com::sun::star::frame::XModel>& rModel, + SvXMLImportPropertyMapper *pExtMapper=0 ); + + ~XMLShapeImportHelper(); + + SvXMLShapeContext* CreateGroupChildContext( + SvXMLImport& rImport, sal_uInt16 nPrefix, const rtl::OUString& rLocalName, + const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList >& xAttrList, + com::sun::star::uno::Reference< com::sun::star::drawing::XShapes >& rShapes, + sal_Bool bTemporaryShape = sal_False); + + SvXMLShapeContext* CreateFrameChildContext( + SvXMLImport& rImport, sal_uInt16 nPrefix, const rtl::OUString& rLocalName, + const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList >& xAttrList, + com::sun::star::uno::Reference< com::sun::star::drawing::XShapes >& rShapes, + const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList >& xFrameAttrList); + SvXMLImportContext* CreateFrameChildContext( + SvXMLImportContext *pThisContext, USHORT nPrefix, const rtl::OUString& rLocalName, + const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList >& xAttrList ); + + SvXMLShapeContext* Create3DSceneChildContext( + SvXMLImport& rImport, sal_uInt16 nPrefix, const rtl::OUString& rLocalName, + const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList >& xAttrList, + com::sun::star::uno::Reference< com::sun::star::drawing::XShapes >& rShapes); + + const SvXMLTokenMap& GetGroupShapeElemTokenMap(); + const SvXMLTokenMap& GetFrameShapeElemTokenMap(); + const SvXMLTokenMap& Get3DSceneShapeElemTokenMap(); + const SvXMLTokenMap& Get3DObjectAttrTokenMap(); + const SvXMLTokenMap& Get3DPolygonBasedAttrTokenMap(); + const SvXMLTokenMap& Get3DCubeObjectAttrTokenMap(); + const SvXMLTokenMap& Get3DSphereObjectAttrTokenMap(); + const SvXMLTokenMap& Get3DSceneShapeAttrTokenMap(); + const SvXMLTokenMap& Get3DLightAttrTokenMap(); + const SvXMLTokenMap& GetPathShapeAttrTokenMap(); + const SvXMLTokenMap& GetPolygonShapeAttrTokenMap(); + + // Styles and AutoStyles contexts + SvXMLStylesContext* GetStylesContext() const { return mpStylesContext; } + void SetStylesContext(SvXMLStylesContext* pNew); + SvXMLStylesContext* GetAutoStylesContext() const { return mpAutoStylesContext; } + void SetAutoStylesContext(SvXMLStylesContext* pNew); + + // get factories and mappers + SvXMLImportPropertyMapper* GetPropertySetMapper() const { return mpPropertySetMapper; } + SvXMLImportPropertyMapper* GetPresPagePropsMapper() const { return mpPresPagePropsMapper; } + + // this function is called whenever the implementation classes like to add this new + // shape to the given XShapes. + virtual void addShape( + com::sun::star::uno::Reference< com::sun::star::drawing::XShape >& rShape, + const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList >& xAttrList, + com::sun::star::uno::Reference< com::sun::star::drawing::XShapes >& rShapes); + + // this function is called whenever the implementation classes have finished importing + // a shape to the given XShapes. The shape is already inserted into its XShapes and + // all properties and styles are set. + virtual void finishShape( + com::sun::star::uno::Reference< com::sun::star::drawing::XShape >& rShape, + const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList >& xAttrList, + com::sun::star::uno::Reference< com::sun::star::drawing::XShapes >& rShapes); + + // helper functions for z-order sorting + void pushGroupForSorting( com::sun::star::uno::Reference< com::sun::star::drawing::XShapes >& rShapes ); + void popGroupAndSort(); + + void shapeWithZIndexAdded( com::sun::star::uno::Reference< com::sun::star::drawing::XShape >& rShape, + sal_Int32 nZIndex ); + + void addShapeConnection( com::sun::star::uno::Reference< com::sun::star::drawing::XShape >& rConnectorShape, + sal_Bool bStart, + const rtl::OUString& rDestShapeId, + sal_Int32 nDestGlueId ); + + /** adds a mapping for a glue point identifier from an xml file to the identifier created after inserting + the new glue point into the core. The saved mappings can be retrieved by getGluePointId() */ + void addGluePointMapping( com::sun::star::uno::Reference< com::sun::star::drawing::XShape >& xShape, + sal_Int32 nSourceId, sal_Int32 nDestinnationId ); + + /** moves all current DestinationId's for rXShape by n */ + void moveGluePointMapping( const com::sun::star::uno::Reference< com::sun::star::drawing::XShape >& xShape, const sal_Int32 n ); + + /** retrieves a mapping for a glue point identifier from the current xml file to the identifier created after + inserting the new glue point into the core. The mapping must be initialized first with addGluePointMapping() */ + sal_Int32 getGluePointId( com::sun::star::uno::Reference< com::sun::star::drawing::XShape >& xShape, sal_Int32 nSourceId ); + + /** this method must be calling before the first shape is imported for the given page. + Calls to this method can be nested */ + void startPage( com::sun::star::uno::Reference< com::sun::star::drawing::XShapes >& rShapes ); + + /** this method must be calling after the last shape is imported for the given page + Calls to this method can be nested */ + void endPage( com::sun::star::uno::Reference< com::sun::star::drawing::XShapes >& rShapes ); + + void restoreConnections(); + + /** creates a property mapper for external chaining */ + static SvXMLImportPropertyMapper* CreateShapePropMapper( + const com::sun::star::uno::Reference< com::sun::star::frame::XModel>& rModel, SvXMLImport& rImport ); + + /** creates a shape property set mapper that can be used for non shape elements */ + static SvXMLImportPropertyMapper* CreateExternalShapePropMapper( + const com::sun::star::uno::Reference< com::sun::star::frame::XModel>& rModel, SvXMLImport& rImport ); + + // #88546# + /** defines if the import should increment the progress bar or not */ + void enableHandleProgressBar( sal_Bool bEnable = sal_True ); + sal_Bool IsHandleProgressBarEnabled() const; + + /** queries the capability of the current model to create presentation shapes */ + sal_Bool IsPresentationShapesSupported(); + + XMLSdPropHdlFactory* GetSdPropHdlFactory() const { return mpSdPropHdlFactory; } + + const rtl::Reference< XMLTableImport >& GetShapeTableImport(); +}; + +#endif // _XMLOFF_SHAPEIMPORT_HXX_ diff --git a/xmloff/inc/xmloff/styleexp.hxx b/xmloff/inc/xmloff/styleexp.hxx new file mode 100644 index 000000000000..10e9db410430 --- /dev/null +++ b/xmloff/inc/xmloff/styleexp.hxx @@ -0,0 +1,142 @@ +/************************************************************************* + * + * 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_STYLEEXP_HXX_ +#define _XMLOFF_STYLEEXP_HXX_ + +#include "sal/config.h" +#include "xmloff/dllapi.h" +#include <rtl/ustring.hxx> +#include <com/sun/star/uno/Reference.h> + +#ifndef _VCL_MAPUNIT_HXX +//#include <tools/mapunit.hxx> +#endif +#include <xmloff/uniref.hxx> + +namespace com { namespace sun { namespace star +{ + namespace style + { + class XStyle; + } + namespace beans + { + class XPropertySet; + } + namespace container //#outline level,add by zhaojianwei + { + class XNameAccess; + } //<-end,zhaojianwei + +} } } + +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; + const ::rtl::OUString sOutlineLevel; //#outline level,add by zhaojianwei + + SvXMLExport& GetExport() { return rExport; } + const SvXMLExport& GetExport() const { return rExport; } + +private: + + const ::rtl::OUString sPoolStyleName; + + SvXMLAutoStylePoolP *pAutoStylePool; + +protected: + + //virtual sal_Bool exportStyle( //#outline level,zhaojianwei + // 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 sal_Bool exportStyle( //add by zhaojianwei + const ::com::sun::star::uno::Reference< + ::com::sun::star::style::XStyle > & rStyle, + const ::rtl::OUString& rXMLFamily, + const UniReference < SvXMLExportPropertyMapper >& rPropMapper, + const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > & xStyles, + const ::rtl::OUString* pPrefix = 0L ); //<-end,zhaojianwei + + 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/table/XMLTableExport.hxx b/xmloff/inc/xmloff/table/XMLTableExport.hxx new file mode 100644 index 000000000000..86906a91ec06 --- /dev/null +++ b/xmloff/inc/xmloff/table/XMLTableExport.hxx @@ -0,0 +1,112 @@ +/************************************************************************* + * + * 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_XMLTABLEEXPORT_HXX +#define _XMLOFF_XMLTABLEEXPORT_HXX + +#include "sal/config.h" + +#include <sal/types.h> +#include <rtl/ustring.hxx> +#include <rtl/ustrbuf.hxx> + +#include <boost/shared_ptr.hpp> +#include <map> +#include <vector> + +#include <com/sun/star/table/XTableColumns.hpp> +#include <com/sun/star/table/XColumnRowRange.hpp> +#include <com/sun/star/table/XCell.hpp> +#include <com/sun/star/text/XText.hpp> +#include <com/sun/star/container/XIndexAccess.hpp> + +#include <rtl/ref.hxx> + +#include "xmloff/dllapi.h" +#include "xmloff/uniref.hxx" +#include "xmloff/xmlprmap.hxx" +#include "xmloff/xmlexppr.hxx" + + +////////////////////////////////////////////////////////////////////////////// +// predeclarations + +class SvXMLExport; +class SvXMLExportPropertyMapper; + +typedef ::std::map< const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >, rtl::OUString > TableStyleMap; + +struct XMLTableInfo +{ + TableStyleMap maColumnStyleMap; + TableStyleMap maRowStyleMap; + TableStyleMap maCellStyleMap; + std::vector< ::rtl::OUString > maDefaultRowCellStyles; +}; + +typedef ::std::map< const ::com::sun::star::uno::Reference< com::sun::star::table::XColumnRowRange >, boost::shared_ptr< XMLTableInfo > > TableInfoMap; + +class XMLOFF_DLLPUBLIC XMLTableExport : public UniRefBase +{ +public: + XMLTableExport(SvXMLExport& rExp, const rtl::Reference< SvXMLExportPropertyMapper >& xCellExportPropertySetMapper, const rtl::Reference< XMLPropertyHandlerFactory >& xFactoryRef ); + virtual ~XMLTableExport(); + + // This method collects all automatic styles for the given table + void collectTableAutoStyles(const com::sun::star::uno::Reference < com::sun::star::table::XColumnRowRange >& xColumnRowRange); + + // This method exports the given table + void exportTable(const com::sun::star::uno::Reference < com::sun::star::table::XColumnRowRange >& xColumnRowRange); + + // export the styles from the cell style family + void exportTableStyles(); + + // Export the collected automatic styles + void exportAutoStyles(); + +private: + void exportTableTemplates(); + + SvXMLExport& mrExport; + rtl::Reference< SvXMLExportPropertyMapper > mxCellExportPropertySetMapper; + rtl::Reference< SvXMLExportPropertyMapper > mxRowExportPropertySetMapper; + rtl::Reference< SvXMLExportPropertyMapper > mxColumnExportPropertySetMapper; + TableInfoMap maTableInfoMap; + bool mbExportTables; + +protected: + SvXMLExport& GetExport() { return mrExport; } + const SvXMLExport& GetExport() const { return mrExport; } +private: + + SAL_DLLPRIVATE void ImpExportText( const com::sun::star::uno::Reference < com::sun::star::table::XCell >& xCell ); + + void ExportCell( const com::sun::star::uno::Reference < com::sun::star::table::XCell >& xCell, const boost::shared_ptr< XMLTableInfo >& pTableInfo, const ::rtl::OUString& sDefaultCellStyle ); + void ExportTableColumns( const com::sun::star::uno::Reference < com::sun::star::container::XIndexAccess >& xtableColumns, const boost::shared_ptr< XMLTableInfo >& pTableInfo ); + +}; + +#endif diff --git a/xmloff/inc/xmloff/table/XMLTableImport.hxx b/xmloff/inc/xmloff/table/XMLTableImport.hxx new file mode 100644 index 000000000000..412bfd05e848 --- /dev/null +++ b/xmloff/inc/xmloff/table/XMLTableImport.hxx @@ -0,0 +1,78 @@ +/************************************************************************* + * + * 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 XMLTABLEIMPORT_HXX_ +#define XMLTABLEIMPORT_HXX_ + +#include <com/sun/star/table/XColumnRowRange.hpp> + +#include "xmloff/dllapi.h" +#include "xmloff/xmlictxt.hxx" +#include "xmloff/uniref.hxx" +#include "xmloff/xmlimppr.hxx" +#include "xmloff/prhdlfac.hxx" + +#include <rtl/ref.hxx> + +#include <boost/shared_ptr.hpp> +#include <map> + +class SvXMLStyleContext; + +typedef std::map< ::rtl::OUString, ::rtl::OUString > XMLTableTemplate; +typedef std::map < ::rtl::OUString, boost::shared_ptr< XMLTableTemplate > > XMLTableTemplateMap; + +class XMLTableImport : public UniRefBase +{ + friend class XMLTableImportContext; + +public: + XMLTableImport( SvXMLImport& rImport, const rtl::Reference< XMLPropertySetMapper >& xCellPropertySetMapper, const rtl::Reference< XMLPropertyHandlerFactory >& xFactoryRef ); + virtual ~XMLTableImport(); + + SvXMLImportContext* CreateTableContext( USHORT nPrfx, const ::rtl::OUString& rLName, + ::com::sun::star::uno::Reference< ::com::sun::star::table::XColumnRowRange >& xColumnRowRange ); + + SvXMLStyleContext* CreateTableTemplateContext( USHORT nPrfx, const ::rtl::OUString& rLName, const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList ); + + rtl::Reference< SvXMLImportPropertyMapper > GetCellImportPropertySetMapper() const { return mxCellImportPropertySetMapper; } + rtl::Reference< SvXMLImportPropertyMapper > GetRowImportPropertySetMapper() const { return mxRowImportPropertySetMapper; } + rtl::Reference< SvXMLImportPropertyMapper > GetColumnImportPropertySetMapper() const { return mxColumnImportPropertySetMapper; } + + void addTableTemplate( const rtl::OUString& rsStyleName, XMLTableTemplate& xTableTemplate ); + void finishStyles(); + +private: + SvXMLImport& mrImport; + rtl::Reference< SvXMLImportPropertyMapper > mxCellImportPropertySetMapper; + rtl::Reference< SvXMLImportPropertyMapper > mxRowImportPropertySetMapper; + rtl::Reference< SvXMLImportPropertyMapper > mxColumnImportPropertySetMapper; + + XMLTableTemplateMap maTableTemplates; +}; + +#endif /*XMLTABLEIMPORT_HXX_*/ diff --git a/xmloff/inc/xmloff/txtimp.hxx b/xmloff/inc/xmloff/txtimp.hxx new file mode 100644 index 000000000000..75310d90f0ae --- /dev/null +++ b/xmloff/inc/xmloff/txtimp.hxx @@ -0,0 +1,758 @@ +/************************************************************************* + * + * 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 diff --git a/xmloff/inc/xmloff/txtparae.hxx b/xmloff/inc/xmloff/txtparae.hxx new file mode 100644 index 000000000000..01907415a024 --- /dev/null +++ b/xmloff/inc/xmloff/txtparae.hxx @@ -0,0 +1,745 @@ +/************************************************************************* + * + * 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_TEXTPARAE_HXX_ +#define _XMLOFF_TEXTPARAE_HXX_ + +#include "sal/config.h" +#include "xmloff/dllapi.h" +#include <rtl/ustring.hxx> +#include <com/sun/star/uno/Reference.h> +#include <com/sun/star/uno/Sequence.h> +#include <com/sun/star/beans/PropertyValue.hpp> +#include <xmloff/uniref.hxx> +#include <xmloff/xmlexppr.hxx> +#include <xmloff/styleexp.hxx> +#include <xmloff/xmltoken.hxx> +#include <xmloff/SinglePropertySetInfoCache.hxx> +#include <xmloff/XMLStringVector.hxx> + +// --> OD 2008-04-25 #refactorlists# +class XMLTextListsHelper; +#include <vector> +// <-- + +class SvXMLExport; +class SvXMLAutoStylePoolP; +class XMLTextFieldExport; +class OUStrings_Impl; +class OUStringsSort_Impl; +class XMLTextNumRuleInfo; +class XMLTextListAutoStylePool; +class SvLongs; +class XMLSectionExport; +class XMLIndexMarkExport; +class XMLRedlineExport; +struct XMLPropertyState; +class MultiPropertySetHelper; + +namespace com { namespace sun { namespace star +{ + namespace beans { class XPropertySet; class XPropertyState; + class XPropertySetInfo; } + namespace container { class XEnumerationAccess; class XEnumeration; class XIndexAccess; } + namespace text { class XTextContent; class XTextRange; class XText; + class XFootnote; class XTextFrame; class XTextSection; + class XTextField; + class XDocumentIndex; class XTextShapesSupplier; } +} } } + +namespace xmloff +{ + class OFormLayerXMLExport; + class BoundFrameSets; +} + +class XMLOFF_DLLPUBLIC XMLTextParagraphExport : public XMLStyleExport +{ + +// SvXMLExport& rExport; + SvXMLAutoStylePoolP& rAutoStylePool; + UniReference < SvXMLExportPropertyMapper > xParaPropMapper; + UniReference < SvXMLExportPropertyMapper > xTextPropMapper; + UniReference < SvXMLExportPropertyMapper > xFramePropMapper; + UniReference < SvXMLExportPropertyMapper > xAutoFramePropMapper; + UniReference < SvXMLExportPropertyMapper > xSectionPropMapper; + UniReference < SvXMLExportPropertyMapper > xRubyPropMapper; + + const ::std::auto_ptr< ::xmloff::BoundFrameSets > pBoundFrameSets; + XMLTextFieldExport *pFieldExport; + OUStrings_Impl *pListElements; + // --> OD 2008-05-07 #refactorlists# - no longer needed +// OUStringsSort_Impl *pExportedLists; + // <-- + XMLTextListAutoStylePool *pListAutoPool; + XMLSectionExport *pSectionExport; + XMLIndexMarkExport *pIndexMarkExport; + + /// may be NULL (if no redlines should be exported; e.g. in block mode) + XMLRedlineExport *pRedlineExport; + XMLStringVector *pHeadingStyles; + + sal_Bool bProgress; + + sal_Bool bBlock; + + // keep track of open rubies + ::rtl::OUString sOpenRubyText; + ::rtl::OUString sOpenRubyCharStyle; + sal_Bool bOpenRuby; + + // --> OD 2008-05-07 #refactorlists# + XMLTextListsHelper* mpTextListsHelper; + ::std::vector< XMLTextListsHelper* > maTextListsHelperStack; + // <-- + + enum FrameType { FT_TEXT, FT_GRAPHIC, FT_EMBEDDED, FT_SHAPE }; + +protected: + + const ::rtl::OUString sActualSize; + // --> OD 2009-07-22 #i73249# +// const ::rtl::OUString sAlternativeText; + const ::rtl::OUString sTitle; + const ::rtl::OUString sDescription; + // <-- + const ::rtl::OUString sAnchorCharStyleName; + const ::rtl::OUString sAnchorPageNo; + const ::rtl::OUString sAnchorType; + const ::rtl::OUString sBeginNotice; + const ::rtl::OUString sBookmark; + const ::rtl::OUString sCategory; + const ::rtl::OUString sChainNextName; + const ::rtl::OUString sCharStyleName; + const ::rtl::OUString sCharStyleNames; + const ::rtl::OUString sContourPolyPolygon; + const ::rtl::OUString sDocumentIndex; + const ::rtl::OUString sDocumentIndexMark; + const ::rtl::OUString sEndNotice; + const ::rtl::OUString sFootnote; + const ::rtl::OUString sFootnoteCounting; + const ::rtl::OUString sFrame; + const ::rtl::OUString sFrameHeightAbsolute; + const ::rtl::OUString sFrameHeightPercent; + const ::rtl::OUString sFrameStyleName; + const ::rtl::OUString sFrameWidthAbsolute; + const ::rtl::OUString sFrameWidthPercent; + const ::rtl::OUString sGraphicFilter; + const ::rtl::OUString sGraphicRotation; + const ::rtl::OUString sGraphicURL; + const ::rtl::OUString sHeight; + const ::rtl::OUString sHoriOrient; + const ::rtl::OUString sHoriOrientPosition; + const ::rtl::OUString sHyperLinkName; + const ::rtl::OUString sHyperLinkTarget; + const ::rtl::OUString sHyperLinkURL; + const ::rtl::OUString sIsAutomaticContour; + const ::rtl::OUString sIsCollapsed; + const ::rtl::OUString sIsPixelContour; + const ::rtl::OUString sIsStart; + const ::rtl::OUString sIsSyncHeightToWidth; + const ::rtl::OUString sIsSyncWidthToHeight; + const ::rtl::OUString sNumberingRules; + const ::rtl::OUString sNumberingType; + const ::rtl::OUString sPageDescName; + const ::rtl::OUString sPageStyleName; + const ::rtl::OUString sParaChapterNumberingLevel; + const ::rtl::OUString sParaConditionalStyleName; + const ::rtl::OUString sParagraphService; + const ::rtl::OUString sParaStyleName; + const ::rtl::OUString sPositionEndOfDoc; + const ::rtl::OUString sPrefix; + const ::rtl::OUString sRedline; + const ::rtl::OUString sReferenceId; + const ::rtl::OUString sReferenceMark; + const ::rtl::OUString sRelativeHeight; + const ::rtl::OUString sRelativeWidth; + const ::rtl::OUString sRuby; + const ::rtl::OUString sRubyAdjust; + const ::rtl::OUString sRubyCharStyleName; + const ::rtl::OUString sRubyText; + const ::rtl::OUString sServerMap; + const ::rtl::OUString sShapeService; + const ::rtl::OUString sSizeType; + const ::rtl::OUString sSoftPageBreak; + const ::rtl::OUString sStartAt; + const ::rtl::OUString sSuffix; + const ::rtl::OUString sTableService; + const ::rtl::OUString sText; + const ::rtl::OUString sTextContentService; + const ::rtl::OUString sTextEmbeddedService; + const ::rtl::OUString sTextEndnoteService; + const ::rtl::OUString sTextField; + const ::rtl::OUString sTextFieldService; + const ::rtl::OUString sTextFrameService; + const ::rtl::OUString sTextGraphicService; + const ::rtl::OUString sTextPortionType; + const ::rtl::OUString sTextSection; + const ::rtl::OUString sUnvisitedCharStyleName; + const ::rtl::OUString sVertOrient; + const ::rtl::OUString sVertOrientPosition; + const ::rtl::OUString sVisitedCharStyleName; + const ::rtl::OUString sWidth; + const ::rtl::OUString sWidthType; + const ::rtl::OUString sTextFieldStart; + const ::rtl::OUString sTextFieldEnd; + const ::rtl::OUString sTextFieldStartEnd; + + SinglePropertySetInfoCache aCharStyleNamesPropInfoCache; + +// SvXMLExport& GetExport() { return rExport; } +// const SvXMLExport& GetExport() const { return rExport; } + + UniReference < SvXMLExportPropertyMapper > GetParaPropMapper() const + { + return xParaPropMapper; + } + + UniReference < SvXMLExportPropertyMapper > GetTextPropMapper() const + { + return xTextPropMapper; + } + + UniReference < SvXMLExportPropertyMapper > GetFramePropMapper() const + { + return xFramePropMapper; + } + UniReference < SvXMLExportPropertyMapper > GetAutoFramePropMapper() const + { + return xAutoFramePropMapper; + } + UniReference < SvXMLExportPropertyMapper > GetSectionPropMapper() const + { + return xSectionPropMapper; + } + UniReference < SvXMLExportPropertyMapper > GetRubyPropMapper() const + { + return xRubyPropMapper; + } + + + SvXMLAutoStylePoolP& GetAutoStylePool() { return rAutoStylePool; } + const SvXMLAutoStylePoolP& GetAutoStylePool() const { return rAutoStylePool; } + +public: + ::rtl::OUString FindTextStyle( + const ::com::sun::star::uno::Reference < + ::com::sun::star::beans::XPropertySet > & rPropSet, + sal_Bool& rbHasCharStyle ) const; + ::rtl::OUString FindTextStyleAndHyperlink( + const ::com::sun::star::uno::Reference < + ::com::sun::star::beans::XPropertySet > & rPropSet, + sal_Bool& rbHyperlink, + sal_Bool& rbHasCharStyle, + sal_Bool& rbHasAutoStyle, + const XMLPropertyState** pAddState = NULL) const; + sal_Bool addHyperlinkAttributes( + const ::com::sun::star::uno::Reference < + ::com::sun::star::beans::XPropertySet > & rPropSet, + const ::com::sun::star::uno::Reference < + ::com::sun::star::beans::XPropertyState > & rPropState, + const ::com::sun::star::uno::Reference < + ::com::sun::star::beans::XPropertySetInfo > & rPropSetInfo ); + + void exportTextRangeEnumeration( + const ::com::sun::star::uno::Reference < + ::com::sun::star::container::XEnumeration > & rRangeEnum, + sal_Bool bAutoStyles, sal_Bool bProgress, + sal_Bool bPrvChrIsSpc = sal_True ); + +protected: + + sal_Int32 addTextFrameAttributes( + const ::com::sun::star::uno::Reference < + ::com::sun::star::beans::XPropertySet >& rPropSet, + sal_Bool bShape, + ::rtl::OUString *pMinHeightValue = 0 ); + + virtual void exportStyleAttributes( + const ::com::sun::star::uno::Reference< + ::com::sun::star::style::XStyle > & rStyle ); + + void exportPageFrames( sal_Bool bAutoStyles, sal_Bool bProgress ); + void exportFrameFrames( sal_Bool bAutoStyles, sal_Bool bProgress, + const ::com::sun::star::uno::Reference < + ::com::sun::star::text::XTextFrame > *pParentTxtFrame = 0 ); + + void exportNumStyles( sal_Bool bUsed ); + + void exportText( + const ::com::sun::star::uno::Reference < + ::com::sun::star::text::XText > & rText, + sal_Bool bAutoStyles, sal_Bool bProgress, sal_Bool bExportParagraph ); + + void exportText( + const ::com::sun::star::uno::Reference < + ::com::sun::star::text::XText > & rText, + const ::com::sun::star::uno::Reference < + ::com::sun::star::text::XTextSection > & rBaseSection, + sal_Bool bAutoStyles, sal_Bool bProgress, sal_Bool bExportParagraph ); + + sal_Bool exportTextContentEnumeration( + const ::com::sun::star::uno::Reference < + ::com::sun::star::container::XEnumeration > & rContentEnum, + sal_Bool bAutoStyles, + const ::com::sun::star::uno::Reference < + ::com::sun::star::text::XTextSection > & rBaseSection, + sal_Bool bProgress, + sal_Bool bExportParagraph = sal_True, + const ::com::sun::star::uno::Reference < + ::com::sun::star::beans::XPropertySet > *pRangePropSet = 0, + sal_Bool bExportLevels = sal_True ); + void exportParagraph( + const ::com::sun::star::uno::Reference < + ::com::sun::star::text::XTextContent > & rTextContent, + sal_Bool bAutoStyles, sal_Bool bProgress, + sal_Bool bExportParagraph, + MultiPropertySetHelper& rPropSetHelper); + virtual void exportTable( + const ::com::sun::star::uno::Reference < + ::com::sun::star::text::XTextContent > & rTextContent, + sal_Bool bAutoStyles, sal_Bool bProgress ); + + void exportTextField( + const ::com::sun::star::uno::Reference < + ::com::sun::star::text::XTextRange > & rTextRange, + sal_Bool bAutoStyles, sal_Bool bProgress ); + + void exportTextField( + const ::com::sun::star::uno::Reference < + ::com::sun::star::text::XTextField> & xTextField, + const sal_Bool bAutoStyles, const sal_Bool bProgress, + const sal_Bool bRecursive ); + + void exportAnyTextFrame( + const ::com::sun::star::uno::Reference < + ::com::sun::star::text::XTextContent > & rTextContent, + FrameType eTxpe, + sal_Bool bAutoStyles, sal_Bool bProgress, sal_Bool bExportContent, + const ::com::sun::star::uno::Reference < + ::com::sun::star::beans::XPropertySet > *pRangePropSet = 0 ); + void _exportTextFrame( + const ::com::sun::star::uno::Reference < + ::com::sun::star::beans::XPropertySet > & rPropSet, + const ::com::sun::star::uno::Reference < + ::com::sun::star::beans::XPropertySetInfo > & rPropSetInfo, + sal_Bool bProgress ); + inline void exportTextFrame( + const ::com::sun::star::uno::Reference < + ::com::sun::star::text::XTextContent > & rTextContent, + sal_Bool bAutoStyles, sal_Bool bProgress, sal_Bool bExportContent, + const ::com::sun::star::uno::Reference < + ::com::sun::star::beans::XPropertySet > *pRangePropSet = 0 ); + inline void exportShape( + const ::com::sun::star::uno::Reference < + ::com::sun::star::text::XTextContent > & rTextContent, + sal_Bool bAutoStyles, + const ::com::sun::star::uno::Reference < + ::com::sun::star::beans::XPropertySet > *pRangePropSet = 0 ); + + void exportContour( + const ::com::sun::star::uno::Reference < + ::com::sun::star::beans::XPropertySet > & rPropSet, + const ::com::sun::star::uno::Reference < + ::com::sun::star::beans::XPropertySetInfo > & rPropSetInfo ); + void _exportTextGraphic( + const ::com::sun::star::uno::Reference < + ::com::sun::star::beans::XPropertySet > & rPropSet, + const ::com::sun::star::uno::Reference < + ::com::sun::star::beans::XPropertySetInfo > & rPropSetInfo ); + inline void exportTextGraphic( + const ::com::sun::star::uno::Reference < + ::com::sun::star::text::XTextContent > & rTextContent, + sal_Bool bAutoStyles, + const ::com::sun::star::uno::Reference < + ::com::sun::star::beans::XPropertySet > *pRangePropSet = 0 ); + + virtual void _collectTextEmbeddedAutoStyles( + const ::com::sun::star::uno::Reference < + ::com::sun::star::beans::XPropertySet > & rPropSet ); + virtual void _exportTextEmbedded( + const ::com::sun::star::uno::Reference < + ::com::sun::star::beans::XPropertySet > & rPropSet, + const ::com::sun::star::uno::Reference < + ::com::sun::star::beans::XPropertySetInfo > & rPropSetInfo ); + inline void exportTextEmbedded( + const ::com::sun::star::uno::Reference < + ::com::sun::star::text::XTextContent > & rTextContent, + sal_Bool bAutoStyles, + const ::com::sun::star::uno::Reference < + ::com::sun::star::beans::XPropertySet > *pRangePropSet = 0 ); + virtual void setTextEmbeddedGraphicURL( + const ::com::sun::star::uno::Reference < + ::com::sun::star::beans::XPropertySet >& rPropSet, + ::rtl::OUString& rStreamName ) const; + + /// export a footnote and styles + void exportTextFootnote( + const ::com::sun::star::uno::Reference< + ::com::sun::star::beans::XPropertySet > & rPropSet, + const ::rtl::OUString& sString, + sal_Bool bAutoStyles, sal_Bool bProgress ); + + /// helper for exportTextFootnote + void exportTextFootnoteHelper( + const ::com::sun::star::uno::Reference< + ::com::sun::star::text::XFootnote > & rPropSet, + const ::com::sun::star::uno::Reference< + ::com::sun::star::text::XText> & rText, + const ::rtl::OUString& sString, + sal_Bool bAutoStyles, + sal_Bool bIsEndnote, sal_Bool bProgress ); + + /// export footnote and endnote configuration elements + void exportTextFootnoteConfiguration(); + + void exportTextFootnoteConfigurationHelper( + const ::com::sun::star::uno::Reference< + ::com::sun::star::beans::XPropertySet> & rFootnoteSupplier, + sal_Bool bIsEndnote); + + void exportTextMark( + const ::com::sun::star::uno::Reference< + ::com::sun::star::beans::XPropertySet> & xPropSet, + const ::rtl::OUString sProperty, + const enum ::xmloff::token::XMLTokenEnum pElements[], + sal_Bool bAutoStyles); + + void exportIndexMark( + const ::com::sun::star::uno::Reference< + ::com::sun::star::beans::XPropertySet> & rPropSet, + sal_Bool bAutoStyles); + + void exportSoftPageBreak( + const ::com::sun::star::uno::Reference< + ::com::sun::star::beans::XPropertySet> & rPropSet, + sal_Bool bAutoStyles); + + void exportTextRange( + const ::com::sun::star::uno::Reference < + ::com::sun::star::text::XTextRange > & rTextRange, + sal_Bool bAutoStyles, + sal_Bool& rPrevCharWasSpace ); + + void exportListChange( const XMLTextNumRuleInfo& rPrvInfo, + const XMLTextNumRuleInfo& rNextInfo ); + + /// check if current section or current list has changed; + /// calls exortListChange as appropriate + void exportListAndSectionChange( + ::com::sun::star::uno::Reference < + ::com::sun::star::text::XTextSection > & rOldSection, + const ::com::sun::star::uno::Reference < + ::com::sun::star::text::XTextSection > & rNewSection, + const XMLTextNumRuleInfo& rOldList, + const XMLTextNumRuleInfo& rNewList, + sal_Bool bAutoStyles ); + + /// overload for exportListAndSectionChange; + /// takes new content rather than new section. + void exportListAndSectionChange( + ::com::sun::star::uno::Reference < + ::com::sun::star::text::XTextSection > & rOldSection, + const ::com::sun::star::uno::Reference < + ::com::sun::star::text::XTextContent > & rNewContent, + const XMLTextNumRuleInfo& rOldList, + const XMLTextNumRuleInfo& rNewList, + sal_Bool bAutoStyles ); + void exportListAndSectionChange( + ::com::sun::star::uno::Reference < + ::com::sun::star::text::XTextSection > & rOldSection, + MultiPropertySetHelper& rPropSetHelper, + sal_Int16 nTextSectionId, + const ::com::sun::star::uno::Reference < + ::com::sun::star::text::XTextContent > & rNewContent, + const XMLTextNumRuleInfo& rOldList, + const XMLTextNumRuleInfo& rNewList, + sal_Bool bAutoStyles ); + + /// export a redline text portion + void exportChange( + const ::com::sun::star::uno::Reference < + ::com::sun::star::beans::XPropertySet > & rPropSet, + sal_Bool bAutoStyle); + + /// export a ruby + void exportRuby( + const ::com::sun::star::uno::Reference< + ::com::sun::star::beans::XPropertySet> & rPortionPropSet, + sal_Bool bAutoStyles ); + + /// export a text:meta + void exportMeta( + const ::com::sun::star::uno::Reference< + ::com::sun::star::beans::XPropertySet> & i_xPortion, + sal_Bool i_bAutoStyles, sal_Bool i_isProgress ); + +public: + + XMLTextParagraphExport( + SvXMLExport& rExp, + SvXMLAutoStylePoolP & rASP + ); + virtual ~XMLTextParagraphExport(); + + /// add autostyle for specified family + void Add( + sal_uInt16 nFamily, + MultiPropertySetHelper& rPropSetHelper, + const ::com::sun::star::uno::Reference < + ::com::sun::star::beans::XPropertySet > & rPropSet, + const XMLPropertyState** pAddState = NULL ); + void Add( + sal_uInt16 nFamily, + const ::com::sun::star::uno::Reference < + ::com::sun::star::beans::XPropertySet > & rPropSet, + const XMLPropertyState** pAddState = NULL, bool bDontSeek = false ); + + /// find style name for specified family and parent + ::rtl::OUString Find( + sal_uInt16 nFamily, + const ::com::sun::star::uno::Reference < + ::com::sun::star::beans::XPropertySet > & rPropSet, + const ::rtl::OUString& rParent, + const XMLPropertyState** pAddState = NULL ) const; + + static SvXMLExportPropertyMapper *CreateShapeExtPropMapper( + SvXMLExport& rExport ); + static SvXMLExportPropertyMapper *CreateCharExtPropMapper( + SvXMLExport& rExport); + static SvXMLExportPropertyMapper *CreateParaExtPropMapper( + SvXMLExport& rExport); + static SvXMLExportPropertyMapper *CreateParaDefaultExtPropMapper( + SvXMLExport& rExport); + + // This methods exports all (or all used) styles + void exportTextStyles( sal_Bool bUsed + , sal_Bool bProg = sal_False + ); + + /// This method exports (text field) declarations etc. + void exportTextDeclarations(); + + /// export the (text field) declarations for a particular XText + void exportTextDeclarations( + const ::com::sun::star::uno::Reference < + ::com::sun::star::text::XText > & rText ); + + /// true: export only those declarations that are used; + /// false: export all declarations + void exportUsedDeclarations( sal_Bool bOnlyUsed ); + + /// Export the list of change information (enclosed by <tracked-changes>) + /// (or the necessary automatic styles) + void exportTrackedChanges(sal_Bool bAutoStyle); + + /// Export the list of change information (enclosed by <tracked-changes>) + /// (or the necessary automatic styles) + void exportTrackedChanges(const ::com::sun::star::uno::Reference < + ::com::sun::star::text::XText > & rText, + sal_Bool bAutoStyle ); + + /// Record tracked changes for this particular XText + /// (empty reference stop recording) + /// This should be used if tracked changes for e.g. footers are to + /// be exported seperately via the exportTrackedChanges(sal_Bool, + /// Reference<XText>) method. + void recordTrackedChangesForXText( + const ::com::sun::star::uno::Reference < + ::com::sun::star::text::XText > & rText ); + + + /// Stop recording tracked changes. + /// This is the same as calling recordTrackedChanges(...) with an + /// empty reference. + void recordTrackedChangesNoXText(); + + + // This method exports the given OUString + void exportText( + const ::rtl::OUString& rText, + sal_Bool& rPrevCharWasSpace ); + + // This method collects all automatic styles for the given XText + void collectTextAutoStyles( + const ::com::sun::star::uno::Reference < + ::com::sun::star::text::XText > & rText, + sal_Bool bIsProgress = sal_False, + sal_Bool bExportParagraph = sal_True ) + { + exportText( rText, sal_True, bIsProgress, bExportParagraph ); + } + + void collectTextAutoStyles( + const ::com::sun::star::uno::Reference < + ::com::sun::star::text::XText > & rText, + const ::com::sun::star::uno::Reference < + ::com::sun::star::text::XTextSection > & rBaseSection, + sal_Bool bIsProgress = sal_False, + sal_Bool bExportParagraph = sal_True ) + { + exportText( rText, rBaseSection, sal_True, bIsProgress, bExportParagraph ); + } + + // It the model implements the xAutoStylesSupplier interface, the automatic + // styles can exported without iterating over the text portions + bool collectTextAutoStylesOptimized( + sal_Bool bIsProgress = sal_False ); + + // This method exports all automatic styles that have been collected. + virtual void exportTextAutoStyles(); + + void exportEvents( const ::com::sun::star::uno::Reference < com::sun::star::beans::XPropertySet > & rPropSet ); + // --> OD 2009-07-22 #i73249# +// void exportAlternativeText( const ::com::sun::star::uno::Reference < ::com::sun::star::beans::XPropertySet > & rPropSet, +// const ::com::sun::star::uno::Reference < ::com::sun::star::beans::XPropertySetInfo > & rPropSetInfo ); + void exportTitleAndDescription( const ::com::sun::star::uno::Reference < ::com::sun::star::beans::XPropertySet > & rPropSet, + const ::com::sun::star::uno::Reference < ::com::sun::star::beans::XPropertySetInfo > & rPropSetInfo ); + // <-- + + // This method exports the given XText + void exportText( + const ::com::sun::star::uno::Reference < + ::com::sun::star::text::XText > & rText, + sal_Bool bIsProgress = sal_False, + sal_Bool bExportParagraph = sal_True) + { + exportText( rText, sal_False, bIsProgress, bExportParagraph ); + } + + void exportText( + const ::com::sun::star::uno::Reference < + ::com::sun::star::text::XText > & rText, + const ::com::sun::star::uno::Reference < + ::com::sun::star::text::XTextSection > & rBaseSection, + sal_Bool bIsProgress = sal_False, + sal_Bool bExportParagraph = sal_True) + { + exportText( rText, rBaseSection, sal_False, bIsProgress, bExportParagraph ); + } + + void exportFramesBoundToPage( sal_Bool bIsProgress = sal_False ) + { + exportPageFrames( sal_False, bIsProgress ); + } + void exportFramesBoundToFrame( + const ::com::sun::star::uno::Reference < + ::com::sun::star::text::XTextFrame >& rParentTxtFrame, + sal_Bool bIsProgress = sal_False ) + { + exportFrameFrames( sal_False, bIsProgress, &rParentTxtFrame ); + } + inline const XMLTextListAutoStylePool& GetListAutoStylePool() const; + + void SetBlockMode( sal_Bool bSet ) { bBlock = bSet; } + sal_Bool IsBlockMode() const { return bBlock; } + + + UniReference < SvXMLExportPropertyMapper > GetParagraphPropertyMapper() const + { + return xParaPropMapper; + } + + + /** exclude form controls which are in mute sections. + * + * This method is necessary to prevent the form layer export from exporting + * control models whose controls are not represented in the document. To + * achieve this, this method iterates over all shapes, checks to see if + * they are control shapes, and if so, whether they should be exported or + * not. If not, the form layer export will be notified accordingly. + * + * The reason this method is located here is tha it needs to access the + * XMLSectionExport, which is only available here. + */ + void PreventExportOfControlsInMuteSections( + const ::com::sun::star::uno::Reference< + ::com::sun::star::container::XIndexAccess> & rShapes, + UniReference<xmloff::OFormLayerXMLExport> xFormExport ); + + SinglePropertySetInfoCache& GetCharStyleNamesPropInfoCache() { return aCharStyleNamesPropInfoCache; } + + sal_Int32 GetHeadingLevel( const ::rtl::OUString& rStyleName ); + + // --> OD 2008-05-08 #refactorlists# + void PushNewTextListsHelper(); + void PopTextListsHelper(); + // <-- + private: + XMLTextParagraphExport(XMLTextParagraphExport &); // private copy-ctor because of explicit copy-ctor of auto_ptr +}; + +inline const XMLTextListAutoStylePool& + XMLTextParagraphExport::GetListAutoStylePool() const +{ + return *pListAutoPool; +} + +inline void XMLTextParagraphExport::exportTextFrame( + const ::com::sun::star::uno::Reference < + ::com::sun::star::text::XTextContent > & rTextContent, + sal_Bool bAutoStyles, sal_Bool bIsProgress, sal_Bool bExportContent, + const ::com::sun::star::uno::Reference < + ::com::sun::star::beans::XPropertySet > *pRangePropSet) +{ + exportAnyTextFrame( rTextContent, FT_TEXT, bAutoStyles, bIsProgress, + bExportContent, pRangePropSet ); +} + +inline void XMLTextParagraphExport::exportTextGraphic( + const ::com::sun::star::uno::Reference < + ::com::sun::star::text::XTextContent > & rTextContent, + sal_Bool bAutoStyles, + const ::com::sun::star::uno::Reference < + ::com::sun::star::beans::XPropertySet > *pRangePropSet ) +{ + exportAnyTextFrame( rTextContent, FT_GRAPHIC, bAutoStyles, sal_False, + sal_True, pRangePropSet ); +} + +inline void XMLTextParagraphExport::exportTextEmbedded( + const ::com::sun::star::uno::Reference < + ::com::sun::star::text::XTextContent > & rTextContent, + sal_Bool bAutoStyles, + const ::com::sun::star::uno::Reference < + ::com::sun::star::beans::XPropertySet > *pRangePropSet ) +{ + exportAnyTextFrame( rTextContent, FT_EMBEDDED, bAutoStyles, sal_False, + sal_True, pRangePropSet ); +} + +inline void XMLTextParagraphExport::exportShape( + const ::com::sun::star::uno::Reference < + ::com::sun::star::text::XTextContent > & rTextContent, + sal_Bool bAutoStyles, + const ::com::sun::star::uno::Reference < + ::com::sun::star::beans::XPropertySet > *pRangePropSet ) +{ + exportAnyTextFrame( rTextContent, FT_SHAPE, bAutoStyles, sal_False, + sal_True, pRangePropSet ); +} + +#endif diff --git a/xmloff/inc/xmloff/txtprmap.hxx b/xmloff/inc/xmloff/txtprmap.hxx new file mode 100644 index 000000000000..d64cc1266ef9 --- /dev/null +++ b/xmloff/inc/xmloff/txtprmap.hxx @@ -0,0 +1,202 @@ +/************************************************************************* + * + * 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_TEXTPRMAP_HXX_ +#define _XMLOFF_TEXTPRMAP_HXX_ + +#include <xmloff/contextid.hxx> +#include <xmloff/xmlprmap.hxx> + +#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) +#define CTF_TEXTWRITINGMODE (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 CTF_OLD_FLOW_WITH_TEXT (XML_TEXT_CTF_START + 141) +#define CTF_ISNUMBERING (XML_TEXT_CTF_START + 142) +#define CTF_TEXT_DISPLAY (XML_TEXT_CTF_START + 143) +#define CTF_TEXT_CLIP (XML_TEXT_CTF_START + 144) +#define CTF_TEXT_CLIP11 (XML_TEXT_CTF_START + 145) +#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 XMLOFF_DLLPUBLIC XMLTextPropertySetMapper : public XMLPropertySetMapper +{ +public: + XMLTextPropertySetMapper( sal_uInt16 nType ); + virtual ~XMLTextPropertySetMapper(); + + static const XMLPropertyMapEntry* getPropertyMapForType( sal_uInt16 _nType ); +}; + +#endif diff --git a/xmloff/inc/xmloff/txtstyle.hxx b/xmloff/inc/xmloff/txtstyle.hxx new file mode 100644 index 000000000000..d8325b76b690 --- /dev/null +++ b/xmloff/inc/xmloff/txtstyle.hxx @@ -0,0 +1,60 @@ +/************************************************************************* + * + * 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_TEXTSTYLE_HXX_ +#define _XMLOFF_TEXTSTYLE_HXX_ + +#include <xmloff/styleexp.hxx> +#include <xmloff/uniref.hxx> + +class XMLPropertySetMapper; + +class XMLTextStyleExport : public XMLStyleExport +{ + UniReference < XMLPropertySetMapper > xParaPropMapper; + + void exportNumStyles( sal_Bool bUsed ); + +public: + + XMLTextStyleExport( + SvXMLExport& rExp, +// const ::com::sun::star::uno::Reference< +// ::com::sun::star::xml::sax::XDocumentHandler > & rHandler, +// const ::com::sun::star::uno::Reference< +// ::com::sun::star::frame::XModel > & rModel, + const ::rtl::OUString& rPoolStyleName, +// const SvXMLNamespaceMap &rNamespaceMap, +// MapUnit eDUnit, + SvXMLAutoStylePoolP *pAutoStyleP=0 ); + virtual ~XMLTextStyleExport(); + + void exportStyles( sal_Bool bUsed ); + + UniReference < XMLPropertySetMapper >& getParaPropMapper(); +}; + +#endif diff --git a/xmloff/inc/xmloff/txtstyli.hxx b/xmloff/inc/xmloff/txtstyli.hxx new file mode 100644 index 000000000000..1c1b97bf3137 --- /dev/null +++ b/xmloff/inc/xmloff/txtstyli.hxx @@ -0,0 +1,120 @@ +/************************************************************************* + * + * 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_TXTSTYLI_HXX_ +#define _XMLOFF_TXTSTYLI_HXX_ + +#include "sal/config.h" +#include "xmloff/dllapi.h" +#include <xmloff/prstylei.hxx> + +class SvXMLTokenMap; +class XMLEventsImportContext; + +class XMLOFF_DLLPUBLIC XMLTextStyleContext : public XMLPropStyleContext +{ + ::rtl::OUString sListStyleName; + ::rtl::OUString sCategoryVal; + ::rtl::OUString sDropCapTextStyleName; + ::rtl::OUString sMasterPageName; + ::rtl::OUString sDataStyleName; // for grid columns only + const ::rtl::OUString sIsAutoUpdate; + const ::rtl::OUString sCategory; + const ::rtl::OUString sNumberingStyleName; + const ::rtl::OUString sOutlineLevel; //#outline level,add by zhaojianwei + +public: + const ::rtl::OUString sDropCapCharStyleName; +private: + const ::rtl::OUString sPageDescName; + + sal_Int8 nOutlineLevel; + + sal_Bool bAutoUpdate : 1; + sal_Bool bHasMasterPageName : 1; + + sal_Bool bHasCombinedCharactersLetter : 1; + + // --> OD 2006-09-21 #i69523# + // introduce import of empty list style + sal_Bool mbListStyleSet : 1; + // <-- + + XMLEventsImportContext* pEventContext; + +protected: + + virtual void SetAttribute( sal_uInt16 nPrefixKey, + const ::rtl::OUString& rLocalName, + const ::rtl::OUString& rValue ); + +public: + + TYPEINFO(); + + XMLTextStyleContext( SvXMLImport& rImport, sal_uInt16 nPrfx, + const ::rtl::OUString& rLName, + const ::com::sun::star::uno::Reference< + ::com::sun::star::xml::sax::XAttributeList > & xAttrList, + SvXMLStylesContext& rStyles, sal_uInt16 nFamily, + sal_Bool bDefaultStyle = sal_False ); + virtual ~XMLTextStyleContext(); + + virtual SvXMLImportContext *CreateChildContext( + sal_uInt16 nPrefix, + const ::rtl::OUString& rLocalName, + const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList > & xAttrList ); + + sal_Bool IsAutoUpdate() const { return bAutoUpdate; } + + const ::rtl::OUString& GetListStyle() const { return sListStyleName; } + // --> OD 2006-10-13 #i69629# + sal_Bool IsListStyleSet() const + { + return mbListStyleSet; + } + // <-- + const ::rtl::OUString& GetMasterPageName() const { return sMasterPageName; } + sal_Bool HasMasterPageName() const { return bHasMasterPageName; } + const ::rtl::OUString& GetDropCapStyleName() const { return sDropCapTextStyleName; } + const ::rtl::OUString& GetDataStyleName() const { return sDataStyleName; } + + virtual void CreateAndInsert( sal_Bool bOverwrite ); + virtual void Finish( sal_Bool bOverwrite ); + virtual void SetDefaults(); + + // overload FillPropertySet, so we can get at the combined characters + virtual void FillPropertySet( + const ::com::sun::star::uno::Reference< + ::com::sun::star::beans::XPropertySet > & rPropSet ); + + inline sal_Bool HasCombinedCharactersLetter() + { return bHasCombinedCharactersLetter; } + + const ::std::vector< XMLPropertyState > & _GetProperties() { return GetProperties(); } +}; + +#endif diff --git a/xmloff/inc/xmloff/uniref.hxx b/xmloff/inc/xmloff/uniref.hxx new file mode 100644 index 000000000000..fd600107a932 --- /dev/null +++ b/xmloff/inc/xmloff/uniref.hxx @@ -0,0 +1,229 @@ +/************************************************************************* + * + * 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 _UNIVERSALL_REFERENCE_HXX +#define _UNIVERSALL_REFERENCE_HXX + +#include "sal/config.h" +#include "xmloff/dllapi.h" +#include <sal/types.h> +#include <osl/interlck.h> + +/** + * An instance of this class holds a pointer to an object. The lifetime of + * the object is controled by the instance. The constructor calls + * acquire() and the destructor calls release(). + * You could delive your class from the baseclass UniRefBase wich implements + * the methods acquire and release, yet. + */ +template< class T > class UniReference +{ +private: + T* mpElement; + +public: + /** Create an empty reference.*/ + UniReference() + : mpElement( NULL ) + {} + + /** Destroy the reference and releases the element.*/ + inline ~UniReference(); + + /** Create a new reference with the same element as in rRef and acquire this one.*/ + inline UniReference( const UniReference< T > & rRef ); + + /** + * Create a new reference with the given element pElement and acquire this one. + */ + inline UniReference( T * pElement ); + + /** + * Release the reference and set the new one pObj. + */ + inline UniReference< T > & operator = ( T * pElement ); + + /** + * Release the reference and set the new one from rObj. + */ + inline UniReference< T > & operator = ( const UniReference< T > & rRef ); + + /** + * Return the pointer to the element, may be null. + */ + inline T* operator -> () const; + + /** + * Returns true if the pointer to the element is valid. + */ + inline sal_Bool is() const; + + /** + * Return true if both elements refer to the same object. + */ + inline sal_Bool operator == ( const UniReference & rRef ) const; + + /** + * Return true if both elements does not refer to the same object. + */ + inline sal_Bool operator != ( const UniReference & rRef ) const; + + /** Gets implementation pointer. + This call does <b>not</b> acquire the implementation. + <br> + @return <b>un</b>acquired implementation pointer + */ + inline T* get() const; +}; + +class XMLOFF_DLLPUBLIC UniRefBase +{ +private: + /** + * The reference counter. + */ + oslInterlockedCount m_refCount; + +public: + UniRefBase() : m_refCount( 0 ) + {} + virtual ~UniRefBase(); + + void acquire() { osl_incrementInterlockedCount( &m_refCount ); } + void release(); +}; + +/////////////////////////////////////////////////////////////////////////////// +// +// Inline-implementations of UniReference +// + +/** Create a new reference with the same element as in rRef and acquire this one.*/ +template< class T > +inline UniReference< T >::UniReference( const UniReference< T > & rRef ) + : mpElement( rRef.mpElement ) +{ + if( mpElement ) + mpElement->acquire(); +} + +template< class T > +inline UniReference< T >::~UniReference() +{ + if( mpElement ) + mpElement->release(); +} + +/** + * Create a new reference with the given element pElement and acquire this one. + * @param pInterface the interface, pointer may be null. + */ +template< class T > +inline UniReference< T >::UniReference( T * pElement ) + : mpElement( pElement ) +{ + if( mpElement ) + mpElement->acquire(); +} + +/** + * Release the reference and set the new one pObj.<BR> + * <B>The operation is not thread save. You must protect all assigns to a reference class.</B> + */ +template< class T > +inline UniReference< T > & UniReference< T >::operator = ( T * pElement ) +{ + if( pElement ) + pElement->acquire(); + if( mpElement ) + mpElement->release(); + + mpElement = pElement; + + return *this; +} + +/** + * Release the reference and set the new one from rObj.<BR> + * <B>The operation is not thread save. You must protect all assigns to a reference class.</B> + */ +template< class T > +inline UniReference< T > & UniReference< T >::operator = ( const UniReference< T > & rRef ) +{ + return operator = ( rRef.mpElement ); +} + +/** + * Return the pointer to the interface, may be null. + */ +template< class T > +inline T* UniReference< T >::operator -> () const +{ + return get(); +} + +/** + * Return the pointer to the interface, may be null. + */ +template< class T > +inline T* UniReference< T >::get () const +{ + return static_cast< T * >( mpElement ); +} + +/** + * Returns true if the pointer to the interface is valid. + */ +template< class T > +inline sal_Bool UniReference< T >::is() const +{ + return (mpElement != 0); +} +/** + * Return true if both interfaces refer to the same object. The operation can be + * much more expensive than a pointer comparision.<BR> + * + * @param rRef another interface reference + */ +template< class T > +inline sal_Bool UniReference< T >::operator == ( const UniReference & rRef ) const +{ + return ( mpElement == rRef.mpElement ); +} +/** + * Return true if both interfaces does not refer to the same object. The operation can be + * much more expensive than a pointer comparision.<BR> + * + * @param rRef another interface reference + */ +template< class T > +inline sal_Bool UniReference< T >::operator != ( const UniReference & rRef ) const +{ + return ( ! operator == ( rRef ) ); +} + +#endif // _UNIVERSALL_REFERENCE_HXX diff --git a/xmloff/inc/xmloff/xmlaustp.hxx b/xmloff/inc/xmloff/xmlaustp.hxx new file mode 100644 index 000000000000..f0aa95c8275e --- /dev/null +++ b/xmloff/inc/xmloff/xmlaustp.hxx @@ -0,0 +1,137 @@ +/************************************************************************* + * + * 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_XMLASTPLP_HXX +#define _XMLOFF_XMLASTPLP_HXX + +#include "sal/config.h" +#include "xmloff/dllapi.h" +#include <com/sun/star/xml/sax/XDocumentHandler.hpp> +#include <xmloff/xmlprmap.hxx> +#include <xmloff/uniref.hxx> + +class SvXMLExportPropertyMapper; +class SvXMLNamespaceMap; +class SvXMLAutoStylePoolP_Impl; +class SvXMLAttributeList; +class SvXMLExport; +namespace com { namespace sun { namespace star { namespace uno + { template<typename A> class Sequence; } +} } } + +class XMLOFF_DLLPUBLIC SvXMLAutoStylePoolP : public UniRefBase +{ + friend class SvXMLAutoStylePoolP_Impl; + + SvXMLAutoStylePoolP_Impl *pImpl; + +protected: + + virtual void exportStyleAttributes( + SvXMLAttributeList& rAttrList, + sal_Int32 nFamily, + const ::std::vector< XMLPropertyState >& rProperties, + const SvXMLExportPropertyMapper& rPropExp + , const SvXMLUnitConverter& rUnitConverter, + const SvXMLNamespaceMap& rNamespaceMap + ) const; + +// this methode is executed after Properties Export, so you can e.g. export a map or so on + virtual void exportStyleContent( + const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XDocumentHandler > & rHandler, + sal_Int32 nFamily, + const ::std::vector< XMLPropertyState >& rProperties, + const SvXMLExportPropertyMapper& rPropExp + , const SvXMLUnitConverter& rUnitConverter, + const SvXMLNamespaceMap& rNamespaceMap + ) const; + + +public: + + SvXMLAutoStylePoolP( SvXMLExport& rExport); + + SvXMLAutoStylePoolP(); + virtual ~SvXMLAutoStylePoolP(); + + SvXMLExport& GetExport() const; + + /** register a new family with its appropriate instance of a derivation of XMLPropertySetMapper + for family numbers see families.hxx + if bAsFamily is sal_False, the family name is used as element name + */ + // TODO: Remove this ugly method as soon as possible + void AddFamily( sal_Int32 nFamily, const ::rtl::OUString& rStrName, SvXMLExportPropertyMapper* pMapper, ::rtl::OUString aStrPrefix, sal_Bool bAsFamily = sal_True ); + void AddFamily( sal_Int32 nFamily, const ::rtl::OUString& rStrName, + const UniReference< SvXMLExportPropertyMapper >& rMapper, + const ::rtl::OUString& rStrPrefix, sal_Bool bAsFamily = sal_True ); + + /// Register a name that must not be used as a generated name. + void RegisterName( sal_Int32 nFamily, const ::rtl::OUString& rName ); + + /// retrieve the registered names (names + families) + void GetRegisteredNames( + com::sun::star::uno::Sequence<sal_Int32>& aFamilies, + com::sun::star::uno::Sequence<rtl::OUString>& aNames ); + + /// register (families + names) + void RegisterNames( + com::sun::star::uno::Sequence<sal_Int32>& aFamilies, + com::sun::star::uno::Sequence<rtl::OUString>& aNames ); + + /// Add an item set to the pool and return its generated name. + ::rtl::OUString Add( sal_Int32 nFamily, const ::std::vector< XMLPropertyState >& rProperties ); + ::rtl::OUString Add( sal_Int32 nFamily, const ::rtl::OUString& rParent, const ::std::vector< XMLPropertyState >& rProperties, bool bDontSeek = false ); + sal_Bool Add( ::rtl::OUString& rName, sal_Int32 nFamily, const ::std::vector< XMLPropertyState >& rProperties ); + sal_Bool Add( ::rtl::OUString& rName, sal_Int32 nFamily, const ::rtl::OUString& rParent, const ::std::vector< XMLPropertyState >& rProperties ); + + /// Add an item set with a pre-defined name (needed for saving sheets separately in Calc). + sal_Bool AddNamed( const ::rtl::OUString& rName, sal_Int32 nFamily, const ::rtl::OUString& rParent, + const ::std::vector< XMLPropertyState >& rProperties ); + + /// Find an item set's name. + ::rtl::OUString Find( sal_Int32 nFamily, const ::std::vector< XMLPropertyState >& rProperties ) const; + ::rtl::OUString Find( sal_Int32 nFamily, const ::rtl::OUString& rParent, const ::std::vector< XMLPropertyState >& rProperties ) const; + + // Add a property set to the pool and cache its name. + ::rtl::OUString AddAndCache( sal_Int32 nFamily, const ::std::vector< XMLPropertyState >& rProperties ); + ::rtl::OUString AddAndCache( sal_Int32 nFamily, const ::rtl::OUString& rParent, const ::std::vector< XMLPropertyState >& rProperties ); + ::rtl::OUString AddAndCache( sal_Int32 nFamily, const ::rtl::OUString& rParent ); + + ::rtl::OUString FindAndRemoveCached( sal_Int32 nFamily ) const; + + /** Export all item sets ofs a certain class in the order in that they have been added. */ + void exportXML( sal_Int32 nFamily + , const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XDocumentHandler > & rHandler, + const SvXMLUnitConverter& rUnitConverter, + const SvXMLNamespaceMap& rNamespaceMap + ) const; + + void ClearEntries(); +}; + +#endif // _XMLOFF_XMLASTPLP_HXX diff --git a/xmloff/inc/xmloff/xmlcnimp.hxx b/xmloff/inc/xmloff/xmlcnimp.hxx new file mode 100644 index 000000000000..b3c27581690e --- /dev/null +++ b/xmloff/inc/xmloff/xmlcnimp.hxx @@ -0,0 +1,129 @@ +/************************************************************************* + * + * 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_XMLCNIMP_HXX +#define _XMLOFF_XMLCNIMP_HXX + +#include "sal/config.h" +#include "xmloff/dllapi.h" +#include "sal/types.h" +#include <com/sun/star/container/XNameAccess.hpp> +#include <svl/svarray.hxx> +#include <xmloff/nmspmap.hxx> + +#define _SVSTDARR_USHORTS +#include <svl/svstdarr.hxx> + +namespace rtl { class OUString; } + +class SvXMLAttrContainerData_Impl; + +class XMLOFF_DLLPUBLIC SvXMLAttrContainerData +{ + SvXMLNamespaceMap aNamespaceMap; + SvUShorts aPrefixPoss; + SvXMLAttrContainerData_Impl *pLNames; + SvXMLAttrContainerData_Impl *pValues; + + SAL_DLLPRIVATE inline sal_uInt16 GetPrefixPos( sal_uInt16 i ) const; +public: + + SvXMLAttrContainerData( const SvXMLAttrContainerData& rImpl ); + SvXMLAttrContainerData(); + ~SvXMLAttrContainerData(); + + int operator ==( const SvXMLAttrContainerData& rCmp ) const; + + BOOL AddAttr( const ::rtl::OUString& rLName, const rtl::OUString& rValue ); + BOOL AddAttr( const ::rtl::OUString& rPrefix, const rtl::OUString& rNamespace, + const ::rtl::OUString& rLName, const rtl::OUString& rValue ); + BOOL AddAttr( const ::rtl::OUString& rPrefix, + const ::rtl::OUString& rLName, + const ::rtl::OUString& rValue ); + + sal_uInt16 GetAttrCount() const; + inline ::rtl::OUString GetAttrNamespace( sal_uInt16 i ) const; + inline ::rtl::OUString GetAttrPrefix( sal_uInt16 i ) const; + const ::rtl::OUString& GetAttrLName( sal_uInt16 i ) const; + const ::rtl::OUString& GetAttrValue( sal_uInt16 i ) const; + + sal_uInt16 GetFirstNamespaceIndex() const { return aNamespaceMap.GetFirstIndex(); } + sal_uInt16 GetNextNamespaceIndex( sal_uInt16 nIdx ) const { return aNamespaceMap.GetNextIndex( nIdx ); } + inline const ::rtl::OUString& GetNamespace( sal_uInt16 i ) const; + inline const ::rtl::OUString& GetPrefix( sal_uInt16 i ) const; + + BOOL SetAt( sal_uInt16 i, + const ::rtl::OUString& rLName, const rtl::OUString& rValue ); + BOOL SetAt( sal_uInt16 i, + const ::rtl::OUString& rPrefix, const rtl::OUString& rNamespace, + const ::rtl::OUString& rLName, const rtl::OUString& rValue ); + BOOL SetAt( sal_uInt16 i, + const ::rtl::OUString& rPrefix, + const ::rtl::OUString& rLName, + const ::rtl::OUString& rValue ); + + void Remove( sal_uInt16 i ); +}; + +inline sal_uInt16 SvXMLAttrContainerData::GetPrefixPos( sal_uInt16 i ) const +{ +// DBG_ASSERT( i >= 0 && i < aPrefixPoss.Count(), +// "SvXMLAttrContainerData::GetPrefixPos: illegal index" ); + return aPrefixPoss[i]; +} + +inline ::rtl::OUString SvXMLAttrContainerData::GetAttrNamespace( sal_uInt16 i ) const +{ + ::rtl::OUString sRet; + sal_uInt16 nPos = GetPrefixPos( i ); + if( USHRT_MAX != nPos ) + sRet = aNamespaceMap.GetNameByIndex( nPos ); + return sRet; +} + +inline ::rtl::OUString SvXMLAttrContainerData::GetAttrPrefix( sal_uInt16 i ) const +{ + ::rtl::OUString sRet; + sal_uInt16 nPos = GetPrefixPos( i ); + if( USHRT_MAX != nPos ) + sRet = aNamespaceMap.GetPrefixByIndex( nPos ); + return sRet; +} + +inline const ::rtl::OUString& SvXMLAttrContainerData::GetNamespace( + sal_uInt16 i ) const +{ + return aNamespaceMap.GetNameByIndex( i ); +} + +inline const ::rtl::OUString& SvXMLAttrContainerData::GetPrefix( sal_uInt16 i ) const +{ + return aNamespaceMap.GetPrefixByIndex( i ); +} + +#endif + diff --git a/xmloff/inc/xmloff/xmlement.hxx b/xmloff/inc/xmloff/xmlement.hxx new file mode 100644 index 000000000000..011e3b27dff0 --- /dev/null +++ b/xmloff/inc/xmloff/xmlement.hxx @@ -0,0 +1,60 @@ +/************************************************************************* + * + * 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_XMLEMENT_HXX +#define _XMLOFF_XMLEMENT_HXX + +#ifndef _SAL_TYPES_H +#include <sal/types.h> +#endif +#include <xmloff/xmltoken.hxx> + +/** Map an XMLTokenEnum to a sal_uInt16 value. + * To be used with SvXMLUnitConverter::convertEnum(...) + */ +struct SvXMLEnumMapEntry +{ + ::xmloff::token::XMLTokenEnum eToken; + sal_uInt16 nValue; +}; + +#define ENUM_STRING_MAP_ENTRY(name,tok) { name, sizeof(name)-1, tok } + +#define ENUM_STRING_MAP_END() { NULL, 0, 0 } + +/** Map a const sal_Char* (with length) to a sal_uInt16 value. + * To be used with SvXMLUnitConverter::convertEnum(...) + */ +struct SvXMLEnumStringMapEntry +{ + const sal_Char * pName; + sal_Int32 nNameLength; + sal_uInt16 nValue; +}; + +#endif // _XMLOFF_XMLEMENT_HXX + diff --git a/xmloff/inc/xmloff/xmlevent.hxx b/xmloff/inc/xmloff/xmlevent.hxx new file mode 100644 index 000000000000..d4cf77e06594 --- /dev/null +++ b/xmloff/inc/xmloff/xmlevent.hxx @@ -0,0 +1,152 @@ +/************************************************************************* + * + * 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_XMLEVENT_HXX +#define _XMLOFF_XMLEVENT_HXX + +#include <com/sun/star/uno/Sequence.hxx> +#include <com/sun/star/uno/Reference.hxx> + + +/** + * @#file + * + * Several definition used in im- and export of events + */ + +namespace com { namespace sun { namespace star { + namespace xml { namespace sax { class XAttributeList; } } + namespace beans { struct PropertyValue; } +} } } +namespace rtl { class OUString; } + +class SvXMLExport; +class SvXMLImportContext; +class SvXMLImport; +class XMLEventsImportContext; + + +struct XMLEventName +{ + sal_uInt16 m_nPrefix; + ::rtl::OUString m_aName; + + XMLEventName() : m_nPrefix( 0 ) {} + XMLEventName( sal_uInt16 n, const sal_Char *p ) : + m_nPrefix( n ), + m_aName( ::rtl::OUString::createFromAscii(p) ) + {} + + XMLEventName( sal_uInt16 n, const ::rtl::OUString& r ) : + m_nPrefix( n ), + m_aName( r ) + {} + + bool operator<( const XMLEventName& r ) const + { + return m_nPrefix < r.m_nPrefix || + (m_nPrefix == r.m_nPrefix && m_aName < r.m_aName ); + } + +}; + +/** + * XMLEventNameTranslation: define tables that translate between event names + * as used in the XML file format and in the StarOffice API. + * The last entry in the table must be { NULL, 0, NULL }. + */ +struct XMLEventNameTranslation +{ + const sal_Char* sAPIName; + sal_uInt16 nPrefix; // namespace prefix + const sal_Char* sXMLName; +}; + +/// a translation table for the events defined in the XEventsSupplier service +/// (implemented in XMLEventExport.cxx) +extern const XMLEventNameTranslation aStandardEventTable[]; + + +/** + * Handle export of an event for a certain event type (event type as + * defined by the PropertyValue "EventType" in API). + * + * The Handler has to generate the full <script:event> element. + */ +class XMLEventExportHandler +{ +public: + virtual ~XMLEventExportHandler() {}; + + virtual void Export( + SvXMLExport& rExport, /// the current XML export + const ::rtl::OUString& rEventQName, /// the XML name of the event + ::com::sun::star::uno::Sequence< /// the values for the event + ::com::sun::star::beans::PropertyValue> & rValues, + sal_Bool bUseWhitespace) = 0; /// create whitespace around elements? +}; + + +/** + * Handle import of an event for a certain event type (as defined by + * the PropertyValue "EventType" in the API). + * + * EventContextFactories must be registered with the EventImportHelper + * that is attached to the SvXMLImport. + * + * The factory has to create an import context for a <script:event> + * element. The context has to call the + * EventsImportContext::AddEventValues() method to fave its event + * registered with the enclosing element. For events consisting only + * of attributes (and an empty element) an easy solution is to handle + * all attributes in the CreateContext()-method and return a default + * context. + * + * EventContextFactory objects have to be registered with the + * EventsImportHelper. + */ +class XMLEventContextFactory +{ +public: + virtual ~XMLEventContextFactory() {}; + + virtual SvXMLImportContext* CreateContext( + SvXMLImport& rImport, /// import context + sal_uInt16 nPrefix, /// element: namespace prefix + const ::rtl::OUString& rLocalName, /// element: local name + const ::com::sun::star::uno::Reference< /// attribute list + ::com::sun::star::xml::sax::XAttributeList> & xAttrList, + /// the context for the enclosing <script:events> element + XMLEventsImportContext* rEvents, + /// the event name (as understood by the API) + const ::rtl::OUString& rApiEventName, + /// the event type name (as registered) + const ::rtl::OUString& rApiLanguage) = 0; +}; + + +#endif diff --git a/xmloff/inc/xmloff/xmlexp.hxx b/xmloff/inc/xmloff/xmlexp.hxx new file mode 100644 index 000000000000..03903f38a331 --- /dev/null +++ b/xmloff/inc/xmloff/xmlexp.hxx @@ -0,0 +1,733 @@ +/************************************************************************* + * + * 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_XMLEXP_HXX +#define _XMLOFF_XMLEXP_HXX + +#include "sal/config.h" +#include "xmloff/dllapi.h" +#include "sal/types.h" + +#include <com/sun/star/embed/XStorage.hpp> +#include <com/sun/star/xml/sax/SAXParseException.hpp> +#include <com/sun/star/xml/sax/XExtendedDocumentHandler.hpp> +#include <com/sun/star/xml/sax/SAXException.hpp> +#include <com/sun/star/xml/sax/XDocumentHandler.hpp> +#include <com/sun/star/xml/sax/XAttributeList.hpp> +#include <com/sun/star/xml/sax/XLocator.hpp> +#include <com/sun/star/util/XNumberFormatsSupplier.hpp> +#include <com/sun/star/lang/XUnoTunnel.hpp> +#include <rtl/ustring.hxx> +#include <tools/mapunit.hxx> +#include <xmloff/txtparae.hxx> +#include <xmloff/formlayerexport.hxx> +#include <xmloff/xmlnumfe.hxx> +#include <xmloff/xmlaustp.hxx> +#include <xmloff/shapeexport.hxx> +#include <xmloff/xmltoken.hxx> +#include <xmloff/SchXMLExportHelper.hxx> +#include <xmloff/XMLFontAutoStylePool.hxx> +#include <com/sun/star/document/XFilter.hpp> +#include <com/sun/star/lang/XServiceInfo.hpp> +#include <com/sun/star/document/XExporter.hpp> +#ifndef _COM_SUN_STAR_DRAWING_XGRAPHICOBJECTRESOLVER_HPP_ +#include <com/sun/star/document/XGraphicObjectResolver.hpp> +#endif +#ifndef _COM_SUN_STAR_DRAWING_XEMBEDDEDOBJECTRESOLVER_HPP_ +#include <com/sun/star/document/XEmbeddedObjectResolver.hpp> +#endif +#include <com/sun/star/beans/XPropertySet.hpp> +#include <com/sun/star/lang/XInitialization.hpp> +#include <com/sun/star/lang/XEventListener.hpp> +#include <com/sun/star/container/XNamed.hpp> + +#include <unotools/saveopt.hxx> + +#include <xmloff/XMLPageExport.hxx> +#include <xmloff/ProgressBarHelper.hxx> +#include <cppuhelper/implbase6.hxx> + +#include <list> + +class SvXMLNamespaceMap; +class SvXMLAttributeList; +class SvXMLExport_Impl; +class SvXMLUnitConverter; +class ProgressBarHelper; +class XMLEventExport; +class XMLSettingsExportHelper; +class XMLImageMapExport; +class XMLErrors; + +// --> OD 2006-03-14 #i51726# +#include <unotools/moduleoptions.hxx> +// <-- + +namespace rtl { class OUString; } +namespace com { namespace sun { namespace star { + namespace uno { class XComponentContext; } + namespace frame { class XModel; } + namespace container { class XIndexContainer; } +} } } +namespace comphelper { class UnoInterfaceToUniqueIdentifierMapper; } + +#define EXPORT_META 0x0001 +#define EXPORT_STYLES 0x0002 +#define EXPORT_MASTERSTYLES 0x0004 +#define EXPORT_AUTOSTYLES 0x0008 +#define EXPORT_CONTENT 0x0010 +#define EXPORT_SCRIPTS 0x0020 +#define EXPORT_SETTINGS 0x0040 +#define EXPORT_FONTDECLS 0x0080 +#define EXPORT_EMBEDDED 0x0100 +#define EXPORT_NODOCTYPE 0x0200 +#define EXPORT_PRETTY 0x0400 +#define EXPORT_SAVEBACKWARDCOMPATIBLE 0x0800 +#define EXPORT_OASIS 0x8000 +#define EXPORT_ALL 0x7fff + +class XMLOFF_DLLPUBLIC SvXMLExport : public ::cppu::WeakImplHelper6< + ::com::sun::star::document::XFilter, + ::com::sun::star::lang::XServiceInfo, + ::com::sun::star::document::XExporter, + ::com::sun::star::lang::XInitialization, + ::com::sun::star::container::XNamed, + ::com::sun::star::lang::XUnoTunnel> +{ + SvXMLExport_Impl *mpImpl; // dummy + + // #110680# + ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > mxServiceFactory; + + ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel > mxModel; + ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XDocumentHandler > mxHandler; // the handlers + ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XExtendedDocumentHandler > mxExtHandler; + ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatsSupplier > mxNumberFormatsSupplier; + ::com::sun::star::uno::Reference< ::com::sun::star::document::XGraphicObjectResolver > mxGraphicResolver; + ::com::sun::star::uno::Reference< ::com::sun::star::document::XEmbeddedObjectResolver > mxEmbeddedResolver; + ::com::sun::star::uno::Reference< ::com::sun::star::task::XStatusIndicator > mxStatusIndicator; + ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > mxExportInfo; + ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener > mxEventListener; + + SvXMLAttributeList *mpAttrList; // a common attribute list + ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList > mxAttrList; // and an interface of it + + ::rtl::OUString msOrigFileName; // the original URL + ::rtl::OUString msPicturesPath; + ::rtl::OUString msGraphicObjectProtocol; + ::rtl::OUString msEmbeddedObjectProtocol; + ::rtl::OUString msObjectsPath; + ::rtl::OUString msFilterName; + SvXMLNamespaceMap *mpNamespaceMap; // the namepspace map + SvXMLUnitConverter *mpUnitConv; // the unit converter + SvXMLNumFmtExport *mpNumExport; + ProgressBarHelper *mpProgressBarHelper; + + UniReference< XMLTextParagraphExport > mxTextParagraphExport; + UniReference< XMLShapeExport > mxShapeExport; + UniReference< SvXMLAutoStylePoolP > mxAutoStylePool; + UniReference< SchXMLExportHelper > mxChartExport; + UniReference< XMLPageExport > mxPageExport; + UniReference< XMLFontAutoStylePool > mxFontAutoStylePool; + UniReference< xmloff::OFormLayerXMLExport > mxFormExport; + XMLEventExport* mpEventExport; + XMLImageMapExport* mpImageMapExport; + XMLErrors* mpXMLErrors; + + sal_Bool mbExtended; // Does document contain extens. + + const enum ::xmloff::token::XMLTokenEnum meClass; + SAL_DLLPRIVATE void _InitCtor(); + + sal_uInt16 mnExportFlags; + sal_uInt16 mnErrorFlags; + bool mbEnableExperimentalOdfExport; + +public: + + const ::rtl::OUString msWS; // " " + +private: + + // --> OD 2006-03-10 #i51726# + SvtModuleOptions::EFactory meModelType; + SAL_DLLPRIVATE void _DetermineModelType(); + // <-- + + SAL_DLLPRIVATE void ImplExportMeta(); // <office:meta> + SAL_DLLPRIVATE void ImplExportSettings(); // <office:settings> + SAL_DLLPRIVATE void ImplExportStyles( sal_Bool bUsed ); // <office:styles> + SAL_DLLPRIVATE void ImplExportAutoStyles( sal_Bool bUsed ); + // <office:automatic-styles> + SAL_DLLPRIVATE void ImplExportMasterStyles( sal_Bool bUsed ); + // <office:master-styles> + SAL_DLLPRIVATE void ImplExportContent(); // <office:body> + virtual void SetBodyAttributes(); + void GetViewSettingsAndViews(com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue>& rProps); + +protected: + void setExportFlags( sal_uInt16 nExportFlags ) { mnExportFlags = nExportFlags; } + + // Get (modifyable) namespace map + SvXMLNamespaceMap& _GetNamespaceMap() { return *mpNamespaceMap; } + + // get a new namespave map (used in starmath to have a default namespace) + void ResetNamespaceMap(); + + // This method can be overloaded to export the content of <office:meta>. + // There is a default implementation. + virtual void _ExportMeta(); + + // This method can be overloaded to export the content of <office:scripts>. + // There is a default implementation. + virtual void _ExportScripts(); + + // This method can be overloaded to export the font declarations + // The default implementation will export the contents of the + // XMLFontAutoStylePool if it has been created. + virtual void _ExportFontDecls(); + + // This method should be overloaded to export the content of <style:styles>. + // If bUsed is set, used styles should be exported only. + // Overloaded Methods must call this method ! + virtual void _ExportStyles( sal_Bool bUsed ) ; + + // This method must be overloaded to export the contents of + // <style:auto-styles> + virtual void _ExportAutoStyles() = 0; + + // This method must be overloaded to export the contents of + // <style:master-styles> + virtual void _ExportMasterStyles() = 0; + + // This method must be overloaded to export the content of <office:body>. + virtual void _ExportContent() = 0; + + void SetExtended( sal_Bool bSet=sal_True ) { mbExtended = bSet; } + + // save linked sections? (may be false in global documents) + sal_Bool mbSaveLinkedSections; + + virtual XMLTextParagraphExport* CreateTextParagraphExport(); + virtual XMLShapeExport* CreateShapeExport(); + virtual SvXMLAutoStylePoolP* CreateAutoStylePool(); + virtual SchXMLExportHelper* CreateChartExport(); + virtual XMLPageExport* CreatePageExport(); + virtual XMLFontAutoStylePool* CreateFontAutoStylePool(); + virtual xmloff::OFormLayerXMLExport* CreateFormExport(); + virtual void GetViewSettings(com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue>& aProps); + virtual void GetConfigurationSettings(com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue>& aProps); + + struct SettingsGroup + { + ::xmloff::token::XMLTokenEnum eGroupName; + ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > aSettings; + + SettingsGroup() + :eGroupName( ::xmloff::token::XML_TOKEN_INVALID ) + ,aSettings() + { + } + + SettingsGroup( + const ::xmloff::token::XMLTokenEnum _eGroupName, + const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& _rSettings ) + :eGroupName( _eGroupName ) + ,aSettings( _rSettings ) + { + } + }; + /** returns the current document settings + + The default implementation will obtain the view settings by calling GetViewSettingsAndViews, and the + configuration settings by calling GetConfigurationSettings, and return them together with the proper XML token. + + @return + the accumulated count of all settings in all groups + */ + virtual sal_Int32 GetDocumentSpecificSettings( ::std::list< SettingsGroup >& _out_rSettings ); + + const ::com::sun::star::uno::Reference< ::com::sun::star::document::XEmbeddedObjectResolver >& GetEmbeddedResolver() const { return mxEmbeddedResolver; } + inline void SetEmbeddedResolver( com::sun::star::uno::Reference< com::sun::star::document::XEmbeddedObjectResolver >& _xEmbeddedResolver ); + + const ::com::sun::star::uno::Reference< ::com::sun::star::document::XGraphicObjectResolver >& GetGraphicResolver() const { return mxGraphicResolver; } + void SetGraphicResolver( com::sun::star::uno::Reference< com::sun::star::document::XGraphicObjectResolver >& _xGraphicResolver ); + + void SetDocHandler( const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XDocumentHandler > &rHandler ); + +public: + + // #110680# + //SvXMLExport( MapUnit eDfltUnit, + // const enum ::xmloff::token::XMLTokenEnum eClass = xmloff::token::XML_TOKEN_INVALID, + // sal_uInt16 nExportFlag = EXPORT_ALL ); + SvXMLExport( + const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xServiceFactory, + MapUnit eDfltUnit, + const enum ::xmloff::token::XMLTokenEnum eClass = xmloff::token::XML_TOKEN_INVALID, + sal_uInt16 nExportFlag = EXPORT_ALL ); + + // #110680# + //SvXMLExport( const ::rtl::OUString& rFileName, + // const ::com::sun::star::uno::Reference< + // ::com::sun::star::xml::sax::XDocumentHandler > & rHandler, + // MapUnit eDfltUnit = MAP_INCH ); + SvXMLExport( + const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xServiceFactory, + const ::rtl::OUString& rFileName, + const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XDocumentHandler > & rHandler, + MapUnit eDfltUnit = MAP_INCH ); + + // #110680# + //SvXMLExport( const ::rtl::OUString& rFileName, + // const ::com::sun::star::uno::Reference< + // ::com::sun::star::xml::sax::XDocumentHandler > & rHandler, + // const ::com::sun::star::uno::Reference< + // ::com::sun::star::frame::XModel > &, + // sal_Int16 eDfltUnit ); + SvXMLExport( + const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xServiceFactory, + const ::rtl::OUString& rFileName, + const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XDocumentHandler > & rHandler, + const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel > &, + sal_Int16 eDfltUnit ); + + // #110680# + //SvXMLExport( const ::rtl::OUString& rFileName, + // const ::com::sun::star::uno::Reference< + // ::com::sun::star::xml::sax::XDocumentHandler > & rHandler, + // const ::com::sun::star::uno::Reference< + // ::com::sun::star::frame::XModel > &, + // const ::com::sun::star::uno::Reference< + // ::com::sun::star::document::XGraphicObjectResolver > &, + // sal_Int16 eDfltUnit ); + SvXMLExport( + const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xServiceFactory, + const ::rtl::OUString& rFileName, + const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XDocumentHandler > & rHandler, + const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel > &, + const ::com::sun::star::uno::Reference< ::com::sun::star::document::XGraphicObjectResolver > &, + sal_Int16 eDfltUnit ); + + virtual ~SvXMLExport(); + + static const ::com::sun::star::uno::Sequence< sal_Int8 > & getUnoTunnelId() throw(); + static SvXMLExport* getImplementation( ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > ) throw(); + + // XExporter + virtual void SAL_CALL setSourceDocument( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent >& xDoc ) throw(::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException); + + // XFilter + virtual sal_Bool SAL_CALL filter( const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& aDescriptor ) throw(::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL cancel() throw(::com::sun::star::uno::RuntimeException); + + // XInitialization + virtual void SAL_CALL initialize( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aArguments ) throw(::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException); + + // XNamed + virtual ::rtl::OUString SAL_CALL getName( ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setName( const ::rtl::OUString& aName ) throw (::com::sun::star::uno::RuntimeException); + + // XServiceInfo + virtual ::rtl::OUString SAL_CALL getImplementationName( ) throw(::com::sun::star::uno::RuntimeException); + virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName ) throw(::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames( ) throw(::com::sun::star::uno::RuntimeException); + + // XUnoTunnel + virtual sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& aIdentifier ) throw(::com::sun::star::uno::RuntimeException); + + /** ensures that the given namespace is in scope at the next started + element. + + <p>If the namespace is not yet declared, the necessary attribute will + be added, as well.</p> + + @param i_rNamespace the namespace to be declared + @param i_rPreferredPrefix (opt.) preferred prefix for the namespace + + @returns the actual prefix that the namespace is associated with + */ + ::rtl::OUString + EnsureNamespace(::rtl::OUString const & i_rNamespace, + ::rtl::OUString const & i_rPreferredPrefix + = ::rtl::OUString::createFromAscii("gen") ); + + // Check if common attribute list is empty. +#ifndef DBG_UTIL + void CheckAttrList() {} +#else + void CheckAttrList(); +#endif + + // Clear common attribute list. + void ClearAttrList(); + + // Add an attribute to the common attribute list. + void AddAttributeASCII( sal_uInt16 nPrefix, const sal_Char *pName, + const sal_Char *pValue ); + void AddAttribute( sal_uInt16 nPrefix, const sal_Char *pName, + const ::rtl::OUString& rValue ); + void AddAttribute( sal_uInt16 nPrefix, const ::rtl::OUString& rName, + const ::rtl::OUString& rValue ); + void AddAttribute( sal_uInt16 nPrefix, + enum ::xmloff::token::XMLTokenEnum eName, + const ::rtl::OUString& rValue ); + void AddAttribute( sal_uInt16 nPrefix, + enum ::xmloff::token::XMLTokenEnum eName, + enum ::xmloff::token::XMLTokenEnum eValue ); + void AddAttribute( const ::rtl::OUString& rQName, + const ::rtl::OUString& rValue ); + void AddAttribute( const ::rtl::OUString& rQName, + enum ::xmloff::token::XMLTokenEnum eValue ); + // add several attributes to the common attribute list + void AddAttributeList( const ::com::sun::star::uno::Reference< + ::com::sun::star::xml::sax::XAttributeList >& xAttrList ); + + // Get common attribute list as implementation or interface. + SvXMLAttributeList &GetAttrList() { return *mpAttrList; } + const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList > & GetXAttrList() { return mxAttrList; } + + // Get document handler. This methods are not const, because the + // reference allowes modifications through the handler. + const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XDocumentHandler > & GetDocHandler() { return mxHandler; } + const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XExtendedDocumentHandler > & GetExtDocHandler() + { + return mxExtHandler; + } + + // Get original ::com::sun::star::util::URL. + const ::rtl::OUString& GetOrigFileName() const { return msOrigFileName; } + + // Get the relative path for embedded pictures + const ::rtl::OUString& GetPicturesPath() const { return msPicturesPath; } + + // Get the relative path for embedded objects + const ::rtl::OUString& GetObjectsPath() const { return msObjectsPath; } + + // Get (const) namespace map. + const SvXMLNamespaceMap& GetNamespaceMap() const { return *mpNamespaceMap; } + + // Get unit converter + const SvXMLUnitConverter& GetMM100UnitConverter() const { return *mpUnitConv; } + + SvXMLUnitConverter& GetMM100UnitConverter() { return *mpUnitConv; } + + // Export the document. + virtual sal_uInt32 exportDoc( enum ::xmloff::token::XMLTokenEnum eClass = ::xmloff::token::XML_TOKEN_INVALID ); + + virtual void addDataStyle(const sal_Int32 nNumberFormat, sal_Bool bTimeFormat = sal_False ); + virtual void exportDataStyles(); + virtual void exportAutoDataStyles(); + virtual rtl::OUString getDataStyleName(const sal_Int32 nNumberFormat, sal_Bool bTimeFormat = sal_False ) const; + sal_Int32 dataStyleForceSystemLanguage(sal_Int32 nFormat) const; + + virtual void exportAnnotationMeta( const com::sun::star::uno::Reference < com::sun::star::drawing::XShape >& xShape); + + // Get XModel + const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel > & + GetModel() const { return mxModel; } + // Get XNumberFormatsSupplier + ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatsSupplier > & GetNumberFormatsSupplier() { return mxNumberFormatsSupplier; } + inline void SetNumberFormatsSupplier(const ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatsSupplier >& _xNumberFormatSupplier) + { + mxNumberFormatsSupplier = _xNumberFormatSupplier; + if ( mxNumberFormatsSupplier.is() && mxHandler.is() ) + mpNumExport = new SvXMLNumFmtExport(*this, mxNumberFormatsSupplier); + } + + // get export helper for text + inline UniReference< XMLTextParagraphExport > GetTextParagraphExport(); + + // get export helper for shapes + inline UniReference< XMLShapeExport > GetShapeExport(); + + // get auto style pool + inline UniReference< SvXMLAutoStylePoolP > GetAutoStylePool(); + + // get Page Export + inline UniReference< XMLPageExport > GetPageExport(); + + // get chart export helper + inline UniReference< SchXMLExportHelper > GetChartExport(); + + // get font auto style pool + inline UniReference< XMLFontAutoStylePool > GetFontAutoStylePool(); + + ProgressBarHelper* GetProgressBarHelper(); + + // get Formlayer Export + inline UniReference< xmloff::OFormLayerXMLExport > GetFormExport(); + inline bool HasFormExport(); + + // get XPropertySet with export information + inline ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > getExportInfo() const { return mxExportInfo; } + + com::sun::star::uno::Reference< com::sun::star::task::XStatusIndicator > GetStatusIndicator() { return mxStatusIndicator; } + + /// get Event export, with handlers for script types "None" and + /// "StarBasic" already registered; other handlers may be registered, too. + XMLEventExport& GetEventExport(); + + /// get the export for image maps + XMLImageMapExport& GetImageMapExport(); + + ::rtl::OUString AddEmbeddedGraphicObject( + const ::rtl::OUString& rGraphicObjectURL ); + sal_Bool AddEmbeddedGraphicObjectAsBase64( + const ::rtl::OUString& rGraphicObjectURL ); + + ::rtl::OUString AddEmbeddedObject( + const ::rtl::OUString& rEmbeddedObjectURL ); + sal_Bool AddEmbeddedObjectAsBase64( + const ::rtl::OUString& rEmbeddedObjectURL ); + + ::rtl::OUString EncodeStyleName( const ::rtl::OUString& rName, + sal_Bool *pEncoded=0 ) const; + + // save linked sections? + inline sal_Bool IsSaveLinkedSections() { return mbSaveLinkedSections; } + + // get export flags + sal_uInt16 getExportFlags() const { return mnExportFlags; } + + sal_Bool ExportEmbeddedOwnObject( + ::com::sun::star::uno::Reference< + ::com::sun::star::lang::XComponent >& rComp ); + + rtl::OUString GetRelativeReference(const rtl::OUString& rValue); + + // methods for accessing the document handler and handling SAX errors + void StartElement(sal_uInt16 nPrefix, + enum ::xmloff::token::XMLTokenEnum eName, + sal_Bool bIgnWSOutside ); + void StartElement(const ::rtl::OUString& rName, + sal_Bool bIgnWSOutside ); + void Characters(const ::rtl::OUString& rChars); + void EndElement(sal_uInt16 nPrefix, + enum ::xmloff::token::XMLTokenEnum eName, + sal_Bool bIgnWSInside ); + void EndElement(const ::rtl::OUString& rName, + sal_Bool bIgnWSInside ); + void IgnorableWhitespace(); + + /** + * Record an error condition that occured during export. The + * behavior of SetError can be modified using the error flag + * constants. + */ + void SetError( + /// error ID, may contain an error flag + sal_Int32 nId, + /// string parameters for the error message + const ::com::sun::star::uno::Sequence< ::rtl::OUString> & rMsgParams, + /// original exception message (if applicable) + const ::rtl::OUString& rExceptionMessage, + /// error location (if applicable) + const ::com::sun::star::uno::Reference< + ::com::sun::star::xml::sax::XLocator> & rLocator ); + + void SetError( + sal_Int32 nId, + const ::com::sun::star::uno::Sequence< ::rtl::OUString> & rMsgParams); + + /** return list of errors */ + XMLErrors* GetErrors(); + + /** return current error flags (logical 'or' of all error flags so far) */ + sal_uInt16 GetErrorFlags() { return mnErrorFlags; } + + virtual void DisposingModel(); + + ::comphelper::UnoInterfaceToUniqueIdentifierMapper& getInterfaceToIdentifierMapper(); + + // #110680# + ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > getServiceFactory(); + + ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > + GetComponentContext() const; + + // --> OD 2006-03-10 #i51726# + SvtModuleOptions::EFactory GetModelType() const + { + return meModelType; + } + // <-- + + // --> OD 2006-09-27 #i69627# + sal_Bool writeOutlineStyleAsNormalListStyle() const; + // <-- + bool isExperimentalOdfExportEnabled() const { return mbEnableExperimentalOdfExport; } + + ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage > GetTargetStorage(); + + /// returns the currently configured default version for odf export + SvtSaveOptions::ODFDefaultVersion getDefaultVersion() const; + + /// name of stream in package, e.g., "content.xml" + ::rtl::OUString GetStreamName() const; + + // FIXME: this is only for legacy stuff that has not yet been adapted + // to implement XMetadatable; this can write duplicate IDs! + /// add xml:id and legacy namespace id + void SAL_DLLPRIVATE AddAttributeIdLegacy( + sal_uInt16 const nLegacyPrefix, ::rtl::OUString const& rValue); + + /// add xml:id attribute (for RDF metadata) + void AddAttributeXmlId(::com::sun::star::uno::Reference< + ::com::sun::star::uno::XInterface> const & i_xIfc); + + /// add RDFa attributes for a metadatable text content + void AddAttributesRDFa( ::com::sun::star::uno::Reference< + ::com::sun::star::text::XTextContent> const & i_xTextContent); + + // --> OD 2008-11-26 #158694# + sal_Bool exportTextNumberElement() const; + // <-- + + /// set null date from model to unit converter, if not already done + sal_Bool SetNullDateOnUnitConverter(); +}; + +inline UniReference< XMLTextParagraphExport > SvXMLExport::GetTextParagraphExport() +{ + if( !mxTextParagraphExport.is() ) + mxTextParagraphExport = CreateTextParagraphExport(); + + return mxTextParagraphExport; +} + +inline UniReference< XMLShapeExport > SvXMLExport::GetShapeExport() +{ + if( !mxShapeExport.is() ) + mxShapeExport = CreateShapeExport(); + + return mxShapeExport; +} + +inline UniReference< SvXMLAutoStylePoolP > SvXMLExport::GetAutoStylePool() +{ + if( !mxAutoStylePool.is() ) + mxAutoStylePool = CreateAutoStylePool(); + + return mxAutoStylePool; +} + +inline UniReference< SchXMLExportHelper > SvXMLExport::GetChartExport() +{ + if( !mxChartExport.is() ) + mxChartExport = CreateChartExport(); + + return mxChartExport; +} + +inline UniReference< XMLPageExport > SvXMLExport::GetPageExport() +{ + if( !mxPageExport.is() ) + mxPageExport = CreatePageExport(); + + return mxPageExport; +} + +inline UniReference< XMLFontAutoStylePool > SvXMLExport::GetFontAutoStylePool() +{ + if( !mxFontAutoStylePool.is() ) + mxFontAutoStylePool = CreateFontAutoStylePool(); + + return mxFontAutoStylePool; +} + +inline UniReference< xmloff::OFormLayerXMLExport > SvXMLExport::GetFormExport() +{ + if( !mxFormExport.is() ) + mxFormExport = CreateFormExport(); + + return mxFormExport; +} + +inline bool SvXMLExport::HasFormExport() +{ + return mxFormExport.is(); +} + +inline void SvXMLExport::SetEmbeddedResolver( + com::sun::star::uno::Reference< com::sun::star::document::XEmbeddedObjectResolver >& _xEmbeddedResolver ) +{ + mxEmbeddedResolver = _xEmbeddedResolver; +} + +inline void SvXMLExport::SetGraphicResolver( + com::sun::star::uno::Reference< com::sun::star::document::XGraphicObjectResolver >& _xGraphicResolver ) +{ + mxGraphicResolver = _xGraphicResolver; +} + +// Helper class to export an element. +class XMLOFF_DLLPUBLIC SvXMLElementExport +{ + SvXMLExport& rExport; + ::rtl::OUString aName; + sal_Bool bIgnWS : 1; + sal_Bool bDoSomething : 1; + + SAL_DLLPRIVATE void StartElement( SvXMLExport& rExp, sal_uInt16 nPrefix, + const ::rtl::OUString& rName, + sal_Bool bIgnWSOutside ); + +public: + + // The constructor prints a start tag that has the common attributes + // of the XMLExport instance attached. + SvXMLElementExport( SvXMLExport& rExp, sal_uInt16 nPrefix, + const sal_Char *pName, + sal_Bool bIgnWSOutside, sal_Bool bIgnWSInside ); + SvXMLElementExport( SvXMLExport& rExp, sal_uInt16 nPrefix, + const ::rtl::OUString& rName, + sal_Bool bIgnWSOutside, sal_Bool bIgnWSInside ); + SvXMLElementExport( SvXMLExport& rExp, sal_uInt16 nPrefix, + enum ::xmloff::token::XMLTokenEnum eName, + sal_Bool bIgnWSOutside, sal_Bool bIgnWSInside ); + SvXMLElementExport( SvXMLExport& rExp, const ::rtl::OUString& rQName, + sal_Bool bIgnWSOutside, sal_Bool bIgnWSInside ); + + // Thes constructors do nothing if bDoSomething is not set + SvXMLElementExport( SvXMLExport& rExp, sal_Bool bDoSomething, + sal_uInt16 nPrefix, const sal_Char *pName, + sal_Bool bIgnWSOutside, sal_Bool bIgnWSInside ); + SvXMLElementExport( SvXMLExport& rExp, sal_Bool bDoSomething, + sal_uInt16 nPrefix, const ::rtl::OUString& rName, + sal_Bool bIgnWSOutside, sal_Bool bIgnWSInside ); + SvXMLElementExport( SvXMLExport& rExp, sal_Bool bDoSomething, + sal_uInt16 nPrefix, + enum ::xmloff::token::XMLTokenEnum eName, + sal_Bool bIgnWSOutside, sal_Bool bIgnWSInside ); + + // The destructor prints an end tag. + ~SvXMLElementExport(); +}; + +#endif // _XMLOFF_SVXMLEXP_HXX + diff --git a/xmloff/inc/xmloff/xmlexppr.hxx b/xmloff/inc/xmloff/xmlexppr.hxx new file mode 100644 index 000000000000..36b7e0ec02a8 --- /dev/null +++ b/xmloff/inc/xmloff/xmlexppr.hxx @@ -0,0 +1,204 @@ +/************************************************************************* + * + * 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_XMLEXPPR_HXX +#define _XMLOFF_XMLEXPPR_HXX + +#include "sal/config.h" +#include "xmloff/dllapi.h" +#include <xmloff/xmlprmap.hxx> +#include <xmloff/uniref.hxx> + +namespace rtl { class OUString; } + +class SvXMLUnitConverter; +class SvXMLAttributeList; +class SvXMLNamespaceMap; +class SvUShorts; +class FilterPropertiesInfos_Impl; +class SvXMLExport; + +#define XML_EXPORT_FLAG_DEFAULTS 0x0001 // export also default items +#define XML_EXPORT_FLAG_DEEP 0x0002 // export also items from + // parent item sets +#define XML_EXPORT_FLAG_EMPTY 0x0004 // export attribs element + // even if its empty +#define XML_EXPORT_FLAG_IGN_WS 0x0008 + +class XMLOFF_DLLPUBLIC SvXMLExportPropertyMapper : public UniRefBase +{ + UniReference< SvXMLExportPropertyMapper> mxNextMapper; + + FilterPropertiesInfos_Impl *pCache; + +protected: + UniReference< XMLPropertySetMapper > maPropMapper; + + rtl::OUString maStyleName; + + /** Filter all properties we don't want to export: + Take all properties of the XPropertySet which are also found in the + XMLPropertyMapEntry-array and which are not set directly (so, the value isn't + default and isn't inherited, apart from bDefault is true) + After this process It'll called 'Contextfilter' for application-specific + filter-processes. */ + ::std::vector< XMLPropertyState > _Filter( + const ::com::sun::star::uno::Reference< + ::com::sun::star::beans::XPropertySet > rPropSet, + const sal_Bool bDefault ) const; + + /** Application-specific filter. By default do nothing. */ + virtual void ContextFilter( + ::std::vector< XMLPropertyState >& rProperties, + ::com::sun::star::uno::Reference< + ::com::sun::star::beans::XPropertySet > rPropSet ) const; + + /** fills the given attribute list with the items in the given set */ + void _exportXML( sal_uInt16 nPropType, sal_uInt16& rPropTypeFlags, + SvXMLAttributeList& rAttrList, + const ::std::vector< XMLPropertyState >& rProperties, + const SvXMLUnitConverter& rUnitConverter, + const SvXMLNamespaceMap& rNamespaceMap, + sal_uInt16 nFlags, + SvUShorts* pIndexArray, + sal_Int32 nPropMapStartIdx, sal_Int32 nPropMapEndIdx ) const; + + void _exportXML( SvXMLAttributeList& rAttrList, + const XMLPropertyState& rProperty, + const SvXMLUnitConverter& rUnitConverter, + const SvXMLNamespaceMap& rNamespaceMap, + sal_uInt16 nFlags, + const ::std::vector< XMLPropertyState > *pProperties = 0, + sal_uInt32 nIdx = 0 ) const; + + void exportElementItems( + SvXMLExport& rExport, + const ::std::vector< XMLPropertyState >& rProperties, + sal_uInt16 nFlags, + const SvUShorts& rIndexArray ) const; + +public: + + SvXMLExportPropertyMapper( + const UniReference< XMLPropertySetMapper >& rMapper ); + virtual ~SvXMLExportPropertyMapper(); + + // Add a ExportPropertyMapper at the end of the import mapper chain. + // The added mapper MUST not be used outside the Mapper chain any longer, + // because its PropertyMapper will be replaced. + void ChainExportMapper( + const UniReference< SvXMLExportPropertyMapper>& rMapper ); + + /** Filter all properties we don't want to export: + Take all properties of the XPropertySet which are also found in the + XMLPropertyMapEntry-array and which are not set directly (so, the value isn't + default and isn't inherited) + After this process It'll called 'Contextfilter' for application-specific + filter-processes. */ + ::std::vector< XMLPropertyState > Filter( + const ::com::sun::star::uno::Reference< + ::com::sun::star::beans::XPropertySet > rPropSet ) const + { return _Filter(rPropSet, sal_False); } + + /** Like Filter(), excepti that: + * - only properties that have the map flag MID_FLAG_DEFAULT_ITEM_EXPORT + * set are exported, + * - instead of the property's value, its defualt value is exported. + */ + ::std::vector< XMLPropertyState > FilterDefaults( + const ::com::sun::star::uno::Reference< + ::com::sun::star::beans::XPropertySet > rPropSet ) const + { return _Filter(rPropSet, sal_True); } + + /** Compare to arrays of XMLPropertyState */ + sal_Bool Equals( const ::std::vector< XMLPropertyState >& aProperties1, + const ::std::vector< XMLPropertyState >& aProperties2 ) const; + + /** fills the given attribute list with the items in the given set */ + void exportXML( + SvXMLAttributeList& rAttrList, + const ::std::vector< XMLPropertyState >& rProperties, + const SvXMLUnitConverter& rUnitConverter, + const SvXMLNamespaceMap& rNamespaceMap, + sal_uInt16 nFlags = 0 ) const; + /** like above but only properties whose property map index is within the + specified range are exported */ + void exportXML( + SvXMLAttributeList& rAttrList, + const ::std::vector< XMLPropertyState >& rProperties, + const SvXMLUnitConverter& rUnitConverter, + const SvXMLNamespaceMap& rNamespaceMap, + sal_Int32 nPropMapStartIdx, sal_Int32 nPropMapEndIdx, + sal_uInt16 nFlags = 0 ) const; + + /** fills the given attribute list with the representation of one item */ + void exportXML( + SvXMLAttributeList& rAttrList, + const XMLPropertyState& rProperty, + const SvXMLUnitConverter& rUnitConverter, + const SvXMLNamespaceMap& rNamespaceMap, + sal_uInt16 nFlags = 0 ) const; + + void exportXML( + SvXMLExport& rExport, + const ::std::vector< XMLPropertyState >& rProperties, + sal_uInt16 nFlags = 0 ) const; + + /** like above but only properties whose property map index is within the + specified range are exported */ + void exportXML( + SvXMLExport& rExport, + const ::std::vector< XMLPropertyState >& rProperties, + sal_Int32 nPropMapStartIdx, sal_Int32 nPropMapEndIdx, + sal_uInt16 nFlags = 0 ) const; + + /** this method is called for every item that has the + MID_FLAG_ELEMENT_EXPORT flag set */ + virtual void handleElementItem( + SvXMLExport& rExport, + const XMLPropertyState& rProperty, + sal_uInt16 nFlags, + const ::std::vector< XMLPropertyState > *pProperties = 0, + sal_uInt32 nIdx = 0 ) const; + + /** this method is called for every item that has the + MID_FLAG_SPECIAL_ITEM_EXPORT flag set */ + virtual void handleSpecialItem( + SvXMLAttributeList& rAttrList, + const XMLPropertyState& rProperty, + const SvXMLUnitConverter& rUnitConverter, + const SvXMLNamespaceMap& rNamespaceMap, + const ::std::vector< XMLPropertyState > *pProperties = 0, + sal_uInt32 nIdx = 0 ) const; + + inline const UniReference< XMLPropertySetMapper >& + getPropertySetMapper() const { return maPropMapper; } + + void SetStyleName( const rtl::OUString& rStyleName ) { maStyleName = rStyleName; } +}; + +#endif // _XMLOFF_XMLEXPPR_HXX diff --git a/xmloff/inc/xmloff/xmlictxt.hxx b/xmloff/inc/xmloff/xmlictxt.hxx new file mode 100644 index 000000000000..bb8d58cf791c --- /dev/null +++ b/xmloff/inc/xmloff/xmlictxt.hxx @@ -0,0 +1,108 @@ +/************************************************************************* + * + * 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_XMLICTXT_HXX +#define _XMLOFF_XMLICTXT_HXX + +#include "sal/config.h" +#include "xmloff/dllapi.h" +#include "sal/types.h" +#include <com/sun/star/xml/sax/XAttributeList.hpp> +#include <tools/solar.h> +#include <tools/ref.hxx> +#include <rtl/ustring.hxx> +#include <tools/rtti.hxx> + +class SvXMLNamespaceMap; +class SvXMLImport; + +class XMLOFF_DLLPUBLIC SvXMLImportContext : public SvRefBase +{ + friend class SvXMLImport; + + SvXMLImport& mrImport; + + USHORT mnPrefix; + ::rtl::OUString maLocalName; + + SvXMLNamespaceMap *mpRewindMap; + + SAL_DLLPRIVATE SvXMLNamespaceMap *GetRewindMap() const + { return mpRewindMap; } + SAL_DLLPRIVATE void SetRewindMap( SvXMLNamespaceMap *p ) { mpRewindMap = p; } + +protected: + + SvXMLImport& GetImport() { return mrImport; } + const SvXMLImport& GetImport() const { return mrImport; } + +public: + TYPEINFO(); + + USHORT GetPrefix() const { return mnPrefix; } + const ::rtl::OUString& GetLocalName() const { return maLocalName; } + + // A contexts constructor does anything that is required if an element + // starts. Namespace processing has been done already. + // Note that virtual methods cannot be used inside constructors. Use + // StartElement instead if this is required. + SvXMLImportContext( SvXMLImport& rImport, USHORT nPrfx, + const ::rtl::OUString& rLName ); + + // A contexts destructor does anything that is required if an element + // ends. By default, nothing is done. + // Note that virtual methods cannot be used inside destructors. Use + // EndElement instead if this is required. + virtual ~SvXMLImportContext(); + + // Create a childs element context. By default, the import's + // CreateContext method is called to create a new default context. + virtual SvXMLImportContext *CreateChildContext( USHORT nPrefix, + const ::rtl::OUString& rLocalName, + const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList ); + + // StartElement is called after a context has been constructed and + // before a elements context is parsed. It may be used for actions that + // require virtual methods. The default is to do nothing. + virtual void StartElement( const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList ); + + // EndElement is called before a context will be destructed, but + // after a elements context has been parsed. It may be used for actions + // that require virtual methods. The default is to do nothing. + virtual void EndElement(); + + // This method is called for all characters that are contained in the + // current element. The default is to ignore them. + virtual void Characters( const ::rtl::OUString& rChars ); +}; + +SV_DECL_REF( SvXMLImportContext ) +SV_IMPL_REF( SvXMLImportContext ) + + +#endif // _XMLOFF_XMLICTXT_HXX + diff --git a/xmloff/inc/xmloff/xmlimp.hxx b/xmloff/inc/xmloff/xmlimp.hxx new file mode 100644 index 000000000000..871703bf9ed7 --- /dev/null +++ b/xmloff/inc/xmloff/xmlimp.hxx @@ -0,0 +1,536 @@ +/************************************************************************* + * + * 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_XMLIMP_HXX +#define _XMLOFF_XMLIMP_HXX + +#include "sal/config.h" +#include "xmloff/dllapi.h" +#include "sal/types.h" +#include <com/sun/star/xml/sax/SAXParseException.hpp> +#include <com/sun/star/xml/sax/XExtendedDocumentHandler.hpp> +#include <com/sun/star/xml/sax/SAXException.hpp> +#include <com/sun/star/xml/sax/XAttributeList.hpp> +#include <com/sun/star/xml/sax/XLocator.hpp> +#include <com/sun/star/lang/XUnoTunnel.hpp> +#include <com/sun/star/util/XNumberFormatsSupplier.hpp> +#include <com/sun/star/container/XNameContainer.hpp> +#include <com/sun/star/lang/XInitialization.hpp> +#include <com/sun/star/lang/XServiceInfo.hpp> +#include <com/sun/star/document/XImporter.hpp> +#include <com/sun/star/document/XFilter.hpp> +#include <com/sun/star/document/XGraphicObjectResolver.hpp> +#include <com/sun/star/document/XEmbeddedObjectResolver.hpp> +#include <com/sun/star/beans/XPropertySet.hpp> +#include <cppuhelper/weak.hxx> +#include <xmloff/txtimp.hxx> +#include <xmloff/shapeimport.hxx> +#include <xmloff/SchXMLImportHelper.hxx> +#include <xmloff/ProgressBarHelper.hxx> +#include <cppuhelper/implbase6.hxx> +#include <xmloff/formlayerimport.hxx> + +#include <com/sun/star/beans/NamedValue.hpp> + +namespace rtl { class OUString; } +namespace com { namespace sun { namespace star { + namespace uno { class XComponentContext; } + namespace frame { class XModel; } + namespace io { class XOutputStream; } + namespace rdf { class XMetadatable; } +} } } +namespace comphelper { class UnoInterfaceToUniqueIdentifierMapper; } + +class SvXMLNamespaceMap; +class SvXMLImportContext; +class SvXMLImportContexts_Impl; +class SvXMLImport_Impl; +class SvXMLUnitConverter; +class SvXMLNumFmtHelper; +class XMLFontStylesContext; +class XMLEventImportHelper; +class XMLErrors; +class StyleMap; +class String; + +namespace xmloff { + class RDFaImportHelper; +} + +#define IMPORT_META 0x0001 +#define IMPORT_STYLES 0x0002 +#define IMPORT_MASTERSTYLES 0x0004 +#define IMPORT_AUTOSTYLES 0x0008 +#define IMPORT_CONTENT 0x0010 +#define IMPORT_SCRIPTS 0x0020 +#define IMPORT_SETTINGS 0x0040 +#define IMPORT_FONTDECLS 0x0080 +#define IMPORT_EMBEDDED 0x0100 +#define IMPORT_OOO_NAMESPACES 0x0100 +#define IMPORT_ALL 0xffff + + + +class XMLOFF_DLLPUBLIC SvXMLImport : public ::cppu::WeakImplHelper6< + ::com::sun::star::xml::sax::XExtendedDocumentHandler, + ::com::sun::star::lang::XServiceInfo, + ::com::sun::star::lang::XInitialization, + ::com::sun::star::document::XImporter, + ::com::sun::star::document::XFilter, + ::com::sun::star::lang::XUnoTunnel> +{ + friend class SvXMLImportContext; + + ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XLocator > mxLocator; + ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel > mxModel; + ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatsSupplier > mxNumberFormatsSupplier; + ::com::sun::star::uno::Reference< ::com::sun::star::document::XGraphicObjectResolver > mxGraphicResolver; + ::com::sun::star::uno::Reference< ::com::sun::star::document::XEmbeddedObjectResolver > mxEmbeddedResolver; + ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > mxImportInfo; + + UniReference< XMLTextImportHelper > mxTextImport; + UniReference< XMLShapeImportHelper > mxShapeImport; + UniReference< SchXMLImportHelper > mxChartImport; + UniReference< ::xmloff::OFormLayerXMLImport > mxFormImport; + + SvXMLImportContextRef mxFontDecls; + SvXMLImportContextRef mxStyles; + SvXMLImportContextRef mxAutoStyles; + SvXMLImportContextRef mxMasterStyles; + + ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer > mxGradientHelper; + ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer > mxHatchHelper; + ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer > mxBitmapHelper; + ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer > mxTransGradientHelper; + ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer > mxMarkerHelper; + ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer > mxDashHelper; + ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer > mxNumberStyles; + ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener > mxEventListener; + + SvXMLImport_Impl *mpImpl; // dummy + + SvXMLNamespaceMap *mpNamespaceMap; + SvXMLUnitConverter *mpUnitConv; + SvXMLImportContexts_Impl *mpContexts; + SvXMLNumFmtHelper *mpNumImport; + ProgressBarHelper *mpProgressBarHelper; + XMLEventImportHelper *mpEventImportHelper; + XMLErrors *mpXMLErrors; + StyleMap *mpStyleMap; + ::rtl::OUString msPackageProtocol; + + SAL_DLLPRIVATE void _InitCtor(); + + sal_uInt16 mnImportFlags; + sal_uInt16 mnErrorFlags; + +protected: + // #110680# + ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > mxServiceFactory; + + ::com::sun::star::uno::Reference< com::sun::star::task::XStatusIndicator > mxStatusIndicator; + sal_Bool mbIsFormsSupported; + bool mbIsTableShapeSupported; + bool mbIsGraphicLoadOnDemandSupported; + + // This method is called after the namespace map has been updated, but + // before a context for the current element has been pushed. + virtual SvXMLImportContext *CreateContext( sal_uInt16 nPrefix, + const ::rtl::OUString& rLocalName, + const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList ); + + virtual XMLTextImportHelper* CreateTextImport(); + virtual XMLShapeImportHelper* CreateShapeImport(); + inline sal_Bool HasShapeImport() const { return mxShapeImport.is(); } + inline void ClearShapeImport() { mxShapeImport = 0; } + + virtual SchXMLImportHelper* CreateChartImport(); + virtual ::xmloff::OFormLayerXMLImport* CreateFormImport(); + + void SetFontDecls( XMLFontStylesContext *pFontDecls ); + void SetStyles( SvXMLStylesContext *pStyles ); + void SetAutoStyles( SvXMLStylesContext *pAutoStyles ); + void SetMasterStyles( SvXMLStylesContext *pMasterStyles ); + + sal_Bool IsODFVersionConsistent( const ::rtl::OUString& aODFVersion ); + + const ::com::sun::star::uno::Reference< ::com::sun::star::document::XEmbeddedObjectResolver >& GetEmbeddedResolver() const { return mxEmbeddedResolver; } + inline void SetEmbeddedResolver( com::sun::star::uno::Reference< com::sun::star::document::XEmbeddedObjectResolver >& _xEmbeddedResolver ); + + const ::com::sun::star::uno::Reference< ::com::sun::star::document::XGraphicObjectResolver >& GetGraphicResolver() const { return mxGraphicResolver; } + void SetGraphicResolver( com::sun::star::uno::Reference< com::sun::star::document::XGraphicObjectResolver >& _xGraphicResolver ); + + + void _CreateNumberFormatsSupplier(); + void _CreateDataStylesImport(); + +public: + // #110680# + // SvXMLImport( sal_uInt16 nImportFlags = IMPORT_ALL ) throw(); + SvXMLImport( + const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xServiceFactory, + sal_uInt16 nImportFlags = IMPORT_ALL ) throw(); + + // #110680# + //SvXMLImport( const ::com::sun::star::uno::Reference< + // ::com::sun::star::frame::XModel > & ) throw(); + SvXMLImport( + const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xServiceFactory, + const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel > & ) throw(); + + // #110680# + //SvXMLImport( const ::com::sun::star::uno::Reference< + // ::com::sun::star::frame::XModel > &, + // const ::com::sun::star::uno::Reference< ::com::sun::star::document::XGraphicObjectResolver > & ) throw(); + SvXMLImport( + const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xServiceFactory, + const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel > &, + const ::com::sun::star::uno::Reference< ::com::sun::star::document::XGraphicObjectResolver > & ) throw(); + + virtual ~SvXMLImport() throw(); + + static const ::com::sun::star::uno::Sequence< sal_Int8 > & getUnoTunnelId() throw(); + static SvXMLImport* getImplementation( ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > ) throw(); + + // ::com::sun::star::xml::sax::XDocumentHandler + virtual void SAL_CALL startDocument(void) + throw( ::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException ); + virtual void SAL_CALL endDocument(void) + throw( ::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException ); + virtual void SAL_CALL startElement(const ::rtl::OUString& aName, + const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList > & xAttribs) + throw( ::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException ); + virtual void SAL_CALL endElement(const ::rtl::OUString& aName) + throw( ::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException ); + virtual void SAL_CALL characters(const ::rtl::OUString& aChars) + throw( ::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException ); + virtual void SAL_CALL ignorableWhitespace(const ::rtl::OUString& aWhitespaces) + throw( ::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException ); + virtual void SAL_CALL processingInstruction(const ::rtl::OUString& aTarget, + const ::rtl::OUString& aData) + throw( ::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException ); + virtual void SAL_CALL setDocumentLocator(const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XLocator > & xLocator) + throw( ::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException ); + + // ::com::sun::star::xml::sax::XExtendedDocumentHandler + virtual void SAL_CALL startCDATA(void) throw( ::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException ); + virtual void SAL_CALL endCDATA(void) throw( ::com::sun::star::uno::RuntimeException ); + virtual void SAL_CALL comment(const ::rtl::OUString& sComment) + throw( ::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException ); + virtual void SAL_CALL allowLineBreak(void) + throw( ::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException ); + virtual void SAL_CALL unknown(const ::rtl::OUString& sString) + throw( ::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException ); + + // XImporter + virtual void SAL_CALL setTargetDocument( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent >& xDoc ) throw(::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException); + + // XFilter + virtual sal_Bool SAL_CALL filter( const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& aDescriptor ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL cancel( ) throw (::com::sun::star::uno::RuntimeException); + + // XInitialization + virtual void SAL_CALL initialize( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aArguments ) throw(::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException); + + // XUnoTunnel + virtual sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& aIdentifier ) throw(::com::sun::star::uno::RuntimeException); + + // XServiceInfo + virtual ::rtl::OUString SAL_CALL getImplementationName( ) throw(::com::sun::star::uno::RuntimeException); + virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName ) throw(::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames( ) throw(::com::sun::star::uno::RuntimeException); + + // may be called by certain subclasses that handle document meta-data + // override to provide customized handling of document statistics + // the base class implementation initializes the progress bar and should + // be called by overriding methods + virtual void SetStatistics(const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue > & i_rStats); + + // get import helper for text + inline UniReference< XMLTextImportHelper > GetTextImport(); + sal_Bool HasTextImport() const { return mxTextImport.is(); } + inline SvXMLNumFmtHelper* GetDataStylesImport(); + + // get import helper for shapes + inline UniReference< XMLShapeImportHelper > GetShapeImport(); + + // get import helper for charts + inline UniReference< SchXMLImportHelper > GetChartImport(); + + // get import helper for form layer + inline UniReference< ::xmloff::OFormLayerXMLImport > GetFormImport(); + + // get XPropertySet with import information + inline ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > getImportInfo() const { return mxImportInfo; } + + // get import helper for events + XMLEventImportHelper& GetEventImport(); + + SvXMLNamespaceMap& GetNamespaceMap() { return *mpNamespaceMap; } + const SvXMLNamespaceMap& GetNamespaceMap() const { return *mpNamespaceMap; } + const SvXMLUnitConverter& GetMM100UnitConverter() const { return *mpUnitConv; } + SvXMLUnitConverter& GetMM100UnitConverter() { return *mpUnitConv; } + const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XLocator > & GetLocator() const { return mxLocator; } + const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel > & + GetModel() const { return mxModel; } + + const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer > & GetGradientHelper(); + const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer > & GetHatchHelper(); + const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer > & GetBitmapHelper(); + const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer > & GetTransGradientHelper(); + const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer > & GetMarkerHelper(); + const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer > & GetDashHelper(); + inline ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatsSupplier > & GetNumberFormatsSupplier(); + inline void SetNumberFormatsSupplier(const ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatsSupplier >& _xNumberFormatSupplier) + { + mxNumberFormatsSupplier = _xNumberFormatSupplier; + } + + // Convert a local packe URL into either a graphic manager or a + // internal package URL. The later one happens only if bLoadURL is true + ::rtl::OUString ResolveGraphicObjectURL( const ::rtl::OUString& rURL, sal_Bool bLoadOnDemand ); + ::com::sun::star::uno::Reference< ::com::sun::star::io::XOutputStream > + GetStreamForGraphicObjectURLFromBase64(); + ::rtl::OUString ResolveGraphicObjectURLFromBase64( + const ::com::sun::star::uno::Reference< ::com::sun::star::io::XOutputStream >& rOut ); + + sal_Bool IsPackageURL( const ::rtl::OUString& rURL ) const; + ::rtl::OUString ResolveEmbeddedObjectURL( const ::rtl::OUString& rURL, + const ::rtl::OUString& rClassId ); + ::com::sun::star::uno::Reference< ::com::sun::star::io::XOutputStream > + GetStreamForEmbeddedObjectURLFromBase64(); + ::rtl::OUString ResolveEmbeddedObjectURLFromBase64(); + + void AddStyleDisplayName( sal_uInt16 nFamily, + const ::rtl::OUString& rName, + const ::rtl::OUString& rDisplayName ); + ::rtl::OUString GetStyleDisplayName( sal_uInt16 nFamily, + const ::rtl::OUString& rName ) const; + + ProgressBarHelper* GetProgressBarHelper(); + + void AddNumberStyle(sal_Int32 nKey, const rtl::OUString& sName); + + virtual void SetViewSettings(const com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue>& aViewProps); + virtual void SetConfigurationSettings(const com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue>& aConfigProps); + virtual void SetDocumentSpecificSettings(const ::rtl::OUString& _rSettingsGroupName, + const com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue>& _rSettings); + + XMLFontStylesContext *GetFontDecls(); + SvXMLStylesContext *GetStyles(); + SvXMLStylesContext *GetAutoStyles(); + SvXMLStylesContext *GetMasterStyles(); + const XMLFontStylesContext *GetFontDecls() const; + const SvXMLStylesContext *GetStyles() const; + const SvXMLStylesContext *GetAutoStyles() const; + const SvXMLStylesContext *GetMasterStyles() const; + + sal_uInt16 getImportFlags() const { return mnImportFlags; } + sal_Bool IsFormsSupported() const { return mbIsFormsSupported; } + rtl::OUString GetAbsoluteReference(const rtl::OUString& rValue) const; + + sal_Unicode ConvStarBatsCharToStarSymbol( sal_Unicode c ); + sal_Unicode ConvStarMathCharToStarSymbol( sal_Unicode c ); + + bool IsTableShapeSupported() const { return mbIsTableShapeSupported; } + + ::rtl::OUString GetODFVersion() const; + + /** + * Record an error condition that occured during import. The + * behavior of SetError can be modified using the error flag + * constants. + */ + void SetError( + /// error ID, may contain an error flag + sal_Int32 nId, + /// string parameters for the error message + const ::com::sun::star::uno::Sequence< ::rtl::OUString> & rMsgParams, + /// original exception message (if applicable) + const ::rtl::OUString& rExceptionMessage, + /// error location (if applicable) + const ::com::sun::star::uno::Reference< + ::com::sun::star::xml::sax::XLocator> & rLocator ); + + void SetError( + sal_Int32 nId, + const ::com::sun::star::uno::Sequence< ::rtl::OUString> & rMsgParams); + + void SetError( sal_Int32 nId ); + void SetError( sal_Int32 nId, const rtl::OUString& rMsg1 ); + void SetError( sal_Int32 nId, const rtl::OUString& rMsg1, + const rtl::OUString& rMsg2 ); + void SetError( sal_Int32 nId, const rtl::OUString& rMsg1, + const rtl::OUString& rMsg2, + const rtl::OUString& rMsg3 ); + void SetError( sal_Int32 nId, const rtl::OUString& rMsg1, + const rtl::OUString& rMsg2, + const rtl::OUString& rMsg3, + const rtl::OUString& rMsg4 ); + + /** return list of errors */ + XMLErrors* GetErrors(); + + /** return current error flags */ + sal_uInt16 GetErrorFlags() { return mnErrorFlags; } + + virtual void DisposingModel(); + + ::comphelper::UnoInterfaceToUniqueIdentifierMapper& getInterfaceToIdentifierMapper(); + + // #110680# + ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > getServiceFactory(); + + ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > + GetComponentContext() const; + + // --> OD 2004-08-10 #i28749# + sal_Bool IsShapePositionInHoriL2R() const; + // <-- + + // --> OD 2007-12-19 #152540# + sal_Bool IsTextDocInOOoFileFormat() const; + // <-- + + String GetBaseURL() const; + String GetDocumentBase() const; + + /// name of stream in package, e.g., "content.xml" + ::rtl::OUString GetStreamName() const; + + /// set the XmlId attribute of given UNO object (for RDF metadata) + void SetXmlId(::com::sun::star::uno::Reference< + ::com::sun::star::uno::XInterface> const & i_xIfc, + ::rtl::OUString const & i_rXmlId); + + /// Add a RDFa statement; parameters are XML attribute values + void AddRDFa( + ::com::sun::star::uno::Reference< ::com::sun::star::rdf::XMetadatable> + i_xObject, + ::rtl::OUString const & i_rAbout, + ::rtl::OUString const & i_rProperty, + ::rtl::OUString const & i_rContent, + ::rtl::OUString const & i_rDatatype); + + /// do not dllexport this; only for advanced cases (bookmark-start) + SAL_DLLPRIVATE ::xmloff::RDFaImportHelper & GetRDFaImportHelper(); + + // #i31958# XForms helper method + // (to be implemented by applications suporting XForms) + virtual void initXForms(); + + /** returns the upd and build id (f.e. "680m124$Build-8964" gives rMaster = 680 and rBuild = 8964) + from the metafile. + this only works if the meta.xml was already imported and the + import propertyset contains the string property "BuildId". + If false is returned the build ids are not available (yet). + **/ + bool getBuildIds( sal_Int32& rUPD, sal_Int32& rBuild ) const; + + static const sal_uInt16 OOo_1x = 10; + static const sal_uInt16 OOo_2x = 20; + static const sal_uInt16 OOo_Current = 30; + + /** this checks the build ID and returns + + * OOo_1x for files created with OpenOffice.org 1.x or StarOffice 7 (this also includes binary import over binfilter) + * OOo_2x for files created with OpenOffice.org 2.x or StarOffice 8 + * OOo_Current for files created with OpenOffice.org 3.x and StarOffice9 or newer or for files not created with OpenOffice.org or StarOffice + */ + sal_uInt16 getGeneratorVersion() const; + + /** If true, the URL for graphic shapes may be stored as a package URL and + loaded later (on demand) by the application. Otherwise graphics are + loaded immediately and the graphic shape gets the graphic manager URL. + + @see <member>mbIsGraphicLoadOnDemandSupported</member> + */ + bool isGraphicLoadOnDemandSupported() const; +}; + +inline UniReference< XMLTextImportHelper > SvXMLImport::GetTextImport() +{ + if( !mxTextImport.is() ) + mxTextImport = CreateTextImport(); + + return mxTextImport; +} + +inline UniReference< XMLShapeImportHelper > SvXMLImport::GetShapeImport() +{ + if( !mxShapeImport.is() ) + mxShapeImport = CreateShapeImport(); + + return mxShapeImport; +} + +inline UniReference< SchXMLImportHelper > SvXMLImport::GetChartImport() +{ + if( !mxChartImport.is() ) + mxChartImport = CreateChartImport(); + + return mxChartImport; +} + +inline UniReference< ::xmloff::OFormLayerXMLImport > SvXMLImport::GetFormImport() +{ + if( !mxFormImport.is() ) + mxFormImport = CreateFormImport(); + + return mxFormImport; +} + +inline void SvXMLImport::SetEmbeddedResolver( + com::sun::star::uno::Reference< com::sun::star::document::XEmbeddedObjectResolver >& _xEmbeddedResolver ) +{ + mxEmbeddedResolver = _xEmbeddedResolver; +} + +inline void SvXMLImport::SetGraphicResolver( + com::sun::star::uno::Reference< com::sun::star::document::XGraphicObjectResolver >& _xGraphicResolver ) +{ + mxGraphicResolver = _xGraphicResolver; +} + +inline ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatsSupplier > & SvXMLImport::GetNumberFormatsSupplier() +{ + if ( ! mxNumberFormatsSupplier.is() && mxModel.is() ) + _CreateNumberFormatsSupplier(); + + return mxNumberFormatsSupplier; +} + +inline SvXMLNumFmtHelper* SvXMLImport::GetDataStylesImport() +{ + if ( mpNumImport == NULL) + _CreateDataStylesImport(); + + return mpNumImport; +} + + +#endif // _XMLOFF_XMLIMP_HXX diff --git a/xmloff/inc/xmloff/xmlimppr.hxx b/xmloff/inc/xmloff/xmlimppr.hxx new file mode 100644 index 000000000000..e29e53e4e1c6 --- /dev/null +++ b/xmloff/inc/xmloff/xmlimppr.hxx @@ -0,0 +1,211 @@ +/************************************************************************* + * + * 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_XMLIMPPR_HXX +#define _XMLOFF_XMLIMPPR_HXX + +#include "sal/config.h" +#include "xmloff/dllapi.h" +#include "sal/types.h" +#include <tools/solar.h> +#include <com/sun/star/xml/sax/XAttributeList.hpp> +#include <com/sun/star/beans/XPropertySet.hpp> +#ifndef _COM_SUN_STAR_BEANS_XPROPERTYVALUE_HPP_ +#include <com/sun/star/beans/PropertyValue.hpp> +#endif +#include <com/sun/star/beans/XMultiPropertySet.hpp> +#include <com/sun/star/beans/XTolerantMultiPropertySet.hpp> + +#ifndef __SGI_STL_VECTOR +#include <vector> +#endif +#include <xmloff/uniref.hxx> + +struct XMLPropertyState; +class XMLPropertySetMapper; + +namespace rtl { class OUString; } + +class SvXMLUnitConverter; +class SvXMLNamespaceMap; +class SvXMLImport; + +/** This struct is used as an optional parameter to the static + * _FillPropertySet() methods. + * + * It should not be used in any other context. + */ +struct _ContextID_Index_Pair +{ + sal_Int16 nContextID; + sal_Int32 nIndex; +}; + +class XMLOFF_DLLPUBLIC SvXMLImportPropertyMapper : public UniRefBase +{ + UniReference< SvXMLImportPropertyMapper> mxNextMapper; + + SvXMLImport& rImport; // access to error handling + + SAL_DLLPRIVATE SvXMLImportPropertyMapper(SvXMLImportPropertyMapper &); + // not defined + SAL_DLLPRIVATE void operator =(SvXMLImportPropertyMapper &); // not defined + +protected: + + UniReference< XMLPropertySetMapper > maPropMapper; + SvXMLImport& GetImport() const { return rImport;} + +public: + + SvXMLImportPropertyMapper( + const UniReference< XMLPropertySetMapper >& rMapper, + SvXMLImport& rImport); + virtual ~SvXMLImportPropertyMapper(); + + // Add a ImportPropertyMapper at the end of the import mapper chain. + // The added mapper MUST not be used outside the Mapper chain any longer, + // because its PropertyMapper will be replaced. + void ChainImportMapper( + const UniReference< SvXMLImportPropertyMapper>& rMapper ); + + /** fills the given itemset with the attributes in the given list */ + void importXML( + ::std::vector< XMLPropertyState >& rProperties, + ::com::sun::star::uno::Reference< + ::com::sun::star::xml::sax::XAttributeList > xAttrList, + const SvXMLUnitConverter& rUnitConverter, + const SvXMLNamespaceMap& rNamespaceMap, + sal_uInt32 nPropType ) const; + + /** like above, except that the mart is only serached within the range + * [nStartIdx, nEndIdx[ + */ + void importXML( + ::std::vector< XMLPropertyState >& rProperties, + ::com::sun::star::uno::Reference< + ::com::sun::star::xml::sax::XAttributeList > xAttrList, + const SvXMLUnitConverter& rUnitConverter, + const SvXMLNamespaceMap& rNamespaceMap, + sal_uInt32 nPropType, + sal_Int32 nStartIdx, sal_Int32 nEndIdx ) const; + + /** this method is called for every item that has the MID_FLAG_SPECIAL_ITEM_IMPORT flag set */ + virtual sal_Bool handleSpecialItem( + XMLPropertyState& rProperty, + ::std::vector< XMLPropertyState >& rProperties, + const ::rtl::OUString& rValue, + const SvXMLUnitConverter& rUnitConverter, + const SvXMLNamespaceMap& rNamespaceMap ) const; + + /** This method is called when all attributes have benn processed. It may be used to remove items that are incomplete */ + virtual void finished( + ::std::vector< XMLPropertyState >& rProperties, + sal_Int32 nStartIndex, sal_Int32 nEndIndex ) const; + + void CheckSpecialContext( + const ::std::vector< XMLPropertyState >& aProperties, + const ::com::sun::star::uno::Reference< + ::com::sun::star::beans::XPropertySet > rPropSet, + _ContextID_Index_Pair* pSpecialContextIds ) const; + + sal_Bool FillPropertySet( + const ::std::vector< XMLPropertyState >& aProperties, + const ::com::sun::star::uno::Reference< + ::com::sun::star::beans::XPropertySet > rPropSet, + _ContextID_Index_Pair* pSpecialContextIds = NULL ) const; + + void FillPropertySequence( + const ::std::vector< XMLPropertyState >& aProperties, + ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& rValues ) + const; + + inline const UniReference< XMLPropertySetMapper >& + getPropertySetMapper() const; + + + + /** implementation helper for FillPropertySet: fill an XPropertySet. + * Exceptions will be asserted. */ + static sal_Bool _FillPropertySet( + const ::std::vector<XMLPropertyState> & rProperties, + const ::com::sun::star::uno::Reference< + ::com::sun::star::beans::XPropertySet> & rPropSet, + const ::com::sun::star::uno::Reference< + ::com::sun::star::beans::XPropertySetInfo> & rPropSetInfo, + const UniReference<XMLPropertySetMapper> & rPropMapper, + SvXMLImport& rImport, + + // parameter for use by txtstyli.cxx; allows efficient + // catching the combined characters property + _ContextID_Index_Pair* pSpecialContextIds = NULL ); + + /** implementation helper for FillPropertySet: fill an XMultiPropertySet. + * If unsuccessul, set return value. */ + static sal_Bool _FillMultiPropertySet( + const ::std::vector<XMLPropertyState> & rProperties, + const ::com::sun::star::uno::Reference< + ::com::sun::star::beans::XMultiPropertySet> & rMultiPropSet, + const ::com::sun::star::uno::Reference< + ::com::sun::star::beans::XPropertySetInfo> & rPropSetInfo, + const UniReference<XMLPropertySetMapper> & rPropMapper, + + // parameters for use by txtstyli.cxx; allows efficient + // catching the combined characters property + _ContextID_Index_Pair* pSpecialContextIds = NULL ); + + /** implementation helper for FillPropertySet: fill an XTolerantMultiPropertySet. + * If unsuccessul, set return value. */ + static sal_Bool _FillTolerantMultiPropertySet( + const ::std::vector<XMLPropertyState> & rProperties, + const ::com::sun::star::uno::Reference< + ::com::sun::star::beans::XTolerantMultiPropertySet> & rTolPropSet, + const UniReference<XMLPropertySetMapper> & rPropMapper, + SvXMLImport& rImport, + + // parameters for use by txtstyli.cxx; allows efficient + // catching the combined characters property + _ContextID_Index_Pair* pSpecialContextIds = NULL ); + + + static void _PrepareForMultiPropertySet( + const ::std::vector<XMLPropertyState> & rProperties, + const ::com::sun::star::uno::Reference< + ::com::sun::star::beans::XPropertySetInfo> & rPropSetInfo, + const UniReference<XMLPropertySetMapper> & rPropMapper, + _ContextID_Index_Pair* pSpecialContextIds, + ::com::sun::star::uno::Sequence< ::rtl::OUString >& rNames, + ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& rValues); +}; + + +inline const UniReference< XMLPropertySetMapper >& + SvXMLImportPropertyMapper::getPropertySetMapper() const +{ + return maPropMapper; +} + +#endif // _XMLOFF_XMLIMPPR_HXX diff --git a/xmloff/inc/xmloff/xmlmetae.hxx b/xmloff/inc/xmloff/xmlmetae.hxx new file mode 100644 index 000000000000..ccc000e4fe19 --- /dev/null +++ b/xmloff/inc/xmloff/xmlmetae.hxx @@ -0,0 +1,127 @@ +/************************************************************************* + * + * 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_XMLMETAE_HXX +#define _XMLOFF_XMLMETAE_HXX + +#include "sal/config.h" +#include "xmloff/dllapi.h" +#include "sal/types.h" + +#include <cppuhelper/implbase1.hxx> +#include <xmloff/xmltoken.hxx> + +#include <vector> + +#include <com/sun/star/beans/StringPair.hpp> +#include <com/sun/star/util/DateTime.hpp> +#include <com/sun/star/xml/sax/XDocumentHandler.hpp> +#include <com/sun/star/document/XDocumentProperties.hpp> + + +class SvXMLExport; + +/** export meta data from an <type>XDocumentProperties</type> instance. + + <p> + This class will start the export at the office:meta element, + not at the root element. This means that when <method>Export</method> + is called here, the document root element must already be written, but + office:meta must <em>not</em> be written. + </p> + */ +class XMLOFF_DLLPUBLIC SvXMLMetaExport : public ::cppu::WeakImplHelper1< + ::com::sun::star::xml::sax::XDocumentHandler > +{ +private: + SvXMLExport& mrExport; + ::com::sun::star::uno::Reference< + ::com::sun::star::document::XDocumentProperties> mxDocProps; + /// counts levels of the xml document. necessary for special handling. + int m_level; + /// preserved namespaces. necessary because we do not write the root node. + std::vector< ::com::sun::star::beans::StringPair > m_preservedNSs; + + SAL_DLLPRIVATE void SimpleStringElement( + const ::rtl::OUString& rText, sal_uInt16 nNamespace, + enum ::xmloff::token::XMLTokenEnum eElementName ); + SAL_DLLPRIVATE void SimpleDateTimeElement( + const ::com::sun::star::util::DateTime & rDate, sal_uInt16 nNamespace, + enum ::xmloff::token::XMLTokenEnum eElementName ); + + /// currently unused; for exporting via the XDocumentProperties interface + SAL_DLLPRIVATE void _MExport(); + +public: + SvXMLMetaExport( SvXMLExport& i_rExport, + const ::com::sun::star::uno::Reference< + ::com::sun::star::document::XDocumentProperties>& i_rDocProps); + + virtual ~SvXMLMetaExport(); + + /// export via XSAXWriter interface, with fallback to _MExport + void Export(); + + static ::rtl::OUString GetISODateTimeString( + const ::com::sun::star::util::DateTime& rDateTime ); + + // ::com::sun::star::xml::sax::XDocumentHandler: + virtual void SAL_CALL startDocument() + throw (::com::sun::star::uno::RuntimeException, + ::com::sun::star::xml::sax::SAXException); + virtual void SAL_CALL endDocument() + throw (::com::sun::star::uno::RuntimeException, + ::com::sun::star::xml::sax::SAXException); + virtual void SAL_CALL startElement(const ::rtl::OUString & i_rName, + const ::com::sun::star::uno::Reference< + ::com::sun::star::xml::sax::XAttributeList > & i_xAttribs) + throw (::com::sun::star::uno::RuntimeException, + ::com::sun::star::xml::sax::SAXException); + virtual void SAL_CALL endElement(const ::rtl::OUString & i_rName) + throw (::com::sun::star::uno::RuntimeException, + ::com::sun::star::xml::sax::SAXException); + virtual void SAL_CALL characters(const ::rtl::OUString & i_rChars) + throw (::com::sun::star::uno::RuntimeException, + ::com::sun::star::xml::sax::SAXException); + virtual void SAL_CALL ignorableWhitespace( + const ::rtl::OUString & i_rWhitespaces) + throw (::com::sun::star::uno::RuntimeException, + ::com::sun::star::xml::sax::SAXException); + virtual void SAL_CALL processingInstruction( + const ::rtl::OUString & i_rTarget, const ::rtl::OUString & i_rData) + throw (::com::sun::star::uno::RuntimeException, + ::com::sun::star::xml::sax::SAXException); + virtual void SAL_CALL setDocumentLocator( + const ::com::sun::star::uno::Reference< + ::com::sun::star::xml::sax::XLocator > & i_xLocator) + throw (::com::sun::star::uno::RuntimeException, + ::com::sun::star::xml::sax::SAXException); + +}; + +#endif // _XMLOFF_XMLMETAE_HXX + diff --git a/xmloff/inc/xmloff/xmlmetai.hxx b/xmloff/inc/xmloff/xmlmetai.hxx new file mode 100644 index 000000000000..6343c4ee37dc --- /dev/null +++ b/xmloff/inc/xmloff/xmlmetai.hxx @@ -0,0 +1,84 @@ +/************************************************************************* + * + * 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_XMLMETAI_HXX +#define _XMLOFF_XMLMETAI_HXX + +#include "sal/config.h" +#include "xmloff/dllapi.h" +#include <xmloff/xmlictxt.hxx> + +#include <com/sun/star/beans/XPropertySet.hpp> +#include <com/sun/star/document/XDocumentProperties.hpp> +#include <com/sun/star/xml/sax/XDocumentHandler.hpp> + + +/// handles the top-level office:document-meta element of meta.xml documents +// NB: virtual inheritance is needed so that the context that handles the +// flat xml file format can multiply inherit properly +class XMLOFF_DLLPUBLIC SvXMLMetaDocumentContext + : public virtual SvXMLImportContext +{ +private: + ::com::sun::star::uno::Reference< + ::com::sun::star::document::XDocumentProperties> mxDocProps; + ::com::sun::star::uno::Reference< + ::com::sun::star::xml::sax::XDocumentHandler> mxDocBuilder; + +public: + SvXMLMetaDocumentContext(SvXMLImport& rImport, USHORT nPrfx, + const rtl::OUString& rLName, + const ::com::sun::star::uno::Reference< + ::com::sun::star::document::XDocumentProperties>& xDocProps, + const ::com::sun::star::uno::Reference< + ::com::sun::star::xml::sax::XDocumentHandler>& xDocBuilder); + + virtual ~SvXMLMetaDocumentContext(); + + virtual SvXMLImportContext *CreateChildContext( USHORT nPrefix, + const rtl::OUString& rLocalName, + const ::com::sun::star::uno::Reference< + ::com::sun::star::xml::sax::XAttributeList>& xAttrList ); + + virtual void StartElement( const ::com::sun::star::uno::Reference< + ::com::sun::star::xml::sax::XAttributeList >& xAttrList ); + + virtual void EndElement(); + +protected: + /// initialize DocumentProperties object with DOM and base URL + void initDocumentProperties(); + // set the BuildId property at the importer + void setBuildId(const ::rtl::OUString & i_rBuildId); + +public: + static void setBuildId(const ::rtl::OUString & rGenerator, + const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet>& xImportInfo ); +}; + +#endif // _XMLOFF_XMLMETAI_HXX + diff --git a/xmloff/inc/xmloff/xmlnume.hxx b/xmloff/inc/xmloff/xmlnume.hxx new file mode 100644 index 000000000000..5643c7a5cb37 --- /dev/null +++ b/xmloff/inc/xmloff/xmlnume.hxx @@ -0,0 +1,116 @@ +/************************************************************************* + * + * 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_XMLNUME_HXX +#define _XMLOFF_XMLNUME_HXX + +#include <rtl/ustring.hxx> +#include <tools/mapunit.hxx> +#include <xmloff/XMLStringVector.hxx> +#include <xmloff/attrlist.hxx> + +namespace com { namespace sun { namespace star { + namespace frame { class XModel; } + namespace style { class XStyle; } + namespace container { class XIndexReplace; } + namespace beans { struct PropertyValue; } +} } } + +class SvXMLNamespaceMap; +class SvXMLUnitConverter; +class SvXMLExportItemMapper; +class SvXMLExport; +class XMLTextListAutoStylePool; + +class SvxXMLNumRuleExport +{ + SvXMLExport& rExport; + const ::rtl::OUString sCDATA; + const ::rtl::OUString sWS; + const ::rtl::OUString sNumberingRules; + const ::rtl::OUString sIsPhysical; + const ::rtl::OUString sIsContinuousNumbering; + // --> OD 2008-06-06 #i89178# + // Boolean indicating, if properties for position-and-space-mode LABEL_ALIGNEMNT + // are exported or not. + // These properties have been introduced in ODF 1.2. Thus, its export have + // to be suppressed on writing ODF 1.0 respectively ODF 1.1 + bool mbExportPositionAndSpaceModeLabelAlignment; + // <-- + + void exportLevelStyles( + const ::com::sun::star::uno::Reference< + ::com::sun::star::container::XIndexReplace > & xNumRule, + sal_Bool bOutline=sal_False ); + + void exportLevelStyle( + sal_Int32 nLevel, + const ::com::sun::star::uno::Sequence< + ::com::sun::star::beans::PropertyValue>& rProps, + sal_Bool bOutline=sal_False ); + +protected: + + // This method may be overloaded to add attributes to the <list-style> + // element. + virtual void AddListStyleAttributes(); + + sal_Bool exportStyle( const ::com::sun::star::uno::Reference< + ::com::sun::star::style::XStyle >& rStyle ); + void exportOutline(); + + SvXMLExport& GetExport() { return rExport; } + + virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexReplace > GetUNONumRule() const; + +public: + + SvxXMLNumRuleExport( SvXMLExport& rExport ); + virtual ~SvxXMLNumRuleExport(); + + void exportStyles( sal_Bool bUsed, + XMLTextListAutoStylePool *pPool, + sal_Bool bExportChapterNumbering = sal_True ); + void exportNumberingRule( + const ::rtl::OUString& rName, + const ::com::sun::star::uno::Reference< + ::com::sun::star::container::XIndexReplace > & xNumRule ); + + // --> OD 2008-06-17 #i90780# + // refactoring: removing unused methods +// void Export( const ::rtl::OUString& rOutline, sal_Bool bContNumbering ); +// void ExportOutline(); + // <-- + + static sal_Bool GetOutlineStyles( XMLStringVector& rStyleNames, + const ::com::sun::star::uno::Reference< + ::com::sun::star::frame::XModel > & rModel ); + +}; + +#endif // _XMLOFF_XMLNUME_HXX + diff --git a/xmloff/inc/xmloff/xmlnumfe.hxx b/xmloff/inc/xmloff/xmlnumfe.hxx new file mode 100644 index 000000000000..dfd86dcb10ac --- /dev/null +++ b/xmloff/inc/xmloff/xmlnumfe.hxx @@ -0,0 +1,140 @@ +/************************************************************************* + * + * 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_XMLNUMFE_HXX +#define _XMLOFF_XMLNUMFE_HXX + +#include "sal/config.h" +#include "xmloff/dllapi.h" +#include "sal/types.h" +#include <com/sun/star/util/XNumberFormatsSupplier.hpp> +#include <com/sun/star/uno/Sequence.h> +#include <rtl/ustrbuf.hxx> + +#define XML_WRITTENNUMBERSTYLES "WrittenNumberStyles" + +class Color; +class LocaleDataWrapper; +class CharClass; +class SvXMLExport; +class SvXMLNamespaceMap; +class SvXMLAttributeList; +class SvNumberFormatter; +class SvNumberformat; +class SvXMLNumUsedList_Impl; +class SvXMLEmbeddedTextEntryArr; + +class XMLOFF_DLLPUBLIC SvXMLNumFmtExport +{ +private: + SvXMLExport& rExport; + ::rtl::OUString sPrefix; + SvNumberFormatter* pFormatter; + ::rtl::OUStringBuffer sTextContent; + SvXMLNumUsedList_Impl* pUsedList; + CharClass* pCharClass; + LocaleDataWrapper* pLocaleData; + + SAL_DLLPRIVATE void AddCalendarAttr_Impl( const ::rtl::OUString& rCalendar ); + SAL_DLLPRIVATE void AddStyleAttr_Impl( sal_Bool bLong ); + SAL_DLLPRIVATE void AddTextualAttr_Impl( sal_Bool bText ); + SAL_DLLPRIVATE void AddLanguageAttr_Impl( sal_Int32 nLang ); + + SAL_DLLPRIVATE void AddToTextElement_Impl( const ::rtl::OUString& rString ); + SAL_DLLPRIVATE void FinishTextElement_Impl(); + + SAL_DLLPRIVATE void WriteColorElement_Impl( const Color& rColor ); + SAL_DLLPRIVATE void WriteNumberElement_Impl( sal_Int32 nDecimals, sal_Int32 nInteger, + const ::rtl::OUString& rDashStr, sal_Bool bVarDecimals, + sal_Bool bGrouping, sal_Int32 nTrailingThousands, + const SvXMLEmbeddedTextEntryArr& rEmbeddedEntries ); + SAL_DLLPRIVATE void WriteScientificElement_Impl( sal_Int32 nDecimals, sal_Int32 nInteger, + sal_Bool bGrouping, sal_Int32 nExp ); + SAL_DLLPRIVATE void WriteFractionElement_Impl( sal_Int32 nInteger, sal_Bool bGrouping, + sal_Int32 nNumerator, sal_Int32 nDenominator ); + SAL_DLLPRIVATE void WriteCurrencyElement_Impl( const ::rtl::OUString& rString, + const ::rtl::OUString& rExt ); + SAL_DLLPRIVATE void WriteBooleanElement_Impl(); + SAL_DLLPRIVATE void WriteTextContentElement_Impl(); + SAL_DLLPRIVATE void WriteDayElement_Impl( const ::rtl::OUString& rCalendar, sal_Bool bLong ); + SAL_DLLPRIVATE void WriteMonthElement_Impl( const ::rtl::OUString& rCalendar, sal_Bool bLong, sal_Bool bText ); + SAL_DLLPRIVATE void WriteYearElement_Impl( const ::rtl::OUString& rCalendar, sal_Bool bLong ); + SAL_DLLPRIVATE void WriteEraElement_Impl( const ::rtl::OUString& rCalendar, sal_Bool bLong ); + SAL_DLLPRIVATE void WriteDayOfWeekElement_Impl( const ::rtl::OUString& rCalendar, sal_Bool bLong ); + SAL_DLLPRIVATE void WriteWeekElement_Impl( const ::rtl::OUString& rCalendar ); + SAL_DLLPRIVATE void WriteQuarterElement_Impl( const ::rtl::OUString& rCalendar, sal_Bool bLong ); + SAL_DLLPRIVATE void WriteHoursElement_Impl( sal_Bool bLong ); + SAL_DLLPRIVATE void WriteMinutesElement_Impl( sal_Bool bLong ); + SAL_DLLPRIVATE void WriteSecondsElement_Impl( sal_Bool bLong, sal_uInt16 nDecimals ); + SAL_DLLPRIVATE void WriteAMPMElement_Impl(); + SAL_DLLPRIVATE void WriteMapElement_Impl( sal_Int32 nOp, double fLimit, + sal_Int32 nKey, sal_Int32 nPart ); + + SAL_DLLPRIVATE sal_Bool WriteTextWithCurrency_Impl( const ::rtl::OUString& rString, + const ::com::sun::star::lang::Locale& rLocale ); + SAL_DLLPRIVATE void ExportPart_Impl( const SvNumberformat& rFormat, sal_uInt32 nKey, + sal_uInt16 nPart, sal_Bool bDefPart ); + + SAL_DLLPRIVATE void ExportFormat_Impl( const SvNumberformat& rFormat, sal_uInt32 nKey ); + +public: + SvXMLNumFmtExport( SvXMLExport& rExport, + const ::com::sun::star::uno::Reference< + ::com::sun::star::util::XNumberFormatsSupplier >& rSupp ); + SvXMLNumFmtExport( SvXMLExport& rExport, + const ::com::sun::star::uno::Reference< + ::com::sun::star::util::XNumberFormatsSupplier >& rSupp, + const rtl::OUString& rPrefix ); + + virtual ~SvXMLNumFmtExport(); + + // core API + void Export( sal_Bool bIsAutoStyle); + + // mark number format as used + void SetUsed( sal_uInt32 nKey ); + + // get the style name that was generated for a key + ::rtl::OUString GetStyleName( sal_uInt32 nKey ); + + void GetWasUsed(com::sun::star::uno::Sequence<sal_Int32>& rWasUsed); + void SetWasUsed(const com::sun::star::uno::Sequence<sal_Int32>& rWasUsed); + + + + // two methods to allow the field import/export to treat system languages + // properly: + + /// obtain number format with system languange for a given key + sal_uInt32 ForceSystemLanguage( sal_uInt32 nKey ); + + /// determine whether number format uses system language + bool IsSystemLanguage( sal_uInt32 nKey ); +}; + +#endif + diff --git a/xmloff/inc/xmloff/xmlnumfi.hxx b/xmloff/inc/xmloff/xmlnumfi.hxx new file mode 100644 index 000000000000..8463037fa6d3 --- /dev/null +++ b/xmloff/inc/xmloff/xmlnumfi.hxx @@ -0,0 +1,233 @@ +/************************************************************************* + * + * 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_XMLNUMFI_HXX +#define _XMLOFF_XMLNUMFI_HXX + +#include "sal/config.h" +#include "xmloff/dllapi.h" +#include "sal/types.h" +#include <com/sun/star/util/XNumberFormatsSupplier.hpp> +#include <com/sun/star/xml/sax/XAttributeList.hpp> +#include <xmloff/xmlstyle.hxx> +#include <rtl/ustrbuf.hxx> +#include <i18npool/lang.h> +#ifndef __SGI_STL_VECTOR +#include <vector> +#endif +#include <unotools/localedatawrapper.hxx> + +#define XML_NUMBERSTYLES "NumberStyles" + +enum SvXMLStylesTokens +{ + XML_TOK_STYLES_NUMBER_STYLE, + XML_TOK_STYLES_CURRENCY_STYLE, + XML_TOK_STYLES_PERCENTAGE_STYLE, + XML_TOK_STYLES_DATE_STYLE, + XML_TOK_STYLES_TIME_STYLE, + XML_TOK_STYLES_BOOLEAN_STYLE, + XML_TOK_STYLES_TEXT_STYLE +}; + +enum SvXMLDateElementAttributes +{ + XML_DEA_NONE, + XML_DEA_ANY, + XML_DEA_SHORT, + XML_DEA_LONG, + XML_DEA_TEXTSHORT, + XML_DEA_TEXTLONG +}; + +class Color; +class SvXMLNumImpData; +class SvXMLImport; +class SvXMLStyleContext; +class SvXMLStylesContext; +struct SvXMLNumberInfo; +class SvNumberFormatter; +class SvtSysLocale; + +// use SvXMLNumFmtHelper in the context for <office:styles> to create +// child contexts for data styles + +class SvXMLNumFmtHelper +{ + SvXMLNumImpData* pData; + + // #110680# + ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > mxServiceFactory; + +public: + // #110680# + //SvXMLNumFmtHelper( const ::com::sun::star::uno::Reference< + // ::com::sun::star::util::XNumberFormatsSupplier >& rSupp ); + //SvXMLNumFmtHelper( SvNumberFormatter* pNumberFormatter ); + SvXMLNumFmtHelper( + const ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatsSupplier >& rSupp, + const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xServiceFactory ); + + SvXMLNumFmtHelper( + SvNumberFormatter* pNumberFormatter, + const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xServiceFactory ); + + ~SvXMLNumFmtHelper(); + + SvXMLStyleContext* CreateChildContext( SvXMLImport& rImport, + USHORT nPrefix, const rtl::OUString& rLocalName, + const ::com::sun::star::uno::Reference< + ::com::sun::star::xml::sax::XAttributeList>& xAttrList, + SvXMLStylesContext& rStyles); + + SvXMLNumImpData* getData() { return pData; } + + const SvXMLTokenMap& GetStylesElemTokenMap(); + +// sal_uInt32 GetKeyForName( const rtl::OUString& rName ); +}; + +// SvXMLNumFmtDefaults is used in import and export + +class SvXMLNumFmtDefaults +{ +public: + static sal_Bool IsSystemLongDay( const SvtSysLocale& rSysLoc, BOOL bLong ); + static sal_Bool IsSystemLongMonth( const SvtSysLocale& rSysLoc, BOOL bLong ); + static sal_Bool IsSystemTextualMonth( const SvtSysLocale& rSysLoc, BOOL bLong ); + static sal_Bool IsSystemLongYear( const SvtSysLocale& rSysLoc, BOOL bLong ); + static sal_Bool IsSystemLongEra( const SvtSysLocale& rSysLoc, BOOL bLong ); + static sal_Bool IsSystemLongDayOfWeek( const SvtSysLocale& rSysLoc, BOOL bLong ); + + // return value is NfIndexTableOffset + static sal_uInt16 GetDefaultDateFormat( SvXMLDateElementAttributes eDOW, + SvXMLDateElementAttributes eDay, SvXMLDateElementAttributes eMonth, + SvXMLDateElementAttributes eYear, SvXMLDateElementAttributes eHours, + SvXMLDateElementAttributes eMins, SvXMLDateElementAttributes eSecs, + sal_Bool bSystem ); +}; + +struct MyCondition +{ + rtl::OUString sCondition; + rtl::OUString sMapName; +}; + +class XMLOFF_DLLPUBLIC SvXMLNumFormatContext : public SvXMLStyleContext +{ + SvXMLNumImpData* pData; + SvXMLStylesContext* pStyles; + std::vector <MyCondition> aMyConditions; + sal_uInt16 nType; + sal_Int32 nKey; +// rtl::OUString sFormatName; + rtl::OUString sFormatTitle; +// rtl::OUString sMapName; + rtl::OUString sCalendar; + rtl::OUString sFormatString; + LanguageType nFormatLang; + com::sun::star::lang::Locale aLocale; + sal_Bool bAutoOrder; + sal_Bool bFromSystem; + sal_Bool bTruncate; + sal_Bool bAutoDec; // set in AddNumber + sal_Bool bAutoInt; // set in AddNumber + sal_Bool bHasExtraText; + rtl::OUStringBuffer aFormatCode; + rtl::OUStringBuffer aConditions; + sal_Bool bHasLongDoW; + sal_Bool bHasEra; + sal_Bool bHasDateTime; + sal_Bool bRemoveAfterUse; + + // contained date elements, used to recognize default date formats + SvXMLDateElementAttributes eDateDOW; + SvXMLDateElementAttributes eDateDay; + SvXMLDateElementAttributes eDateMonth; + SvXMLDateElementAttributes eDateYear; + SvXMLDateElementAttributes eDateHours; + SvXMLDateElementAttributes eDateMins; + SvXMLDateElementAttributes eDateSecs; + sal_Bool bDateNoDefault; + + SAL_DLLPRIVATE sal_Int32 PrivateGetKey(); + +public: + SvXMLNumFormatContext( SvXMLImport& rImport, USHORT nPrfx, + const rtl::OUString& rLName, + SvXMLNumImpData* pNewData, sal_uInt16 nNewType, + const ::com::sun::star::uno::Reference< + ::com::sun::star::xml::sax::XAttributeList>& xAttrList, + SvXMLStylesContext& rStyles ); + SvXMLNumFormatContext( SvXMLImport& rImport, USHORT nPrfx, + const rtl::OUString& rLName, + const ::com::sun::star::uno::Reference< + ::com::sun::star::xml::sax::XAttributeList>& xAttrList, + const sal_Int32 nKey, + SvXMLStylesContext& rStyles ); + virtual ~SvXMLNumFormatContext(); + + virtual SvXMLImportContext *CreateChildContext( USHORT nPrefix, + const rtl::OUString& rLocalName, + const ::com::sun::star::uno::Reference< + ::com::sun::star::xml::sax::XAttributeList>& xAttrList ); + virtual void CreateAndInsert(sal_Bool bOverwrite); + virtual void Finish(sal_Bool bOverwrite); + + SvXMLNumImpData* GetData() const { return pData; } + sal_Int32 GetKey(); + sal_Int32 CreateAndInsert( SvNumberFormatter* pFormatter ); + sal_Int32 CreateAndInsert( com::sun::star::uno::Reference< com::sun::star::util::XNumberFormatsSupplier >& xFormatsSupplier ); + sal_uInt16 GetType() const { return nType; } // SvXMLStylesTokens + + sal_Bool IsFromSystem() const { return bFromSystem; } + sal_Bool HasLongDoW() const { return bHasLongDoW; } + void SetHasLongDoW(sal_Bool bSet) { bHasLongDoW = bSet; } + sal_Bool HasEra() const { return bHasEra; } + void SetHasEra(sal_Bool bSet) { bHasEra = bSet; } + + void UpdateCalendar( const rtl::OUString& rNewCalendar ); + + const LocaleDataWrapper& GetLocaleData() const; + + void AddToCode( const rtl::OUString& rString ); + void AddNumber( const SvXMLNumberInfo& rInfo ); + void AddCurrency( const rtl::OUString& rContent, LanguageType nLang ); + + void AddNfKeyword( sal_uInt16 nIndex ); + sal_Bool ReplaceNfKeyword( sal_uInt16 nOld, sal_uInt16 nNew ); + void AddCondition( const sal_Int32 nIndex ); + void AddCondition( const sal_Int32 nIndex, const rtl::OUString& rFormat, const LocaleDataWrapper& rData ); + void AddCondition( const rtl::OUString& rCondition, const rtl::OUString& rApplyName ); + void AddColor( const Color& rColor ); + + /// determine whether number format uses the system language + sal_Bool IsSystemLanguage(); +}; + +#endif + diff --git a/xmloff/inc/xmloff/xmlnumi.hxx b/xmloff/inc/xmloff/xmlnumi.hxx new file mode 100644 index 000000000000..dee231fb3774 --- /dev/null +++ b/xmloff/inc/xmloff/xmlnumi.hxx @@ -0,0 +1,111 @@ +/************************************************************************* + * + * 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_XMLNUMI_HXX +#define _XMLOFF_XMLNUMI_HXX + +#include <com/sun/star/container/XIndexReplace.hpp> + +#include <xmloff/xmlstyle.hxx> +#include <com/sun/star/style/NumberingType.hpp> + +namespace com { namespace sun { namespace star { namespace frame { class XModel; } } } } +class SvI18NMap; +class SvxXMLListStyle_Impl; + +class SvxXMLListStyleContext : public SvXMLStyleContext +{ + const ::rtl::OUString sIsPhysical; + const ::rtl::OUString sNumberingRules; + const ::rtl::OUString sName; + const ::rtl::OUString sIsContinuousNumbering; + + ::com::sun::star::uno::Reference < + ::com::sun::star::container::XIndexReplace > xNumRules; + + SvxXMLListStyle_Impl *pLevelStyles; + + sal_Int32 nLevels; + sal_Bool bConsecutive : 1; + sal_Bool bOutline : 1; + +protected: + + virtual void SetAttribute( sal_uInt16 nPrefixKey, + const ::rtl::OUString& rLocalName, + const ::rtl::OUString& rValue ); + +public: + + TYPEINFO(); + + SvxXMLListStyleContext( + SvXMLImport& rImport, sal_uInt16 nPrfx, + const ::rtl::OUString& rLName, + const ::com::sun::star::uno::Reference< + ::com::sun::star::xml::sax::XAttributeList >& xAttrList, + sal_Bool bOutl=sal_False ); + + virtual ~SvxXMLListStyleContext(); + + virtual SvXMLImportContext *CreateChildContext( + sal_uInt16 nPrefix, + const ::rtl::OUString& rLocalName, + const ::com::sun::star::uno::Reference< + ::com::sun::star::xml::sax::XAttributeList >& xAttrList ); + + void FillUnoNumRule( + const ::com::sun::star::uno::Reference< + ::com::sun::star::container::XIndexReplace > & rNumRule, + const SvI18NMap *pI18NMap ) const; + + const ::com::sun::star::uno::Reference < + ::com::sun::star::container::XIndexReplace >& GetNumRules() const + { return xNumRules; } + sal_Bool IsOutline() const { return bOutline; } + sal_Bool IsConsecutive() const { return bConsecutive; } + sal_Int32 GetLevels() const { return nLevels; } + + static ::com::sun::star::uno::Reference < + ::com::sun::star::container::XIndexReplace > + CreateNumRule( + const ::com::sun::star::uno::Reference < + ::com::sun::star::frame::XModel > & rModel ); + + static void SetDefaultStyle( + const ::com::sun::star::uno::Reference < + ::com::sun::star::container::XIndexReplace > & rNumRule, + sal_Int16 nLevel, + sal_Bool bOrdered ); + + virtual void CreateAndInsertLate( sal_Bool bOverwrite ); + + void CreateAndInsertAuto() const; +}; + +#endif // _XMLOFF_XMLNUMI_HXX + diff --git a/xmloff/inc/xmloff/xmlprcon.hxx b/xmloff/inc/xmloff/xmlprcon.hxx new file mode 100644 index 000000000000..33ae4986e4d2 --- /dev/null +++ b/xmloff/inc/xmloff/xmlprcon.hxx @@ -0,0 +1,78 @@ +/************************************************************************* + * + * 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_XMLPROPERTYSETCONTEXT_HXX +#define _XMLOFF_XMLPROPERTYSETCONTEXT_HXX + +#include <xmloff/xmlictxt.hxx> +#include <xmloff/xmlimppr.hxx> +#include <xmloff/xmlprmap.hxx> +#include <xmloff/uniref.hxx> + +namespace rtl { class OUString; } + +class SvXMLImportPropertyMapper; + +class SvXMLPropertySetContext : public SvXMLImportContext +{ +protected: + sal_Int32 mnStartIdx; + sal_Int32 mnEndIdx; + sal_uInt32 mnFamily; + ::std::vector< XMLPropertyState > &mrProperties; + UniReference < SvXMLImportPropertyMapper > mxMapper; + +public: + + SvXMLPropertySetContext( + SvXMLImport& rImport, USHORT nPrfx, + const ::rtl::OUString& rLName, + const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList, + sal_uInt32 nFamily, + ::std::vector< XMLPropertyState > &rProps, + const UniReference < SvXMLImportPropertyMapper > &rMap, + sal_Int32 nStartIdx = -1, sal_Int32 nEndIdx = -1 ); + + virtual ~SvXMLPropertySetContext(); + + virtual SvXMLImportContext *CreateChildContext( USHORT nPrefix, + const ::rtl::OUString& rLocalName, + const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList ); + + // This method is called from this instance implementation of + // CreateChildContext if the element matches an entry in the + // SvXMLImportItemMapper with the mid flag MID_FLAG_ELEMENT_ITEM_IMPORT + virtual SvXMLImportContext *CreateChildContext( USHORT nPrefix, + const ::rtl::OUString& rLocalName, + const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList, + ::std::vector< XMLPropertyState > &rProperties, + const XMLPropertyState& rProp ); + +}; + +#endif // _XMLOFF_XMLPROPERTYSETCONTEXT_HXX + diff --git a/xmloff/inc/xmloff/xmlprhdl.hxx b/xmloff/inc/xmloff/xmlprhdl.hxx new file mode 100644 index 000000000000..c6dd14dee3e4 --- /dev/null +++ b/xmloff/inc/xmloff/xmlprhdl.hxx @@ -0,0 +1,64 @@ +/************************************************************************* + * + * 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_PROPERTYHANDLERBASE_HXX +#define _XMLOFF_PROPERTYHANDLERBASE_HXX + +#include "sal/config.h" +#include "xmloff/dllapi.h" +#include <sal/types.h> + +namespace com{ namespace sun{ namespace star{ namespace uno{ class Any; } } } } +namespace rtl{ class OUString; } + +class SvXMLUnitConverter; +struct XMLPropertyState; + +/////////////////////////////////////////////////////////////////////////// +// +/** Abstract base-class for different XML-types. Derivations of this class + knows how to compare, im/export a special XML-type +*/ +class XMLOFF_DLLPUBLIC XMLPropertyHandler +{ + // ??? const SvXMLUnitConverter& rUnitConverter Do we need this ? + +public: + // Just needed for virtual destruction + virtual ~XMLPropertyHandler(); + + /** Compares two Any's in case of the given XML-data-type. + By default the Any-equal-operator is called. */ + virtual bool equals( const ::com::sun::star::uno::Any& r1, const ::com::sun::star::uno::Any& r2 ) const; + + /// Imports the given value in cas of the given XML-data-type + virtual sal_Bool importXML( const ::rtl::OUString& rStrImpValue, ::com::sun::star::uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const =0; + /// Exports the given value in cas of the given XML-data-type + virtual sal_Bool exportXML( ::rtl::OUString& rStrExpValue, const ::com::sun::star::uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const =0; +}; + +#endif // _XMLOFF_PROPERTYHANDLERBASE_HXX diff --git a/xmloff/inc/xmloff/xmlprmap.hxx b/xmloff/inc/xmloff/xmlprmap.hxx new file mode 100644 index 000000000000..7dcb3c5cc926 --- /dev/null +++ b/xmloff/inc/xmloff/xmlprmap.hxx @@ -0,0 +1,189 @@ +/************************************************************************* + * + * 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_PROPERTYSETMAPPER_HXX +#define _XMLOFF_PROPERTYSETMAPPER_HXX + +#include "sal/config.h" +#include "xmloff/dllapi.h" +#include <com/sun/star/uno/Sequence.hxx> +#include <com/sun/star/uno/Any.hxx> +#include <com/sun/star/beans/XPropertySet.hpp> + +#ifndef __SGI_STL_VECTOR +#include <vector> +#endif +#include <xmloff/uniref.hxx> +#include <xmloff/maptype.hxx> +#include <xmloff/xmltypes.hxx> +#include <xmloff/prhdlfac.hxx> + +#include <tools/debug.hxx> + +class SvXMLUnitConverter; +class XMLPropertyHandler; + +/////////////////////////////////////////////////////////////////////////// +// +/** Helper-class for XML-im/export: + - Holds a pointer to a given array of XMLPropertyMapEntry + - Provides several methods to access data from this array + - Holds a Sequence of XML-names (for properties) + - The filter takes all properties of the XPropertySet which are also + in the XMLPropertyMapEntry and which are have not a default value + and put them into a vector of XMLPropertyStae + - this class knows how to compare, im/export properties + + Attention: At all methods, which get an index as parameter, there is no + range validation to save runtime !! +*/ +struct XMLPropertySetMapperEntry_Impl +{ + ::rtl::OUString sXMLAttributeName; + ::rtl::OUString sAPIPropertyName; + sal_uInt16 nXMLNameSpace; + sal_Int32 nType; + sal_Int16 nContextId; + SvtSaveOptions::ODFDefaultVersion nEarliestODFVersionForExport; + const XMLPropertyHandler *pHdl; + + XMLPropertySetMapperEntry_Impl( + const XMLPropertyMapEntry& rMapEntry, + const UniReference< XMLPropertyHandlerFactory >& rFactory ); + + XMLPropertySetMapperEntry_Impl( + const XMLPropertySetMapperEntry_Impl& rEntry ); + + sal_uInt32 GetPropType() const { return nType & XML_TYPE_PROP_MASK; } +}; + +class XMLOFF_DLLPUBLIC XMLPropertySetMapper : public UniRefBase +{ + ::std::vector< XMLPropertySetMapperEntry_Impl > aMapEntries; + ::std::vector< UniReference < XMLPropertyHandlerFactory > > aHdlFactories; + +public: + /** The last element of the XMLPropertyMapEntry-array must contain NULL-values */ + XMLPropertySetMapper( + const XMLPropertyMapEntry* pEntries, + const UniReference< XMLPropertyHandlerFactory >& rFactory ); + virtual ~XMLPropertySetMapper(); + + void AddMapperEntry( const UniReference < XMLPropertySetMapper >& rMapper ); + + /** Return number of entries in input-array */ + sal_Int32 GetEntryCount() const { return aMapEntries.size(); } + + /** Returns the flags of an entry */ + sal_uInt32 GetEntryFlags( sal_Int32 nIndex ) const + { + DBG_ASSERT( (nIndex >= 0) && (nIndex < (sal_Int32)aMapEntries.size() ), "illegal access to invalid entry!" ); + return aMapEntries[nIndex].nType & ~MID_FLAG_MASK; + } + + /** Returns the type of an entry */ + sal_uInt32 GetEntryType( sal_Int32 nIndex, + sal_Bool bWithFlags = sal_True ) const + { + DBG_ASSERT( (nIndex >= 0) && (nIndex < (sal_Int32)aMapEntries.size() ), "illegal access to invalid entry!" ); + sal_uInt32 nType = aMapEntries[nIndex].nType; + if( !bWithFlags ) + nType = nType & MID_FLAG_MASK; + return nType; + } + + /** Returns the namespace-key of an entry */ + sal_uInt16 GetEntryNameSpace( sal_Int32 nIndex ) const + { + DBG_ASSERT( (nIndex >= 0) && (nIndex < (sal_Int32)aMapEntries.size() ), "illegal access to invalid entry!" ); + return aMapEntries[nIndex].nXMLNameSpace; + } + + /** Returns the 'local' XML-name of the entry */ + const ::rtl::OUString& GetEntryXMLName( sal_Int32 nIndex ) const + { + DBG_ASSERT( (nIndex >= 0) && (nIndex < (sal_Int32)aMapEntries.size() ), "illegal access to invalid entry!" ); + return aMapEntries[nIndex].sXMLAttributeName; + } + + /** Returns the entry API name */ + const ::rtl::OUString& GetEntryAPIName( sal_Int32 nIndex ) const + { + DBG_ASSERT( (nIndex >= 0) && (nIndex < (sal_Int32)aMapEntries.size() ), "illegal access to invalid entry!" ); + return aMapEntries[nIndex].sAPIPropertyName; + } + + /** returns the entry context id. -1 is a valid index here. */ + sal_Int16 GetEntryContextId( sal_Int32 nIndex ) const + { + DBG_ASSERT( (nIndex >= -1) && (nIndex < (sal_Int32)aMapEntries.size() ), "illegal access to invalid entry!" ); + return nIndex == -1 ? 0 : aMapEntries[nIndex].nContextId; + } + + /** returns the earliest odf version for which this property should be exported. */ + SvtSaveOptions::ODFDefaultVersion GetEarliestODFVersionForExport( sal_Int32 nIndex ) const + { + DBG_ASSERT( (nIndex >= -1) && (nIndex < (sal_Int32)aMapEntries.size() ), "illegal access to invalid entry!" ); + return nIndex == -1 ? SvtSaveOptions::ODFVER_UNKNOWN : aMapEntries[nIndex].nEarliestODFVersionForExport; + } + + /** Returns the index of an entry with the given XML-name and namespace + If there is no matching entry the method returns -1 */ + sal_Int32 GetEntryIndex( sal_uInt16 nNamespace, + const ::rtl::OUString& rStrName, + sal_uInt32 nPropType, + sal_Int32 nStartAt = -1 ) const; + + /** Retrieves a PropertyHandler for that property wich placed at nIndex in the XMLPropertyMapEntry-array */ + const XMLPropertyHandler* GetPropertyHandler( sal_Int32 nIndex ) const + { + DBG_ASSERT( (nIndex >= 0) && (nIndex < (sal_Int32)aMapEntries.size() ), "illegal access to invalid entry!" ); + return aMapEntries[nIndex].pHdl; + } + + /** import/export + This methods calls the respective im/export-method of the respective PropertyHandler. */ + virtual sal_Bool exportXML( ::rtl::OUString& rStrExpValue, + const XMLPropertyState& rProperty, + const SvXMLUnitConverter& rUnitConverter ) const; + virtual sal_Bool importXML( const ::rtl::OUString& rStrImpValue, + XMLPropertyState& rProperty, + const SvXMLUnitConverter& rUnitConverter ) const; + + /** searches for an entry that matches the given api name, namespace and local name or -1 if nothing found */ + sal_Int32 FindEntryIndex( const sal_Char* sApiName, + sal_uInt16 nNameSpace, + const ::rtl::OUString& sXMLName ) const; + + /** searches for an entry that matches the given ContextId or gives -1 if nothing found */ + sal_Int32 FindEntryIndex( const sal_Int16 nContextId ) const; + + /** Remove an entry */ + void RemoveEntry( sal_Int32 nIndex ); +}; + +#endif // _XMLOFF_PROPERTYSETMAPPER_HXX diff --git a/xmloff/inc/xmloff/xmlscripti.hxx b/xmloff/inc/xmloff/xmlscripti.hxx new file mode 100644 index 000000000000..561dda0f0473 --- /dev/null +++ b/xmloff/inc/xmloff/xmlscripti.hxx @@ -0,0 +1,61 @@ +/************************************************************************* + * + * 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_XMLSCRIPTI_HXX +#define _XMLOFF_XMLSCRIPTI_HXX + +#include "sal/config.h" +#include "xmloff/dllapi.h" +#include <xmloff/xmlictxt.hxx> + +namespace com { namespace sun { namespace star { namespace frame { + class XModel; +}}}} + +class XMLOFF_DLLPUBLIC XMLScriptContext : public SvXMLImportContext +{ +private: + ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel > m_xModel; + +public: + XMLScriptContext( SvXMLImport& rImport, sal_uInt16 nPrfx, + const ::rtl::OUString& rLName, + const ::com::sun::star::uno::Reference< + ::com::sun::star::frame::XModel>& rDocModel ); + virtual ~XMLScriptContext(); + + // Create child element. + virtual SvXMLImportContext *CreateChildContext( sal_uInt16 nPrefix, + const ::rtl::OUString& rLocalName, + const ::com::sun::star::uno::Reference< + ::com::sun::star::xml::sax::XAttributeList>& xAttrList ); + + virtual void EndElement(); +}; + +#endif // _XMLOFF_XMLSCRIPTI_HXX + diff --git a/xmloff/inc/xmloff/xmlstyle.hxx b/xmloff/inc/xmloff/xmlstyle.hxx new file mode 100644 index 000000000000..c26912c72870 --- /dev/null +++ b/xmloff/inc/xmloff/xmlstyle.hxx @@ -0,0 +1,269 @@ +/************************************************************************* + * + * 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_XMLSTYLE_HXX +#define _XMLOFF_XMLSTYLE_HXX + +#include "sal/config.h" +#include "xmloff/dllapi.h" +#include "sal/types.h" +#include <rsc/rscsfx.hxx> +#include <tools/rtti.hxx> +#include <xmloff/uniref.hxx> +#include <xmloff/xmltkmap.hxx> +#include <xmloff/xmlictxt.hxx> + +class SvXMLStylesContext_Impl; +class SvXMLUnitConverter; +class SvXMLImportPropertyMapper; + +namespace com { namespace sun { namespace star { +namespace container { class XNameContainer; } +namespace style { class XAutoStyleFamily; } +} } } + +enum XMLStyleStylesElemTokens +{ + XML_TOK_STYLE_STYLE, + XML_TOK_STYLE_PAGE_MASTER, + XML_TOK_TEXT_LIST_STYLE, + XML_TOK_TEXT_OUTLINE, + XML_TOK_STYLES_GRADIENTSTYLES, + XML_TOK_STYLES_HATCHSTYLES, + XML_TOK_STYLES_BITMAPSTYLES, + XML_TOK_STYLES_TRANSGRADIENTSTYLES, + XML_TOK_STYLES_MARKERSTYLES, + XML_TOK_STYLES_DASHSTYLES, + XML_TOK_TEXT_NOTE_CONFIG, + XML_TOK_TEXT_BIBLIOGRAPHY_CONFIG, + XML_TOK_TEXT_LINENUMBERING_CONFIG, + XML_TOK_STYLE_DEFAULT_STYLE, + XML_TOK_STYLE_DEFAULT_PAGE_LAYOUT, //text grid enhancement + XML_TOK_STYLE_STYLES_ELEM_END=XML_TOK_UNKNOWN +}; + +class XMLOFF_DLLPUBLIC SvXMLStyleContext : public SvXMLImportContext +{ + ::rtl::OUString maName; + ::rtl::OUString maDisplayName; + ::rtl::OUString maAutoName; + ::rtl::OUString maParentName;// Will be moved to XMLPropStyle soon!!!! + ::rtl::OUString maFollow; // Will be moved to XMLPropStyle soon!!!! + + ::rtl::OUString maHelpFile; // Will be removed very soon!!!! + + sal_uInt32 mnHelpId; // Will be removed very soon!!!! + sal_uInt16 mnFamily; + + sal_Bool mbValid : 1; // Set this to false in CreateAndInsert + // if the style shouldn't be processed + // by Finish() or si somehow invalid. + sal_Bool mbNew : 1; // Set this to false in CreateAnsInsert + // if the style is already existing. + sal_Bool mbDefaultStyle : 1; + +protected: + + virtual void SetAttribute( sal_uInt16 nPrefixKey, + const ::rtl::OUString& rLocalName, + const ::rtl::OUString& rValue ); + + void SetFamily( sal_uInt16 nSet ) { mnFamily = nSet; } + void SetAutoName( const ::rtl::OUString& rName ) { maAutoName = rName; } + +public: + + TYPEINFO(); + + SvXMLStyleContext( SvXMLImport& rImport, sal_uInt16 nPrfx, + const ::rtl::OUString& rLName, + const ::com::sun::star::uno::Reference< + ::com::sun::star::xml::sax::XAttributeList >& xAttrList, + sal_uInt16 nFamily=0, sal_Bool bDefaultStyle = sal_False ); + + virtual ~SvXMLStyleContext(); + + virtual SvXMLImportContext *CreateChildContext( sal_uInt16 nPrefix, + const ::rtl::OUString& rLocalName, + const ::com::sun::star::uno::Reference< + ::com::sun::star::xml::sax::XAttributeList > & xAttrList ); + + virtual void StartElement( + const ::com::sun::star::uno::Reference< + ::com::sun::star::xml::sax::XAttributeList > & xAttrList ); + + const ::rtl::OUString& GetName() const { return maName; } + const ::rtl::OUString& GetDisplayName() const { return maDisplayName.getLength() ? maDisplayName : maName; } + const ::rtl::OUString& GetAutoName() const { return maAutoName; } + const ::rtl::OUString& GetParentName() const { return maParentName; } + const ::rtl::OUString& GetFollow() const { return maFollow; } + + const ::rtl::OUString& GetHelpFile() const { return maHelpFile; } + sal_uInt32 GetHelpId() const { return mnHelpId; } + + sal_uInt16 GetFamily() const { return mnFamily; } + + BOOL IsValid() const { return mbValid; } + void SetValid( sal_Bool b ) { mbValid = b; } + + BOOL IsNew() const { return mbNew; } + void SetNew( sal_Bool b ) { mbNew = b; } + + // This method is called for every default style + virtual void SetDefaults(); + + // This method is called for every style. It must create it and insert + // it into the document. + virtual void CreateAndInsert( sal_Bool bOverwrite ); + + // This method is called for every style. It must create it and insert + // it into the document if this hasn't happened already in CreateAndInsert(). + virtual void CreateAndInsertLate( sal_Bool bOverwrite ); + + // This method is called fpr every style after all styles have been + // inserted into the document. + virtual void Finish( sal_Bool bOverwrite ); + + sal_Bool IsDefaultStyle() const { return mbDefaultStyle; } + + /** if this method returns true, its parent styles context + should not add it to its container.<br> + Transient styles can't be accessed from its + parent SvXMLStylesContext after theyre imported and + the methods CreateAndInsert(), CreateAndInsertLate() + and Finish() will not be called. + The default return value is false + */ + virtual BOOL IsTransient() const; +}; + +class XMLOFF_DLLPUBLIC SvXMLStylesContext : public SvXMLImportContext +{ + const ::rtl::OUString msParaStyleServiceName; + const ::rtl::OUString msTextStyleServiceName; + + SvXMLStylesContext_Impl *mpImpl; + SvXMLTokenMap *mpStyleStylesElemTokenMap; + + + ::com::sun::star::uno::Reference < + ::com::sun::star::container::XNameContainer > mxParaStyles; + + ::com::sun::star::uno::Reference < + ::com::sun::star::container::XNameContainer > mxTextStyles; + + ::com::sun::star::uno::Reference < + ::com::sun::star::style::XAutoStyleFamily > mxParaAutoStyles; + + ::com::sun::star::uno::Reference < + ::com::sun::star::style::XAutoStyleFamily > mxTextAutoStyles; + + UniReference < SvXMLImportPropertyMapper > mxParaImpPropMapper; + UniReference < SvXMLImportPropertyMapper > mxTextImpPropMapper; + UniReference < SvXMLImportPropertyMapper > mxShapeImpPropMapper; + mutable UniReference < SvXMLImportPropertyMapper > mxChartImpPropMapper; + mutable UniReference < SvXMLImportPropertyMapper > mxPageImpPropMapper; + + SAL_DLLPRIVATE const SvXMLTokenMap& GetStyleStylesElemTokenMap(); + + SAL_DLLPRIVATE SvXMLStylesContext(SvXMLStylesContext &); // not defined + SAL_DLLPRIVATE void operator =(SvXMLStylesContext &); // not defined + +protected: + + sal_uInt32 GetStyleCount() const; + SvXMLStyleContext *GetStyle( sal_uInt32 i ); + const SvXMLStyleContext *GetStyle( sal_uInt32 i ) const; + + virtual SvXMLStyleContext *CreateStyleChildContext( sal_uInt16 nPrefix, + const ::rtl::OUString& rLocalName, + const ::com::sun::star::uno::Reference< + ::com::sun::star::xml::sax::XAttributeList > & xAttrList ); + + virtual SvXMLStyleContext *CreateStyleStyleChildContext( sal_uInt16 nFamily, + sal_uInt16 nPrefix, const ::rtl::OUString& rLocalName, + const ::com::sun::star::uno::Reference< + ::com::sun::star::xml::sax::XAttributeList > & xAttrList ); + + virtual SvXMLStyleContext *CreateDefaultStyleStyleChildContext( + sal_uInt16 nFamily, sal_uInt16 nPrefix, + const ::rtl::OUString& rLocalName, + const ::com::sun::star::uno::Reference< + ::com::sun::star::xml::sax::XAttributeList > & xAttrList ); + + virtual sal_Bool InsertStyleFamily( sal_uInt16 nFamily ) const; + +public: + TYPEINFO(); + + SvXMLStylesContext( SvXMLImport& rImport, sal_uInt16 nPrfx, + const ::rtl::OUString& rLName, + const ::com::sun::star::uno::Reference< + ::com::sun::star::xml::sax::XAttributeList > & xAttrList, + sal_Bool bAutomatic = sal_False ); + + virtual ~SvXMLStylesContext(); + + // Create child element. + virtual SvXMLImportContext *CreateChildContext( sal_uInt16 nPrefix, + const ::rtl::OUString& rLocalName, + const ::com::sun::star::uno::Reference< + ::com::sun::star::xml::sax::XAttributeList > & xAttrList ); + + // This method must be overloaded to insert styles into the document. + virtual void EndElement(); + + // This allows to add an SvXMLStyleContext to this context from extern + void AddStyle(SvXMLStyleContext& rNew); + + const SvXMLStyleContext *FindStyleChildContext( + sal_uInt16 nFamily, + const ::rtl::OUString& rName, + BOOL bCreateIndex=sal_False ) const; + virtual sal_uInt16 GetFamily( const ::rtl::OUString& rFamily ) const; + virtual UniReference < SvXMLImportPropertyMapper > GetImportPropertyMapper( + sal_uInt16 nFamily ) const; + + virtual ::com::sun::star::uno::Reference < + ::com::sun::star::container::XNameContainer > + GetStylesContainer( sal_uInt16 nFamily ) const; + virtual ::rtl::OUString GetServiceName( sal_uInt16 nFamily ) const; + + virtual ::com::sun::star::uno::Reference < ::com::sun::star::style::XAutoStyleFamily > + GetAutoStyles( sal_uInt16 nFamily ) const; + void CopyAutoStylesToDoc(); + void CopyStylesToDoc( sal_Bool bOverwrite, sal_Bool bFinish=sal_True ); + void FinishStyles( sal_Bool bOverwrite ); + + // This method must be called to release the references to all styles + // that are stored in the context. + void Clear(); + sal_Bool IsAutomaticStyle() const; +}; + +#endif // _XMLOFF_XMLSTYLE_HXX + diff --git a/xmloff/inc/xmloff/xmltkmap.hxx b/xmloff/inc/xmloff/xmltkmap.hxx new file mode 100644 index 000000000000..cfbb50bbe277 --- /dev/null +++ b/xmloff/inc/xmloff/xmltkmap.hxx @@ -0,0 +1,67 @@ +/************************************************************************* + * + * 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_XMLTKMAP_HXX +#define _XMLOFF_XMLTKMAP_HXX + +#include "sal/config.h" +#include "xmloff/dllapi.h" +#include <sal/types.h> +#include <xmloff/xmltoken.hxx> + +namespace rtl { class OUString; } + +class SvXMLTokenMap_Impl; +class SvXMLTokenMapEntry_Impl; + +#define XML_TOK_UNKNOWN 0xffffU +#define XML_TOKEN_MAP_END { 0xffffU, ::xmloff::token::XML_TOKEN_INVALID, 0U } + +struct SvXMLTokenMapEntry +{ + sal_uInt16 nPrefixKey; + enum ::xmloff::token::XMLTokenEnum eLocalName; + sal_uInt16 nToken; +}; + +class XMLOFF_DLLPUBLIC SvXMLTokenMap +{ + SvXMLTokenMap_Impl *pImpl; + + SAL_DLLPRIVATE SvXMLTokenMapEntry_Impl *_Find( + sal_uInt16 nKind, const ::rtl::OUString& rName ) const; + +public: + + SvXMLTokenMap( const SvXMLTokenMapEntry* pMap ); + ~SvXMLTokenMap(); + + sal_uInt16 Get( sal_uInt16 nPrefix, const ::rtl::OUString& rLName ) const; +}; + +#endif // _XMLOFF_XMLTKMAP_HXX + diff --git a/xmloff/inc/xmloff/xmltoken.hxx b/xmloff/inc/xmloff/xmltoken.hxx new file mode 100644 index 000000000000..90e9e113e9d7 --- /dev/null +++ b/xmloff/inc/xmloff/xmltoken.hxx @@ -0,0 +1,3137 @@ +/************************************************************************* + * + * 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_XMLTOKEN_HXX +#define _XMLOFF_XMLTOKEN_HXX + +#include "sal/config.h" +#include "xmloff/dllapi.h" +#include <sal/types.h> + +namespace rtl { class OUString; } + + +/** + * Handling of tokens in XML: + * + * This header defines te enum ::xmloff::token::XMLTokenEnum containing one + * value for every fixed string used in our XML files. + * + * Usage: + * To obtain an OUString for a token, use the GetXMLToken() function. + * To test equality of an OUString and a token, use IsXMLToken(). + * Additionally, XMLTokenEnum values may be passed to SvXMLExport::AddAttribute + * methods and the SvXMLElementExport constructor. + */ + +namespace xmloff { namespace token { + + + /** + * The enumeration of all XML tokens. + */ + enum XMLTokenEnum + { + XML_TOKEN_START = 0, + XML_TOKEN_INVALID = XML_TOKEN_START, + + // common xml + XML_CDATA, + XML_WS, + XML_XML, + XML_XMLNS, + XML_XML_PI, + XML_XML_DOCTYPE_PREFIX, + XML_XML_DOCTYPE_SUFFIX, + + // namespace prefixes and names + XML_N_XML, + XML_NP_OFFICE, + XML_N_OFFICE, + XML_N_OFFICE_OLD, + XML_NP_META, + XML_N_META, + XML_N_META_OLD, + XML_NP_STYLE, + XML_N_STYLE, + XML_N_STYLE_OLD, + XML_NP_NUMBER, + XML_N_NUMBER, + XML_N_NUMBER_OLD, + XML_NP_TEXT, + XML_N_TEXT, + XML_N_TEXT_OLD, + XML_NP_TABLE, + XML_N_TABLE, + XML_N_TABLE_OLD, + XML_NP_DRAW, + XML_N_DRAW, + XML_NP_DR3D, + XML_N_DR3D, + XML_N_DRAW_OLD, + XML_NP_PRESENTATION, + XML_N_PRESENTATION, + XML_N_PRESENTATION_OLD, + XML_NP_CHART, + XML_N_CHART, + XML_NP_CONFIG, + XML_N_CONFIG, + XML_N_CHART_OLD, + XML_NP_FO, + XML_N_FO_OLD, + XML_N_FO, + XML_NP_XLINK, + XML_N_XLINK, + XML_N_XLINK_OLD, + XML_NP_DC, + XML_N_DC, + XML_NP_SVG, + XML_N_SVG, + XML_NP_FORM, + XML_N_FORM, + XML_NP_SCRIPT, + XML_N_SCRIPT, + XML_NP_XFORMS_1_0, + XML_N_XFORMS_1_0, + XML_NP_XSD, + XML_N_XSD, + XML_NP_XSI, + XML_N_XSI, + + XML_NP_BLOCK_LIST, + XML_N_BLOCK_LIST, + + XML_NP_MATH, + XML_N_MATH, + + XML_NP_VERSIONS_LIST, + XML_N_VERSIONS_LIST, + + // erAck: 2008-04-09T20:02+0200 OpenFormula aka ODFF + XML_NP_OF, + XML_N_OF, + + // ODF 1.2 metadata: RDFa and GRDDL + XML_NP_XHTML, + XML_N_XHTML, + XML_NP_GRDDL, + XML_N_GRDDL, + + // ODF Enhanced namespaces + XML_NP_OFFICE_EXT, + XML_N_OFFICE_EXT, + + XML_NP_TABLE_EXT, + XML_N_TABLE_EXT, + + XML_NP_DRAW_EXT, + XML_N_DRAW_EXT, + + // units + XML_UNIT_MM, + XML_UNIT_M, + XML_UNIT_KM, + XML_UNIT_CM, + XML_UNIT_PT, + XML_UNIT_PC, + XML_UNIT_FOOT, + XML_UNIT_MILES, + XML_UNIT_INCH, + + // any other + XML_1, + XML_10, + XML_2, + XML_3, + XML_4, + XML_5, + XML_6, + XML_7, + XML_8, + XML_9, + XML_A_UPCASE, + XML_I_UPCASE, + XML_IBM437, + XML_IBM850, + XML_IBM860, + XML_IBM861, + XML_IBM863, + XML_IBM865, + XML_ISO_8859_1, + XML_OLE2, + XML__COLON, + XML__EMPTY, + XML__UNKNOWN_, + + XML_A, + XML_ABBREVIATED_NAME, + XML_ABOVE, + XML_ABS, + XML_ACCENT, + XML_ACCENTUNDER, + XML_ACCEPTANCE_STATE, + XML_ACCEPTED, + XML_ACTION, + XML_ACTIVE, + XML_ACTIVE_SPLIT_RANGE, + XML_ACTIVE_TABLE, + XML_ACTUATE, + XML_ADD_IN, + XML_ADD_IN_NAME, + XML_ADDRESS, + XML_ADJUSTMENT, + XML_ALGORITHM, + XML_ALIGN, + XML_ALL, + XML_ALLOW_EMPTY_CELL, + XML_ALPHABETICAL_INDEX, + XML_ALPHABETICAL_INDEX_AUTO_MARK_FILE, + XML_ALPHABETICAL_INDEX_ENTRY_TEMPLATE, + XML_ALPHABETICAL_INDEX_MARK, + XML_ALPHABETICAL_INDEX_MARK_END, + XML_ALPHABETICAL_INDEX_MARK_START, + XML_ALPHABETICAL_INDEX_SOURCE, + XML_ALPHABETICAL_SEPARATORS, + XML_ALTERNATE, + XML_AM_PM, + XML_AMBIENT_COLOR, + XML_ANCHOR_PAGE_NUMBER, + XML_ANCHOR_TYPE, + XML_AND, + XML_ANIMATION, + XML_ANIMATION_DELAY, + XML_ANIMATION_DIRECTION, + XML_ANIMATION_REPEAT, + XML_ANIMATION_START_INSIDE, + XML_ANIMATION_STEPS, + XML_ANIMATION_STOP_INSIDE, + XML_ANIMATIONS, + XML_ANNOTATION, + XML_ANNOTATIONS, + XML_ANNOTE, + XML_APPEAR, + XML_APPLET, + XML_APPLET_NAME, + XML_APPLICATION_DATA, + XML_APPLICATION_XML, + XML_APPLY, + XML_APPLY_STYLE_NAME, + XML_AQUA, + XML_ARC, + XML_ARCCOS, + XML_ARCHIVE, + XML_ARCSIN, + XML_ARCTAN, + XML_AREA, + XML_AREA_CIRCLE, + XML_AREA_POLYGON, + XML_AREA_RECTANGLE, + XML_ARTICLE, + XML_AS_CHAR, + XML_ASCENDING, + XML_ATTACHED_AXIS, + XML_ATTRACTIVE, + XML_AUTHOR, + XML_AUTHOR_INITIALS, + XML_AUTHOR_NAME, + XML_AUTO, + XML_AUTO_GROW_HEIGHT, + XML_AUTO_GROW_WIDTH, + XML_AUTO_RELOAD, + XML_AUTO_TEXT, + XML_AUTO_TEXT_EVENTS, + XML_AUTO_TEXT_GROUP, + XML_AUTO_TEXT_INDENT, + XML_AUTO_UPDATE, + XML_AUTOMATIC, + XML_AUTOMATIC_FIND_LABELS, + XML_AUTOMATIC_ORDER, + XML_AUTOMATIC_STYLES, + XML_AUTOMATIC_UPDATE, + XML_AUTOSIZE, + XML_AVERAGE, + XML_AXIS, + XML_BACK_SCALE, + XML_BACKFACE_CULLING, + XML_BACKGROUND, + XML_BACKGROUND_COLOR, + XML_BACKGROUND_IMAGE, + XML_BACKGROUND_NO_REPEAT, + XML_BACKGROUND_REPEAT, + XML_BACKGROUND_STRETCH, + XML_BAR, + XML_BASE64BINARY, + XML_BASE_CELL_ADDRESS, + XML_BASELINE, + XML_BEFORE_DATE_TIME, + XML_BELOW, + XML_BETWEEN_DATE_TIMES, + XML_BEVEL, + XML_BIBILIOGRAPHIC_TYPE, + XML_BIBLIOGRAPHY, + XML_BIBLIOGRAPHY_CONFIGURATION, + XML_BIBLIOGRAPHY_DATA_FIELD, + XML_BIBLIOGRAPHY_ENTRY_TEMPLATE, + XML_BIBLIOGRAPHY_MARK, + XML_BIBLIOGRAPHY_SOURCE, + XML_BIBLIOGRAPHY_TYPE, + XML_BIND_STYLES_TO_CONTENT, + XML_BITMAP, + XML_BLACK, + XML_BLEND, + XML_BLINKING, + XML_BLOCK, + XML_BLOCK_LIST, + XML_BLUE, + XML_BODY, + XML_BOLD, + XML_BOOK, + XML_BOOKLET, + XML_BOOKMARK, + XML_BOOKMARK_END, + XML_BOOKMARK_REF, + XML_BOOKMARK_START, + XML_BOOKTITLE, + XML_BOOLEAN, + XML_BOOLEAN_STYLE, + XML_BOOLEAN_VALUE, + XML_BORDER, + XML_BORDER_BOTTOM, + XML_BORDER_COLOR, + XML_BORDER_LEFT, + XML_BORDER_LINE_WIDTH, + XML_BORDER_LINE_WIDTH_BOTTOM, + XML_BORDER_LINE_WIDTH_LEFT, + XML_BORDER_LINE_WIDTH_RIGHT, + XML_BORDER_LINE_WIDTH_TOP, + XML_BORDER_RIGHT, + XML_BORDER_TOP, + XML_BOTH, + XML_BOTTOM, + XML_BOTTOM_LEFT, + XML_BOTTOM_PERCENT, + XML_BOTTOM_RIGHT, + XML_BOTTOM_VALUES, + XML_BOTTOMARC, + XML_BOTTOMCIRCLE, + XML_BREAK_AFTER, + XML_BREAK_BEFORE, + XML_BREAK_INSIDE, + XML_BUBBLE, + XML_BULLET_CHAR, + XML_BULLET_RELATIVE_SIZE, + XML_BUTTON1, + XML_BUTTON2, + XML_BUTTON3, + XML_BUTTON4, + XML_BUTTONS, + XML_BVAR, + XML_C, + XML_CALCULATION_SETTINGS, + XML_CALENDAR, + XML_CAPITALIZE_ENTRIES, + XML_CAPTION, + XML_CAPTION_POINT_X, + XML_CAPTION_POINT_Y, + XML_CAPTION_SEQUENCE_FORMAT, + XML_CAPTION_SEQUENCE_NAME, + XML_CASE_SENSITIVE, + XML_CASEMAP_CAPITALIZE, + XML_CASEMAP_LOWERCASE, + XML_CASEMAP_NORMAL, + XML_CASEMAP_SMALL_CAPS, + XML_CASEMAP_UPPERCASE, + XML_CATEGORIES, + XML_CATEGORY, + XML_CATEGORY_AND_VALUE, + XML_CELL_ADDRESS, + XML_CELL_CONTENT_CHANGE, + XML_CELL_CONTENT_DELETION, + XML_CELL_COUNT, + XML_CELL_PROTECT, + XML_CELL_RANGE_ADDRESS, + XML_CELL_RANGE_ADDRESS_LIST, + XML_CELL_RANGE_SOURCE, + XML_CENTER, + XML_CHAIN_NEXT_NAME, + XML_CHANGE, + XML_CHANGE_DELETION, + XML_CHANGE_END, + XML_CHANGE_ID, + XML_CHANGE_INFO, + XML_CHANGE_START, + XML_CHANGE_TRACK_TABLE_CELL, + XML_CHANGE_VIEW_CONDITIONS, + XML_CHANGE_VIEW_SETTINGS, + XML_CHANGED_REGION, + XML_CHAPTER, + XML_CHAR, + XML_CHARACTER_COUNT, + XML_CHART, + XML_CHARTS, + XML_CHECKERBOARD, + XML_CHG_AUTHOR, + XML_CHG_COMMENT, + XML_CHG_DATE_TIME, + XML_CI, + XML_CIRCLE, + XML_CITATION_BODY_STYLE_NAME, + XML_CITATION_STYLE_NAME, + XML_CLASS, + XML_CLASS_ID, + XML_CLIP, + XML_CLOCKWISE, + XML_CLOSE, + XML_CLOSE_HORIZONTAL, + XML_CLOSE_VERTICAL, + XML_CM, + XML_CN, + XML_CODE, + XML_CODEBASE, + XML_COLLAPSE, + XML_COLOR, + XML_COLOR_INVERSION, + XML_COLOR_MODE, + XML_COLUMN, + XML_COLUMN_COUNT, + XML_COLUMN_GAP, + XML_COLUMN_NAME, + XML_COLUMN_SEP, + XML_COLUMN_WIDTH, + XML_COLUMNS, + XML_COLUMNSPLIT_AUTO, + XML_COLUMNSPLIT_AVOID, + XML_COMBINE_ENTRIES, + XML_COMBINE_ENTRIES_WITH_DASH, + XML_COMBINE_ENTRIES_WITH_PP, + XML_COMMA_SEPARATED, + XML_COMMAND, + XML_COMMENT, + XML_COMPOSE, + XML_COND_STYLE_NAME, + XML_CONDITION, + XML_CONDITION_SOURCE, + XML_CONDITION_SOURCE_RANGE_ADDRESS, + XML_CONDITIONAL_TEXT, + XML_CONE, + XML_CONFERENCE, + XML_CONFIG_ITEM, + XML_CONFIG_ITEM_MAP_ENTRY, + XML_CONFIG_ITEM_MAP_INDEXED, + XML_CONFIG_ITEM_MAP_NAMED, + XML_CONFIG_ITEM_SET, + XML_CONFIGURATION_SETTINGS, + XML_CONJUGATE, + XML_CONNECT_BARS, + XML_CONNECTION_NAME, + XML_CONNECTOR, + XML_CONSECUTIVE_NUMBERING, + XML_CONSOLIDATION, + XML_CONSTANT, + XML_CONTAINS_ERROR, + XML_CONTAINS_HEADER, + XML_CONTENT, + XML_CONTENT_VALIDATION, + XML_CONTENT_VALIDATION_NAME, + XML_CONTENT_VALIDATIONS, + XML_CONTINUE, + XML_CONTINUE_NUMBERING, + XML_CONTOUR_PATH, + XML_CONTOUR_POLYGON, + XML_CONTRAST, + XML_CONTROL, + XML_CONVERSION_MODE, + XML_COPY_BACK, + XML_COPY_FORMULAS, + XML_COPY_OUTLINE_LEVELS, + XML_COPY_RESULTS_ONLY, + XML_COPY_STYLES, + XML_CORNER_RADIUS, + XML_CORRECT, + XML_COS, + XML_COSH, + XML_COT, + XML_COTH, + XML_COUNT, + XML_COUNT_EMPTY_LINES, + XML_COUNT_IN_FLOATING_FRAMES, + XML_COUNTER_CLOCKWISE, + XML_COUNTERCLOCKWISE, + XML_COUNTNUMS, + XML_COUNTRY, + XML_COUNTRY_ASIAN, + XML_COUNTRY_COMPLEX, + XML_COVERED_TABLE_CELL, + XML_CREATE_DATE, + XML_CREATE_DATE_STRING, + XML_CREATION_DATE, + XML_CREATION_TIME, + XML_CREATOR, + XML_CSC, + XML_CSCH, + XML_CUBE, + XML_CUBOID, + XML_CURRENCY, + XML_CURRENCY_STYLE, + XML_CURRENCY_SYMBOL, + XML_CURRENT, + XML_CURRENT_VALUE, + XML_CURSOR_POSITION, + XML_CURSOR_POSITION_X, + XML_CURSOR_POSITION_Y, + XML_CURVE, + XML_CUSTOM1, + XML_CUSTOM2, + XML_CUSTOM3, + XML_CUSTOM4, + XML_CUSTOM5, + XML_CUT, + XML_CUT_OFFS, + XML_CX, + XML_CY, + XML_CYLINDER, + XML_D, + XML_DASH, + XML_DASHED, + XML_DATA, + XML_DATA_CELL_RANGE_ADDRESS, + XML_DATA_LABEL_NUMBER, + XML_DATA_LABEL_SYMBOL, + XML_DATA_LABEL_TEXT, + XML_DATA_PILOT_FIELD, + XML_DATA_PILOT_GRAND_TOTAL, + XML_DATA_PILOT_LEVEL, + XML_DATA_PILOT_MEMBER, + XML_DATA_PILOT_MEMBERS, + XML_DATA_PILOT_SUBTOTAL, + XML_DATA_PILOT_SUBTOTALS, + XML_DATA_PILOT_TABLE, + XML_DATA_PILOT_TABLES, + XML_DATA_POINT, + XML_DATA_STYLE, + XML_DATA_STYLE_NAME, + XML_DATA_TYPE, + XML_DATABASE_DISPLAY, + XML_DATABASE_NAME, + XML_DATABASE_NEXT, + XML_DATABASE_RANGE, + XML_DATABASE_RANGES, + XML_DATABASE_ROW_NUMBER, + XML_DATABASE_SELECT, + XML_DATABASE_SOURCE_QUERY, + XML_DATABASE_SOURCE_SQL, + XML_DATABASE_SOURCE_TABLE, + XML_DATE, + XML_DATE_ADJUST, + XML_DATE_STYLE, + XML_DATE_TIME, + XML_DATE_VALUE, + XML_DATETIME, + XML_DAY, + XML_DAY_OF_WEEK, + XML_DDE_APPLICATION, + XML_DDE_CONNECTION, + XML_DDE_CONNECTION_DECL, + XML_DDE_CONNECTION_DECLS, + XML_DDE_ITEM, + XML_DDE_LINK, + XML_DDE_LINKS, + XML_DDE_SOURCE, + XML_DDE_TOPIC, + XML_DECIMAL_PLACES, + XML_DECIMAL_REPLACEMENT, + XML_DECLARE, + XML_DECORATE_WORDS_ONLY, + XML_DECORATIVE, + XML_DEEP, + XML_DEFAULT, + XML_DEFAULT_CELL_STYLE_NAME, + XML_DEFAULT_STYLE, + XML_DEFAULT_STYLE_NAME, + XML_DEGREE, + XML_DELAY, + XML_DELETION, + XML_DELETIONS, + XML_DEPENDENCE, + XML_DEPENDENCES, + XML_DEPENDENCIES, + XML_DEPTH, + XML_DESC, + XML_DESCENDING, + XML_DESCRIPTION, + XML_DETECTIVE, + XML_DETERMINANT, + XML_DIFF, + XML_DIFFUSE_COLOR, + XML_DIM, + XML_DIRECTION, + XML_DISABLED, + XML_DISC, + XML_DISPLAY, + XML_DISPLAY_BORDER, + XML_DISPLAY_DETAILS, + XML_DISPLAY_DUPLICATES, + XML_DISPLAY_EMPTY, + XML_DISPLAY_FILTER_BUTTONS, + XML_DISPLAY_FORMULA, + XML_DISPLAY_LABEL, + XML_DISPLAY_LEVELS, + XML_DISPLAY_NAME, + XML_DISPLAY_OUTLINE_LEVEL, + XML_DISSOLVE, + XML_DISTANCE, + XML_DISTANCE_AFTER_SEP, + XML_DISTANCE_BEFORE_SEP, + XML_DISTRIBUTE_LETTER, + XML_DISTRIBUTE_SPACE, + XML_DIVIDE, + XML_DOCUMENT, + XML_DOCUMENT_CONTENT, + XML_DOCUMENT_META, + XML_DOCUMENT_SETTINGS, + XML_DOCUMENT_STATISTIC, + XML_DOCUMENT_STYLES, + XML_DOMAIN, + XML_DOT, + XML_DOTS1, + XML_DOTS1_LENGTH, + XML_DOTS2, + XML_DOTS2_LENGTH, + XML_DOTTED, + XML_DOUBLE, + XML_DOUBLE_SIDED, + XML_DOWN, + XML_DRAFT, + XML_DRAW, + XML_DRAW_ASPECT, + XML_DRAWING, + XML_DRAWINGS, + XML_DRAWPOOL, + XML_DROP_CAP, + XML_DYNAMIC, + XML_EDGE_ROUNDING, + XML_EDITABLE, + XML_EDITING_CYCLES, + XML_EDITING_DURATION, + XML_EDITION, + XML_EDITOR, + XML_EFFECT, + XML_ELLIPSE, + XML_EMAIL, + XML_EMBED, + XML_EMBEDDED_VISIBLE_AREA, + XML_EMBOSSED, + XML_EMISSIVE_COLOR, + XML_EMPTY, + XML_ENABLE_NUMBERING, + XML_ENABLED, + XML_ENCODING, + XML_END, + XML_END_ANGLE, + XML_END_CELL_ADDRESS, + XML_END_COLOR, + XML_END_COLUMN, + XML_END_GLUE_POINT, + XML_END_GUIDE, + XML_END_INTENSITY, + XML_END_LINE_SPACING_HORIZONTAL, + XML_END_LINE_SPACING_VERTICAL, + XML_END_POSITION, + XML_END_ROW, + XML_END_SHAPE, + XML_END_TABLE, + XML_END_X, + XML_END_Y, + XML_ENDLESS, + XML_ENDNOTE, + XML_ENDNOTE_BODY, + XML_ENDNOTE_CITATION, + XML_ENDNOTE_REF, + XML_ENDNOTES_CONFIGURATION, + XML_ENGRAVED, + XML_EQ, + XML_EQUAL_AUTHOR, + XML_EQUAL_COMMENT, + XML_EQUAL_DATE, + XML_ERA, + XML_ERGO_SUM, + XML_ERROR_CATEGORY, + XML_ERROR_LOWER_INDICATOR, + XML_ERROR_LOWER_LIMIT, + XML_ERROR_MACRO, + XML_ERROR_MARGIN, + XML_ERROR_MESSAGE, + XML_ERROR_PERCENTAGE, + XML_ERROR_UPPER_INDICATOR, + XML_ERROR_UPPER_LIMIT, + XML_ESCAPEMENT_SUB, + XML_ESCAPEMENT_SUPER, + XML_EVEN_PAGE, + XML_EVENT, + XML_EVENT_NAME, + XML_EVENTS, + XML_EXECUTE, + XML_EXECUTE_MACRO, + XML_EXISTS, + XML_EXP, + XML_EXPONENTIAL, + XML_EXPRESSION, + XML_EXTRA, + XML_EXTRUDE, + XML_FACTORIAL, + XML_FADE, + XML_FADE_FROM_BOTTOM, + XML_FADE_FROM_CENTER, + XML_FADE_FROM_LEFT, + XML_FADE_FROM_LOWERLEFT, + XML_FADE_FROM_LOWERRIGHT, + XML_FADE_FROM_RIGHT, + XML_FADE_FROM_TOP, + XML_FADE_FROM_UPPERLEFT, + XML_FADE_FROM_UPPERRIGHT, + XML_FADE_OUT, + XML_FADE_TO_CENTER, + XML_FALSE, + XML_FAMILY, + XML_FAST, + XML_FIELD_NUMBER, + XML_FILE_NAME, + XML_FILL, + XML_FILL_COLOR, + XML_FILL_GRADIENT_NAME, + XML_FILL_HATCH_NAME, + XML_FILL_HATCH_SOLID, + XML_FILL_IMAGE, + XML_FILL_IMAGE_HEIGHT, + XML_FILL_IMAGE_NAME, + XML_FILL_IMAGE_REF_POINT, + XML_FILL_IMAGE_REF_POINT_X, + XML_FILL_IMAGE_REF_POINT_Y, + XML_FILL_IMAGE_WIDTH, + XML_FILTER, + XML_FILTER_AND, + XML_FILTER_CONDITION, + XML_FILTER_NAME, + XML_FILTER_OPTIONS, + XML_FILTER_OR, + XML_FIRST_DATE_TIME, + XML_FIRST_PAGE, + XML_FIRST_PAGE_NUMBER, + XML_FIT_TO_CONTOUR, + XML_FIT_TO_SIZE, + XML_FIX, + XML_FIXED, + XML_FLAT, + XML_FLOAT, + XML_FLOATING_FRAME, + XML_FLOOR, + XML_FN, + XML_FOCAL_LENGTH, + XML_FONT_CHAR_WIDTH, + XML_FONT_CHARSET, + XML_FONT_CHARSET_ASIAN, + XML_FONT_CHARSET_COMPLEX, + XML_FONT_COLOR, + XML_FONT_DECL, + XML_FONT_DECLS, + XML_FONT_FAMILY, + XML_FONT_FAMILY_ASIAN, + XML_FONT_FAMILY_COMPLEX, + XML_FONT_FAMILY_GENERIC, + XML_FONT_FAMILY_GENERIC_ASIAN, + XML_FONT_FAMILY_GENERIC_COMPLEX, + XML_FONT_KERNING, + XML_FONT_NAME, + XML_FONT_NAME_ASIAN, + XML_FONT_NAME_COMPLEX, + XML_FONT_PITCH, + XML_FONT_PITCH_ASIAN, + XML_FONT_PITCH_COMPLEX, + XML_FONT_RELIEF, + XML_FONT_SIZE, + XML_FONT_SIZE_ASIAN, + XML_FONT_SIZE_COMPLEX, + XML_FONT_SIZE_REL, + XML_FONT_SIZE_REL_ASIAN, + XML_FONT_SIZE_REL_COMPLEX, + XML_FONT_STYLE, + XML_FONT_STYLE_ASIAN, + XML_FONT_STYLE_COMPLEX, + XML_FONT_STYLE_NAME, + XML_FONT_STYLE_NAME_ASIAN, + XML_FONT_STYLE_NAME_COMPLEX, + XML_FONT_VARIANT, + XML_FONT_WEIGHT, + XML_FONT_WEIGHT_ASIAN, + XML_FONT_WEIGHT_COMPLEX, + XML_FONT_WIDTH, + XML_FONT_WORD_LINE_MODE, + XML_FONTFAMILY, + XML_FONTSIZE, + XML_FONTSTYLE, + XML_FONTWEIGHT, + XML_FONTWORK_ADJUST, + XML_FONTWORK_DISTANCE, + XML_FONTWORK_FORM, + XML_FONTWORK_HIDE_FORM, + XML_FONTWORK_MIRROR, + XML_FONTWORK_OUTLINE, + XML_FONTWORK_SHADOW, + XML_FONTWORK_SHADOW_COLOR, + XML_FONTWORK_SHADOW_OFFSET_X, + XML_FONTWORK_SHADOW_OFFSET_Y, + XML_FONTWORK_SHADOW_TRANSPARENCE, + XML_FONTWORK_START, + XML_FONTWORK_STYLE, + XML_FOOTER, + XML_FOOTER_LEFT, + XML_FOOTER_STYLE, + XML_FOOTNOTE, + XML_FOOTNOTE_BODY, + XML_FOOTNOTE_CITATION, + XML_FOOTNOTE_CONTINUATION_NOTICE_BACKWARD, + XML_FOOTNOTE_CONTINUATION_NOTICE_FORWARD, + XML_FOOTNOTE_MAX_HEIGHT, + XML_FOOTNOTE_REF, + XML_FOOTNOTE_SEP, + XML_FOOTNOTES_CONFIGURATION, + XML_FOOTNOTES_POSITION, + XML_FORALL, + XML_FORCE_MANUAL, + XML_FOREGROUND, + XML_FOREIGN_OBJECT, + XML_FORMAT_CHANGE, + XML_FORMAT_SOURCE, + XML_FORMS, + XML_FORMULA, + XML_FORMULA_HIDDEN, + XML_FORMULAS, + XML_FRACTION, + XML_FRAME, + XML_FRAME_CONTENT, + XML_FRAME_DISPLAY_BORDER, + XML_FRAME_DISPLAY_SCROLLBAR, + XML_FRAME_END_MARGIN, + XML_FRAME_MARGIN_HORIZONTAL, + XML_FRAME_MARGIN_VERTICAL, + XML_FRAME_NAME, + XML_FRAME_START_MARGIN, + XML_FREEZE, + XML_FREEZE_POSITION, + XML_FROM_ANOTHER_TABLE, + XML_FROM_BOTTOM, + XML_FROM_CENTER, + XML_FROM_INSIDE, + XML_FROM_LEFT, + XML_FROM_LOWER_LEFT, + XML_FROM_LOWER_RIGHT, + XML_FROM_RIGHT, + XML_FROM_SAME_TABLE, + XML_FROM_TOP, + XML_FROM_UPPER_LEFT, + XML_FROM_UPPER_RIGHT, + XML_FUCHSIA, + XML_FULL, + XML_FULL_SCREEN, + XML_FUNCTION, + XML_G, + XML_GAMMA, + XML_GAP, + XML_GAP_WIDTH, + XML_GCD, + XML_GENERATOR, + XML_GEQ, + XML_GOURAUD, + XML_GRADIENT, + XML_GRADIENT_ANGLE, + XML_GRADIENT_BORDER, + XML_GRADIENT_STEP_COUNT, + XML_GRADIENT_STYLE, + XML_GRADIENTSTYLE_AXIAL, + XML_GRADIENTSTYLE_ELLIPSOID, + XML_GRADIENTSTYLE_LINEAR, + XML_GRADIENTSTYLE_RADIAL, + XML_GRADIENTSTYLE_RECTANGULAR, + XML_GRADIENTSTYLE_SQUARE, + XML_GRAND_TOTAL, + XML_GRAPHIC, + XML_GRAY, + XML_GREEN, + XML_GREYSCALE, + XML_GRID, + XML_GROOVE, + XML_GROUP_BY_FIELD_NUMBER, + XML_GROUP_NAME, + XML_GROUPING, + XML_GT, + XML_GUIDE_DISTANCE, + XML_GUIDE_OVERHANG, + XML_H, + XML_HANGING, + XML_HAS_PERSISTENT_DATA, + XML_HATCH, + XML_HATCH_DISTANCE, + XML_HATCH_STYLE, + XML_HATCHSTYLE_DOUBLE, + XML_HATCHSTYLE_SINGLE, + XML_HATCHSTYLE_TRIPLE, + XML_HEADER, + XML_HEADER_LEFT, + XML_HEADER_STYLE, + XML_HEADERS, + XML_HEIGHT, + XML_HELP, + XML_HELP_FILE_NAME, + XML_HELP_ID, + XML_HELP_MESSAGE, + XML_HIDDEN, + XML_HIDDEN_AND_PROTECTED, + XML_HIDDEN_PARAGRAPH, + XML_HIDDEN_TEXT, + XML_HIDE, + XML_HIDE_SHAPE, + XML_HIDE_TEXT, + XML_HIGHLIGHTED_RANGE, + XML_HINT, + XML_HORIZONTAL, + XML_HORIZONTAL_LINES, + // --> OD 2005-05-12 #i49139# + // XML_HORIZONTAL_ON_LEFT_PAGES and XML_HORIZONTAL_ON_RIGHT_PAGES + // are replaced by XML_HORIZONTAL_ON_EVEN and XML_HORIZONTAL_ON_ODD. + // Usage is deprecated, but the old token are needed for the + // OpenOffice.org file format import/export filter for the renaming + XML_HORIZONTAL_ON_LEFT_PAGES, + XML_HORIZONTAL_ON_RIGHT_PAGES, + // <-- + XML_HORIZONTAL_POS, + XML_HORIZONTAL_REL, + XML_HORIZONTAL_SCROLLBAR_WIDTH, + XML_HORIZONTAL_SEGMENTS, + XML_HORIZONTAL_SPLIT_MODE, + XML_HORIZONTAL_SPLIT_POSITION, + XML_HORIZONTAL_STRIPES, + XML_HOURS, + XML_HOWPUBLISHED, + XML_HREF, + XML_HTML, + XML_HYPERLINK_BEHAVIOUR, + XML_HYPHENATE, + XML_HYPHENATION_KEEP, + XML_HYPHENATION_LADDER_COUNT, + XML_HYPHENATION_PUSH_CHAR_COUNT, + XML_HYPHENATION_REMAIN_CHAR_COUNT, + XML_I, + XML_ICON, + XML_ID, + XML_IDENT, + XML_IDENTIFIER, + XML_IDENTIFY_CATEGORIES, + XML_IDEOGRAPH_ALPHA, + XML_IGNORE_CASE, + XML_IGNORE_EMPTY_ROWS, + XML_ILLUSTRATION_INDEX, + XML_ILLUSTRATION_INDEX_ENTRY_TEMPLATE, + XML_ILLUSTRATION_INDEX_SOURCE, + XML_IMAGE, + XML_IMAGE_COUNT, + XML_IMAGE_MAP, + XML_IMPLIES, + XML_IN, + XML_IN_RANGE, + XML_INBOOK, + XML_INCOLLECTION, + XML_INCREMENT, + XML_INDEX, + XML_INDEX_BODY, + XML_INDEX_ENTRY_BIBLIOGRAPHY, + XML_INDEX_ENTRY_CHAPTER, + XML_INDEX_ENTRY_CHAPTER_NUMBER, + XML_INDEX_ENTRY_LINK_END, + XML_INDEX_ENTRY_LINK_START, + XML_INDEX_ENTRY_PAGE_NUMBER, + XML_INDEX_ENTRY_SPAN, + XML_INDEX_ENTRY_TAB_STOP, + XML_INDEX_ENTRY_TEMPLATE, + XML_INDEX_ENTRY_TEXT, + XML_INDEX_NAME, + XML_INDEX_SCOPE, + XML_INDEX_SOURCE_STYLE, + XML_INDEX_SOURCE_STYLES, + XML_INDEX_TITLE, + XML_INDEX_TITLE_TEMPLATE, + XML_INFORMATION, + XML_INITIAL_CREATOR, + XML_INPROCEEDINGS, + XML_INSERTION, + XML_INSERTION_CUT_OFF, + XML_INSET, + XML_INSIDE, + XML_INSTITUTION, + XML_INT, + XML_INTENSITY, + XML_INTERSECT, + XML_INTERVAL, + XML_INTERVAL_MAJOR, + XML_INTERVAL_MINOR, + XML_INTO_ENGLISH_NUMBER, + XML_INVERSE, + XML_IS_ACTIVE, + XML_IS_DATA_LAYOUT_FIELD, + XML_IS_HIDDEN, + XML_IS_SELECTION, + XML_ISBN, + XML_ITALIC, + XML_ITERATION, + XML_JOURNAL, + XML_JUSTIFIED, + XML_JUSTIFY, + XML_JUSTIFY_SINGLE_WORD, + XML_KEEP_WITH_NEXT, + XML_KERNING_NORMAL, + XML_KEY, + XML_KEY1, + XML_KEY2, + XML_KEYWORD, + XML_KEYWORDS, + XML_KIND, + XML_KM, + XML_LABEL, + XML_LABEL_ARRANGEMENT, + XML_LABEL_CELL_ADDRESS, + XML_LABEL_CELL_RANGE_ADDRESS, + XML_LABEL_RANGE, + XML_LABEL_RANGES, + XML_LAMBDA, + XML_LANDSCAPE, + XML_LANGUAGE, + XML_LANGUAGE_ASIAN, + XML_LANGUAGE_COMPLEX, + XML_LASER, + XML_LAST_COLUMN_SPANNED, + XML_LAST_PAGE, + XML_LAST_ROW_SPANNED, + XML_LAYER, + XML_LAYER_SET, + XML_LEADER_CHAR, + XML_LEFT, + XML_LEFT_OUTSIDE, + XML_LEFT_TOP_POSITION, + XML_LEFTARC, + XML_LEFTCIRCLE, + XML_LEGEND, + XML_LEGEND_POSITION, + XML_LENGTH, + XML_LEQ, + XML_LET_TEXT, + XML_KEEP_TEXT, + XML_LETTER_KERNING, + XML_LETTER_SPACING, + XML_LETTERS, + XML_LEVEL, + XML_LIBRARY, + XML_LIBRARY_EMBEDDED, + XML_LIBRARY_LINKED, + XML_LIGHT, + XML_LIGHTING_MODE, + XML_LIME, + XML_LIMIT, + XML_LINE, + XML_LINE_BREAK, + XML_LINE_DISTANCE, + XML_LINE_HEIGHT, + XML_LINE_HEIGHT_AT_LEAST, + XML_LINE_NUMBER, + XML_LINE_SKEW, + XML_LINE_SPACING, + XML_LINEAR, + XML_LINENUMBERING_CONFIGURATION, + XML_LINENUMBERING_SEPARATOR, + XML_LINES, + XML_LINES_USED, + XML_LINK_TO_SOURCE_DATA, + XML_LIST, + XML_LIST_BLOCK, + XML_LIST_HEADER, + XML_LIST_INFO, + XML_LIST_ITEM, + XML_LIST_LEVEL, + XML_LIST_LEVEL_STYLE_BULLET, + XML_LIST_LEVEL_STYLE_IMAGE, + XML_LIST_LEVEL_STYLE_NUMBER, + XML_LIST_NAME, + XML_LIST_STYLE, + XML_LIST_STYLE_NAME, + XML_LN, + XML_LOCKED, + XML_LOG, + XML_LOGARITHMIC, + XML_LOGBASE, + XML_LONG, + XML_LOWLIMIT, + XML_LR_TB, + XML_LT, + XML_LTR, + XML_LUMINANCE, + XML_MACRO_NAME, + XML_MACTION, + XML_MAIN_ENTRY_STYLE_NAME, + XML_MAJOR, + XML_MALIGNGROUP, + XML_MALIGNMARK, + XML_MANUAL, + XML_MAP, + XML_MARGIN_BOTTOM, + XML_MARGIN_LEFT, + XML_MARGIN_RIGHT, + XML_MARGIN_TOP, + XML_MARGINS, + XML_MARKER, + XML_MARKER_END, + XML_MARKER_END_CENTER, + XML_MARKER_END_WIDTH, + XML_MARKER_START, + XML_MARKER_START_CENTER, + XML_MARKER_START_WIDTH, + XML_MAROON, + XML_MASTER_PAGE, + XML_MASTER_PAGE_NAME, + XML_MASTER_STYLES, + XML_MASTERSTHESIS, + XML_MATCH, + XML_MATH, + XML_MATRIX, + XML_MATRIX_COVERED, + XML_MATRIXROW, + XML_MAX, + XML_MAX_EDGE, + XML_MAX_HEIGHT, + XML_MAX_WIDTH, + XML_MAXIMUM, + XML_MAXIMUM_DIFFERENCE, + XML_MAY_BREAK_BETWEEN_ROWS, + XML_MAY_SCRIPT, + XML_MEAN, + XML_MEAN_VALUE, + XML_MEASURE, + XML_MEASURE_ALIGN, + XML_MEASURE_VERTICAL_ALIGN, + XML_MEDIAN, + XML_MEDIUM, + XML_MERROR, + XML_MESSAGE_TYPE, + XML_META, + XML_MFENCED, + XML_MFRAC, + XML_MI, + XML_MIDDLE, + XML_MIME_TYPE, + XML_MIN, + XML_MIN_DENOMINATOR_DIGITS, + XML_MIN_EDGE, + XML_MIN_EXPONENT_DIGITS, + XML_MIN_HEIGHT, + XML_MIN_INTEGER_DIGITS, + XML_MIN_LABEL_DISTANCE, + XML_MIN_LABEL_WIDTH, + XML_MIN_LINE_HEIGHT, + XML_MIN_NUMERATOR_DIGITS, + XML_MIN_ROW_HEIGHT, + XML_MIN_WIDTH, + XML_MINIMUM, + XML_MINOR, + XML_MINUS, + XML_MINUTES, + XML_MIRROR, + XML_MIRRORED, + XML_MISC, + XML_MITER, + XML_MM, + XML_MMULTISCRIPTS, + XML_MN, + XML_MO, + XML_MODE, + XML_MODERN, + XML_MODIFICATION_DATE, + XML_MODIFICATION_TIME, + XML_MODULATE, + XML_MODULE, + XML_MOMENT, + XML_MONO, + XML_MONTH, + XML_MOUSE_AS_PEN, + XML_MOUSE_VISIBLE, + XML_MOVE, + XML_MOVE_FROM_BOTTOM, + XML_MOVE_FROM_LEFT, + XML_MOVE_FROM_RIGHT, + XML_MOVE_FROM_TOP, + XML_MOVE_PROTECT, + XML_MOVE_SHORT, + XML_MOVEMENT, + XML_MOVEMENT_CUT_OFF, + XML_MOVER, + XML_MPADDED, + XML_MPHANTOM, + XML_MPRESCRIPTS, + XML_MROOT, + XML_MROW, + XML_MS, + XML_MSPACE, + XML_MSQRT, + XML_MSTYLE, + XML_MSUB, + XML_MSUBSUP, + XML_MSUP, + XML_MTABLE, + XML_MTD, + XML_MTEXT, + XML_MTR, + XML_MULTI_DELETION_SPANNED, + XML_MUNDER, + XML_MUNDEROVER, + XML_NAME, + XML_NAME_AND_EXTENSION, + XML_NAMED_EXPRESSION, + XML_NAMED_EXPRESSIONS, + XML_NAMED_RANGE, + XML_NAVY, + XML_NEQ, + XML_NEW, + XML_NEXT, + XML_NEXT_PAGE, + XML_NEXT_STYLE_NAME, + XML_NO_LIMIT, + XML_NO_WRAP, + XML_NOEMPTY, + XML_NOHREF, + XML_NOMATCH, + XML_NONE, + XML_NOPRTSUBSET, + XML_NORMAL, + XML_NORMALS_DIRECTION, + XML_NORMALS_KIND, + XML_NOT, + XML_NOT_EQUAL_DATE, + XML_NOTE, + XML_NOTES, + XML_NOTIN, + XML_NOTSUBSET, + XML_NULL_DATE, + XML_NULL_YEAR, + XML_NUM_FORMAT, + XML_NUM_LETTER_SYNC, + XML_NUM_PREFIX, + XML_NUM_SUFFIX, + XML_NUMBER, + XML_NUMBER_AND_NAME, + XML_NUMBER_COLUMNS_REPEATED, + XML_NUMBER_COLUMNS_SPANNED, + XML_NUMBER_LINES, + XML_NUMBER_MATRIX_COLUMNS_SPANNED, + XML_NUMBER_MATRIX_ROWS_SPANNED, + XML_NUMBER_POSITION, + XML_NUMBER_ROWS_REPEATED, + XML_NUMBER_ROWS_SPANNED, + XML_NUMBER_STYLE, + XML_NUMBER_WRAPPED_PARAGRAPHS, + XML_NUMBERED_ENTRIES, + XML_OBJECT, + XML_OBJECT_COUNT, + XML_OBJECT_INDEX, + XML_OBJECT_INDEX_ENTRY_TEMPLATE, + XML_OBJECT_INDEX_SOURCE, + XML_OBJECT_NAME, + XML_OBJECT_OLE, + XML_OBJECTS, + XML_ODD_PAGE, + XML_OFFSET, + XML_OLIVE, + XML_ONLOAD, + XML_ONREQUEST, + XML_ON_UPDATE_KEEP_SIZE, + XML_ON_UPDATE_KEEP_STYLES, + XML_ONLINE, + XML_ONLINE_TEXT, + XML_OPAQUE_BACKGROUND, + XML_OPAQUE_FOREGROUND, + XML_OPEN, + XML_OPEN_HORIZONTAL, + XML_OPEN_VERTICAL, + XML_OPERATION, + XML_OPERATOR, + XML_OPTIMAL, + XML_OR, + XML_ORDER, + XML_ORDERED_LIST, + XML_ORGANIZATIONS, + XML_ORIENTATION, + XML_ORIENTATION_LANDSCAPE, + XML_ORIENTATION_PORTRAIT, + XML_ORIGIN, + XML_ORPHANS, + XML_OUTLINE_LEVEL, + XML_OUTLINE_LEVEL_STYLE, + XML_OUTLINE_STYLE, + XML_OUTSET, + XML_OUTSIDE, + XML_OVERLAP, + XML_P, + XML_PACKAGE_NAME, + XML_PADDING, + XML_PADDING_BOTTOM, + XML_PADDING_LEFT, + XML_PADDING_RIGHT, + XML_PADDING_TOP, + XML_PAGE, + XML_PAGE_ADJUST, + XML_PAGE_BREAKS_ON_GROUP_CHANGE, + XML_PAGE_CONTENT, + XML_PAGE_CONTINUATION_STRING, + XML_PAGE_COUNT, + XML_PAGE_END_MARGIN, + XML_PAGE_HEIGHT, + XML_PAGE_MASTER, + XML_PAGE_MASTER_NAME, + XML_PAGE_NUMBER, + XML_PAGE_START_MARGIN, + XML_PAGE_STYLE_NAME, + XML_PAGE_THUMBNAIL, + XML_PAGE_USAGE, + XML_PAGE_VARIABLE_GET, + XML_PAGE_VARIABLE_SET, + XML_PAGE_VIEW_ZOOM_VALUE, + XML_PAGE_WIDTH, + XML_PAGES, + XML_PAPER_TRAY_NUMBER, + XML_PARAGRAPH, + XML_PARAGRAPH_CONTENT, + XML_PARAGRAPH_COUNT, + XML_PARAGRAPH_END_MARGIN, + XML_PARAGRAPH_START_MARGIN, + XML_PARALLEL, + XML_PARAM, + XML_PARENT_STYLE_NAME, + XML_PARSE_SQL_STATEMENT, + XML_PARSED, + XML_PARTIALDIFF, + XML_PASSWORD, + XML_PASSWORT, + XML_PATH, + XML_PATH_ID, + XML_PAUSE, + XML_PENDING, + XML_PERCENTAGE, + XML_PERCENTAGE_STYLE, + XML_PERSPECTIVE, + XML_PHDTHESIS, + XML_PHONG, + XML_PIE_OFFSET, + XML_PLACEHOLDER, + XML_PLACEHOLDER_TYPE, + XML_PLACING, + XML_PLAIN_NUMBER, + XML_PLAIN_NUMBER_AND_NAME, + XML_PLAY_FULL, + XML_PLOT_AREA, + XML_PLUGIN, + XML_PLUS, + XML_POINTS, + XML_POLYGON, + XML_POLYLINE, + XML_POLYNOMIAL, + XML_POOL_ID, + XML_PORTRAIT, + XML_POSITION, + XML_POSITION_BOTTOM, + XML_POSITION_LEFT, + XML_POSITION_RIGHT, + XML_POSITION_TOP, + XML_POSTURE_ITALIC, + XML_POSTURE_NORMAL, + XML_POSTURE_OBLIQUE, + XML_POWER, + XML_PRECISION_AS_SHOWN, + XML_PREFIX, + XML_PRESENTATION, + XML_PRESENTATION_CHART, + XML_PRESENTATION_GRAPHIC, + XML_PRESENTATION_NOTES, + XML_PRESENTATION_OBJECT, + XML_PRESENTATION_ORGCHART, + XML_PRESENTATION_OUTLINE, + XML_PRESENTATION_PAGE, + XML_PRESENTATION_PAGE_LAYOUT, + XML_PRESENTATION_PAGE_LAYOUT_NAME, + XML_PRESENTATION_SUBTITLE, + XML_PRESENTATION_TABLE, + XML_PRESENTATION_TITLE, + XML_PREVIOUS, + XML_PREVIOUS_PAGE, + XML_PRINT, + XML_PRINT_CONTENT, + XML_PRINT_DATE, + XML_PRINT_ORIENTATION, + XML_PRINT_PAGE_ORDER, + XML_PRINT_RANGE, + XML_PRINT_RANGES, + XML_PRINT_TIME, + XML_PRINTABLE, + XML_PRINTED_BY, + XML_PROCEEDINGS, + XML_PRODUCT, + XML_PROJECTION, + XML_PROPERTIES, + XML_PROTECT, + XML_PROTECT_CONTENT, + XML_PROTECT_POSITION, + XML_PROTECT_SIZE, + XML_PROTECTED, + XML_PROTECTION_KEY, + XML_PRSUBSET, + XML_PUBLISHER, + XML_PUNCTUATION_WRAP, + XML_PURPLE, + XML_PYRAMID, + XML_QUARTER, + XML_QUERY_NAME, + XML_QUO_VADIS, + XML_QUOTIENT, + XML_R, + XML_RADAR, + XML_RANDOM, + XML_RANGE_ADDRESS, + XML_RANGE_USABLE_AS, + XML_RECREATE_ON_EDIT, + XML_RECT, + XML_RED, + XML_REF_NAME, + XML_REFERENCE, + XML_REFERENCE_END, + XML_REFERENCE_FORMAT, + XML_REFERENCE_MARK, + XML_REFERENCE_MARK_END, + XML_REFERENCE_MARK_START, + XML_REFERENCE_REF, + XML_REFERENCE_START, + XML_REFERENCE_TYPE, + XML_REFRESH_DELAY, + XML_REGION_CENTER, + XML_REGION_LEFT, + XML_REGION_RIGHT, + XML_REGISTER_TRUE, + XML_REGISTER_TRUTH_REF_STYLE_NAME, + XML_REGRESSION_TYPE, + XML_REJECTED, + XML_REJECTING_CHANGE_ID, + XML_REJECTION, + XML_REL_COLUMN_WIDTH, + XML_REL_HEIGHT, + XML_REL_WIDTH, + XML_RELATIVE, + XML_RELATIVE_TAB_STOP_POSITION, + XML_RELN, + XML_REM, + XML_REMOVE_DEPENDENTS, + XML_REMOVE_PRECEDENTS, + XML_REPEAT, + XML_REPEAT_COLUMN, + XML_REPEAT_ROW, + XML_REPEATED, + XML_REPLACE, + XML_REPORT_TYPE, + XML_RESTART_ON_PAGE, + XML_REVISION, + XML_RIDGE, + XML_RIGHT, + XML_RIGHT_OUTSIDE, + XML_RIGHTARC, + XML_RIGHTCIRCLE, + XML_RING, + XML_ROLE, + XML_ROLL_FROM_BOTTOM, + XML_ROLL_FROM_LEFT, + XML_ROLL_FROM_RIGHT, + XML_ROMAN, + XML_ROOT, + XML_ROTATE, + XML_ROTATION, + XML_ROTATION_ALIGN, + XML_ROTATION_ANGLE, + XML_ROUND, + XML_ROW, + XML_ROW_HEIGHT, + XML_ROW_NUMBER, + XML_ROWS, + XML_RUBY, + XML_RUBY_ALIGN, + XML_RUBY_BASE, + XML_RUBY_POSITION, + XML_RUBY_TEXT, + XML_RUN_THROUGH, + XML_RX, + XML_RY, + XML_S, + XML_SCALE, + XML_SCALE_MIN, + XML_SCALE_TEXT, + XML_SCALE_TO, + XML_SCALE_TO_PAGES, + XML_SCATTER, + XML_SCENARIO, + XML_SCENARIO_RANGES, + XML_SCENE, + XML_SCHOOL, + XML_SCIENTIFIC_NUMBER, + XML_SCORE_SPACES, + XML_SCRIPT, + XML_SCROLL, + XML_SDEV, + XML_SEARCH_CRITERIA_MUST_APPLY_TO_WHOLE_CELL, + XML_SEC, + XML_SECH, + XML_SECOND_DATE_TIME, + XML_SECONDS, + XML_SECTION, + XML_SECTION_DESC, + XML_SECTION_NAME, + XML_SECTION_SOURCE, + XML_SELECT_PAGE, + XML_SELECTOR, + XML_SEMANTICS, + XML_SEMI_AUTOMATIC, + XML_SENDER_CITY, + XML_SENDER_COMPANY, + XML_SENDER_COUNTRY, + XML_SENDER_EMAIL, + XML_SENDER_FAX, + XML_SENDER_FIRSTNAME, + XML_SENDER_INITIALS, + XML_SENDER_LASTNAME, + XML_SENDER_PHONE_PRIVATE, + XML_SENDER_PHONE_WORK, + XML_SENDER_POSITION, + XML_SENDER_POSTAL_CODE, + XML_SENDER_STATE_OR_PROVINCE, + XML_SENDER_STREET, + XML_SENDER_TITLE, + XML_SEP, + XML_SEPARATION_CHARACTER, + XML_SEPARATOR, + XML_SEQUENCE, + XML_SEQUENCE_DECL, + XML_SEQUENCE_DECLS, + XML_SEQUENCE_REF, + XML_SERIES, + XML_SERIES_SOURCE, + XML_SERVER_MAP, + XML_SET, + XML_SETDIFF, + XML_SETTINGS, + XML_SHADE_MODE, + XML_SHADOW, + XML_SHADOW_COLOR, + XML_SHADOW_OFFSET_X, + XML_SHADOW_OFFSET_Y, + XML_SHADOW_SLANT, + XML_SHADOW_TRANSPARENCY, + XML_SHAPE, + XML_SHAPE_ID, + XML_SHAPES, + XML_SHEET_NAME, + XML_SHININESS, + XML_SHORT, + XML_SHOW, + XML_SHOW_ACCEPTED_CHANGES, + XML_SHOW_CHANGES, + XML_SHOW_CHANGES_BY_AUTHOR, + XML_SHOW_CHANGES_BY_AUTHOR_NAME, + XML_SHOW_CHANGES_BY_COMMENT, + XML_SHOW_CHANGES_BY_COMMENT_TEXT, + XML_SHOW_CHANGES_BY_DATETIME, + XML_SHOW_CHANGES_BY_DATETIME_FIRST_DATETIME, + XML_SHOW_CHANGES_BY_DATETIME_MODE, + XML_SHOW_CHANGES_BY_DATETIME_SECOND_DATETIME, + XML_SHOW_CHANGES_BY_RANGES, + XML_SHOW_CHANGES_BY_RANGES_LIST, + XML_SHOW_LOGO, + XML_SHOW_REJECTED_CHANGES, + XML_SHOW_SHAPE, + XML_SHOW_TEXT, + XML_SHOW_UNIT, + XML_SHOWS, + XML_SIDE_BY_SIDE, + XML_SILVER, + XML_SIMPLE, + XML_SIN, + XML_SINCE_DATE_TIME, + XML_SINCE_SAVE, + XML_SINH, + XML_SIZE, + XML_SIZE_PROTECT, + XML_SLANT, + XML_SLANT_X, + XML_SLANT_Y, + XML_SLIDE, + XML_SLOW, + XML_SOLID, + XML_SOLID_TYPE, + XML_SORT, + XML_SORT_ASCENDING, + XML_SORT_BY, + XML_SORT_BY_POSITION, + XML_SORT_GROUPS, + XML_SORT_KEY, + XML_SOUND, + XML_SOURCE_CELL_RANGE, + XML_SOURCE_CELL_RANGE_ADDRESSES, + XML_SOURCE_FIELD_NAME, + XML_SOURCE_NAME, + XML_SOURCE_RANGE_ADDRESS, + XML_SOURCE_SERVICE, + XML_SPACE_BEFORE, + XML_SPAN, + XML_SPECULAR, + XML_SPECULAR_COLOR, + XML_SPEED, + XML_SPHERE, + XML_SPIRAL, + XML_SPIRAL_IN, + XML_SPIRAL_INWARD_LEFT, + XML_SPIRAL_INWARD_RIGHT, + XML_SPIRAL_OUT, + XML_SPIRAL_OUTWARD_LEFT, + XML_SPIRAL_OUTWARD_RIGHT, + XML_SPIRALIN_LEFT, + XML_SPIRALIN_RIGHT, + XML_SPIRALOUT_LEFT, + XML_SPIRALOUT_RIGHT, + XML_SPLINES, + XML_SPLIT, + XML_SPLIT_COLUMN, + XML_SPLIT_POSITION, + XML_SPLIT_ROW, + XML_SPREADSHEET, + XML_SQL_STATEMENT, + XML_STACKED, + XML_STAGGER_EVEN, + XML_STAGGER_ODD, + XML_STANDARD, + XML_STANDARD_DEVIATION, + XML_STARBASIC, + XML_START, + XML_START_ANGLE, + XML_START_COLOR, + XML_START_COLUMN, + XML_START_GLUE_POINT, + XML_START_GUIDE, + XML_START_INTENSITY, + XML_START_LINE_SPACING_HORIZONTAL, + XML_START_LINE_SPACING_VERTICAL, + XML_START_NUMBERING_AT, + XML_START_PAGE, + XML_START_POSITION, + XML_START_ROW, + XML_START_SCALE, + XML_START_SHAPE, + XML_START_TABLE, + XML_START_VALUE, + XML_START_WITH_NAVIGATOR, + XML_STATISTICS, + XML_STATUS, + XML_STAY_ON_TOP, + XML_STDEV, + XML_STDEVP, + XML_STEPS, + XML_STOCK, + XML_STOCK_UPDOWN_BARS, + XML_STOCK_WITH_VOLUME, + XML_STOP, + XML_STRETCH, + XML_STRETCH_FROM_BOTTOM, + XML_STRETCH_FROM_LEFT, + XML_STRETCH_FROM_RIGHT, + XML_STRETCH_FROM_TOP, + XML_STRETCHY, + XML_STRICT, + XML_STRING, + XML_STRING_VALUE, + XML_STRING_VALUE_IF_FALSE, + XML_STRING_VALUE_IF_TRUE, + XML_STRIPES, + XML_STROKE, + XML_STROKE_COLOR, + XML_STROKE_DASH, + XML_STROKE_LINEJOIN, + XML_STROKE_OPACITY, + XML_STROKE_WIDTH, + XML_STRUCTURE_PROTECTED, + XML_STYLE, + XML_STYLE_NAME, + XML_STYLES, + XML_STYLESHEET, + XML_SUB_TABLE, + XML_SUBJECT, + XML_SUBSET, + XML_SUBTITLE, + XML_SUBTOTAL_FIELD, + XML_SUBTOTAL_RULE, + XML_SUBTOTAL_RULES, + XML_SUFFIX, + XML_SUM, + XML_SWISS, + XML_SYMBOL, + XML_SYMBOL_HEIGHT, + XML_SYMBOL_IMAGE_NAME, + XML_SYMBOL_WIDTH, + XML_SYSTEM, + XML_TAB_COLOR, + XML_TAB_STOP, + XML_TAB_STOP_DISTANCE, + XML_TAB_STOPS, + XML_TABLE, + XML_TABLE_BACKGROUND, + XML_TABLE_CELL, + XML_TABLE_CENTERING, + XML_TABLE_COLUMN, + XML_TABLE_COLUMN_GROUP, + XML_TABLE_COLUMNS, + XML_TABLE_COUNT, + XML_TABLE_HEADER, + XML_TABLE_HEADER_COLUMNS, + XML_TABLE_HEADER_ROWS, + XML_TABLE_INDEX, + XML_TABLE_INDEX_ENTRY_TEMPLATE, + XML_TABLE_INDEX_SOURCE, + XML_TABLE_NAME, + XML_TABLE_NUMBER_LIST, + XML_TABLE_OF_CONTENT, + XML_TABLE_OF_CONTENT_ENTRY_TEMPLATE, + XML_TABLE_OF_CONTENT_SOURCE, + XML_TABLE_PAGE, + XML_TABLE_ROW, + XML_TABLE_ROW_GROUP, + XML_TABLE_ROWS, + XML_TABLE_SOURCE, + XML_TABLE_VIEW, + XML_TABLES, + XML_TAN, + XML_TANH, + XML_TARGET_CELL_ADDRESS, + XML_TARGET_FRAME_NAME, + XML_TARGET_RANGE_ADDRESS, + XML_TB_RL, + XML_TEAL, + XML_TECHREPORT, + XML_TEMPLATE, + XML_TEMPLATE_NAME, + XML_TENDSTO, + XML_TEX_FILTER, + XML_TEX_GENERATION_MODE_X, + XML_TEX_GENERATION_MODE_Y, + XML_TEX_KIND, + XML_TEX_MODE, + XML_TEXT, + XML_TEXT_ALIGN, + XML_TEXT_ALIGN_LAST, + XML_TEXT_ALIGN_SOURCE, + XML_TEXT_AUTOSPACE, + XML_TEXT_BACKGROUND_COLOR, + XML_TEXT_BLINKING, + XML_TEXT_BOX, + XML_TEXT_COMBINE, + XML_TEXT_COMBINE_END_CHAR, + XML_TEXT_COMBINE_START_CHAR, + XML_TEXT_CONTENT, + XML_TEXT_CROSSING_OUT, + XML_TEXT_EMPHASIZE, + XML_TEXT_GLOBAL, + XML_TEXT_INDENT, + XML_TEXT_INPUT, + XML_TEXT_OUTLINE, + XML_TEXT_POSITION, + XML_TEXT_ROTATION_ANGLE, + XML_TEXT_ROTATION_SCALE, + XML_TEXT_SCALE, + XML_TEXT_SHADOW, + XML_TEXT_STYLE, + XML_TEXT_TRANSFORM, + XML_TEXT_UNDERLINE, + XML_TEXT_UNDERLINE_COLOR, + XML_TEXTAREA_HORIZONTAL_ALIGN, + XML_TEXTAREA_VERTICAL_ALIGN, + XML_TEXTUAL, + XML_THICK, + XML_THIN, + XML_THREE_DIMENSIONAL, + XML_THUMBNAIL, + XML_TICK_MARKS_MAJOR_INNER, + XML_TICK_MARKS_MAJOR_OUTER, + XML_TICK_MARKS_MINOR_INNER, + XML_TICK_MARKS_MINOR_OUTER, + XML_TILE_REPEAT_OFFSET, + XML_TIME, + XML_TIME_ADJUST, + XML_TIME_STYLE, + XML_TIME_VALUE, + XML_TIMES, + XML_TITLE, + XML_TO_ANOTHER_TABLE, + XML_TO_BOTTOM, + XML_TO_CENTER, + XML_TO_LEFT, + XML_TO_LOWER_LEFT, + XML_TO_LOWER_RIGHT, + XML_TO_RIGHT, + XML_TO_TOP, + XML_TO_UPPER_LEFT, + XML_TO_UPPER_RIGHT, + XML_TOC_MARK, + XML_TOC_MARK_END, + XML_TOC_MARK_START, + XML_TOP, + XML_TOP_LEFT, + XML_TOP_PERCENT, + XML_TOP_RIGHT, + XML_TOP_VALUES, + XML_TOPARC, + XML_TOPCIRCLE, + XML_TRACE_DEPENDENTS, + XML_TRACE_ERRORS, + XML_TRACE_PRECEDENTS, + XML_TRACK_CHANGES, + XML_TRACKED_CHANGES, + XML_TRACKED_CHANGES_VIEW_SETTINGS, + XML_TRANSFORM, + XML_TRANSITION_ON_CLICK, + XML_TRANSPARENCY, + XML_TRANSPARENCY_NAME, + XML_TRANSPARENT, + XML_TRANSPOSE, + XML_TRUE, + XML_TRUNCATE_ON_OVERFLOW, + XML_TTB, + XML_TYPE, + XML_DOT_DASH, + XML_DOT_DOT_DASH, + XML_LONG_DASH, + XML_SINGLE, + XML_SMALL_WAVE, + XML_WAVE, + XML_UNFORMATTED_TEXT, + XML_UNION, + XML_UNIT, + XML_UNORDERED_LIST, + XML_UNPUBLISHED, + XML_UP, + XML_UPLIMIT, + XML_UPRIGHT, + XML_URL, + XML_USE_CAPTION, + XML_USE_CELL_PROTECTION, + XML_USE_CHART_OBJECTS, + XML_USE_CONDITION, + XML_USE_DRAW_OBJECTS, + XML_USE_FLOATING_FRAMES, + XML_USE_GRAPHICS, + XML_USE_IMAGE_OBJECTS, + XML_USE_INDEX_MARKS, + XML_USE_INDEX_SOURCE_STYLES, + XML_USE_KEYS_AS_ENTRIES, + XML_USE_LABEL, + XML_USE_MATH_OBJECTS, + XML_USE_OBJECTS, + XML_USE_OPTIMAL_COLUMN_WIDTH, + XML_USE_OPTIMAL_ROW_HEIGHT, + XML_USE_OTHER_OBJECTS, + XML_USE_SPREADSHEET_OBJECTS, + XML_USE_STYLES, + XML_USE_TABLES, + XML_USE_WINDOW_FONT_COLOR, + XML_USED_HIERARCHY, + XML_USER_DEFINED, + XML_USER_FIELD_DECL, + XML_USER_FIELD_DECLS, + XML_USER_FIELD_GET, + XML_USER_FIELD_INPUT, + XML_USER_INDEX, + XML_USER_INDEX_ENTRY_TEMPLATE, + XML_USER_INDEX_MARK, + XML_USER_INDEX_MARK_END, + XML_USER_INDEX_MARK_START, + XML_USER_INDEX_SOURCE, + XML_USER_TRANSFORMED, + XML_USERNAME, + XML_VALUE, + XML_VALUE_TYPE, + XML_VALUES_CELL_RANGE_ADDRESS, + XML_VAR, + XML_VARIABLE, + XML_VARIABLE_DECL, + XML_VARIABLE_DECLS, + XML_VARIABLE_GET, + XML_VARIABLE_INPUT, + XML_VARIABLE_SET, + XML_VARIANCE, + XML_VARP, + XML_VECTOR, + XML_VERB, + XML_VERSION, + XML_VERSION_ENTRY, + XML_VERSION_LIST, + XML_VERTICAL, + XML_VERTICAL_ALIGN, + XML_VERTICAL_LINES, + XML_VERTICAL_POS, + XML_VERTICAL_REL, + XML_VERTICAL_SEGMENTS, + XML_VERTICAL_SPLIT_MODE, + XML_VERTICAL_SPLIT_POSITION, + XML_VERTICAL_STRIPES, + XML_VIEW, + XML_VIEWBOX, + XML_VIEW_ID, + XML_VIEW_SETTINGS, + XML_VISIBILITY, + XML_VISIBLE, + XML_VISIBLE_AREA, + XML_VISIBLE_AREA_HEIGHT, + XML_VISIBLE_AREA_LEFT, + XML_VISIBLE_AREA_TOP, + XML_VISIBLE_AREA_WIDTH, + XML_VISITED_STYLE_NAME, + XML_VOLATILE, + XML_VOLUME, + XML_VPN, + XML_VRP, + XML_VUP, + XML_WALL, + XML_WARNING, + XML_WATERMARK, + XML_WAVYLINE, + XML_WAVYLINE_FROM_BOTTOM, + XML_WAVYLINE_FROM_LEFT, + XML_WAVYLINE_FROM_RIGHT, + XML_WAVYLINE_FROM_TOP, + XML_WEEK_OF_YEAR, + XML_WEIGHT_BOLD, + XML_WEIGHT_NORMAL, + XML_WHITE, + XML_WHOLE_PAGE, + XML_WIDOWS, + XML_WIDTH, + XML_WORD, + XML_WORD_COUNT, + XML_WRAP, + XML_WRAP_CONTOUR, + XML_WRAP_CONTOUR_MODE, + XML_WRAP_OPTION, + XML_WRITING_MODE, + XML_WWW, + XML_X, + XML_X1, + XML_X2, + XML_X_MAC_ROMAN, + XML_X_SYMBOL, + XML_X_SYSTEM, + XML_XOR, + XML_Y, + XML_Y1, + XML_Y2, + XML_YEAR, + XML_YELLOW, + XML_ZERO_VALUES, + XML_ZINDEX, + XML_ZOOM_TYPE, + XML_ZOOM_VALUE, + + XML_ENABLE, + XML_USE_REGULAR_EXPRESSIONS, + XML_DATA_SOURCE_HAS_LABELS, + XML_LINK_DATA_STYLE_TO_SOURCE, + XML_SORT_ALGORITHM, + XML_STRAIGHT_LINE, + XML_ANGLED_LINE, + XML_ANGLED_CONNECTOR_LINE, + XML_APPLICATION_X_WWW_FORM_URLENCODED, + XML_MULTIPART_FORMDATA, + XML_APPLICATION_TEXT, + XML_GET, + XML_POST, + XML_QUERY, + XML_PARENT, + XML_RECORDS, + XML_PUSH, + XML_SUBMIT, + XML_RESET, + XML_VALUE_LIST, + XML_SQL, + XML_SQL_PASS_THROUGH, + XML_TABLE_FIELDS, + XML_UNCHECKED, + XML_CHECKED, + XML_UNKNOWN, + + XML_ROLL_FROM_TOP, + + XML_BINARY_DATA, + XML_NOTIFY_ON_UPDATE_OF_TABLE, + + XML_0, + XML_PLAY, + XML_HANDOUT_MASTER, + XML_TEXT_STYLE_NAME, + XML_ESCAPE_DIRECTION, + XML_GLUE_POINT, + XML_PRIMARY_X, + XML_SECONDARY_X, + XML_PRIMARY_Y, + XML_SECONDARY_Y, + XML_PRIMARY_Z, + + XML_CAPTION_TYPE, + XML_CAPTION_ANGLE_TYPE, + XML_CAPTION_ANGLE, + XML_CAPTION_GAP, + XML_CAPTION_ESCAPE_DIRECTION, + XML_CAPTION_ESCAPE, + XML_CAPTION_LINE_LENGTH, + XML_CAPTION_FIT_LINE_LENGTH, + XML_FREE, + + XML_TRANSITION_TYPE, + XML_TRANSITION_STYLE, + XML_TRANSITION_SPEED, + XML_DURATION, + XML_BACKGROUND_SIZE, + XML_BACKGROUND_OBJECTS_VISIBLE, + XML_BACKGROUND_VISIBLE, + + XML_MOVE_FROM_UPPERLEFT, + XML_MOVE_FROM_UPPERRIGHT, + XML_MOVE_FROM_LOWERRIGHT, + XML_MOVE_FROM_LOWERLEFT, + XML_UNCOVER_TO_LEFT, + XML_UNCOVER_TO_UPPERLEFT, + XML_UNCOVER_TO_TOP, + XML_UNCOVER_TO_UPPERRIGHT, + XML_UNCOVER_TO_RIGHT, + XML_UNCOVER_TO_LOWERRIGHT, + XML_UNCOVER_TO_BOTTOM, + XML_UNCOVER_TO_LOWERLEFT, + XML_VERTICAL_CHECKERBOARD, + XML_HORIZONTAL_CHECKERBOARD, + XML_NOTIFY_ON_UPDATE_OF_RANGES, + XML_BYTE, + XML_MACRO, + XML_LOCATION, + XML_APPLICATION, + XML_SYMBOL_IMAGE, + XML_TEXT_OVERLAP, + XML_SPLINE_ORDER, + XML_SPLINE_RESOLUTION, + + XML_PAPER_TRAY_NAME, + + XML_COLUMN_MAPPING, + XML_ROW_MAPPING, + + XML_TABLE_FORMULA, + + XML_EMBEDDED_TEXT, + + XML_MERGE_LAST_PARAGRAPH, + + XML_STOCK_LOSS_MARKER, + XML_STOCK_GAIN_MARKER, + XML_STOCK_RANGE_LINE, + + XML_RL_TB, + XML_TB_LR, + XML_LR, + XML_RL, + XML_TB, + + XML_LAYOUT_GRID_COLOR, + XML_LAYOUT_GRID_LINES, + XML_LAYOUT_GRID_BASE_HEIGHT, + XML_LAYOUT_GRID_RUBY_HEIGHT, + XML_LAYOUT_GRID_MODE, + XML_LAYOUT_GRID_RUBY_BELOW, + XML_LAYOUT_GRID_PRINT, + XML_LAYOUT_GRID_DISPLAY, + + //text grid enhancement for better CJK support + XML_DEFAULT_PAGE_LAYOUT, + XML_LAYOUT_GRID_STANDARD_MODE, + XML_LAYOUT_GRID_BASE_WIDTH, + XML_LAYOUT_GRID_SNAP_TO_CHARS, + + XML_SNAP_TO_LAYOUT_GRID, + XML_DONT_BALANCE_TEXT_COLUMNS, + + XML_GLYPH_ORIENTATION_VERTICAL, + + XML_MARKED_INVALID, + + XML_REGRESSION_CURVE, + XML_ERROR_INDICATOR, + + XML_TABLE_TYPE, + + XML_DISPLAY_FACTOR, + + XML_TRANSLITERATION_FORMAT, + XML_TRANSLITERATION_LANGUAGE, + XML_TRANSLITERATION_COUNTRY, + XML_TRANSLITERATION_STYLE, + + XML_KEY1_PHONETIC, + XML_KEY2_PHONETIC, + XML_STRING_VALUE_PHONETIC, + + XML_BACKGROUND_TRANSPARENCY, + XML_BACKGROUND_IMAGE_TRANSPARENCY, + + XML_DYNAMIC_SPACING, + XML_MAIN_ENTRY, + + XML_USE_OUTLINE_LEVEL, + + // #107245# New 3D properties which are possible for lathe and extrude 3d objects + XML_CLOSE_FRONT, + XML_CLOSE_BACK, + + XML_DROPDOWN, + XML_CURRENT_SELECTED, + + XML_JOIN_BORDER, + + XML_DISPLAY_LIST, + XML_NO, + XML_UNSORTED, + XML_SORTED_ASCENDING, + XML_FONT_INDEPENDENT_LINE_SPACING, + + XML_DATABASE, + XML_DATASOURCE, + XML_QUERIES, + XML_REPORTS, + XML_REPORT, + XML_AS_TEMPLATE, + + XML_CONNECTION_RESOURCE, + XML_SUPPRESS_VERSION_COLUMNS, + XML_JAVA_DRIVER_CLASS, + XML_EXTENSION, + XML_IS_FIRST_ROW_HEADER_LINE, + XML_SHOW_DELETED, + XML_IS_TABLE_NAME_LENGTH_LIMITED, + XML_SYSTEM_DRIVER_SETTINGS, + XML_ENABLE_SQL92_CHECK, + XML_APPEND_TABLE_ALIAS_NAME, + XML_PARAMETER_NAME_SUBSTITUTION, + XML_IGNORE_DRIVER_PRIVILEGES, + XML_BOOLEAN_COMPARISON_MODE, + XML_USE_CATALOG, + XML_BASE_DN, + XML_MAX_ROW_COUNT, + XML_LOGIN, + XML_USER_NAME, + XML_IS_PASSWORD_REQUIRED, + XML_LOGIN_TIMEOUT, + XML_DELIMITER, + XML_FIELD, + XML_DECIMAL, + XML_THOUSAND, + XML_TABLE_FILTER, + XML_TABLE_FILTER_PATTERN, + XML_TABLE_TYPE_FILTER, + XML_AUTO_INCREMENT, + XML_ADDITIONAL_COLUMN_STATEMENT, + XML_ROW_RETRIEVING_STATEMENT, + XML_DATA_SOURCE_SETTINGS, + XML_DATA_SOURCE_SETTING, + XML_DATA_SOURCE_SETTING_VALUE, + XML_DATA_SOURCE_SETTING_IS_LIST, + XML_DATA_SOURCE_SETTING_TYPE, + XML_DATA_SOURCE_SETTING_NAME, + XML_COMPONENT, + XML_COMPONENT_COLLECTION, + XML_QUERY_COLLECTION, + XML_UPDATE_TABLE, + XML_FILTER_STATEMENT, + XML_ORDER_STATEMENT, + XML_ESCAPE_PROCESSING, + XML_KEYS, + XML_INDICES, + XML_TYPE_NAME, + XML_PRECISION, + XML_IS_NULLABLE, + XML_IS_AUTOINCREMENT, + XML_DEFAULT_VALUE, + XML_REFERENCED_TABLE_NAME, + XML_UPDATE_RULE, + XML_DELETE_RULE, + XML_KEY_COLUMNS, + XML_KEY_COLUMN, + XML_RELATED_COLUMN_NAME, + XML_CATALOG_NAME, + XML_IS_UNIQUE, + XML_IS_CLUSTERED, + XML_INDEX_COLUMNS, + XML_INDEX_COLUMN, + XML_IS_ASCENDING, + XML_SCHEMA_NAME, + XML_NP_DB, + XML_N_DB, + XML_APPLY_FILTER, + XML_APPLY_ORDER, + XML_AUTOMATIC_PRINT_RANGE, + + XML_SELECTION, + XML_SELECTION_INDEXES, + + XML_SCALE_TO_X, + XML_SCALE_TO_Y, + + XML_KEEP_TOGETHER, + + XML_USE_HEADER_NAME, + XML_USE_FOOTER_NAME, + XML_USE_DATE_TIME_NAME, + XML_DISPLAY_HEADER, + XML_DISPLAY_FOOTER, + XML_DISPLAY_PAGE_NUMBER, + XML_DISPLAY_DATE_TIME, + XML_SOURCE, + XML_CURRENT_DATE, + + XML_HEADER_DECL, + XML_FOOTER_DECL, + XML_DATE_TIME_DECL, + + XML_SELECTED_PAGE, + + // DVO, OD 01.10.2003 #i18732 + XML_FLOW_WITH_TEXT, + + XML_WITH_TAB, // #i21237# + + XML_CUSTOM_SHAPE, + XML_ENGINE, + XML_ENHANCED_GEOMETRY, + XML_TEXT_ROTATE_ANGLE, + XML_MIRROR_VERTICAL, + XML_MIRROR_HORIZONTAL, + XML_EXTRUSION_ALLOWED, + XML_TEXT_PATH_ALLOWED, + XML_CONCENTRIC_GRADIENT_FILL_ALLOWED, + XML_EXTRUSION, + XML_EXTRUSION_BRIGHTNESS, + XML_EXTRUSION_DEPTH, + XML_EXTRUSION_DIFFUSION, + XML_EXTRUSION_NUMBER_OF_LINE_SEGMENTS, + XML_EXTRUSION_LIGHT_FACE, + XML_EXTRUSION_FIRST_LIGHT_HARSH, + XML_EXTRUSION_SECOND_LIGHT_HARSH, + XML_EXTRUSION_FIRST_LIGHT_LEVEL, + XML_EXTRUSION_SECOND_LIGHT_LEVEL, + XML_EXTRUSION_FIRST_LIGHT_DIRECTION, + XML_EXTRUSION_SECOND_LIGHT_DIRECTION, + XML_EXTRUSION_METAL, + XML_EXTRUSION_ROTATION_ANGLE, + XML_EXTRUSION_ROTATION_CENTER, + XML_EXTRUSION_SHININESS, + XML_EXTRUSION_SKEW, + XML_EXTRUSION_SPECULARITY, + XML_EXTRUSION_PROJECTION_MODE, + XML_EXTRUSION_VIEWPOINT, + XML_EXTRUSION_ORIGIN, + XML_EXTRUSION_COLOR, + XML_SECONDARY_FILL_COLOR, + XML_ENHANCED_PATH, + XML_PATH_STRETCHPOINT_X, + XML_PATH_STRETCHPOINT_Y, + XML_TEXT_AREAS, + XML_GLUE_POINTS, + XML_GLUE_POINT_TYPE, + XML_GLUE_POINT_LEAVING_DIRECTIONS, + XML_TEXT_PATH, + XML_TEXT_PATH_MODE, + XML_TEXT_PATH_SCALE, + XML_TEXT_PATH_SAME_LETTER_HEIGHTS, + XML_MODIFIERS, + XML_EQUATION, + XML_XSTRETCH, + XML_YSTRETCH, + XML_HASSTROKE, + XML_HASFILL, + XML_LOGWIDTH, + XML_LOGHEIGHT, + XML_HANDLE, + XML_HANDLE_MIRROR_VERTICAL, + XML_HANDLE_MIRROR_HORIZONTAL, + XML_HANDLE_SWITCHED, + XML_HANDLE_POSITION, + XML_HANDLE_RANGE_X_MINIMUM, + XML_HANDLE_RANGE_X_MAXIMUM, + XML_HANDLE_RANGE_Y_MINIMUM, + XML_HANDLE_RANGE_Y_MAXIMUM, + XML_HANDLE_POLAR, + XML_HANDLE_RADIUS_RANGE_MINIMUM, + XML_HANDLE_RADIUS_RANGE_MAXIMUM, + XML_RECTANGLE, + XML_ROUNDRECTANGLE, + XML_OVAL, + XML_CLOUD, + XML_BOUNDINGCUBE, + XML_WIREFRAME, + XML_SEGMENTS, + XML_WORD_WRAP, + + XML_COLLAPSING, + XML_SEPARATING, + XML_BORDER_MODEL, + + XML_DATA_PILOT_FIELD_REFERENCE, + XML_MEMBER_DIFFERENCE, + XML_MEMBER_PERCENTAGE, + XML_MEMBER_PERCENTAGE_DIFFERENCE, + XML_RUNNING_TOTAL, + XML_ROW_PERCENTAGE, + XML_COLUMN_PERCENTAGE, + XML_TOTAL_PERCENTAGE, + XML_FIELD_NAME, + XML_MEMBER_TYPE, + XML_NAMED, + XML_MEMBER_NAME, + XML_DISPLAY_MEMBER_MODE, + XML_MEMBER_COUNT, + XML_DATA_FIELD, + XML_DATA_PILOT_DISPLAY_INFO, + XML_SORT_MODE, + XML_DATA_PILOT_SORT_INFO, + XML_ADD_EMPTY_LINES, + XML_TABULAR_LAYOUT, + XML_OUTLINE_SUBTOTALS_TOP, + XML_OUTLINE_SUBTOTALS_BOTTOM, + XML_LAYOUT_MODE, + XML_DATA_PILOT_LAYOUT_INFO, + + XML_SYMBOL_COLOR, + + XML_3D, + XML_IMAGE_POSITION, + XML_IMAGE_ALIGN, + + XML_DIAGONAL_BL_TR, + XML_DIAGONAL_BL_TR_WIDTH, + XML_DIAGONAL_TL_BR, + XML_DIAGONAL_TL_BR_WIDTH, + XML_REPEAT_CONTENT, + XML_SHRINK_TO_FIT, + + // OD 2004-05-05 #i28701# + XML_WRAP_INFLUENCE_ON_POSITION, + // --> OD 2004-10-18 #i35017# - tokens have been renamed and + // <XML_ITERATIVE> has been added + XML_ONCE_SUCCESSIVE, + XML_ONCE_CONCURRENT, + // <-- + + // Names for OOo format only + XML_N_OFFICE_OOO, + XML_N_META_OOO, + XML_N_STYLE_OOO, + XML_N_NUMBER_OOO, + XML_N_TEXT_OOO, + XML_N_TABLE_OOO, + XML_N_DRAW_OOO, + XML_N_DR3D_OOO, + XML_N_PRESENTATION_OOO, + XML_N_CHART_OOO, + XML_N_CONFIG_OOO, + XML_N_FORM_OOO, + XML_N_SCRIPT_OOO, + + XML_GLOBAL, + XML_NOTE_CLASS, + XML_NOTE_CITATION, + XML_NOTE_BODY, + XML_NOTES_CONFIGURATION, + XML_NOTE_REF, + XML_IS_SUB_TABLE, + XML_PAGE_LAYOUT, + XML_PAGE_LAYOUT_NAME, + XML_GRAPHIC_PROPERTIES, + XML_DRAWING_PAGE_PROPERTIES, + XML_PAGE_LAYOUT_PROPERTIES, + XML_HEADER_FOOTER_PROPERTIES, + XML_TEXT_PROPERTIES, + XML_PARAGRAPH_PROPERTIES, + XML_RUBY_PROPERTIES, + XML_SECTION_PROPERTIES, + XML_TABLE_PROPERTIES, + XML_TABLE_COLUMN_PROPERTIES, + XML_TABLE_ROW_PROPERTIES, + XML_TABLE_CELL_PROPERTIES, + XML_LIST_LEVEL_PROPERTIES, + XML_CHART_PROPERTIES, + XML_DRAWING_PAGE, + XML_GRAPHICS, + XML_TAB, + XML_TEXT_UNDERLINE_MODE, + XML_TEXT_LINE_THROUGH_MODE, + XML_CONTINUOUS, + XML_SKIP_WHITE_SPACE, + XML_SCRIPTS, + XML_FONT_FACE_DECLS, + XML_FONT_FACE, + XML_FONT_ADORNMENTS, + XML_INCH, + XML_SPACE_AFTER, + XML_START_INDENT, + XML_END_INDENT, + + // chart Oasis format additions + XML_INTERVAL_MINOR_DIVISOR, + XML_DATE_STRING, + + XML_TEXT_UNDERLINE_STYLE, + XML_TEXT_UNDERLINE_TYPE, + XML_TEXT_UNDERLINE_WIDTH, + + XML_TEXT_OVERLINE_TYPE, + XML_TEXT_OVERLINE_STYLE, + XML_TEXT_OVERLINE_WIDTH, + XML_TEXT_OVERLINE_COLOR, + XML_TEXT_OVERLINE_MODE, + + XML_TEXT_LINE_THROUGH_STYLE, + XML_TEXT_LINE_THROUGH_TYPE, + XML_TEXT_LINE_THROUGH_WIDTH, + XML_TEXT_LINE_THROUGH_TEXT, + + XML_LEADER_STYLE, + XML_LEADER_TEXT, + + XML_BOLD_DOTTED, + XML_BOLD_DASH, + XML_BOLD_LONG_DASH, + XML_BOLD_DOT_DASH, + XML_BOLD_DOT_DOT_DASH, + XML_BOLD_WAVE, + XML_DOUBLE_WAVE, + XML_DOUBLE_LINE, + XML_THICK_LINE, + XML_SINGLE_LINE, + XML_SLASH, + XML_TEXT_LINE_THROUGH_COLOR, + XML_TEXT_LINE_THROUGH_TEXT_STYLE, + XML_LEADER_COLOR, + XML_LEADER_TYPE, + XML_LEADER_WIDTH, + XML_LEADER_TEXT_STYLE, + + XML_OPACITY, + XML_OPACITY_NAME, + XML_SHADOW_OPACITY, + XML_ALWAYS, + XML_COUNT_IN_TEXT_BOXES, + + XML_NP_OOO, + XML_N_OOO, + XML_NP_OOOW, + XML_N_OOOW, + XML_NP_OOOC, + XML_N_OOOC, + XML_NP_DOM, + XML_N_DOM, + + XML_EVENT_LISTENERS, + XML_EVENT_LISTENER, + + XML_FORM, + XML_VOID, + XML_PROPERTY, + XML_PROPERTY_NAME, + XML_LIST_PROPERTY, + XML_LIST_VALUE, + XML_COLUMN_STYLE_NAME, + + XML_TEXTAREA, + XML_FIXED_TEXT, + XML_FILE, + XML_FORMATTED_TEXT, + XML_BUTTON, + XML_CHECKBOX, + XML_RADIO, + XML_LISTBOX, + XML_COMBOBOX, + XML_IMAGE_FRAME, + XML_VALUE_RANGE, + XML_GENERIC_CONTROL, + XML_SERVICE_NAME, + XML_PROPERTY_TYPE, + XML_INTEGER, + XML_PROPERTY_IS_VOID, + XML_PROPERTY_IS_LIST, + XML_PROPERTY_VALUE, + XML_MIMETYPE, + XML_DATABASE_ROW_SELECT, + XML_CONTROL_IMPLEMENTATION, + XML_INTERPOLATION, + XML_CUBIC_SPLINE, + XML_B_SPLINE, + XML_N_DB_OASIS, + + XML_SHOW_FILTER_BUTTON, + XML_DRILL_DOWN_ON_DOUBLE_CLICK, + XML_HEADER_GRID_LAYOUT, + XML_GROUPED_BY, + XML_DAYS, + XML_MONTHS, + XML_QUARTERS, + XML_YEARS, + XML_DATE_START, + XML_DATE_END, + XML_STEP, + XML_IS_GROUP_FIELD, + XML_DATA_PILOT_GROUPS, + XML_DATA_PILOT_GROUP, + + XML_JAPANESE_CANDLE_STICK, + XML_NAMED_SYMBOL, + XML_DIAMOND, + XML_ARROW_DOWN, + XML_ARROW_UP, + XML_ARROW_RIGHT, + XML_ARROW_LEFT, + XML_BOW_TIE, + XML_HOURGLASS, + XML_SYMBOL_NAME, + XML_SYMBOL_TYPE, + XML_IMAGE_OPACITY, // #i25616# + + XML_DEFAULT_OUTLINE_LEVEL, + XML_SHOW_DETAILS, + XML_SHOW_EMPTY, + XML_ITERATIVE, + XML_uX, + XML_NP_DLG, + XML_N_DLG, + XML_SCRIPT_DATA, + XML_LIBRARIES, + XML_SOURCE_CODE, + XML_READONLY, + + XML_Z, + XML_DIMENSION, + XML_VALIDATION_NAME, + + XML_SCREEN, + XML_PRINTER, + + // XForms tokens + // already defined: XML_ACTION, XML_VERSION, XML_ENCODING, + // XML_REPLACE, XML_SEPARATOR, XML_TYPE, XML_ID + XML_MODEL, + XML_SCHEMA, + XML_BIND, + XML_INSTANCE, + XML_SUBMISSION, + XML_REF, + XML_SRC, + XML_METHOD, + XML_NODESET, + XML_INDENT, + XML_OMIT_XML_DECLARATION, + XML_STANDALONE, + XML_CDATA_SECTION_ELEMENTS, + XML_REQUIRED, + XML_RELEVANT, + XML_CALCULATE, + XML_CONSTRAINT, + XML_MAXOCCURS, // maxOccurs + XML_MINOCCURS, // minOccurs + XML_P3PTYPE, + XML_MEDIATYPE, + XML_INCLUDENAMESPACEPREFIXES, + + // XForms/XSD Schema; these tokens use innerWordCapitalization + // (already defined: XML_SCHEMA, XML_LENGTH, XML_ID) + XML_BASE, + XML_TARGETNAMESPACE, // targetNamespace + XML_SIMPLETYPE, // simpleType + XML_RESTRICTION, + XML_MAXLENGTH, // maxLength + XML_MINLENGTH, // minLength + XML_MININCLUSIVE, // minInclusive + XML_MINEXCLUSIVE, // minExclusive + XML_MAXINCLUSIVE, // maxInclusive + XML_MAXEXCLUSIVE, // maxExclusive + XML_PATTERN, + XML_ENUMERATION, + XML_WHITESPACE, // whiteSpace + XML_TOTALDIGITS, // totalDigits + XML_FRACTIONDIGITS, // fractionDigits + XML_PRESERVE, + XML_ANYURI, // anyURI + XML_DATETIME_XSD, // dateTime + XML_MAIN_ETRY, // #i28755# + + // SMIL + XML_REMOVE, + XML_HOLD, + XML_TRANSITION, + XML_INHERIT, + XML_FILLDEFAULT, + XML_RESTART, + XML_RESTARTDEFAULT, + XML_WHENNOTACTIVE, + XML_NEVER, + XML_ACCELERATE, + XML_DECELERATE, + XML_AUTOREVERSE, + XML_INDEFINITE, + XML_REPEATCOUNT, + XML_REPEATDUR, + XML_ENDSYNC, + XML_FIRST, + XML_LAST, + XML_MEDIA, + XML_DUR, + XML_BEGIN, + XML_WHOLE, + XML_FROM, + XML_TO, + XML_BY, + XML_VALUES, + XML_KEYTIMES, + XML_KEYSPLINES, + XML_CALCMODE, + XML_DISCRETE, + XML_PACED, + XML_SPLINE, + XML_ACCUMULATE, + XML_ADDITIVE, + XML_MULTIPLY, + XML_ANIMATE, + XML_ANIMATEMOTION, + XML_ANIMATETRANSFORM, + XML_ANIMATECOLOR, + XML_TRANSITIONFILTER, + XML_ATTRIBUTENAME, + + XML_NP_SMIL, + XML_N_SMIL, + + XML_NP_ANIMATION, + XML_N_ANIMATION, + + XML_PAR, + XML_SEQ, + + XML_TRANSLATE, + XML_SKEWX, + XML_SKEWY, + + XML_AUDIO, + + XML_COLOR_INTERPOLATION, + XML_COLOR_INTERPOLATION_DIRECTION, + XML_HSL, + XML_RGB, + + XML_BARWIPE, + XML_BOXWIPE, + XML_FOURBOXWIPE, + XML_BARNDOORWIPE, + XML_DIAGONALWIPE, + XML_BOWTIEWIPE, + XML_MISCDIAGONALWIPE, + XML_VEEWIPE, + XML_BARNVEEWIPE, + XML_ZIGZAGWIPE, + XML_BARNZIGZAGWIPE, + XML_IRISWIPE, + XML_TRIANGLEWIPE, + XML_ARROWHEADWIPE, + XML_PENTAGONWIPE, + XML_HEXAGONWIPE, + XML_ELLIPSEWIPE, + XML_EYEWIPE, + XML_ROUNDRECTWIPE, + XML_STARWIPE, + XML_MISCSHAPEWIPE, + XML_CLOCKWIPE, + XML_PINWHEELWIPE, + XML_SINGLESWEEPWIPE, + XML_FANWIPE, + XML_DOUBLEFANWIPE, + XML_DOUBLESWEEPWIPE, + XML_SALOONDOORWIPE, + XML_WINDSHIELDWIPE, + XML_SNAKEWIPE, + XML_SPIRALWIPE, + XML_PARALLELSNAKESWIPE, + XML_BOXSNAKESWIPE, + XML_WATERFALLWIPE, + XML_PUSHWIPE, + XML_SLIDEWIPE, + XML_BLINDSWIPE, + XML_RANDOMBARWIPE, + XML_CHECKERBOARDWIPE, + XML_ZOOM, + + XML_LEFTTORIGHT, + XML_TOPTOBOTTOM, + XML_TOPLEFT, + XML_TOPRIGHT, + XML_BOTTOMRIGHT, + XML_BOTTOMLEFT, + XML_TOPCENTER, + XML_RIGHTCENTER, + XML_BOTTOMCENTER, + XML_LEFTCENTER, + XML_CORNERSIN, + XML_CORNERSOUT, + XML_DIAGONALBOTTOMLEFT, + XML_DIAGONALTOPLEFT, + XML_DOUBLEBARNDOOR, + XML_DOUBLEDIAMOND, + XML_FOURPOINT, + XML_FIVEPOINT, + XML_SIXPOINT, + XML_HEART, + XML_KEYHOLE, + XML_CLOCKWISETWELVE, + XML_CLOCKWISETHREE, + XML_CLOCKWISESIX, + XML_CLOCKWISENINE, + XML_TWOBLADEVERTICAL, + XML_TWOBLADEHORIZONTAL, + XML_FOURBLADE, + XML_CLOCKWISETOP, + XML_CLOCKWISERIGHT, + XML_CLOCKWISEBOTTOM, + XML_CLOCKWISELEFT, + XML_CLOCKWISETOPLEFT, + XML_COUNTERCLOCKWISEBOTTOMLEFT, + XML_CLOCKWISEBOTTOMRIGHT, + XML_COUNTERCLOCKWISETOPRIGHT, + XML_CENTERTOP, + XML_CENTERRIGHT, + XML_FANOUTVERTICAL, + XML_FANOUTHORIZONTAL, + XML_FANINVERTICAL, + XML_FANINHORIZONTAL, + XML_PARALLELVERTICAL, + XML_PARALLELDIAGONAL, + XML_OPPOSITEVERTICAL, + XML_OPPOSITEHORIZONTAL, + XML_PARALLELDIAGONALTOPLEFT, + XML_PARALLELDIAGONALBOTTOMLEFT, + XML_TOPLEFTHORIZONTAL, + XML_TOPLEFTDIAGONAL, + XML_TOPLEFTVERTICAL, + XML_TOPRIGHTDIAGONAL, + XML_BOTTOMRIGHTDIAGONAL, + XML_BOTTOMLEFTDIAGONAL, + XML_TOPLEFTCLOCKWISE, + XML_TOPRIGHTCLOCKWISE, + XML_BOTTOMRIGHTCLOCKWISE, + XML_BOTTOMLEFTCLOCKWISE, + XML_TOPLEFTCOUNTERCLOCKWISE, + XML_TOPRIGHTCOUNTERCLOCKWISE, + XML_BOTTOMRIGHTCOUNTERCLOCKWISE, + XML_BOTTOMLEFTCOUNTERCLOCKWISE, + XML_VERTICALTOPSAME, + XML_VERTICALBOTTOMSAME, + XML_VERTICALTOPLEFTOPPOSITE, + XML_VERTICALBOTTOMLEFTOPPOSITE, + XML_HORIZONTALLEFTSAME, + XML_HORIZONTALRIGHTSAME, + XML_HORIZONTALTOPLEFTOPPOSITE, + XML_HORIZONTALTOPRIGHTOPPOSITE, + XML_DIAGONALBOTTOMLEFTOPPOSITE, + XML_DIAGONALTOPLEFTOPPOSITE, + XML_TWOBOXTOP, + XML_TWOBOXBOTTOM, + XML_TWOBOXLEFT, + XML_TWOBOXRIGHT, + XML_FOURBOXVERTICAL, + XML_FOURBOXHORIZONTAL, + XML_VERTICALLEFT, + XML_VERTICALRIGHT, + XML_HORIZONTALLEFT, + XML_HORIZONTALRIGHT, + XML_FROMLEFT, + XML_FROMTOP, + XML_FROMRIGHT, + XML_FROMBOTTOM, + XML_CROSSFADE, + XML_FADETOCOLOR, + XML_FADEFROMCOLOR, + XML_FADEOVERCOLOR, + XML_THREEBLADE, + XML_EIGHTBLADE, + XML_ONEBLADE, + XML_ACROSS, + XML_COMBHORIZONTAL, + XML_COMBVERTICAL, + XML_ROTATEIN, + XML_ROTATEOUT, + XML_FROMTOPLEFT, + XML_FROMTOPRIGHT, + XML_FROMBOTTOMLEFT, + XML_FROMBOTTOMRIGHT, + + XML_SUBTYPE, + XML_OUT, + + XML_FORWARD, + XML_REVERSE, + + XML_FADECOLOR, + + XML_ONBEGIN, + XML_ONEND, + XML_CLICK, + XML_DOUBLECLICK, + XML_MOUSEOVER, + XML_MOUSEOUT, + + XML_NODE_TYPE, + XML_PRESET_ID, + XML_PRESET_SUB_TYPE, + XML_PRESET_CLASS, + XML_CUSTOM, + XML_ENTRANCE, + XML_EXIT, + XML_EMPHASIS, + XML_MOTION_PATH, + XML_OLE_ACTION, + XML_MEDIA_CALL, + XML_ON_CLICK, + XML_WITH_PREVIOUS, + XML_AFTER_PREVIOUS, + XML_MAIN_SEQUENCE, + XML_TIMING_ROOT, + XML_INTERACTIVE_SEQUENCE, + + XML_SUB_ITEM, + XML_ITERATE_TYPE, + XML_ITERATE_INTERVAL, + XML_ITERATE, + XML_BY_PARAGRAPH, + XML_BY_WORD, + XML_BY_LETTER, + + XML_AFTER_EFFECT, + XML_MASTER, + + XML_GROUP_ID, + XML_TARGETELEMENT, + XML_TOGGLE_PAUSE, + XML_MASTER_ELEMENT, + XML_STOP_AUDIO, + + XML_AUDIO_LEVEL, + + XML_URN_OASIS_NAMES_TC, + XML_OPENDOCUMENT, + XML_1_0, + + XML_IS_LIST_HEADER, + XML_N_SVG_COMPAT, + XML_N_FO_COMPAT, + XML_N_SMIL_COMPAT, + XML_N_SMIL_OLD, + XML_XFORMS_SUBMISSION, + XML_XFORMS_LIST_SOURCE, + + XML_URI_W3_PREFIX, + XML_URI_XFORMS_SUFFIX, + + // --> OD 2005-05-12 #i49139# + // XML_HORIZONTAL_ON_LEFT_PAGES and XML_HORIZONTAL_ON_RIGHT_PAGES + // are replaced by XML_HORIZONTAL_ON_EVEN and XML_HORIZONTAL_ON_ODD. + XML_HORIZONTAL_ON_EVEN, + // --> OJ 2005-09-01 + XML_N_RPT_OASIS, + XML_N_RPT, + XML_GROUP, + XML_GROUPS , + XML_REPORT_HEADER, + XML_PAGE_HEADER , + XML_DETAIL , + XML_PAGE_FOOTER , + XML_REPORT_FOOTER, + XML_START_NEW_COLUMN , + XML_RESET_PAGE_NUMBER , + XML_PRINT_HEADER_ON_EACH_PAGE , + XML_GROUP_EXPRESSION , + XML_GROUP_HEADER , + XML_GROUP_FOOTER , + XML_HEADER_ON_NEW_PAGE, + XML_FOOTER_ON_NEW_PAGE, + XML_PAGE_PRINT_OPTION, + XML_PRE_EVALUATED, + XML_COMMAND_TYPE, + XML_MASTER_FIELDS, + XML_DETAIL_FIELDS, + XML_CONDITIONAL_PRINT_EXPRESSION, + XML_REPORT_COMPONENT, + XML_PRINT_REPEATED_VALUES, + XML_REPEAT_SECTION, + XML_FORCE_NEW_COLUMN, + XML_GROUP_ON, + XML_FORCE_NEW_PAGE, + XML_GROUP_INTERVAL, + XML_PRINT_ONLY_WHEN_GROUP_CHANGE, + XML_REPORT_ELEMENT, + XML_LIST_SOURCE, + XML_LIST_SOURCE_TYPE, + XML_IMAGE_DATA, + XML_SELECTED, + XML_CURRENT_STATE, + XML_IS_TRISTATE, + XML_ALL_PAGES, + XML_NOT_WITH_REPORT_HEADER, + XML_NOT_WITH_REPORT_FOOTER, + XML_NOT_WITH_REPORT_HEADER_NOR_FOOTER, + XML_BEFORE_SECTION, + XML_AFTER_SECTION, + XML_BEFORE_AFTER_SECTION, + XML_PREFIX_CHARACTERS, + XML_QUARTAL, + XML_WEEK, + XML_WHOLE_GROUP, + XML_WITH_FIRST_DETAIL, + XML_TOP_DOWN, + XML_BOTTOM_UP, + XML_HOUR, + XML_MINUTE, + XML_NP_RPT, + XML_FORMAT_CONDITION, + XML_EXPRESSION1, + XML_EXPRESSION2, + XML_EQUAL, + XML_NOT_EQUAL, + XML_LESS, + XML_GREATER, + XML_LESS_EQUAL, + XML_GREATER_EQUAL, + XML_BETWEEN, + XML_NOT_BETWEEN, + XML_TABLE_TEMPLATE, + XML_FIRST_ROW, + XML_LAST_ROW, + XML_FIRST_COLUMN, + XML_LAST_COLUMN, + XML_EVEN_ROWS, + XML_ODD_ROWS, + XML_EVEN_COLUMNS, + XML_ODD_COLUMNS, + // <-- + XML_HORIZONTAL_ON_ODD, + // <-- + // --> OD 2005-10-10 #i45874# + XML_RESTART_NUMBERING, + // <-- + // --> FLR #i52127# + XML_NUMBERED_PARAGRAPH, + // <-- + XML_MASTER_DETAIL_FIELDS, + XML_MASTER_DETAIL_FIELD, + XML_SUB_DOCUMENT, + XML_FIXED_CONTENT, + XML_INITIAL_FORMULA, + XML_DEEP_TRAVERSING, + XML_PRESERVE_IRI, + XML_SORT_BY_X_VALUES, + XML_PAGE_CONTINUATION, + XML_RIGHT_ANGLED_AXES, + XML_SOFT_PAGE_BREAK, + XML_USE_SOFT_PAGE_BREAKS, + XML_PERCENTAGE_DATA_STYLE_NAME, + XML_VALUE_AND_PERCENTAGE, + XML_GROUP_BARS_PER_AXIS, + XML_INCLUDE_HIDDEN_CELLS, + XML_AUTOMATIC_POSITION, + XML_AUTOMATIC_SIZE, + XML_REVERSE_DIRECTION, + XML_LABEL_SEPARATOR, + XML_LABEL_POSITION, + XML_AVOID_OVERLAP, + XML_NEAR_ORIGIN, + XML_DEPENDENCY, + XML_NAV_ORDER, + + XML_USE_FIRST_ROW_STYLES, + XML_USE_LAST_ROW_STYLES, + XML_USE_FIRST_COLUMN_STYLES, + XML_USE_LAST_COLUMN_STYLES, + XML_USE_BANDING_ROWS_STYLES, + XML_USE_BANDING_COLUMNS_STYLES, + + XML_AUTOMATIC_CONTENT, + XML_DISPLAY_R_SQUARE, + XML_DISPLAY_EQUATION, + // db odf 12 + XML_TABLE_REPRESENTATIONS, + XML_TABLE_REPRESENTATION, + XML_SCHEMA_DEFINITION, + XML_CONNECTION_DATA, + XML_DATABASE_DESCRIPTION, + XML_COMPOUND_DATABASE, + XML_FILE_BASED_DATABASE, + XML_SERVER_DATABASE, + XML_MEDIA_TYPE, + XML_HOSTNAME, + XML_PORT, + XML_LOCAL_SOCKET, + XML_USE_SYSTEM_USER, + XML_DRIVER_SETTINGS, + XML_JAVA_CLASSPATH, + XML_CHARACTER_SET, + XML_APPLICATION_CONNECTION_SETTINGS, + XML_TABLE_INCLUDE_FILTER, + XML_DEFAULT_ROW_STYLE_NAME, + XML_ANGLE_OFFSET, + // --> OD 2007-09-14 #i81002# + XML_NUMBER_NO_SUPERIOR, + XML_NUMBER_ALL_SUPERIOR, + // <-- + // --> OD 2008-01-15 #newlistlevelattrs# + XML_LIST_LEVEL_POSITION_AND_SPACE_MODE, + XML_LABEL_WIDTH_AND_POSITION, + XML_LABEL_ALIGNMENT, + XML_LIST_LEVEL_LABEL_ALIGNMENT, + XML_LABEL_FOLLOWED_BY, + XML_LISTTAB, + XML_SPACE, + XML_NOTHING, + XML_LIST_TAB_STOP_POSITION, + // <-- + XML_STANDARD_ERROR, + XML_CELL_RANGE, + XML_ERROR_LOWER_RANGE, + XML_ERROR_UPPER_RANGE, + + // --> OD 2008-04-22 #refactorlists# + XML_CONTINUE_LIST, + XML_STYLE_OVERRIDE, + // <-- + + // fs: #i90243# + XML_XFORM_MODEL_SETTINGS, + + // ODF 1.2 metadata + XML_META_FIELD, + XML_ABOUT, + XML_DATATYPE, + XML_TRANSFORMATION, + + // ODF 1.2 numbered-paragraph + XML_LIST_ID, + + XML_TREAT_EMPTY_CELLS, + XML_LEAVE_GAP, + XML_USE_ZERO, + XML_IGNORE, + + // enhanced fields + XML_FIELDMARK, + XML_FIELDMARK_START, + XML_FIELDMARK_END, + XML_N_FIELD, + XML_NP_FIELD, + + XML_IMAGE_SCALE, + XML_ISOTROPIC, + XML_ANISOTROPIC, + + XML_AXIS_POSITION, + XML_AXIS_LABEL_POSITION, + XML_NEAR_AXIS, + XML_NEAR_AXIS_OTHER_SIDE, + XML_OUTSIDE_START, + XML_OUTSIDE_END, + XML_TICK_MARK_POSITION, + XML_AT_LABELS, + XML_AT_AXIS, + XML_AT_LABELS_AND_AXIS, + XML_FILLED_RADAR, + XML_SURFACE, + + // MathML only + XML_MATHVARIANT, + XML_MATHSIZE, + XML_MATHWEIGHT, + XML_MATHCOLOR, + + XML_CONTAINS, + XML_DOES_NOT_CONTAIN, + XML_BEGINS_WITH, + XML_DOES_NOT_BEGIN_WITH, + XML_ENDS_WITH, + XML_DOES_NOT_END_WITH, + + //chart + XML_NP_CHART_EXT, + XML_N_CHART_EXT, + XML_COORDINATE_REGION, + + XML_DIAGONAL_BL_TR_WIDTHS, + XML_DIAGONAL_TL_BR_WIDTHS, + + XML_TOKEN_END + }; + + + /// return the OUString representation for eToken + XMLOFF_DLLPUBLIC const ::rtl::OUString& GetXMLToken( + enum XMLTokenEnum eToken ); + + /// compare eToken to the string + XMLOFF_DLLPUBLIC sal_Bool IsXMLToken( + const ::rtl::OUString& rString, + enum XMLTokenEnum eToken ); + + // gives all allocated memory for OUString* back + XMLOFF_DLLPUBLIC void ResetTokens(); + + XMLOFF_DLLPUBLIC void IncRescheduleCount(); + + XMLOFF_DLLPUBLIC void DecRescheduleCount(); + + +} } + +#endif diff --git a/xmloff/inc/xmloff/xmltypes.hxx b/xmloff/inc/xmloff/xmltypes.hxx new file mode 100644 index 000000000000..5fce50158089 --- /dev/null +++ b/xmloff/inc/xmloff/xmltypes.hxx @@ -0,0 +1,286 @@ +/************************************************************************* + * + * 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_XMLTYPES_HXX +#define _XMLOFF_XMLTYPES_HXX + +/////////////////////////////////////////////////////////////////////////////// +// Flags to specify how to im/export the property +// +// OLD: +// 8421.8421.8421.8421.8421.8421.8421.8421 +// n n m mmmd m baaa tttt.tttt.tttt +// spsp eep paef e ppp tttt.tttt.tttt +// iiee iei ieie i ppp tttt.tttt.tttt +// NOW: +// n n mm mmdm pp ppba aatt.tttt.tttt +// spsp eepp aefe p pptt.tttt.tttt +// iiee ieii eiei p pptt.tttt.tttt + +#define MID_FLAG_MASK 0x00003fff + +// Import only: the xml attribute's value is evaluated by a call to +// handleSpecialItem instead of calling the property handler's importXML method +#define MID_FLAG_SPECIAL_ITEM_IMPORT 0x80000000 + +// Export only: the property's value is exported by a call to handleSpecialItem +// instead of calling the property handler's exportXML method +#define MID_FLAG_SPECIAL_ITEM_EXPORT 0x20000000 +#define MID_FLAG_SPECIAL_ITEM 0xa0000000 // both import and export + +// the map entry denotes the name of an element item +#define MID_FLAG_ELEMENT_ITEM_IMPORT 0x08000000 +#define MID_FLAG_ELEMENT_ITEM_EXPORT 0x04000000 +#define MID_FLAG_ELEMENT_ITEM 0x0c000000 // both import and export + +// the attribute is ignored (not yet implemented) +#define MID_FLAG_NO_PROPERTY_IMPORT 0x40000000 + +// the property is ignored +#define MID_FLAG_NO_PROPERTY_EXPORT 0x10000000 +#define MID_FLAG_NO_PROPERTY 0x50000000 // both import and export + +// Import only: there are more entries for the same xml attribute existing +#define MID_FLAG_MULTI_PROPERTY 0x02000000 // + +// Import only: If a property with the same name has been set already, supply +// the current value to the importXML call. +#define MID_FLAG_MERGE_PROPERTY 0x01000000 + +// Export only: If an xml attribute with the same name has been exported +// already, supply its value to teh exportXML call and delete the existing +// atribute afterwards. +#define MID_FLAG_MERGE_ATTRIBUTE 0x00800000 + +// Import and Export: The property in question must exist. No call to +// hasPropertyByName is required. +#define MID_FLAG_MUST_EXIST 0x00400000 + +// Export only: When exporting defaults, export this property even if it is +// not set +#define MID_FLAG_DEFAULT_ITEM_EXPORT 0x00200000 + +// Import only: In general, properties may not throw exception, but +// this one may. If it throws an IllegalArgumentException, it will be +// silently ignored. This should be used for properties whose values +// cannot be checked. (E.g., the printer paper tray: The tray names +// are different for all printers, and we don't know ahead whether a +// printer supports the trays in the current document.) +#define MID_FLAG_PROPERTY_MAY_EXCEPT 0x00100000 + +#define XML_TYPE_PROP_SHIFT 14 +#define XML_TYPE_PROP_MASK (0xf << XML_TYPE_PROP_SHIFT) + +#define XML_TYPE_PROP_START (0x1 << XML_TYPE_PROP_SHIFT) +#define XML_TYPE_PROP_GRAPHIC (0x1 << XML_TYPE_PROP_SHIFT) +#define XML_TYPE_PROP_DRAWING_PAGE (0x2 << XML_TYPE_PROP_SHIFT) +#define XML_TYPE_PROP_PAGE_LAYOUT (0x3 << XML_TYPE_PROP_SHIFT) +#define XML_TYPE_PROP_HEADER_FOOTER (0x4 << XML_TYPE_PROP_SHIFT) +#define XML_TYPE_PROP_TEXT (0x5 << XML_TYPE_PROP_SHIFT) +#define XML_TYPE_PROP_PARAGRAPH (0x6 << XML_TYPE_PROP_SHIFT) +#define XML_TYPE_PROP_RUBY (0x7 << XML_TYPE_PROP_SHIFT) +#define XML_TYPE_PROP_SECTION (0x8 << XML_TYPE_PROP_SHIFT) +#define XML_TYPE_PROP_TABLE (0x9 << XML_TYPE_PROP_SHIFT) +#define XML_TYPE_PROP_TABLE_COLUMN (0xa << XML_TYPE_PROP_SHIFT) +#define XML_TYPE_PROP_TABLE_ROW (0xb << XML_TYPE_PROP_SHIFT) +#define XML_TYPE_PROP_TABLE_CELL (0xc << XML_TYPE_PROP_SHIFT) +#define XML_TYPE_PROP_LIST_LEVEL (0xd << XML_TYPE_PROP_SHIFT) +#define XML_TYPE_PROP_CHART (0xe << XML_TYPE_PROP_SHIFT) +#define XML_TYPE_PROP_END (0xf << XML_TYPE_PROP_SHIFT) + +/////////////////////////////////////////////////////////////////////////////// +// +// XML-data-type-ID's +// + +// simple types, no special compare necessary +#define XML_TYPE_BUILDIN_CMP 0x00002000 + +// basic types (all also XML_TYPE_BUILDIN_CMP) +#define XML_TYPE_BOOL 0x00002001 // true/false +#define XML_TYPE_MEASURE 0x00002002 // 1cm +#define XML_TYPE_MEASURE8 0x00002003 // 1cm +#define XML_TYPE_MEASURE16 0x00002004 // 1cm +#define XML_TYPE_PERCENT 0x00002005 // 50% +#define XML_TYPE_PERCENT8 0x00002006 // 50% +#define XML_TYPE_PERCENT16 0x00002007 // 50% +#define XML_TYPE_STRING 0x00002008 // "blablabla" +#define XML_TYPE_COLOR 0x00002009 // Colors +#define XML_TYPE_NUMBER 0x0000200a // 123 +#define XML_TYPE_NUMBER8 0x0000200b // 123 +#define XML_TYPE_NUMBER16 0x0000200c // 123 +#define XML_TYPE_NUMBER_NONE 0x0000200d // 123 and "no-limit" for 0 +#define XML_TYPE_DOUBLE 0x0000200e // for doubles +#define XML_TYPE_NBOOL 0x0000200f // !true/false +#define XML_TYPE_COLORTRANSPARENT 0x00002010 // Colors or "transparent" +#define XML_TYPE_ISTRANSPARENT 0x00002011 // "transparent" +#define XML_TYPE_BUILDIN_CMP_ONLY 0x00002012 // Only buildin comparison is required, so no handler exists +#define XML_TYPE_NUMBER8_NONE 0x00002013 // 123 and "no-limit" for 0 +#define XML_TYPE_NUMBER16_NONE 0x00002014 // 123 and "no-limit" for 0 +#define XML_TYPE_COLOR_MODE 0x00002015 +#define XML_TYPE_DURATION16_MS 0x00002016 // PT00H00M01S to ms in sal_Int16 +#define XML_TYPE_MEASURE_PX 0x00002017 // 1px +#define XML_TYPE_COLORAUTO 0x00002018 // color if not -1 +#define XML_TYPE_ISAUTOCOLOR 0x00002019 // true if -1 +#define XML_TYPE_STYLENAME 0x00002020 // "blablabla" +#define XML_TYPE_NEG_PERCENT 0x00002021 // (100-x)% +#define XML_TYPE_NEG_PERCENT8 0x00002022 // (100-x)% +#define XML_TYPE_NEG_PERCENT16 0x00002023 // (100-x) +#define XML_TYPE_DOUBLE_PERCENT 0x00002024 // 50% (source is a double from 0.0 to 1.0) + +// special basic types +#define XML_TYPE_RECTANGLE_LEFT 0x00000100 // the Left member of a awt::Rectangle as a measure +#define XML_TYPE_RECTANGLE_TOP 0x00000101 // the Top member of a awt::Rectangle as a measure +#define XML_TYPE_RECTANGLE_WIDTH 0x00000102 // the Width member of a awt::Rectangle as a measure +#define XML_TYPE_RECTANGLE_HEIGHT 0x00000103 // the Height member of a awt::Rectangle as a measure + +#define XML_TYPE_APP_SHIFT 10 +#define XML_SC_TYPES_START (0x1 << XML_TYPE_APP_SHIFT) +#define XML_SD_TYPES_START (0x2 << XML_TYPE_APP_SHIFT) + +#define XML_TEXT_TYPES_START (0x3 << XML_TYPE_APP_SHIFT) +#define XML_TYPE_TEXT_CROSSEDOUT_STYLE (XML_TEXT_TYPES_START + 0) +#define XML_TYPE_TEXT_CASEMAP (XML_TEXT_TYPES_START + 1) +#define XML_TYPE_TEXT_FONTFAMILYNAME (XML_TEXT_TYPES_START + 2) +#define XML_TYPE_TEXT_FONTFAMILY (XML_TEXT_TYPES_START + 3) +#define XML_TYPE_TEXT_FONTENCODING (XML_TEXT_TYPES_START + 4) +#define XML_TYPE_TEXT_FONTPITCH (XML_TEXT_TYPES_START + 5) +#define XML_TYPE_TEXT_KERNING (XML_TEXT_TYPES_START + 6) +#define XML_TYPE_TEXT_POSTURE (XML_TEXT_TYPES_START + 7) +#define XML_TYPE_TEXT_SHADOWED (XML_TEXT_TYPES_START + 8) +#define XML_TYPE_TEXT_UNDERLINE_STYLE (XML_TEXT_TYPES_START + 9) +#define XML_TYPE_TEXT_WEIGHT (XML_TEXT_TYPES_START + 10) +#define XML_TYPE_TEXT_SPLIT (XML_TEXT_TYPES_START + 11) +#define XML_TYPE_TEXT_BREAKBEFORE (XML_TEXT_TYPES_START + 12) +#define XML_TYPE_TEXT_BREAKAFTER (XML_TEXT_TYPES_START + 13) +#define XML_TYPE_TEXT_SHADOW (XML_TEXT_TYPES_START + 14) +#define XML_TYPE_TEXT_ADJUST (XML_TEXT_TYPES_START + 15) +#define XML_TYPE_TEXT_ADJUSTLAST (XML_TEXT_TYPES_START + 16) +#define XML_TYPE_TEXT_CASEMAP_VAR (XML_TEXT_TYPES_START + 17) +#define XML_TYPE_TEXT_ESCAPEMENT (XML_TEXT_TYPES_START + 18) +#define XML_TYPE_TEXT_ESCAPEMENT_HEIGHT (XML_TEXT_TYPES_START + 19) +#define XML_TYPE_CHAR_HEIGHT (XML_TEXT_TYPES_START + 20) +#define XML_TYPE_CHAR_HEIGHT_PROP (XML_TEXT_TYPES_START + 21) +#define XML_TYPE_CHAR_LANGUAGE (XML_TEXT_TYPES_START + 22) +#define XML_TYPE_CHAR_COUNTRY (XML_TEXT_TYPES_START + 23) +#define XML_TYPE_LINE_SPACE_FIXED (XML_TEXT_TYPES_START + 24) +#define XML_TYPE_LINE_SPACE_MINIMUM (XML_TEXT_TYPES_START + 25) +#define XML_TYPE_LINE_SPACE_DISTANCE (XML_TEXT_TYPES_START + 26) +#define XML_TYPE_BORDER (XML_TEXT_TYPES_START + 27) +#define XML_TYPE_BORDER_WIDTH (XML_TEXT_TYPES_START + 28) +#define XML_TYPE_TEXT_DROPCAP (XML_TEXT_TYPES_START + 29) +#define XML_TYPE_TEXT_TABSTOP (XML_TEXT_TYPES_START + 30) +#define XML_TYPE_TEXT_BOOLCROSSEDOUT (XML_TEXT_TYPES_START + 31) +#define XML_TYPE_TEXT_WRAP (XML_TEXT_TYPES_START + 32) +#define XML_TYPE_TEXT_PARAGRAPH_ONLY (XML_TEXT_TYPES_START + 33) +#define XML_TYPE_TEXT_WRAP_OUTSIDE (XML_TEXT_TYPES_START + 34) +#define XML_TYPE_TEXT_OPAQUE (XML_TEXT_TYPES_START + 35) +#define XML_TYPE_TEXT_PROTECT_CONTENT (XML_TEXT_TYPES_START + 36) +#define XML_TYPE_TEXT_PROTECT_SIZE (XML_TEXT_TYPES_START + 37) +#define XML_TYPE_TEXT_PROTECT_POSITION (XML_TEXT_TYPES_START + 38) +#define XML_TYPE_TEXT_ANCHOR_TYPE (XML_TEXT_TYPES_START + 39) +#define XML_TYPE_TEXT_COLUMNS (XML_TEXT_TYPES_START + 40) +#define XML_TYPE_TEXT_HORIZONTAL_POS (XML_TEXT_TYPES_START + 41) +#define XML_TYPE_TEXT_HORIZONTAL_POS_MIRRORED (XML_TEXT_TYPES_START + 42) +#define XML_TYPE_TEXT_HORIZONTAL_REL (XML_TEXT_TYPES_START + 43) +#define XML_TYPE_TEXT_HORIZONTAL_REL_FRAME (XML_TEXT_TYPES_START + 44) +#define XML_TYPE_TEXT_HORIZONTAL_MIRROR (XML_TEXT_TYPES_START + 45) +#define XML_TYPE_TEXT_VERTICAL_POS (XML_TEXT_TYPES_START + 46) +#define XML_TYPE_TEXT_VERTICAL_REL (XML_TEXT_TYPES_START + 47) +#define XML_TYPE_TEXT_VERTICAL_REL_PAGE (XML_TEXT_TYPES_START + 48) +#define XML_TYPE_TEXT_VERTICAL_REL_FRAME (XML_TEXT_TYPES_START + 49) +#define XML_TYPE_TEXT_VERTICAL_REL_AS_CHAR (XML_TEXT_TYPES_START + 50) +#define XML_TYPE_TEXT_MIRROR_VERTICAL (XML_TEXT_TYPES_START + 51) +#define XML_TYPE_TEXT_MIRROR_HORIZONTAL_LEFT (XML_TEXT_TYPES_START + 52) +#define XML_TYPE_TEXT_MIRROR_HORIZONTAL_RIGHT (XML_TEXT_TYPES_START + 53) +#define XML_TYPE_TEXT_CLIP11 (XML_TEXT_TYPES_START + 54) +#define XML_TYPE_ATTRIBUTE_CONTAINER (XML_TEXT_TYPES_START + 55 ) +#define XML_TYPE_CHAR_HEIGHT_DIFF (XML_TEXT_TYPES_START + 56) +#define XML_TYPE_TEXT_EMPHASIZE (XML_TEXT_TYPES_START + 57) +#define XML_TYPE_TEXT_COMBINE (XML_TEXT_TYPES_START + 58) +#define XML_TYPE_TEXT_COMBINECHAR (XML_TEXT_TYPES_START + 59) +#define XML_TYPE_TEXT_UNDERLINE_COLOR (XML_TEXT_TYPES_START + 60) +#define XML_TYPE_TEXT_UNDERLINE_HASCOLOR (XML_TEXT_TYPES_START + 61) +#define XML_TYPE_TEXT_AUTOSPACE (XML_TEXT_TYPES_START + 62) +#define XML_TYPE_TEXT_PUNCTUATION_WRAP (XML_TEXT_TYPES_START + 63) +#define XML_TYPE_TEXT_LINE_BREAK (XML_TEXT_TYPES_START + 64) + +#define XML_TYPE_TEXT_ALIGN (XML_TEXT_TYPES_START + 65) +#define XML_TYPE_FONT_WIDTH (XML_TEXT_TYPES_START + 66) +#define XML_TYPE_ROTATION_ANGLE (XML_TEXT_TYPES_START + 67) +#define XML_TYPE_CONTROL_BORDER (XML_TEXT_TYPES_START + 68) +#define XML_TYPE_TEXT_REL_WIDTH_HEIGHT (XML_TEXT_TYPES_START + 69) +#define XML_TYPE_TEXT_SYNC_WIDTH_HEIGHT (XML_TEXT_TYPES_START + 70) +#define XML_TYPE_TEXT_SYNC_WIDTH_HEIGHT_MIN (XML_TEXT_TYPES_START + 71) +#define XML_TYPE_TEXT_COMBINE_CHARACTERS (XML_TEXT_TYPES_START + 72) +#define XML_TYPE_TEXT_ANIMATION (XML_TEXT_TYPES_START + 73) +#define XML_TYPE_TEXT_ANIMATION_DIRECTION (XML_TEXT_TYPES_START + 74) +#define XML_TYPE_TEXT_HORIZONTAL_ADJUST (XML_TEXT_TYPES_START + 75) +#define XML_TYPE_TEXT_RUBY_ADJUST (XML_TEXT_TYPES_START + 76) +#define XML_TYPE_TEXT_FONT_RELIEF (XML_TEXT_TYPES_START + 77) +#define XML_TYPE_TEXT_ROTATION_ANGLE (XML_TEXT_TYPES_START + 78) +#define XML_TYPE_TEXT_ROTATION_SCALE (XML_TEXT_TYPES_START + 79) +#define XML_TYPE_TEXT_VERTICAL_ALIGN (XML_TEXT_TYPES_START + 80) +#define XML_TYPE_TEXT_DRAW_ASPECT (XML_TEXT_TYPES_START + 81) +#define XML_TYPE_CONTROL_TEXT_EMPHASIZE (XML_TEXT_TYPES_START + 82) +#define XML_TYPE_TEXT_RUBY_POSITION (XML_TEXT_TYPES_START + 83) +#define XML_TYPE_TEXT_VERTICAL_POS_AT_CHAR (XML_TEXT_TYPES_START + 84) +#define XML_TYPE_TEXT_WRITING_MODE (XML_TEXT_TYPES_START + 85) +#define XML_TYPE_TEXT_WRITING_MODE_WITH_DEFAULT (XML_TEXT_TYPES_START + 86) +#define XML_TYPE_LAYOUT_GRID_MODE (XML_TEXT_TYPES_START + 87) +#define XML_TYPE_TEXT_HIDDEN_AS_DISPLAY (XML_TEXT_TYPES_START + 88) +#define XML_TYPE_CONTROL_BORDER_COLOR (XML_TEXT_TYPES_START + 89) +#define XML_TYPE_BORDER_MODEL (XML_TEXT_TYPES_START + 90) +#define XML_TYPE_TEXT_LINE_MODE (XML_TEXT_TYPES_START + 91) +#define XML_TYPE_TEXT_UNDERLINE_TYPE (XML_TEXT_TYPES_START + 92) +#define XML_TYPE_TEXT_UNDERLINE_WIDTH (XML_TEXT_TYPES_START + 93) +#define XML_TYPE_TEXT_CROSSEDOUT_TYPE (XML_TEXT_TYPES_START + 94) +#define XML_TYPE_TEXT_CROSSEDOUT_WIDTH (XML_TEXT_TYPES_START + 95) +#define XML_TYPE_TEXT_CROSSEDOUT_TEXT (XML_TEXT_TYPES_START + 96) +#define XML_TYPE_TEXT_KEEP (XML_TEXT_TYPES_START + 97) +#define XML_TYPE_TEXT_NKEEP (XML_TEXT_TYPES_START + 98) +#define XML_TYPE_WRAP_INFLUENCE_ON_POSITION (XML_TEXT_TYPES_START + 99) +#define XML_TYPE_WRAP_OPTION (XML_TEXT_TYPES_START + 100) +#define XML_TYPE_TEXT_NUMBER8_ONE_BASED (XML_TEXT_TYPES_START + 101) +#define XML_TYPE_NUMBER_NO_ZERO (XML_TEXT_TYPES_START + 102) +#define XML_TYPE_NUMBER8_NO_ZERO (XML_TEXT_TYPES_START + 103) +#define XML_TYPE_NUMBER16_NO_ZERO (XML_TEXT_TYPES_START + 104) +#define XML_TYPE_NUMBER16_AUTO (XML_TEXT_TYPES_START + 105) +#define XML_TYPE_TEXT_SOFT_PAGE_BREAK (XML_TEXT_TYPES_START + 106) +#define XML_TYPE_TEXT_USE_SOFT_PAGE_BREAKS (XML_TEXT_TYPES_START + 107) +#define XML_TYPE_TEXT_CLIP (XML_TEXT_TYPES_START + 108) +#define XML_TYPE_TEXT_OVERLINE_TYPE (XML_TEXT_TYPES_START + 109) +#define XML_TYPE_TEXT_OVERLINE_STYLE (XML_TEXT_TYPES_START + 110) +#define XML_TYPE_TEXT_OVERLINE_WIDTH (XML_TEXT_TYPES_START + 111) +#define XML_TYPE_TEXT_OVERLINE_COLOR (XML_TEXT_TYPES_START + 112) +#define XML_TYPE_TEXT_OVERLINE_HASCOLOR (XML_TEXT_TYPES_START + 113) + +#define XML_SCH_TYPES_START (0x4 << XML_TYPE_APP_SHIFT) +#define XML_PM_TYPES_START (0x5 << XML_TYPE_APP_SHIFT) // page master +#define XML_DB_TYPES_START (0x6 << XML_TYPE_APP_SHIFT) + +#endif // _XMLOFF_XMLTYPES_HXX diff --git a/xmloff/inc/xmloff/xmluconv.hxx b/xmloff/inc/xmloff/xmluconv.hxx new file mode 100644 index 000000000000..580a20b76a5c --- /dev/null +++ b/xmloff/inc/xmloff/xmluconv.hxx @@ -0,0 +1,445 @@ +/************************************************************************* + * + * 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_XMLUCONV_HXX +#define _XMLOFF_XMLUCONV_HXX + +#include "sal/config.h" +#include "xmloff/dllapi.h" +#include "sal/types.h" + +#include <limits.h> +#include <tools/solar.h> +#include <tools/color.hxx> +#include <tools/mapunit.hxx> +#include <xmloff/xmlement.hxx> +#include <xmloff/xmltoken.hxx> +#include <com/sun/star/util/Date.hpp> +#include <com/sun/star/frame/XModel.hpp> +#include <com/sun/star/beans/XPropertySet.hpp> +#include <com/sun/star/drawing/Position3D.hpp> + +// #110680# +#include <com/sun/star/lang/XMultiServiceFactory.hpp> + +////////////////////////////////////////////////////////////////////////////// +// predeclarations + +class Time; +namespace rtl +{ +class OUString; +class OUStringBuffer; +} + +namespace com { namespace sun { namespace star { + namespace util { struct DateTime; } + namespace text { class XNumberingTypeInfo; } + namespace i18n { class XCharacterClassification; } +}}} + +namespace basegfx +{ + class B3DVector; +} // end of namespace basegfx + +class XMLOFF_DLLPUBLIC SvXMLTokenEnumerator +{ +private: + const ::rtl::OUString& maTokenString; + sal_Int32 mnNextTokenPos; + sal_Unicode mcSeperator; + +public: + SvXMLTokenEnumerator( const ::rtl::OUString& rString, sal_Unicode cSeperator = sal_Unicode(' ') ); + + sal_Bool getNextToken( ::rtl::OUString& rToken ); +}; + +/** the SvXMLTypeConverter converts values of various types from + their internal represantation to the textual form used in xml + and back. + Most of the methods are static but the SvXMLTypeConverter can + also store default units for both numerical and textual measures. +*/ + +class XMLOFF_DLLPUBLIC SvXMLUnitConverter +{ +private: + MapUnit meCoreMeasureUnit; + MapUnit meXMLMeasureUnit; + com::sun::star::util::Date aNullDate; + ::com::sun::star::uno::Reference< + ::com::sun::star::text::XNumberingTypeInfo > xNumTypeInfo; + ::com::sun::star::uno::Reference< + ::com::sun::star::i18n::XCharacterClassification > xCharClass; + // #110680# + ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > mxServiceFactory; + + SAL_DLLPRIVATE static ::rtl::OUString msXML_false; + SAL_DLLPRIVATE static ::rtl::OUString msXML_true; + + SAL_DLLPRIVATE static void initXMLStrings(); + + SAL_DLLPRIVATE void createNumTypeInfo() const; + +public: + /** constructs a SvXMLUnitConverter. The core measure unit is the + default unit for numerical measures, the XML measure unit is + the default unit for textual measures */ + // #110680# + // SvXMLUnitConverter( MapUnit eCoreMeasureUnit, MapUnit eXMLMeasureUnit ); + SvXMLUnitConverter( + MapUnit eCoreMeasureUnit, + MapUnit eXMLMeasureUnit, + const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xServiceFactory ); + + virtual ~SvXMLUnitConverter(); + + static MapUnit GetMapUnit(sal_Int16 nFieldUnit); + + /** sets the default unit for numerical measures */ + inline void setCoreMeasureUnit( MapUnit eCoreMeasureUnit ); + + /** gets the default unit for numerical measures */ + inline MapUnit getCoreMeasureUnit() const; + + /** sets the default unit for textual measures */ + void setXMLMeasureUnit( MapUnit eXMLMeasureUnit ); + + /** gets the default unit for textual measures */ + MapUnit getXMLMeasureUnit() const; + + /** gets XNumberingTypeInfo */ + const ::com::sun::star::uno::Reference< + ::com::sun::star::text::XNumberingTypeInfo >& getNumTypeInfo() const + { + if( !xNumTypeInfo.is() ) + createNumTypeInfo(); + return xNumTypeInfo; + } + + /** convert string to measure using optional min and max values*/ + sal_Bool convertMeasure( sal_Int32& rValue, + const ::rtl::OUString& rString, + sal_Int32 nMin = SAL_MIN_INT32, + sal_Int32 nMax = SAL_MAX_INT32) const; + + /** convert measure to string */ + void convertMeasure( ::rtl::OUStringBuffer& rBuffer, + sal_Int32 nMeasure ) const; + + /** convert measure with given unit to string */ + void convertMeasure( ::rtl::OUStringBuffer&, + sal_Int32 nMeasure, + MapUnit eSrcUnit ) const; + + /** convert string to measure in given unit + using optional min and max values */ + static sal_Bool convertMeasure( sal_Int32& rVal, + const ::rtl::OUString& rString, + MapUnit eDstUnit, + sal_Int32 nMin = SAL_MIN_INT32, + sal_Int32 nMax = SAL_MAX_INT32); + + /** convert measure in given unit to string with given unit */ + static void convertMeasure( ::rtl::OUStringBuffer& rBuffer, + sal_Int32 nMeasure, + MapUnit eSrcUnit, + MapUnit eDstUnit ); + + /** convert string to boolean */ + static sal_Bool convertBool( sal_Bool& rBool, + const ::rtl::OUString& rString ); + + /** convert boolean to string */ + static void convertBool( ::rtl::OUStringBuffer& rBuffer, + sal_Bool bValue ); + + /** convert string to percent */ + static sal_Bool convertPercent( sal_Int32& rValue, + const ::rtl::OUString& rString ); + + /** convert percent to string */ + static void convertPercent( ::rtl::OUStringBuffer& rBuffer, + sal_Int32 nValue ); + + /** convert string to pixel measure unite */ + static sal_Bool convertMeasurePx( sal_Int32& rValue, + const ::rtl::OUString& rString ); + + /** convert pixel measure unit to string */ + static void convertMeasurePx( ::rtl::OUStringBuffer& rBuffer, + sal_Int32 nValue ); + + /** convert string to enum using given enum map, if the enum is + not found in the map, this method will return false */ + static sal_Bool convertEnum( sal_uInt16& rEnum, + const ::rtl::OUString& rValue, + const SvXMLEnumMapEntry *pMap ); + + /** convert string to enum using given token map, if the enum is + not found in the map, this method will return false */ + static sal_Bool convertEnum( sal_uInt16& rEnum, + const ::rtl::OUString& rValue, + const SvXMLEnumStringMapEntry *pMap ); + + /** convert enum to string using given enum map with an optional + default token. If the enum is not found in the map, + this method will either use the given default or return + false if not default is set */ + static sal_Bool convertEnum( ::rtl::OUStringBuffer& rBuffer, + unsigned int nValue, + const SvXMLEnumMapEntry *pMap, + enum ::xmloff::token::XMLTokenEnum eDefault = + ::xmloff::token::XML_TOKEN_INVALID ); + + /** convert enum to string using given token map with an optional + default token. If the enum is not found in the map, + this method will either use the given default or return + false if not default is set */ + static sal_Bool convertEnum( ::rtl::OUStringBuffer& rBuffer, + USHORT nValue, + const SvXMLEnumStringMapEntry *pMap, + sal_Char* pDefault = NULL ); + + /** convert string to color */ + static sal_Bool convertColor( Color& rColor, + const ::rtl::OUString&rValue ); + + /** convert color to string */ + static void convertColor( ::rtl::OUStringBuffer &rBuffer, + const Color& rCol ); + + /** convert number to string */ + static void convertNumber( ::rtl::OUStringBuffer& rBuffer, + sal_Int32 nNumber ); + + /** convert string to number with optional min and max values */ + static sal_Bool convertNumber( sal_Int32& rValue, + const ::rtl::OUString& rString, + sal_Int32 nMin = SAL_MIN_INT32, + sal_Int32 nMax = SAL_MAX_INT32); + + /** convert number to string */ + static void convertNumber64( ::rtl::OUStringBuffer& rBuffer, + sal_Int64 nNumber ); + + /** convert string to number with optional min and max values */ + static sal_Bool convertNumber64( sal_Int64& rValue, + const ::rtl::OUString& rString, + sal_Int64 nMin = SAL_MIN_INT64, + sal_Int64 nMax = SAL_MAX_INT64); + + /** convert double number to string (using ::rtl::math) and DO + convert to export MapUnit */ + void convertDouble(::rtl::OUStringBuffer& rBuffer, + double fNumber, BOOL bWriteUnits) const; + + /** convert double number to string (using ::rtl::math) and + DO convert from eSrcUnit to export MapUnit */ + static void convertDouble( ::rtl::OUStringBuffer& rBuffer, + double fNumber, BOOL bWriteUnits, MapUnit eCoreUnit, MapUnit eDstUnit); + + /** convert double number to string (using ::rtl::math) without unit conversion */ + static void convertDouble( ::rtl::OUStringBuffer& rBuffer, double fNumber); + + /** convert string to double number (using ::rtl::math) and DO convert. */ + sal_Bool convertDouble(double& rValue, const ::rtl::OUString& rString, BOOL bLookForUnits) const; + + /** convert string to double number (using ::rtl::math) and DO convert from + SrcUnit to DstUnit. */ + static sal_Bool convertDouble(double& rValue, + const ::rtl::OUString& rString, MapUnit eSrcUnit, MapUnit eCoreUnit); + + /** convert string to double number (using ::rtl::math) without unit conversion */ + static sal_Bool convertDouble(double& rValue, const ::rtl::OUString& rString); + + /** get the Null Date of the XModel and set it to the UnitConverter */ + sal_Bool setNullDate ( + const com::sun::star::uno::Reference <com::sun::star::frame::XModel>& xModel); + + /** Set the Null Date of the UnitConverter */ + void setNullDate ( const com::sun::star::util::Date& aTempNullDate ) { aNullDate = aTempNullDate; } + + /** convert double to ISO Time String */ + static void convertTime( ::rtl::OUStringBuffer& rBuffer, + const double& fTime); + + /** convert util::DateTime to ISO Time String */ + static void convertTime( ::rtl::OUStringBuffer& rBuffer, + const ::com::sun::star::util::DateTime& rDateTime ); + + /** convert ISO Time String to double */ + static sal_Bool convertTime( double& fTime, + const ::rtl::OUString& rString); + + /** convert ISO Time String to util::DateTime */ + static sal_Bool convertTime( ::com::sun::star::util::DateTime& rDateTime, + const ::rtl::OUString& rString ); + + /** convert double to ISO Date Time String */ + void convertDateTime( ::rtl::OUStringBuffer& rBuffer, + const double& fDateTime, + sal_Bool bAddTimeIf0AM=sal_False) { convertDateTime(rBuffer, fDateTime, aNullDate, bAddTimeIf0AM); } + + /** convert ISO Date Time String to double */ + sal_Bool convertDateTime( double& fDateTime, + const ::rtl::OUString& rString) { return convertDateTime(fDateTime, rString, aNullDate); } + + /** convert double to ISO Date Time String */ + static void convertDateTime( ::rtl::OUStringBuffer& rBuffer, + const double& fDateTime, + const com::sun::star::util::Date& aNullDate, + sal_Bool bAddTimeIf0AM=sal_False); + /** convert ISO Date Time String to double */ + static sal_Bool convertDateTime( double& fDateTime, + const ::rtl::OUString& rString, + const com::sun::star::util::Date& aNullDate); + + /** converts the given time value into an ISO-conform duration string + + @param rTime + the time value to convert. This parameter is evaluated only down to the seconds - in particular, + "100th seconds" are ignored. + @param nSecondsFraction + Additional milleseconds to add to the time. Must be smaller than 1000. + This parameter is necessary since neither <type>Time</type> nor <type scope="com::sun::star::util">Time</type> + have a sufficient resolution to transport milliseconds. + @see http://www.w3.org/TR/xmlschema-2/#duration + */ + static ::rtl::OUString convertTimeDuration( const ::Time& rTime, sal_Int32 nSecondsFraction = 0 ); + + /** converts the given ISO-conform duration string into a time value + + @param rTime + the converted time value. Fractions of seconds of this object are not filled, even if present in + the string. See <arg>nSecondsFraction</arg> + + @param pSecondsFraction + recieves fractions of whole seconds, in milliseconds. May be <NULL/> + This parameter is necessary since neither <type>Time</type> nor <type scope="com::sun::star::util">Time</type> + have a sufficient resolution to transport milliseconds. + @see http://www.w3.org/TR/xmlschema-2/#duration + */ + static bool convertTimeDuration( const rtl::OUString& rString, ::Time& rTime, sal_Int32* pSecondsFraction = NULL ); + + /** convert string to ::basegfx::B3DVector */ + static sal_Bool convertB3DVector( ::basegfx::B3DVector& rVector, + const ::rtl::OUString& rValue ); + + /** convert B3DVector to string */ + static void convertB3DVector( ::rtl::OUStringBuffer &rBuffer, + const ::basegfx::B3DVector& rVector ); + + /** convert string to Position3D */ + sal_Bool convertPosition3D( com::sun::star::drawing::Position3D& rPosition, + const ::rtl::OUString& rValue ); + + /** convert Position3D to string */ + void convertPosition3D( ::rtl::OUStringBuffer &rBuffer, + const com::sun::star::drawing::Position3D& rVector ); + + /** convert util::DateTime to ISO Date String */ + static void convertDateTime( ::rtl::OUStringBuffer& rBuffer, + const com::sun::star::util::DateTime& rDateTime, + sal_Bool bAddTimeIf0AM=sal_False ); + + /** convert ISO Date String to util::DateTime */ + static sal_Bool convertDateTime( com::sun::star::util::DateTime& rDateTime, + const ::rtl::OUString& rString ); + + /** gets the position of the first comma after npos in the string + rStr. Commas inside '"' pairs are not matched */ + static sal_Int32 indexOfComma( const ::rtl::OUString& rStr, + sal_Int32 nPos ); + + static void encodeBase64(rtl::OUStringBuffer& aStrBuffer, const com::sun::star::uno::Sequence<sal_Int8>& aPass); + + // Decode a base 64 encoded string into a sequence of bytes. The first + // version can be used for attribute values only, bacause it does not + // return any chars left from conversion. + // For text submitted throgh the SAX characters call, the later method + // must be used! + static void decodeBase64(com::sun::star::uno::Sequence<sal_Int8>& aPass, const rtl::OUString& sBuffer); + + static sal_Int32 decodeBase64SomeChars(com::sun::star::uno::Sequence<sal_Int8>& aPass, const rtl::OUString& sBuffer); + + /** convert num-forat and num-letter-sync values to NumberingType */ + sal_Bool convertNumFormat( sal_Int16& rType, + const ::rtl::OUString& rNumFormat, + const ::rtl::OUString& rNumLetterSync, + sal_Bool bNumberNone = sal_False ) const; + + /** convert NumberingType to num-forat and num-letter-sync values */ + void convertNumFormat( ::rtl::OUStringBuffer& rBuffer, + sal_Int16 nType ) const; + void convertNumLetterSync( ::rtl::OUStringBuffer& rBuffer, + sal_Int16 nType ) const; + + static void convertPropertySet(com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue>& rProps, + const com::sun::star::uno::Reference<com::sun::star::beans::XPropertySet>& aProperties); + static void convertPropertySet(com::sun::star::uno::Reference<com::sun::star::beans::XPropertySet>& rProperties, + const com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue>& aProps); + + static void clearUndefinedChars(rtl::OUString& rTarget, const rtl::OUString& rSource); + + ::rtl::OUString encodeStyleName( const ::rtl::OUString& rName, + sal_Bool *pEncoded=0 ) const; + + /** convert an Any to string (typesafe) */ + static sal_Bool convertAny( ::rtl::OUStringBuffer& sValue, + ::rtl::OUStringBuffer& sType , + const com::sun::star::uno::Any& aValue); + + /** convert a string to Any (typesafe) */ + static sal_Bool convertAny( com::sun::star::uno::Any& aValue, + const ::rtl::OUString& sType , + const ::rtl::OUString& sValue); +}; + +inline void SvXMLUnitConverter::setCoreMeasureUnit( MapUnit eCoreMeasureUnit ) +{ + meCoreMeasureUnit = eCoreMeasureUnit; +} + +inline MapUnit SvXMLUnitConverter::getCoreMeasureUnit() const +{ + return meCoreMeasureUnit; +} + +inline void SvXMLUnitConverter::setXMLMeasureUnit( MapUnit eXMLMeasureUnit ) +{ + meXMLMeasureUnit = eXMLMeasureUnit; +} + +inline MapUnit SvXMLUnitConverter::getXMLMeasureUnit() const +{ + return meXMLMeasureUnit; +} + +#endif // _XMLOFF_XMLUCONV_HXX |