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 RPT_XMLHELPER_HXX 24 #define RPT_XMLHELPER_HXX 25 26 #include <xmloff/xmlprmap.hxx> 27 #include <xmloff/contextid.hxx> 28 #include <xmloff/controlpropertyhdl.hxx> 29 #include <com/sun/star/frame/XModel.hpp> 30 #include <com/sun/star/report/XReportDefinition.hpp> 31 #include <com/sun/star/util/XNumberFormatsSupplier.hpp> 32 33 #include <memory> 34 35 #define CTF_RPT_NUMBERFORMAT (XML_DB_CTF_START + 1) 36 37 #define XML_STYLE_FAMILY_REPORT_ID 700 38 #define XML_STYLE_FAMILY_REPORT_NAME "report-element" 39 #define XML_STYLE_FAMILY_REPORT_PREFIX "rptelem" 40 41 42 class SvXMLImport; 43 class SvXMLExport; 44 class SvXMLStylesContext; 45 class SvXMLTokenMap; 46 namespace rptxml 47 { 48 class OPropertyHandlerFactory : public ::xmloff::OControlPropertyHandlerFactory 49 { 50 OPropertyHandlerFactory(const OPropertyHandlerFactory&); 51 void operator =(const OPropertyHandlerFactory&); 52 protected: 53 mutable ::std::auto_ptr<XMLConstantsPropertyHandler> m_pDisplayHandler; 54 mutable ::std::auto_ptr<XMLPropertyHandler> m_pTextAlignHandler; 55 public: 56 OPropertyHandlerFactory(); 57 virtual ~OPropertyHandlerFactory(); 58 59 virtual const XMLPropertyHandler* GetPropertyHandler(sal_Int32 _nType) const; 60 }; 61 62 class OXMLHelper 63 { 64 public: 65 static UniReference < XMLPropertySetMapper > GetCellStylePropertyMap(bool _bOldFormat = false); 66 67 static const SvXMLEnumMapEntry* GetReportPrintOptions(); 68 static const SvXMLEnumMapEntry* GetForceNewPageOptions(); 69 static const SvXMLEnumMapEntry* GetKeepTogetherOptions(); 70 static const SvXMLEnumMapEntry* GetCommandTypeOptions(); 71 static const SvXMLEnumMapEntry* GetImageScaleOptions(); 72 73 static const XMLPropertyMapEntry* GetTableStyleProps(); 74 static const XMLPropertyMapEntry* GetColumnStyleProps(); 75 76 static const XMLPropertyMapEntry* GetRowStyleProps(); 77 78 static void copyStyleElements(const bool _bOld,const ::rtl::OUString& _sStyleName,const SvXMLStylesContext* _pAutoStyles,const com::sun::star::uno::Reference< com::sun::star::beans::XPropertySet>& _xProp); 79 static com::sun::star::uno::Reference< com::sun::star::beans::XPropertySet> createBorderPropertySet(); 80 81 static SvXMLTokenMap* GetReportElemTokenMap(); 82 static SvXMLTokenMap* GetSubDocumentElemTokenMap(); 83 84 }; 85 // ----------------------------------------------------------------------------- 86 } // rptxml 87 // ----------------------------------------------------------------------------- 88 #endif // RPT_XMLHELPER_HXX 89 90