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 <com/sun/star/uno/Reference.hxx>
24 #include <oox/core/contexthandler.hxx>
25 #include <oox/core/contexthandler2.hxx>
26 #include <oox/core/fragmenthandler.hxx>
27 #include <oox/dllapi.h>
28 #include <rtl/ref.hxx>
29 #include <rtl/ustring.hxx>
30 #include <sal/types.h>
36 class OOX_DLLPUBLIC FragmentHandler2
: public FragmentHandler
, public ContextHandler2Helper
39 explicit FragmentHandler2(
40 XmlFilterBase
& rFilter
,
41 const OUString
& rFragmentPath
,
42 bool bEnableTrimSpace
= true );
43 virtual ~FragmentHandler2() override
;
45 FragmentHandler2(FragmentHandler2
const &) = default;
46 FragmentHandler2(FragmentHandler2
&&) = default;
47 FragmentHandler2
& operator =(FragmentHandler2
const &) = delete; // due to FragmentHandler
48 FragmentHandler2
& operator =(FragmentHandler2
&&) = delete; // due to FragmentHandler
50 // resolve ambiguity from base classes
51 virtual void SAL_CALL
acquire() noexcept override
{ FragmentHandler::acquire(); }
52 virtual void SAL_CALL
release() noexcept override
{ FragmentHandler::release(); }
54 // com.sun.star.xml.sax.XFastContextHandler interface ---------------------
56 virtual css::uno::Reference
< css::xml::sax::XFastContextHandler
> SAL_CALL
57 createFastChildContext(
59 const css::uno::Reference
< css::xml::sax::XFastAttributeList
>& rxAttribs
) final override
;
61 virtual void SAL_CALL
startFastElement(
63 const css::uno::Reference
< css::xml::sax::XFastAttributeList
>& rxAttribs
) final override
;
65 virtual void SAL_CALL
characters( const OUString
& rChars
) final override
;
67 virtual void SAL_CALL
endFastElement( sal_Int32 nElement
) final override
;
69 // com.sun.star.xml.sax.XFastDocumentHandler interface --------------------
71 virtual void SAL_CALL
startDocument() override
;
73 virtual void SAL_CALL
endDocument() override
;
75 // oox.core.ContextHandler interface --------------------------------------
77 virtual ContextHandlerRef
createRecordContext( sal_Int32 nRecId
, SequenceInputStream
& rStrm
) override
;
78 virtual void startRecord( sal_Int32 nRecId
, SequenceInputStream
& rStrm
) override
;
79 virtual void endRecord( sal_Int32 nRecId
) override
;
81 // oox.core.ContextHandler2Helper interface -------------------------------
83 virtual ContextHandlerRef
onCreateContext( sal_Int32 nElement
, const AttributeList
& rAttribs
) override
;
84 virtual void onStartElement( const AttributeList
& rAttribs
) override
;
85 virtual void onCharacters( const OUString
& rChars
) override
;
86 virtual void onEndElement() override
;
88 virtual ContextHandlerRef
onCreateRecordContext( sal_Int32 nRecId
, SequenceInputStream
& rStrm
) override
;
89 virtual void onStartRecord( SequenceInputStream
& rStrm
) override
;
90 virtual void onEndRecord() override
;
92 // oox.core.FragmentHandler2 interface ------------------------------------
94 virtual void initializeImport();
95 virtual void finalizeImport();
98 typedef ::rtl::Reference
< FragmentHandler2
> FragmentHandler2Ref
;
101 } // namespace oox::core
105 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */