bump product version to 4.1.6.2
[LibreOffice.git] / include / oox / core / fragmenthandler2.hxx
blob21ad03619fd1d76191c15a064df2a1cff1f095b4
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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 OOX_CORE_FRAGMENTHANDLER2_HXX
21 #define OOX_CORE_FRAGMENTHANDLER2_HXX
23 #include "oox/core/contexthandler2.hxx"
24 #include "oox/core/fragmenthandler.hxx"
25 #include <vector>
26 #include "oox/dllapi.h"
28 namespace oox {
29 namespace core {
31 // ============================================================================
33 class OOX_DLLPUBLIC FragmentHandler2 : public FragmentHandler, public ContextHandler2Helper
35 protected:
36 enum MCE_STATE
38 MCE_UNUSED,
39 MCE_STARTED,
40 MCE_FOUND_CHOICE
42 ::std::vector<MCE_STATE> aMceState;
44 bool prepareMceContext( sal_Int32 nElement, const AttributeList& rAttribs );
47 public:
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() { FragmentHandler::acquire(); }
56 virtual void SAL_CALL release() throw() { 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(
62 sal_Int32 nElement,
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 );
67 virtual void SAL_CALL startFastElement(
68 sal_Int32 nElement,
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 );
73 virtual void SAL_CALL characters( const OUString& rChars )
74 throw( ::com::sun::star::xml::sax::SAXException,
75 ::com::sun::star::uno::RuntimeException );
77 virtual void SAL_CALL endFastElement( sal_Int32 nElement )
78 throw( ::com::sun::star::xml::sax::SAXException,
79 ::com::sun::star::uno::RuntimeException );
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 );
87 virtual void SAL_CALL endDocument()
88 throw( ::com::sun::star::xml::sax::SAXException,
89 ::com::sun::star::uno::RuntimeException );
91 // oox.core.ContextHandler interface --------------------------------------
93 virtual ContextHandlerRef createRecordContext( sal_Int32 nRecId, SequenceInputStream& rStrm );
94 virtual void startRecord( sal_Int32 nRecId, SequenceInputStream& rStrm );
95 virtual void endRecord( sal_Int32 nRecId );
97 // oox.core.ContextHandler2Helper interface -------------------------------
99 virtual ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs );
100 virtual void onStartElement( const AttributeList& rAttribs );
101 virtual void onCharacters( const OUString& rChars );
102 virtual void onEndElement();
104 virtual ContextHandlerRef onCreateRecordContext( sal_Int32 nRecId, SequenceInputStream& rStrm );
105 virtual void onStartRecord( SequenceInputStream& rStrm );
106 virtual void onEndRecord();
108 // oox.core.FragmentHandler2 interface ------------------------------------
110 virtual void initializeImport();
111 virtual void finalizeImport();
114 // ============================================================================
116 } // namespace core
117 } // namespace oox
119 #endif
121 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */