1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: OOXMLFastDocumentHandler.hxx,v $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #ifndef INCLUDED_OOXML_FAST_DOCUMENT_HANDLER_HXX
32 #define INCLUDED_OOXML_FAST_DOCUMENT_HANDLER_HXX
34 #include <sal/config.h>
35 #include <com/sun/star/uno/XComponentContext.hpp>
36 #include <cppuhelper/implbase1.hxx>
37 #include <com/sun/star/xml/sax/XFastDocumentHandler.hpp>
38 #include <resourcemodel/WW8ResourceModel.hxx>
39 #include <ooxml/OOXMLDocument.hxx>
40 #include "OOXMLParserState.hxx"
42 namespace writerfilter
{
45 using namespace ::com::sun::star
;
47 class OOXMLFastContextHandler
;
49 class OOXMLFastDocumentHandler
:
50 public ::cppu::WeakImplHelper1
<
51 xml::sax::XFastDocumentHandler
>
54 OOXMLFastDocumentHandler
55 (uno::Reference
< uno::XComponentContext
> const & context
);
56 virtual ~OOXMLFastDocumentHandler() {}
58 // ::com::sun::star::xml::sax::XFastDocumentHandler:
59 virtual void SAL_CALL
startDocument()
60 throw (uno::RuntimeException
, xml::sax::SAXException
);
61 virtual void SAL_CALL
endDocument()
62 throw (uno::RuntimeException
, xml::sax::SAXException
);
63 virtual void SAL_CALL setDocumentLocator
64 (const uno::Reference
< xml::sax::XLocator
> & xLocator
)
65 throw (uno::RuntimeException
, xml::sax::SAXException
);
67 // ::com::sun::star::xml::sax::XFastContextHandler:
68 virtual void SAL_CALL startFastElement
70 const uno::Reference
< xml::sax::XFastAttributeList
> & Attribs
)
71 throw (uno::RuntimeException
, xml::sax::SAXException
);
72 virtual void SAL_CALL startUnknownElement
73 (const ::rtl::OUString
& Namespace
,
74 const ::rtl::OUString
& Name
,
75 const uno::Reference
< xml::sax::XFastAttributeList
> & Attribs
)
76 throw (uno::RuntimeException
, xml::sax::SAXException
);
77 virtual void SAL_CALL
endFastElement(::sal_Int32 Element
)
78 throw (uno::RuntimeException
, xml::sax::SAXException
);
79 virtual void SAL_CALL endUnknownElement
80 (const ::rtl::OUString
& Namespace
,
81 const ::rtl::OUString
& Name
)
82 throw (uno::RuntimeException
, xml::sax::SAXException
);
83 virtual uno::Reference
< xml::sax::XFastContextHandler
> SAL_CALL
84 createFastChildContext
86 const uno::Reference
< xml::sax::XFastAttributeList
> & Attribs
)
87 throw (uno::RuntimeException
, xml::sax::SAXException
);
88 virtual uno::Reference
< xml::sax::XFastContextHandler
> SAL_CALL
89 createUnknownChildContext
90 (const ::rtl::OUString
& Namespace
,
91 const ::rtl::OUString
& Name
,
92 const uno::Reference
< xml::sax::XFastAttributeList
> & Attribs
)
93 throw (uno::RuntimeException
, xml::sax::SAXException
);
94 virtual void SAL_CALL
characters(const ::rtl::OUString
& aChars
)
95 throw (uno::RuntimeException
, xml::sax::SAXException
);
97 void setStream(Stream
* pStream
);
98 void setDocument(OOXMLDocument
* pDocument
);
99 void setXNoteId(const ::rtl::OUString
& rXNoteId
);
101 OOXMLParserState::Pointer_t
getParserState() const;
103 void setIsSubstream( bool bSubstream
);
106 OOXMLFastDocumentHandler(OOXMLFastDocumentHandler
&); // not defined
107 void operator =(OOXMLFastDocumentHandler
&); // not defined
109 uno::Reference
< uno::XComponentContext
> m_xContext
;
112 OOXMLDocument
* mpDocument
;
113 ::rtl::OUString msXNoteId
;
114 mutable boost::shared_ptr
<OOXMLFastContextHandler
> mpContextHandler
;
115 boost::shared_ptr
<OOXMLFastContextHandler
> getContextHandler() const;
119 #endif // INCLUDED_OOXML_FAST_DOCUMENT_HANDLER_HXX