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