1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
20 #ifndef INCLUDED_OOXML_FAST_DOCUMENT_HANDLER_HXX
21 #define INCLUDED_OOXML_FAST_DOCUMENT_HANDLER_HXX
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"
31 namespace writerfilter
{
34 using namespace ::com::sun::star
;
36 class OOXMLFastContextHandler
;
38 class OOXMLFastDocumentHandler
:
39 public ::cppu::WeakImplHelper1
<
40 xml::sax::XFastDocumentHandler
>
43 OOXMLFastDocumentHandler
44 (uno::Reference
< uno::XComponentContext
> const & context
);
45 virtual ~OOXMLFastDocumentHandler() {}
47 // ::com::sun::star::xml::sax::XFastDocumentHandler:
48 virtual void SAL_CALL
startDocument()
49 throw (uno::RuntimeException
, xml::sax::SAXException
);
50 virtual void SAL_CALL
endDocument()
51 throw (uno::RuntimeException
, xml::sax::SAXException
);
52 virtual void SAL_CALL setDocumentLocator
53 (const uno::Reference
< xml::sax::XLocator
> & xLocator
)
54 throw (uno::RuntimeException
, xml::sax::SAXException
);
56 // ::com::sun::star::xml::sax::XFastContextHandler:
57 virtual void SAL_CALL startFastElement
59 const uno::Reference
< xml::sax::XFastAttributeList
> & Attribs
)
60 throw (uno::RuntimeException
, xml::sax::SAXException
);
61 virtual void SAL_CALL startUnknownElement
62 (const OUString
& Namespace
,
63 const OUString
& Name
,
64 const uno::Reference
< xml::sax::XFastAttributeList
> & Attribs
)
65 throw (uno::RuntimeException
, xml::sax::SAXException
);
66 virtual void SAL_CALL
endFastElement(::sal_Int32 Element
)
67 throw (uno::RuntimeException
, xml::sax::SAXException
);
68 virtual void SAL_CALL endUnknownElement
69 (const OUString
& Namespace
,
70 const OUString
& Name
)
71 throw (uno::RuntimeException
, xml::sax::SAXException
);
72 virtual uno::Reference
< xml::sax::XFastContextHandler
> SAL_CALL
73 createFastChildContext
75 const uno::Reference
< xml::sax::XFastAttributeList
> & Attribs
)
76 throw (uno::RuntimeException
, xml::sax::SAXException
);
77 virtual uno::Reference
< xml::sax::XFastContextHandler
> SAL_CALL
78 createUnknownChildContext
79 (const OUString
& Namespace
,
80 const OUString
& Name
,
81 const uno::Reference
< xml::sax::XFastAttributeList
> & Attribs
)
82 throw (uno::RuntimeException
, xml::sax::SAXException
);
83 virtual void SAL_CALL
characters(const OUString
& aChars
)
84 throw (uno::RuntimeException
, xml::sax::SAXException
);
86 void setStream(Stream
* pStream
);
87 void setDocument(OOXMLDocument
* pDocument
);
88 void setXNoteId(const sal_Int32 nXNoteId
);
90 void setIsSubstream( bool bSubstream
);
93 OOXMLFastDocumentHandler(OOXMLFastDocumentHandler
&); // not defined
94 void operator =(OOXMLFastDocumentHandler
&); // not defined
96 uno::Reference
< uno::XComponentContext
> m_xContext
;
100 Stream::Pointer_t mpTmpStream
;
102 OOXMLDocument
* mpDocument
;
104 mutable boost::shared_ptr
<OOXMLFastContextHandler
> mpContextHandler
;
105 boost::shared_ptr
<OOXMLFastContextHandler
> getContextHandler() const;
109 #endif // INCLUDED_OOXML_FAST_DOCUMENT_HANDLER_HXX
111 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */