xref: /aoo42x/main/xmloff/source/draw/ximppage.hxx (revision ecfe53c5)
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 _XIMPPAGE_HXX
25 #define _XIMPPAGE_HXX
26 
27 #include <xmloff/xmlictxt.hxx>
28 #include "sdxmlimp_impl.hxx"
29 #include <xmloff/nmspmap.hxx>
30 #include <com/sun/star/drawing/XShapes.hpp>
31 #include <com/sun/star/office/XAnnotationAccess.hpp>
32 #include <tools/rtti.hxx>
33 #include "ximpshap.hxx"
34 
35 //////////////////////////////////////////////////////////////////////////////
36 // draw:g context (RECURSIVE)
37 
38 class SdXMLGenericPageContext : public SvXMLImportContext
39 {
40 	// the shape group this group is working on
41     ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes > mxShapes;
42     ::com::sun::star::uno::Reference< ::com::sun::star::office::XAnnotationAccess > mxAnnotationAccess;
43 
44 protected:
45 	rtl::OUString				maPageLayoutName;
46 	rtl::OUString				maUseHeaderDeclName;
47 	rtl::OUString				maUseFooterDeclName;
48 	rtl::OUString				maUseDateTimeDeclName;
49 	rtl::OUString				msNavOrder;
50 
SetLocalShapesContext(com::sun::star::uno::Reference<com::sun::star::drawing::XShapes> & rNew)51 	void SetLocalShapesContext(com::sun::star::uno::Reference< com::sun::star::drawing::XShapes >& rNew)
52 		{ mxShapes = rNew; }
53 
54 	/** sets the page style on this page */
55 	void SetStyle( rtl::OUString& rStyleName );
56 
57 	/** sets the presentation layout at this page. It is used for drawing pages and for the handout master */
58 	void SetLayout();
59 
60 	/** deletes all shapes on this drawing page */
61 	void DeleteAllShapes();
62 
GetSdImport() const63 	const SdXMLImport& GetSdImport() const { return (const SdXMLImport&)GetImport(); }
GetSdImport()64 	SdXMLImport& GetSdImport() { return (SdXMLImport&)GetImport(); }
65 
66 	/** sets the properties from a page master style with the given name on this contexts page */
67 	void SetPageMaster( rtl::OUString& rsPageMasterName );
68 
69 	void SetNavigationOrder();
70 
71 public:
72 	TYPEINFO();
73 
74 	SdXMLGenericPageContext( SvXMLImport& rImport, sal_uInt16 nPrfx, const rtl::OUString& rLocalName,
75 		const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList,
76 		com::sun::star::uno::Reference< com::sun::star::drawing::XShapes >& rShapes);
77 	virtual ~SdXMLGenericPageContext();
78 
79 	virtual void StartElement( const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList );
80 	virtual SvXMLImportContext *CreateChildContext(
81 		sal_uInt16 nPrefix, const rtl::OUString& rLocalName,
82 		const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList );
83 	virtual void EndElement();
84 
GetLocalShapesContext() const85 	const com::sun::star::uno::Reference< com::sun::star::drawing::XShapes >& GetLocalShapesContext() const
86 		{ return mxShapes; }
GetLocalShapesContext()87 	com::sun::star::uno::Reference< com::sun::star::drawing::XShapes >& GetLocalShapesContext()
88 		{ return mxShapes; }
89 };
90 
91 
92 #endif	//  _XIMPGROUP_HXX
93