xref: /trunk/main/xmloff/inc/xmloff/XMLPageExport.hxx (revision cdf0e10c)
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_XMLPAGEEXPORT_HXX
29 #define _XMLOFF_XMLPAGEEXPORT_HXX
30 
31 #include "sal/config.h"
32 #include "xmloff/dllapi.h"
33 #include "sal/types.h"
34 #include <rtl/ustring.hxx>
35 #ifndef __SGI_STL_VECTOR
36 #include <vector>
37 #endif
38 #include <xmloff/attrlist.hxx>
39 #include <xmloff/uniref.hxx>
40 #include <com/sun/star/container/XIndexAccess.hpp>
41 
42 namespace com { namespace sun { namespace star {
43 	namespace style { class XStyle; }
44 	namespace container { class XIndexReplace; class XNameAccess;}
45 	namespace beans { class XPropertySet; }
46 } } }
47 
48 class SvXMLExport;
49 class XMLPropertyHandlerFactory;
50 class XMLPropertySetMapper;
51 class SvXMLExportPropertyMapper;
52 
53 //______________________________________________________________________________
54 
55 struct XMLPageExportNameEntry
56 {
57 	::rtl::OUString			sPageMasterName;
58 	::rtl::OUString			sStyleName;
59 };
60 
61 //______________________________________________________________________________
62 
63 class XMLOFF_DLLPUBLIC XMLPageExport : public UniRefBase
64 {
65 	SvXMLExport& rExport;
66 
67 	const ::rtl::OUString sIsPhysical;
68 	const ::rtl::OUString sFollowStyle;
69 
70 	::com::sun::star::uno::Reference<
71 		::com::sun::star::container::XNameAccess > xPageStyles;
72 
73 	::std::vector< XMLPageExportNameEntry > aNameVector;
74 	SAL_DLLPRIVATE sal_Bool findPageMasterName( const ::rtl::OUString& rStyleName, ::rtl::OUString& rPMName ) const;
75 
76 	UniReference < XMLPropertyHandlerFactory > xPageMasterPropHdlFactory;
77 	UniReference < XMLPropertySetMapper > xPageMasterPropSetMapper;
78 	UniReference < SvXMLExportPropertyMapper > xPageMasterExportPropMapper;
79 
80 protected:
81 
82 	SvXMLExport& GetExport() { return rExport; }
83 
84 	virtual void collectPageMasterAutoStyle(
85 				const ::com::sun::star::uno::Reference <
86 					::com::sun::star::beans::XPropertySet > & rPropSet,
87 				::rtl::OUString& rPageMasterName );
88 
89 	virtual void exportMasterPageContent(
90 				const ::com::sun::star::uno::Reference <
91 					::com::sun::star::beans::XPropertySet > & rPropSet,
92 				 sal_Bool bAutoStyles );
93 
94 	sal_Bool exportStyle(
95 				const ::com::sun::star::uno::Reference<
96 					::com::sun::star::style::XStyle >& rStyle,
97 				sal_Bool bAutoStyles );
98 
99 	void exportStyles( sal_Bool bUsed, sal_Bool bAutoStyles );
100 
101 public:
102 	XMLPageExport( SvXMLExport& rExp );
103 	~XMLPageExport();
104 
105 	void	collectAutoStyles( sal_Bool bUsed )		{ exportStyles( bUsed, sal_True ); }
106 	void	exportAutoStyles();
107 	void	exportMasterStyles( sal_Bool bUsed )	{ exportStyles( bUsed, sal_False ); }
108 
109 	//text grid enhancement for better CJK support
110 	void exportDefaultStyle();
111 };
112 
113 #endif	//  _XMLOFF_XMLTEXTMASTERPAGEEXPORT_HXX
114 
115