xref: /trunk/main/sw/source/core/inc/SwXMLBlockImport.hxx (revision cdf0e10c4e3984b49a9502b011690b615761d4a3)
1 /*************************************************************************
2  *
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
5  * Copyright 2000, 2010 Oracle and/or its affiliates.
6  *
7  * OpenOffice.org - a multi-platform office productivity suite
8  *
9  * This file is part of OpenOffice.org.
10  *
11  * OpenOffice.org is free software: you can redistribute it and/or modify
12  * it under the terms of the GNU Lesser General Public License version 3
13  * only, as published by the Free Software Foundation.
14  *
15  * OpenOffice.org is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU Lesser General Public License version 3 for more details
19  * (a copy is included in the LICENSE file that accompanied this code).
20  *
21  * You should have received a copy of the GNU Lesser General Public License
22  * version 3 along with OpenOffice.org.  If not, see
23  * <http://www.openoffice.org/license.html>
24  * for a copy of the LGPLv3 License.
25  *
26  ************************************************************************/
27 #ifndef _SW_XMLBLOCKIMPORT_HXX
28 #define _SW_XMLBLOCKIMPORT_HXX
29 
30 #include <xmloff/xmlimp.hxx>
31 
32 class SwXMLTextBlocks;
33 class SwXMLBlockListImport : public SvXMLImport
34 {
35 private:
36     SwXMLTextBlocks &rBlockList;
37 protected:
38 
39     // This method is called after the namespace map has been updated, but
40     // before a context for the current element has been pushed.
41     virtual SvXMLImportContext *CreateContext( sal_uInt16 nPrefix,
42                   const ::rtl::OUString& rLocalName,
43                   const ::com::sun::star::uno::Reference<
44                     ::com::sun::star::xml::sax::XAttributeList > & xAttrList );
45 public:
46     // #110680#
47     SwXMLBlockListImport(
48         const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > xServiceFactory,
49         SwXMLTextBlocks &rBlocks );
50 
51     SwXMLTextBlocks& getBlockList ( void )
52     {
53         return rBlockList;
54     }
55     virtual ~SwXMLBlockListImport ( void )
56         throw();
57 };
58 
59 class SwXMLTextBlockImport : public SvXMLImport
60 {
61 private:
62     SwXMLTextBlocks &rBlockList;
63 protected:
64 
65     // This method is called after the namespace map has been updated, but
66     // before a context for the current element has been pushed.
67     virtual SvXMLImportContext *CreateContext( sal_uInt16 nPrefix,
68                   const ::rtl::OUString& rLocalName,
69                   const ::com::sun::star::uno::Reference<
70                     ::com::sun::star::xml::sax::XAttributeList > & xAttrList );
71 public:
72     sal_Bool bTextOnly;
73     String &m_rText;
74 
75     // #110680#
76     SwXMLTextBlockImport(
77         const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > xServiceFactory,
78         SwXMLTextBlocks &rBlocks, String &rNewText, sal_Bool bNewTextOnly );
79 
80     SwXMLTextBlocks& getBlockList ( void )
81     {
82         return rBlockList;
83     }
84     virtual ~SwXMLTextBlockImport ( void )
85         throw();
86     virtual void SAL_CALL endDocument(void)
87         throw( ::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException );
88 };
89 #endif
90