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 _SW_XMLBLOCKIMPORT_HXX
21 : #define _SW_XMLBLOCKIMPORT_HXX
22 :
23 : #include <xmloff/xmlimp.hxx>
24 : #include <tools/string.hxx>
25 :
26 : class SwXMLTextBlocks;
27 : class SwXMLBlockListImport : public SvXMLImport
28 : {
29 : private:
30 : SwXMLTextBlocks &rBlockList;
31 :
32 : protected:
33 : // This method is called after the namespace map has been updated, but
34 : // before a context for the current element has been pushed.
35 : virtual SvXMLImportContext *CreateContext( sal_uInt16 nPrefix,
36 : const ::rtl::OUString& rLocalName,
37 : const ::com::sun::star::uno::Reference<
38 : ::com::sun::star::xml::sax::XAttributeList > & xAttrList );
39 :
40 : public:
41 : SwXMLBlockListImport(
42 : const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > xServiceFactory,
43 : SwXMLTextBlocks &rBlocks );
44 :
45 0 : SwXMLTextBlocks& getBlockList ( void )
46 : {
47 0 : return rBlockList;
48 : }
49 : virtual ~SwXMLBlockListImport ( void )
50 : throw();
51 : };
52 :
53 : class SwXMLTextBlockImport : public SvXMLImport
54 : {
55 : private:
56 : SwXMLTextBlocks &rBlockList;
57 :
58 : protected:
59 : // This method is called after the namespace map has been updated, but
60 : // before a context for the current element has been pushed.
61 : virtual SvXMLImportContext *CreateContext( sal_uInt16 nPrefix,
62 : const ::rtl::OUString& rLocalName,
63 : const ::com::sun::star::uno::Reference<
64 : ::com::sun::star::xml::sax::XAttributeList > & xAttrList );
65 :
66 : public:
67 : sal_Bool bTextOnly;
68 : String &m_rText;
69 : SwXMLTextBlockImport(
70 : const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > xServiceFactory,
71 : SwXMLTextBlocks &rBlocks, String &rNewText, sal_Bool bNewTextOnly );
72 :
73 : SwXMLTextBlocks& getBlockList ( void )
74 : {
75 : return rBlockList;
76 : }
77 : virtual ~SwXMLTextBlockImport ( void )
78 : throw();
79 : virtual void SAL_CALL endDocument(void)
80 : throw( ::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException );
81 : };
82 :
83 : #endif
84 :
85 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|