Line data Source code
1 : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : /*
3 : * This file is part of the LibreOffice project.
4 : *
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/.
8 : *
9 : * This file incorporates work covered by the following license notice:
10 : *
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 .
18 : */
19 :
20 : #ifndef INCLUDED_SW_SOURCE_CORE_INC_SWXMLBLOCKIMPORT_HXX
21 : #define INCLUDED_SW_SOURCE_CORE_INC_SWXMLBLOCKIMPORT_HXX
22 :
23 : #include <xmloff/xmlimp.hxx>
24 :
25 : class SwXMLTextBlocks;
26 : class SwXMLBlockListImport : public SvXMLImport
27 : {
28 : private:
29 : SwXMLTextBlocks &rBlockList;
30 :
31 : protected:
32 : // This method is called after the namespace map has been updated, but
33 : // before a context for the current element has been pushed.
34 : virtual SvXMLImportContext *CreateContext( sal_uInt16 nPrefix,
35 : const OUString& rLocalName,
36 : const ::com::sun::star::uno::Reference<
37 : ::com::sun::star::xml::sax::XAttributeList > & xAttrList ) SAL_OVERRIDE;
38 :
39 : public:
40 : SwXMLBlockListImport(
41 : const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > xContext,
42 : SwXMLTextBlocks &rBlocks );
43 :
44 182 : SwXMLTextBlocks& getBlockList ( void )
45 : {
46 182 : return rBlockList;
47 : }
48 : virtual ~SwXMLBlockListImport ( void )
49 : throw();
50 : };
51 :
52 : class SwXMLTextBlockImport : public SvXMLImport
53 : {
54 : private:
55 : SwXMLTextBlocks &rBlockList;
56 :
57 : protected:
58 : // This method is called after the namespace map has been updated, but
59 : // before a context for the current element has been pushed.
60 : virtual SvXMLImportContext *CreateContext( sal_uInt16 nPrefix,
61 : const OUString& rLocalName,
62 : const ::com::sun::star::uno::Reference<
63 : ::com::sun::star::xml::sax::XAttributeList > & xAttrList ) SAL_OVERRIDE;
64 :
65 : public:
66 : bool bTextOnly;
67 : OUString &m_rText;
68 : SwXMLTextBlockImport(
69 : const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > xContext,
70 : SwXMLTextBlocks &rBlocks, OUString &rNewText, bool bNewTextOnly );
71 :
72 : SwXMLTextBlocks& getBlockList ( void )
73 : {
74 : return rBlockList;
75 : }
76 : virtual ~SwXMLTextBlockImport ( void )
77 : throw();
78 : virtual void SAL_CALL endDocument(void)
79 : throw( ::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
80 : };
81 :
82 : #endif
83 :
84 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|