update dev300-m58
[ooovba.git] / framework / inc / xml / saxnamespacefilter.hxx
blob1dc04e46fb2220a1707263a7d2304ba21cded469
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: saxnamespacefilter.hxx,v $
10 * $Revision: 1.5 $
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 __FRAMEWORK_SERVICES_SAXNAMESPACEFILTER_HXX_
32 #define __FRAMEWORK_SERVICES_SAXNAMESPACEFILTER_HXX_
34 #include <com/sun/star/xml/sax/XDocumentHandler.hpp>
35 #include <threadhelp/threadhelpbase.hxx>
36 #include <xml/xmlnamespaces.hxx>
37 #include <rtl/ustring.hxx>
38 #include <vcl/menu.hxx>
39 #include <cppuhelper/implbase1.hxx>
41 #include <stack>
43 //_________________________________________________________________________________________________________________
44 // namespace
45 //_________________________________________________________________________________________________________________
47 namespace framework
50 class SaxNamespaceFilter : public ThreadHelpBase, // Struct for right initalization of mutex member! Must be first of baseclasses.
51 public ::cppu::WeakImplHelper1< ::com::sun::star::xml::sax::XDocumentHandler >
53 public:
54 SaxNamespaceFilter( ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XDocumentHandler >& rSax1DocumentHandler );
55 virtual ~SaxNamespaceFilter();
57 // XDocumentHandler
58 virtual void SAL_CALL startDocument(void)
59 throw ( ::com::sun::star::xml::sax::SAXException,
60 ::com::sun::star::uno::RuntimeException );
62 virtual void SAL_CALL endDocument(void)
63 throw( ::com::sun::star::xml::sax::SAXException,
64 ::com::sun::star::uno::RuntimeException );
66 virtual void SAL_CALL startElement(
67 const rtl::OUString& aName,
68 const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList > &xAttribs)
69 throw( ::com::sun::star::xml::sax::SAXException,
70 ::com::sun::star::uno::RuntimeException );
72 virtual void SAL_CALL endElement(const rtl::OUString& aName)
73 throw( ::com::sun::star::xml::sax::SAXException,
74 ::com::sun::star::uno::RuntimeException );
76 virtual void SAL_CALL characters(const rtl::OUString& aChars)
77 throw( ::com::sun::star::xml::sax::SAXException,
78 ::com::sun::star::uno::RuntimeException );
80 virtual void SAL_CALL ignorableWhitespace(const rtl::OUString& aWhitespaces)
81 throw( ::com::sun::star::xml::sax::SAXException,
82 ::com::sun::star::uno::RuntimeException );
84 virtual void SAL_CALL processingInstruction(const rtl::OUString& aTarget,
85 const rtl::OUString& aData)
86 throw( ::com::sun::star::xml::sax::SAXException,
87 ::com::sun::star::uno::RuntimeException );
89 virtual void SAL_CALL setDocumentLocator(
90 const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XLocator > &xLocator)
91 throw( ::com::sun::star::xml::sax::SAXException,
92 ::com::sun::star::uno::RuntimeException );
94 protected:
95 typedef ::std::stack< XMLNamespaces > NamespaceStack;
97 ::rtl::OUString getErrorLineString();
99 ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XLocator > m_xLocator;
100 ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XDocumentHandler> xDocumentHandler;
101 NamespaceStack m_aNamespaceStack;
102 sal_Int32 m_nDepth;
107 #endif // __FRAMEWORK_SERVICES_SAXNAMESPACEFILTER_HXX_