1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: xmlaustp.hxx,v $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #ifndef _XMLOFF_XMLASTPLP_HXX
32 #define _XMLOFF_XMLASTPLP_HXX
34 #ifndef _COM_SUN_STAR_XML_SAX_XDOCUMENTHANDLER_HPP_
35 #include <com/sun/star/xml/sax/XDocumentHandler.hpp>
38 #ifndef _XMLOFF_PROPERTYSETMAPPER_HXX
39 #include <bf_xmloff/xmlprmap.hxx>
42 #ifndef _UNIVERSALL_REFERENCE_HXX
43 #include <bf_xmloff/uniref.hxx>
47 class SvXMLExportPropertyMapper
;
48 class SvXMLNamespaceMap
;
49 class SvXMLAttributeList
;
50 class SvXMLAutoStylePoolP_Impl
;
53 class SvXMLAutoStylePoolP
: public UniRefBase
55 friend class SvXMLAutoStylePoolP_Impl
;
57 SvXMLAutoStylePoolP_Impl
*pImpl
;
61 virtual void exportStyleAttributes(
62 SvXMLAttributeList
& rAttrList
,
64 const ::std::vector
< XMLPropertyState
>& rProperties
,
65 const SvXMLExportPropertyMapper
& rPropExp
66 , const SvXMLUnitConverter
& rUnitConverter
,
67 const SvXMLNamespaceMap
& rNamespaceMap
70 // this methode is executed after Properties Export, so you can e.g. export a map or so on
71 virtual void exportStyleContent(
72 const ::com::sun::star::uno::Reference
< ::com::sun::star::xml::sax::XDocumentHandler
> & rHandler
,
74 const ::std::vector
< XMLPropertyState
>& rProperties
,
75 const SvXMLExportPropertyMapper
& rPropExp
76 , const SvXMLUnitConverter
& rUnitConverter
,
77 const SvXMLNamespaceMap
& rNamespaceMap
82 SvXMLAutoStylePoolP( SvXMLExport
& rExport
);
84 virtual ~SvXMLAutoStylePoolP();
86 SvXMLExport
& GetExport() const;
88 /** register a new family with its appropriate instance of a derivation of XMLPropertySetMapper
89 for family numbers see families.hxx
90 if bAsFamily is sal_False, the family name is used as element name
92 // TODO: Remove this ugly method as soon as possible
93 void AddFamily( sal_Int32 nFamily
, const ::rtl::OUString
& rStrName
, SvXMLExportPropertyMapper
* pMapper
, ::rtl::OUString aStrPrefix
, sal_Bool bAsFamily
= sal_True
);
94 void AddFamily( sal_Int32 nFamily
, const ::rtl::OUString
& rStrName
,
95 const UniReference
< SvXMLExportPropertyMapper
>& rMapper
,
96 const ::rtl::OUString
& rStrPrefix
, sal_Bool bAsFamily
= sal_True
);
98 /// Register a name that must not be used as a generated name.
99 void RegisterName( sal_Int32 nFamily
, const ::rtl::OUString
& rName
);
101 /// Add an item set to the pool and return its generated name.
102 ::rtl::OUString
Add( sal_Int32 nFamily
, const ::std::vector
< XMLPropertyState
>& rProperties
);
103 ::rtl::OUString
Add( sal_Int32 nFamily
, const ::rtl::OUString
& rParent
, const ::std::vector
< XMLPropertyState
>& rProperties
);
104 sal_Bool
Add(::rtl::OUString
& rName
, sal_Int32 nFamily
, const ::rtl::OUString
& rParent
, const ::std::vector
< XMLPropertyState
>& rProperties
);
107 /// Find an item set's name.
108 ::rtl::OUString
Find( sal_Int32 nFamily
, const ::rtl::OUString
& rParent
, const ::std::vector
< XMLPropertyState
>& rProperties
) const;
110 /** Export all item sets ofs a certain class in the order in that they have been added. */
111 void exportXML( sal_Int32 nFamily
112 , const ::com::sun::star::uno::Reference
< ::com::sun::star::xml::sax::XDocumentHandler
> & rHandler
,
113 const SvXMLUnitConverter
& rUnitConverter
,
114 const SvXMLNamespaceMap
& rNamespaceMap
120 }//end of namespace binfilter
121 #endif // _XMLOFF_XMLASTPLP_HXX