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_XMLFOOTNOTECONFIGURATIONIMPORTCONTEXT_HXX
29 #define _XMLOFF_XMLFOOTNOTECONFIGURATIONIMPORTCONTEXT_HXX
30 
31 #include <xmloff/xmlstyle.hxx>
32 
33 namespace com { namespace sun { namespace star {
34 	namespace uno {	template<class X> class Reference; }
35 	namespace xml { namespace sax { class XAttributeList; } }
36 	namespace beans { class XPropertySet; }
37 } } }
38 namespace rtl {	class OUString; }
39 class SvXMLImport;
40 
41 /// import footnote and endnote configuration elements
42 class XMLFootnoteConfigurationImportContext : public SvXMLStyleContext
43 {
44 	const ::rtl::OUString sPropertyAnchorCharStyleName;
45 	const ::rtl::OUString sPropertyCharStyleName;
46 	const ::rtl::OUString sPropertyNumberingType;
47 	const ::rtl::OUString sPropertyPageStyleName;
48 	const ::rtl::OUString sPropertyParagraphStyleName;
49 	const ::rtl::OUString sPropertyPrefix;
50 	const ::rtl::OUString sPropertyStartAt;
51 	const ::rtl::OUString sPropertySuffix;
52 	const ::rtl::OUString sPropertyPositionEndOfDoc;
53 	const ::rtl::OUString sPropertyFootnoteCounting;
54 	const ::rtl::OUString sPropertyEndNotice;
55 	const ::rtl::OUString sPropertyBeginNotice;
56 
57 	::rtl::OUString sCitationStyle;
58 	::rtl::OUString sAnchorStyle;
59 	::rtl::OUString sDefaultStyle;
60 	::rtl::OUString sPageStyle;
61 	::rtl::OUString sPrefix;
62 	::rtl::OUString sSuffix;
63 	::rtl::OUString sNumFormat;
64 	::rtl::OUString sNumSync;
65 	::rtl::OUString sBeginNotice;
66 	::rtl::OUString sEndNotice;
67 
68 	SvXMLTokenMap* pAttrTokenMap;
69 
70 	sal_Int16 nOffset;
71 	sal_Int16 nNumbering;
72 	sal_Bool bPosition;
73 	sal_Bool bIsEndnote;
74 
75 public:
76 
77 	TYPEINFO();
78 
79 	XMLFootnoteConfigurationImportContext(
80 		SvXMLImport& rImport,
81 		sal_uInt16 nPrfx,
82 		const ::rtl::OUString& rLName,
83 		const ::com::sun::star::uno::Reference<
84 				::com::sun::star::xml::sax::XAttributeList> & xAttrList);
85 
86 	virtual ~XMLFootnoteConfigurationImportContext();
87 
88 	/// parse attributes
89 	virtual void StartElement(
90 		const ::com::sun::star::uno::Reference<
91 			::com::sun::star::xml::sax::XAttributeList> & xAttrList );
92 
93 	/// for footnotes, also parse begin and end notices
94 	virtual SvXMLImportContext *CreateChildContext(
95 		sal_uInt16 nPrefix,
96 		const ::rtl::OUString& rLocalName,
97 		const ::com::sun::star::uno::Reference<
98 			::com::sun::star::xml::sax::XAttributeList> & xAttrList );
99 
100 	/// get token map for attributes
101 	const SvXMLTokenMap& GetFtnConfigAttrTokenMap();
102 
103     /// set configuration at document; calls ProcessSettings
104     // --> OD 2005-01-31 #i40579# - move code from <CreateAndInsertLate(..)>
105     // to <Finish(..)>, because at this time all styles it references have been set.
106     virtual void Finish( sal_Bool bOverwrite);
107     // <--
108 
109 	/// set configuration at document
110 	void ProcessSettings(
111 		const ::com::sun::star::uno::Reference<
112 			::com::sun::star::beans::XPropertySet> & rConfig);
113 
114 	/// for helper class: set begin notice
115 	void SetBeginNotice( ::rtl::OUString sText);
116 
117 	/// for helper class: set end notice
118 	void SetEndNotice( ::rtl::OUString sText);
119 };
120 
121 #endif
122