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 
28 #ifndef _XMLOFF_XMLFOOTNOTEIMPORTCONTEXT_HXX_
29 #define _XMLOFF_XMLFOOTNOTEIMPORTCONTEXT_HXX_
30 
31 #include <xmloff/xmlictxt.hxx>
32 #include <com/sun/star/uno/Reference.h>
33 
34 
35 namespace com { namespace sun { namespace star {
36 	namespace text {
37 		class XTextCursor;
38 		class XFootnote;
39 	}
40 	namespace xml { namespace sax {
41 		class XAttributeList;
42 	} }
43 } } }
44 namespace rtl {
45 	class OUString;
46 }
47 class XMLTextImportHelper;
48 
49 /// import footnote elements (<text:footnote>)
50 class XMLFootnoteImportContext : public SvXMLImportContext
51 {
52 	const ::rtl::OUString sPropertyReferenceId;
53 
54 	/// old document cursor
55 	::com::sun::star::uno::Reference<
56 		::com::sun::star::text::XTextCursor> xOldCursor;
57 
58     /// old list item and block (#89891#)
59     bool mbListContextPushed;
60 
61 	/// text import helper; holds current XTextCursor (and XText)
62 	XMLTextImportHelper& rHelper;
63 
64 	/// the footnote
65 	::com::sun::star::uno::Reference<
66 		::com::sun::star::text::XFootnote> xFootnote;
67 
68 public:
69 
70 	TYPEINFO();
71 
72 	XMLFootnoteImportContext(
73 		SvXMLImport& rImport,
74 		XMLTextImportHelper& rHlp,
75 		sal_uInt16 nPrfx,
76 		const ::rtl::OUString& rLocalName );
77 
78 protected:
79 
80 	virtual void StartElement(
81 		const ::com::sun::star::uno::Reference<
82 			::com::sun::star::xml::sax::XAttributeList> & xAttrList);
83 
84 	virtual void Characters(
85 		const ::rtl::OUString& rChars);
86 
87 	virtual void EndElement();
88 
89 	virtual SvXMLImportContext *CreateChildContext(
90 		sal_uInt16 nPrefix,
91 		const ::rtl::OUString& rLocalName,
92 		const ::com::sun::star::uno::Reference<
93 			::com::sun::star::xml::sax::XAttributeList> & xAttrList );
94 
95 };
96 
97 #endif
98