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_WRITERFILTER_SOURCE_OOXML_OOXMLFASTDOCUMENTHANDLER_HXX
21 : #define INCLUDED_WRITERFILTER_SOURCE_OOXML_OOXMLFASTDOCUMENTHANDLER_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 :
35 : class OOXMLFastContextHandler;
36 :
37 : class OOXMLFastDocumentHandler:
38 : public ::cppu::WeakImplHelper1<
39 : css::xml::sax::XFastDocumentHandler>
40 : {
41 : public:
42 : OOXMLFastDocumentHandler(
43 : css::uno::Reference< css::uno::XComponentContext > const & context,
44 : Stream* pStream,
45 : OOXMLDocumentImpl* pDocument,
46 : sal_Int32 nXNoteId );
47 95692 : virtual ~OOXMLFastDocumentHandler() {}
48 :
49 : // ::com::sun::star::xml::sax::XFastDocumentHandler:
50 : virtual void SAL_CALL startDocument()
51 : throw (css::uno::RuntimeException, css::xml::sax::SAXException, std::exception) SAL_OVERRIDE;
52 : virtual void SAL_CALL endDocument()
53 : throw (css::uno::RuntimeException, css::xml::sax::SAXException, std::exception) SAL_OVERRIDE;
54 : virtual void SAL_CALL setDocumentLocator
55 : (const css::uno::Reference< css::xml::sax::XLocator > & xLocator)
56 : throw (css::uno::RuntimeException, css::xml::sax::SAXException, std::exception) SAL_OVERRIDE;
57 :
58 : // ::com::sun::star::xml::sax::XFastContextHandler:
59 : virtual void SAL_CALL startFastElement
60 : (::sal_Int32 Element,
61 : const css::uno::Reference< css::xml::sax::XFastAttributeList > & Attribs)
62 : throw (css::uno::RuntimeException, css::xml::sax::SAXException, std::exception) SAL_OVERRIDE;
63 : virtual void SAL_CALL startUnknownElement
64 : (const OUString & Namespace,
65 : const OUString & Name,
66 : const css::uno::Reference< css::xml::sax::XFastAttributeList > & Attribs)
67 : throw (css::uno::RuntimeException, css::xml::sax::SAXException, std::exception) SAL_OVERRIDE;
68 : virtual void SAL_CALL endFastElement(::sal_Int32 Element)
69 : throw (css::uno::RuntimeException, css::xml::sax::SAXException, std::exception) SAL_OVERRIDE;
70 : virtual void SAL_CALL endUnknownElement
71 : (const OUString & Namespace,
72 : const OUString & Name)
73 : throw (css::uno::RuntimeException, css::xml::sax::SAXException, std::exception) SAL_OVERRIDE;
74 : virtual css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL
75 : createFastChildContext
76 : (::sal_Int32 Element,
77 : const css::uno::Reference< css::xml::sax::XFastAttributeList > & Attribs)
78 : throw (css::uno::RuntimeException, css::xml::sax::SAXException, std::exception) SAL_OVERRIDE;
79 : virtual css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL
80 : createUnknownChildContext
81 : (const OUString & Namespace,
82 : const OUString & Name,
83 : const css::uno::Reference< css::xml::sax::XFastAttributeList > & Attribs)
84 : throw (css::uno::RuntimeException, css::xml::sax::SAXException, std::exception) SAL_OVERRIDE;
85 : virtual void SAL_CALL characters(const OUString & aChars)
86 : throw (css::uno::RuntimeException, css::xml::sax::SAXException, std::exception) SAL_OVERRIDE;
87 :
88 : void setIsSubstream( bool bSubstream );
89 :
90 : private:
91 : OOXMLFastDocumentHandler(OOXMLFastDocumentHandler &); // not defined
92 : void operator =(OOXMLFastDocumentHandler &); // not defined
93 :
94 : css::uno::Reference< css::uno::XComponentContext > m_xContext;
95 :
96 : Stream * mpStream;
97 : #ifdef DEBUG_WRITERFILTER
98 : Stream::Pointer_t mpTmpStream;
99 : #endif
100 : OOXMLDocumentImpl* mpDocument;
101 : sal_Int32 mnXNoteId;
102 : mutable boost::shared_ptr<OOXMLFastContextHandler> mpContextHandler;
103 : boost::shared_ptr<OOXMLFastContextHandler> getContextHandler() const;
104 : };
105 : }}
106 :
107 : #endif // INCLUDED_WRITERFILTER_SOURCE_OOXML_OOXMLFASTDOCUMENTHANDLER_HXX
108 :
109 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|