1 /************************************************************************* 2 * 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 * 5 * Copyright 2000, 2010 Oracle and/or its affiliates. 6 * 7 * OpenOffice.org - a multi-platform office productivity suite 8 * 9 * This file is part of OpenOffice.org. 10 * 11 * OpenOffice.org is free software: you can redistribute it and/or modify 12 * it under the terms of the GNU Lesser General Public License version 3 13 * only, as published by the Free Software Foundation. 14 * 15 * OpenOffice.org is distributed in the hope that it will be useful, 16 * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 * GNU Lesser General Public License version 3 for more details 19 * (a copy is included in the LICENSE file that accompanied this code). 20 * 21 * You should have received a copy of the GNU Lesser General Public License 22 * version 3 along with OpenOffice.org. If not, see 23 * <http://www.openoffice.org/license.html> 24 * for a copy of the LGPLv3 License. 25 * 26 ************************************************************************/ 27 28 #ifndef _XMLOFF_METATCONTEXT_HXX 29 #define _XMLOFF_METATCONTEXT_HXX 30 31 #include <rtl/ref.hxx> 32 #include "xmloff/functional.hxx" 33 34 #include <map> 35 36 #ifndef _XMLOFF_FLATTRCONTEXT_HXX 37 #include "FlatTContext.hxx" 38 #endif 39 40 typedef ::std::multimap< ::rtl::OUString, 41 ::rtl::Reference< XMLPersTextContentTContext >, 42 less_functor > XMLMetaContexts_Impl; 43 44 45 class XMLMetaTransformerContext : public XMLTransformerContext 46 { 47 XMLMetaContexts_Impl m_aContexts; 48 49 public: 50 TYPEINFO(); 51 52 // A contexts constructor does anything that is required if an element 53 // starts. Namespace processing has been done already. 54 // Note that virtual methods cannot be used inside constructors. Use 55 // StartElement instead if this is required. 56 XMLMetaTransformerContext( XMLTransformerBase& rTransformer, 57 const ::rtl::OUString& rQName ); 58 59 // A contexts destructor does anything that is required if an element 60 // ends. By default, nothing is done. 61 // Note that virtual methods cannot be used inside destructors. Use 62 // EndElement instead if this is required. 63 virtual ~XMLMetaTransformerContext(); 64 65 // Create a childs element context. By default, the import's 66 // CreateContext method is called to create a new default context. 67 virtual XMLTransformerContext *CreateChildContext( sal_uInt16 nPrefix, 68 const ::rtl::OUString& rLocalName, 69 const ::rtl::OUString& rQName, 70 const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList ); 71 72 // EndElement is called before a context will be destructed, but 73 // after a elements context has been parsed. It may be used for actions 74 // that require virtual methods. The default is to do nothing. 75 virtual void EndElement(); 76 77 // This method is called for all characters that are contained in the 78 // current element. The default is to ignore them. 79 virtual void Characters( const ::rtl::OUString& rChars ); 80 }; 81 82 #endif // _XMLOFF_METATCONTEXT_HXX 83 84