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