Line data Source code
1 : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : /*
3 : * This file is part of the LibreOffice project.
4 : *
5 : * This Source Code Form is subject to the terms of the Mozilla Public
6 : * License, v. 2.0. If a copy of the MPL was not distributed with this
7 : * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 : *
9 : * This file incorporates work covered by the following license notice:
10 : *
11 : * Licensed to the Apache Software Foundation (ASF) under one or more
12 : * contributor license agreements. See the NOTICE file distributed
13 : * with this work for additional information regarding copyright
14 : * ownership. The ASF licenses this file to you under the Apache
15 : * License, Version 2.0 (the "License"); you may not use this file
16 : * except in compliance with the License. You may obtain a copy of
17 : * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 : */
19 :
20 : #ifndef INCLUDED_OOXML_FAST_DOCUMENT_HANDLER_HXX
21 : #define INCLUDED_OOXML_FAST_DOCUMENT_HANDLER_HXX
22 :
23 : #include <sal/config.h>
24 : #include <com/sun/star/uno/XComponentContext.hpp>
25 : #include <cppuhelper/implbase1.hxx>
26 : #include <com/sun/star/xml/sax/XFastDocumentHandler.hpp>
27 : #include <resourcemodel/WW8ResourceModel.hxx>
28 : #include <ooxml/OOXMLDocument.hxx>
29 : #include "OOXMLParserState.hxx"
30 :
31 : namespace writerfilter {
32 : namespace ooxml
33 : {
34 : using namespace ::com::sun::star;
35 :
36 : class OOXMLFastContextHandler;
37 :
38 : class OOXMLFastDocumentHandler:
39 : public ::cppu::WeakImplHelper1<
40 : xml::sax::XFastDocumentHandler>
41 : {
42 : public:
43 : OOXMLFastDocumentHandler(
44 : uno::Reference< uno::XComponentContext > const & context,
45 : Stream* pStream,
46 : OOXMLDocument* pDocument,
47 : sal_Int32 nXNoteId );
48 2928 : virtual ~OOXMLFastDocumentHandler() {}
49 :
50 : // ::com::sun::star::xml::sax::XFastDocumentHandler:
51 : virtual void SAL_CALL startDocument()
52 : throw (uno::RuntimeException, xml::sax::SAXException);
53 : virtual void SAL_CALL endDocument()
54 : throw (uno::RuntimeException, xml::sax::SAXException);
55 : virtual void SAL_CALL setDocumentLocator
56 : (const uno::Reference< xml::sax::XLocator > & xLocator)
57 : throw (uno::RuntimeException, xml::sax::SAXException);
58 :
59 : // ::com::sun::star::xml::sax::XFastContextHandler:
60 : virtual void SAL_CALL startFastElement
61 : (::sal_Int32 Element,
62 : const uno::Reference< xml::sax::XFastAttributeList > & Attribs)
63 : throw (uno::RuntimeException, xml::sax::SAXException);
64 : virtual void SAL_CALL startUnknownElement
65 : (const OUString & Namespace,
66 : const OUString & Name,
67 : const uno::Reference< xml::sax::XFastAttributeList > & Attribs)
68 : throw (uno::RuntimeException, xml::sax::SAXException);
69 : virtual void SAL_CALL endFastElement(::sal_Int32 Element)
70 : throw (uno::RuntimeException, xml::sax::SAXException);
71 : virtual void SAL_CALL endUnknownElement
72 : (const OUString & Namespace,
73 : const OUString & Name)
74 : throw (uno::RuntimeException, xml::sax::SAXException);
75 : virtual uno::Reference< xml::sax::XFastContextHandler > SAL_CALL
76 : createFastChildContext
77 : (::sal_Int32 Element,
78 : const uno::Reference< xml::sax::XFastAttributeList > & Attribs)
79 : throw (uno::RuntimeException, xml::sax::SAXException);
80 : virtual uno::Reference< xml::sax::XFastContextHandler > SAL_CALL
81 : createUnknownChildContext
82 : (const OUString & Namespace,
83 : const OUString & Name,
84 : const uno::Reference< xml::sax::XFastAttributeList > & Attribs)
85 : throw (uno::RuntimeException, xml::sax::SAXException);
86 : virtual void SAL_CALL characters(const OUString & aChars)
87 : throw (uno::RuntimeException, xml::sax::SAXException);
88 :
89 : void setIsSubstream( bool bSubstream );
90 :
91 : private:
92 : OOXMLFastDocumentHandler(OOXMLFastDocumentHandler &); // not defined
93 : void operator =(OOXMLFastDocumentHandler &); // not defined
94 :
95 : uno::Reference< uno::XComponentContext > m_xContext;
96 :
97 : Stream * mpStream;
98 : #ifdef DEBUG_ELEMENT
99 : Stream::Pointer_t mpTmpStream;
100 : #endif
101 : OOXMLDocument * mpDocument;
102 : sal_Int32 mnXNoteId;
103 : mutable boost::shared_ptr<OOXMLFastContextHandler> mpContextHandler;
104 : boost::shared_ptr<OOXMLFastContextHandler> getContextHandler() const;
105 : };
106 : }}
107 :
108 : #endif // INCLUDED_OOXML_FAST_DOCUMENT_HANDLER_HXX
109 :
110 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|