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