1*0a1e2f0eSAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3*0a1e2f0eSAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*0a1e2f0eSAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*0a1e2f0eSAndrew Rist  * distributed with this work for additional information
6*0a1e2f0eSAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*0a1e2f0eSAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*0a1e2f0eSAndrew Rist  * "License"); you may not use this file except in compliance
9*0a1e2f0eSAndrew Rist  * with the License.  You may obtain a copy of the License at
10*0a1e2f0eSAndrew Rist  *
11*0a1e2f0eSAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12*0a1e2f0eSAndrew Rist  *
13*0a1e2f0eSAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*0a1e2f0eSAndrew Rist  * software distributed under the License is distributed on an
15*0a1e2f0eSAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*0a1e2f0eSAndrew Rist  * KIND, either express or implied.  See the License for the
17*0a1e2f0eSAndrew Rist  * specific language governing permissions and limitations
18*0a1e2f0eSAndrew Rist  * under the License.
19*0a1e2f0eSAndrew Rist  *
20*0a1e2f0eSAndrew Rist  *************************************************************/
21*0a1e2f0eSAndrew Rist 
22*0a1e2f0eSAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir #include <cppuhelper/implbase1.hxx>
25cdf0e10cSrcweir 
26cdf0e10cSrcweir #include <com/sun/star/xml/sax/XAttributeList.hpp>
27cdf0e10cSrcweir #include <com/sun/star/xml/sax/SAXException.hpp>
28cdf0e10cSrcweir #include <com/sun/star/xml/sax/XDocumentHandler.hpp>
29cdf0e10cSrcweir #include <com/sun/star/xml/sax/XExtendedDocumentHandler.hpp>
30cdf0e10cSrcweir #include <com/sun/star/xml/sax/XParser.hpp>
31cdf0e10cSrcweir 
32cdf0e10cSrcweir #include <com/sun/star/lang/NoSupportException.hpp>
33cdf0e10cSrcweir #include <com/sun/star/lang/XMultiComponentFactory.hpp>
34cdf0e10cSrcweir namespace css = ::com::sun::star;
35cdf0e10cSrcweir namespace dp_registry
36cdf0e10cSrcweir {
37cdf0e10cSrcweir namespace backend
38cdf0e10cSrcweir {
39cdf0e10cSrcweir namespace sfwk
40cdf0e10cSrcweir {
41cdf0e10cSrcweir 
42cdf0e10cSrcweir typedef ::cppu::WeakImplHelper1< css::xml::sax::XDocumentHandler > t_DocHandlerImpl;
43cdf0e10cSrcweir 
44cdf0e10cSrcweir class ParcelDescDocHandler : public t_DocHandlerImpl
45cdf0e10cSrcweir {
46cdf0e10cSrcweir private:
47cdf0e10cSrcweir     bool m_bIsParsed;
48cdf0e10cSrcweir     ::rtl::OUString m_sLang;
49cdf0e10cSrcweir     sal_Int32 skipIndex;
50cdf0e10cSrcweir public:
ParcelDescDocHandler()51cdf0e10cSrcweir     ParcelDescDocHandler():m_bIsParsed( false ), skipIndex( 0 ){}
getParcelLanguage()52cdf0e10cSrcweir     ::rtl::OUString getParcelLanguage() { return m_sLang; }
isParsed()53cdf0e10cSrcweir     bool isParsed() { return m_bIsParsed; }
54cdf0e10cSrcweir     // XDocumentHandler
55cdf0e10cSrcweir     virtual void SAL_CALL startDocument()
56cdf0e10cSrcweir         throw ( css::xml::sax::SAXException, css::uno::RuntimeException );
57cdf0e10cSrcweir 
58cdf0e10cSrcweir     virtual void SAL_CALL endDocument()
59cdf0e10cSrcweir         throw ( css::xml::sax::SAXException, css::uno::RuntimeException );
60cdf0e10cSrcweir 
61cdf0e10cSrcweir     virtual void SAL_CALL startElement( const ::rtl::OUString& aName,
62cdf0e10cSrcweir         const css::uno::Reference< css::xml::sax::XAttributeList > & xAttribs )
63cdf0e10cSrcweir         throw ( css::xml::sax::SAXException,
64cdf0e10cSrcweir             css::uno::RuntimeException );
65cdf0e10cSrcweir 
66cdf0e10cSrcweir     virtual void SAL_CALL endElement( const ::rtl::OUString & aName )
67cdf0e10cSrcweir         throw ( css::xml::sax::SAXException, css::uno::RuntimeException );
68cdf0e10cSrcweir 
69cdf0e10cSrcweir     virtual void SAL_CALL characters( const ::rtl::OUString & aChars )
70cdf0e10cSrcweir         throw ( css::xml::sax::SAXException, css::uno::RuntimeException );
71cdf0e10cSrcweir 
72cdf0e10cSrcweir     virtual void SAL_CALL ignorableWhitespace( const ::rtl::OUString & aWhitespaces )
73cdf0e10cSrcweir         throw ( css::xml::sax::SAXException, css::uno::RuntimeException );
74cdf0e10cSrcweir 
75cdf0e10cSrcweir     virtual void SAL_CALL processingInstruction(
76cdf0e10cSrcweir         const ::rtl::OUString & aTarget, const ::rtl::OUString & aData )
77cdf0e10cSrcweir         throw ( css::xml::sax::SAXException, css::uno::RuntimeException );
78cdf0e10cSrcweir 
79cdf0e10cSrcweir     virtual void SAL_CALL setDocumentLocator(
80cdf0e10cSrcweir         const css::uno::Reference< css::xml::sax::XLocator >& xLocator )
81cdf0e10cSrcweir         throw ( css::xml::sax::SAXException, css::uno::RuntimeException );
82cdf0e10cSrcweir };
83cdf0e10cSrcweir }
84cdf0e10cSrcweir }
85cdf0e10cSrcweir }
86