1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 
24 #ifndef _XMLOFF_XMLFOOTNOTECONFIGURATIONIMPORTCONTEXT_HXX
25 #define _XMLOFF_XMLFOOTNOTECONFIGURATIONIMPORTCONTEXT_HXX
26 
27 #include <xmloff/xmlstyle.hxx>
28 
29 namespace com { namespace sun { namespace star {
30 	namespace uno {	template<class X> class Reference; }
31 	namespace xml { namespace sax { class XAttributeList; } }
32 	namespace beans { class XPropertySet; }
33 } } }
34 namespace rtl {	class OUString; }
35 class SvXMLImport;
36 
37 /// import footnote and endnote configuration elements
38 class XMLFootnoteConfigurationImportContext : public SvXMLStyleContext
39 {
40 	const ::rtl::OUString sPropertyAnchorCharStyleName;
41 	const ::rtl::OUString sPropertyCharStyleName;
42 	const ::rtl::OUString sPropertyNumberingType;
43 	const ::rtl::OUString sPropertyPageStyleName;
44 	const ::rtl::OUString sPropertyParagraphStyleName;
45 	const ::rtl::OUString sPropertyPrefix;
46 	const ::rtl::OUString sPropertyStartAt;
47 	const ::rtl::OUString sPropertySuffix;
48 	const ::rtl::OUString sPropertyPositionEndOfDoc;
49 	const ::rtl::OUString sPropertyFootnoteCounting;
50 	const ::rtl::OUString sPropertyEndNotice;
51 	const ::rtl::OUString sPropertyBeginNotice;
52 
53 	::rtl::OUString sCitationStyle;
54 	::rtl::OUString sAnchorStyle;
55 	::rtl::OUString sDefaultStyle;
56 	::rtl::OUString sPageStyle;
57 	::rtl::OUString sPrefix;
58 	::rtl::OUString sSuffix;
59 	::rtl::OUString sNumFormat;
60 	::rtl::OUString sNumSync;
61 	::rtl::OUString sBeginNotice;
62 	::rtl::OUString sEndNotice;
63 
64 	SvXMLTokenMap* pAttrTokenMap;
65 
66 	sal_Int16 nOffset;
67 	sal_Int16 nNumbering;
68 	sal_Bool bPosition;
69 	sal_Bool bIsEndnote;
70 
71 public:
72 
73 	TYPEINFO();
74 
75 	XMLFootnoteConfigurationImportContext(
76 		SvXMLImport& rImport,
77 		sal_uInt16 nPrfx,
78 		const ::rtl::OUString& rLName,
79 		const ::com::sun::star::uno::Reference<
80 				::com::sun::star::xml::sax::XAttributeList> & xAttrList);
81 
82 	virtual ~XMLFootnoteConfigurationImportContext();
83 
84 	/// parse attributes
85 	virtual void StartElement(
86 		const ::com::sun::star::uno::Reference<
87 			::com::sun::star::xml::sax::XAttributeList> & xAttrList );
88 
89 	/// for footnotes, also parse begin and end notices
90 	virtual SvXMLImportContext *CreateChildContext(
91 		sal_uInt16 nPrefix,
92 		const ::rtl::OUString& rLocalName,
93 		const ::com::sun::star::uno::Reference<
94 			::com::sun::star::xml::sax::XAttributeList> & xAttrList );
95 
96 	/// get token map for attributes
97 	const SvXMLTokenMap& GetFtnConfigAttrTokenMap();
98 
99     /// set configuration at document; calls ProcessSettings
100     // --> OD 2005-01-31 #i40579# - move code from <CreateAndInsertLate(..)>
101     // to <Finish(..)>, because at this time all styles it references have been set.
102     virtual void Finish( sal_Bool bOverwrite);
103     // <--
104 
105 	/// set configuration at document
106 	void ProcessSettings(
107 		const ::com::sun::star::uno::Reference<
108 			::com::sun::star::beans::XPropertySet> & rConfig);
109 
110 	/// for helper class: set begin notice
111 	void SetBeginNotice( ::rtl::OUString sText);
112 
113 	/// for helper class: set end notice
114 	void SetEndNotice( ::rtl::OUString sText);
115 };
116 
117 #endif
118