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 #include <cppuhelper/implbase1.hxx> 29 30 #include <com/sun/star/xml/sax/XAttributeList.hpp> 31 #include <com/sun/star/xml/sax/SAXException.hpp> 32 #include <com/sun/star/xml/sax/XDocumentHandler.hpp> 33 #include <com/sun/star/xml/sax/XExtendedDocumentHandler.hpp> 34 #include <com/sun/star/xml/sax/XParser.hpp> 35 36 #include <com/sun/star/lang/NoSupportException.hpp> 37 #include <com/sun/star/lang/XMultiComponentFactory.hpp> 38 namespace css = ::com::sun::star; 39 namespace dp_registry 40 { 41 namespace backend 42 { 43 namespace sfwk 44 { 45 46 typedef ::cppu::WeakImplHelper1< css::xml::sax::XDocumentHandler > t_DocHandlerImpl; 47 48 class ParcelDescDocHandler : public t_DocHandlerImpl 49 { 50 private: 51 bool m_bIsParsed; 52 ::rtl::OUString m_sLang; 53 sal_Int32 skipIndex; 54 public: 55 ParcelDescDocHandler():m_bIsParsed( false ), skipIndex( 0 ){} 56 ::rtl::OUString getParcelLanguage() { return m_sLang; } 57 bool isParsed() { return m_bIsParsed; } 58 // XDocumentHandler 59 virtual void SAL_CALL startDocument() 60 throw ( css::xml::sax::SAXException, css::uno::RuntimeException ); 61 62 virtual void SAL_CALL endDocument() 63 throw ( css::xml::sax::SAXException, css::uno::RuntimeException ); 64 65 virtual void SAL_CALL startElement( const ::rtl::OUString& aName, 66 const css::uno::Reference< css::xml::sax::XAttributeList > & xAttribs ) 67 throw ( css::xml::sax::SAXException, 68 css::uno::RuntimeException ); 69 70 virtual void SAL_CALL endElement( const ::rtl::OUString & aName ) 71 throw ( css::xml::sax::SAXException, css::uno::RuntimeException ); 72 73 virtual void SAL_CALL characters( const ::rtl::OUString & aChars ) 74 throw ( css::xml::sax::SAXException, css::uno::RuntimeException ); 75 76 virtual void SAL_CALL ignorableWhitespace( const ::rtl::OUString & aWhitespaces ) 77 throw ( css::xml::sax::SAXException, css::uno::RuntimeException ); 78 79 virtual void SAL_CALL processingInstruction( 80 const ::rtl::OUString & aTarget, const ::rtl::OUString & aData ) 81 throw ( css::xml::sax::SAXException, css::uno::RuntimeException ); 82 83 virtual void SAL_CALL setDocumentLocator( 84 const css::uno::Reference< css::xml::sax::XLocator >& xLocator ) 85 throw ( css::xml::sax::SAXException, css::uno::RuntimeException ); 86 }; 87 } 88 } 89 } 90