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_IGNORETCONTEXT_HXX 29 #define _XMLOFF_IGNORETCONTEXT_HXX 30 31 #include "TransformerContext.hxx" 32 33 34 class XMLIgnoreTransformerContext : public XMLTransformerContext 35 { 36 sal_Bool m_bIgnoreCharacters; 37 sal_Bool m_bIgnoreElements; 38 sal_Bool m_bAllowCharactersRecursive; 39 sal_Bool m_bRecursiveUse; 40 41 public: 42 TYPEINFO(); 43 44 // A contexts constructor does anything that is required if an element 45 // starts. Namespace processing has been done already. 46 // Note that virtual methods cannot be used inside constructors. Use 47 // StartElement instead if this is required. 48 XMLIgnoreTransformerContext( XMLTransformerBase& rTransformer, 49 const ::rtl::OUString& rQName, 50 sal_Bool bIgnoreCharacters, 51 sal_Bool bIgnoreElements ); 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 XMLIgnoreTransformerContext( XMLTransformerBase& rTransformer, 57 const ::rtl::OUString& rQName, 58 sal_Bool bAllowCharactersRecursive ); 59 60 // A contexts destructor does anything that is required if an element 61 // ends. By default, nothing is done. 62 // Note that virtual methods cannot be used inside destructors. Use 63 // EndElement instead if this is required. 64 virtual ~XMLIgnoreTransformerContext(); 65 66 // Create a childs element context. By default, the import's 67 // CreateContext method is called to create a new default context. 68 virtual XMLTransformerContext *CreateChildContext( sal_uInt16 nPrefix, 69 const ::rtl::OUString& rLocalName, 70 const ::rtl::OUString& rQName, 71 const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList ); 72 73 // StartElement is called after a context has been constructed and 74 // before a elements context is parsed. It may be used for actions that 75 // require virtual methods. The default is to do nothing. 76 virtual void StartElement( const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList ); 77 78 // EndElement is called before a context will be destructed, but 79 // after a elements context has been parsed. It may be used for actions 80 // that require virtual methods. The default is to do nothing. 81 virtual void EndElement(); 82 83 // This method is called for all characters that are contained in the 84 // current element. The default is to ignore them. 85 virtual void Characters( const ::rtl::OUString& rChars ); 86 }; 87 88 #endif // _XMLOFF_IGNORETCONTEXT_HXX 89 90