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 #ifndef SC_XMLTABLEHEADERFOOTERCONTEXT_HXX_
24 #define SC_XMLTABLEHEADERFOOTERCONTEXT_HXX_
25 
26 
27 #include <xmloff/xmlictxt.hxx>
28 #include <xmloff/xmlimp.hxx>
29 #include <com/sun/star/sheet/XHeaderFooterContent.hpp>
30 
31 namespace com { namespace sun { namespace star {
32 	namespace text { class XTextCursor; }
33 	namespace beans { class XPropertySet; }
34 } } }
35 
36 class XMLTableHeaderFooterContext: public SvXMLImportContext
37 {
38 	::com::sun::star::uno::Reference <
39 		::com::sun::star::text::XTextCursor > xTextCursor;
40 	::com::sun::star::uno::Reference <
41 		::com::sun::star::text::XTextCursor > xOldTextCursor;
42 	::com::sun::star::uno::Reference <
43 		::com::sun::star::beans::XPropertySet > xPropSet;
44 	::com::sun::star::uno::Reference <
45 		::com::sun::star::sheet::XHeaderFooterContent > xHeaderFooterContent;
46 
47 	const ::rtl::OUString	sOn;
48 	const ::rtl::OUString	sShareContent;
49 	const ::rtl::OUString	sContent;
50 	const ::rtl::OUString	sContentLeft;
51 	const ::rtl::OUString	sEmpty;
52 	rtl::OUString			sCont;
53 
54 	sal_Bool	bDisplay;
55 	sal_Bool	bInsertContent;
56 	sal_Bool 	bLeft;
57 	sal_Bool	bContainsLeft;
58 	sal_Bool	bContainsRight;
59 	sal_Bool	bContainsCenter;
60 
61 public:
62 	TYPEINFO();
63 
64 	XMLTableHeaderFooterContext( SvXMLImport& rImport, sal_uInt16 nPrfx,
65 			const ::rtl::OUString& rLName,
66 		    const ::com::sun::star::uno::Reference<
67 					::com::sun::star::xml::sax::XAttributeList > & xAttrList,
68 			const ::com::sun::star::uno::Reference <
69 		   			::com::sun::star::beans::XPropertySet > & rPageStylePropSet,
70 			   sal_Bool bFooter, sal_Bool bLft );
71 
72 	virtual ~XMLTableHeaderFooterContext();
73 
74 	virtual SvXMLImportContext *CreateChildContext(
75 			sal_uInt16 nPrefix,
76 			const ::rtl::OUString& rLocalName,
77 			const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList > & xAttrList );
78 
79 	virtual void EndElement();
80 };
81 
82 class XMLHeaderFooterRegionContext: public SvXMLImportContext
83 {
84 private:
85 	::com::sun::star::uno::Reference <
86 		::com::sun::star::text::XTextCursor >& xTextCursor;
87 	::com::sun::star::uno::Reference <
88 		::com::sun::star::text::XTextCursor > xOldTextCursor;
89 
90 public:
91 	TYPEINFO();
92 
93 	XMLHeaderFooterRegionContext( SvXMLImport& rImport, sal_uInt16 nPrfx,
94 			const ::rtl::OUString& rLName,
95 		    const ::com::sun::star::uno::Reference<
96 					::com::sun::star::xml::sax::XAttributeList > & xAttrList,
97 			com::sun::star::uno::Reference< com::sun::star::text::XTextCursor >& xCursor );
98 
99 	virtual ~XMLHeaderFooterRegionContext();
100 
101 	virtual SvXMLImportContext *CreateChildContext(
102 			sal_uInt16 nPrefix,
103 			const ::rtl::OUString& rLocalName,
104 			const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList > & xAttrList );
105 
106 	virtual void EndElement();
107 };
108 
109 
110 #endif
111