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_OOX_CORE_FRAGMENTHANDLER2_HXX
21 #define INCLUDED_OOX_CORE_FRAGMENTHANDLER2_HXX
23 #include <oox/core/contexthandler2.hxx>
24 #include <oox/core/fragmenthandler.hxx>
26 #include <oox/dllapi.h>
33 class OOX_DLLPUBLIC FragmentHandler2
: public FragmentHandler
, public ContextHandler2Helper
42 ::std::vector
<MCE_STATE
> aMceState
;
44 bool prepareMceContext( sal_Int32 nElement
, const AttributeList
& rAttribs
);
48 explicit FragmentHandler2(
49 XmlFilterBase
& rFilter
,
50 const OUString
& rFragmentPath
,
51 bool bEnableTrimSpace
= true );
52 virtual ~FragmentHandler2();
54 // resolve ambiguity from base classes
55 virtual void SAL_CALL
acquire() throw() SAL_OVERRIDE
{ FragmentHandler::acquire(); }
56 virtual void SAL_CALL
release() throw() SAL_OVERRIDE
{ FragmentHandler::release(); }
58 // com.sun.star.xml.sax.XFastContextHandler interface ---------------------
60 virtual ::com::sun::star::uno::Reference
< ::com::sun::star::xml::sax::XFastContextHandler
> SAL_CALL
61 createFastChildContext(
63 const ::com::sun::star::uno::Reference
< ::com::sun::star::xml::sax::XFastAttributeList
>& rxAttribs
)
64 throw( ::com::sun::star::xml::sax::SAXException
,
65 ::com::sun::star::uno::RuntimeException
, std::exception
) SAL_FINAL SAL_OVERRIDE
;
67 virtual void SAL_CALL
startFastElement(
69 const ::com::sun::star::uno::Reference
< ::com::sun::star::xml::sax::XFastAttributeList
>& rxAttribs
)
70 throw( ::com::sun::star::xml::sax::SAXException
,
71 ::com::sun::star::uno::RuntimeException
, std::exception
) SAL_FINAL SAL_OVERRIDE
;
73 virtual void SAL_CALL
characters( const OUString
& rChars
)
74 throw( ::com::sun::star::xml::sax::SAXException
,
75 ::com::sun::star::uno::RuntimeException
, std::exception
) SAL_FINAL SAL_OVERRIDE
;
77 virtual void SAL_CALL
endFastElement( sal_Int32 nElement
)
78 throw( ::com::sun::star::xml::sax::SAXException
,
79 ::com::sun::star::uno::RuntimeException
, std::exception
) SAL_FINAL SAL_OVERRIDE
;
81 // com.sun.star.xml.sax.XFastDocumentHandler interface --------------------
83 virtual void SAL_CALL
startDocument()
84 throw( ::com::sun::star::xml::sax::SAXException
,
85 ::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
87 virtual void SAL_CALL
endDocument()
88 throw( ::com::sun::star::xml::sax::SAXException
,
89 ::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
91 // oox.core.ContextHandler interface --------------------------------------
93 virtual ContextHandlerRef
createRecordContext( sal_Int32 nRecId
, SequenceInputStream
& rStrm
) SAL_OVERRIDE
;
94 virtual void startRecord( sal_Int32 nRecId
, SequenceInputStream
& rStrm
) SAL_OVERRIDE
;
95 virtual void endRecord( sal_Int32 nRecId
) SAL_OVERRIDE
;
97 // oox.core.ContextHandler2Helper interface -------------------------------
99 virtual ContextHandlerRef
onCreateContext( sal_Int32 nElement
, const AttributeList
& rAttribs
) SAL_OVERRIDE
;
100 virtual void onStartElement( const AttributeList
& rAttribs
) SAL_OVERRIDE
;
101 virtual void onCharacters( const OUString
& rChars
) SAL_OVERRIDE
;
102 virtual void onEndElement() SAL_OVERRIDE
;
104 virtual ContextHandlerRef
onCreateRecordContext( sal_Int32 nRecId
, SequenceInputStream
& rStrm
) SAL_OVERRIDE
;
105 virtual void onStartRecord( SequenceInputStream
& rStrm
) SAL_OVERRIDE
;
106 virtual void onEndRecord() SAL_OVERRIDE
;
108 // oox.core.FragmentHandler2 interface ------------------------------------
110 virtual void initializeImport();
111 virtual void finalizeImport();
114 typedef ::rtl::Reference
< FragmentHandler2
> FragmentHandler2Ref
;
123 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */