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: MetaTContext.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_METATCONTEXT_HXX
32 #define _XMLOFF_METATCONTEXT_HXX
34 #include <rtl/ref.hxx>
35 #include "functional.hxx"
39 #ifndef _XMLOFF_FLATTRCONTEXT_HXX
40 #include "FlatTContext.hxx"
43 typedef ::std::multimap
< ::rtl::OUString
,
44 ::rtl::Reference
< XMLPersTextContentTContext
>,
45 less_functor
> XMLMetaContexts_Impl
;
48 class XMLMetaTransformerContext
: public XMLTransformerContext
50 XMLMetaContexts_Impl m_aContexts
;
55 // A contexts constructor does anything that is required if an element
56 // starts. Namespace processing has been done already.
57 // Note that virtual methods cannot be used inside constructors. Use
58 // StartElement instead if this is required.
59 XMLMetaTransformerContext( XMLTransformerBase
& rTransformer
,
60 const ::rtl::OUString
& rQName
);
62 // A contexts destructor does anything that is required if an element
63 // ends. By default, nothing is done.
64 // Note that virtual methods cannot be used inside destructors. Use
65 // EndElement instead if this is required.
66 virtual ~XMLMetaTransformerContext();
68 // Create a childs element context. By default, the import's
69 // CreateContext method is called to create a new default context.
70 virtual XMLTransformerContext
*CreateChildContext( sal_uInt16 nPrefix
,
71 const ::rtl::OUString
& rLocalName
,
72 const ::rtl::OUString
& rQName
,
73 const ::com::sun::star::uno::Reference
< ::com::sun::star::xml::sax::XAttributeList
>& xAttrList
);
75 // EndElement is called before a context will be destructed, but
76 // after a elements context has been parsed. It may be used for actions
77 // that require virtual methods. The default is to do nothing.
78 virtual void EndElement();
80 // This method is called for all characters that are contained in the
81 // current element. The default is to ignore them.
82 virtual void Characters( const ::rtl::OUString
& rChars
);
85 #endif // _XMLOFF_METATCONTEXT_HXX