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 _SW_XMLBLOCKIMPORT_HXX 24 #define _SW_XMLBLOCKIMPORT_HXX 25 26 #include <xmloff/xmlimp.hxx> 27 28 class SwXMLTextBlocks; 29 class SwXMLBlockListImport : public SvXMLImport 30 { 31 private: 32 SwXMLTextBlocks &rBlockList; 33 protected: 34 35 // This method is called after the namespace map has been updated, but 36 // before a context for the current element has been pushed. 37 virtual SvXMLImportContext *CreateContext( sal_uInt16 nPrefix, 38 const ::rtl::OUString& rLocalName, 39 const ::com::sun::star::uno::Reference< 40 ::com::sun::star::xml::sax::XAttributeList > & xAttrList ); 41 public: 42 // #110680# 43 SwXMLBlockListImport( 44 const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > xServiceFactory, 45 SwXMLTextBlocks &rBlocks ); 46 getBlockList(void)47 SwXMLTextBlocks& getBlockList ( void ) 48 { 49 return rBlockList; 50 } 51 virtual ~SwXMLBlockListImport ( void ) 52 throw(); 53 }; 54 55 class SwXMLTextBlockImport : public SvXMLImport 56 { 57 private: 58 SwXMLTextBlocks &rBlockList; 59 protected: 60 61 // This method is called after the namespace map has been updated, but 62 // before a context for the current element has been pushed. 63 virtual SvXMLImportContext *CreateContext( sal_uInt16 nPrefix, 64 const ::rtl::OUString& rLocalName, 65 const ::com::sun::star::uno::Reference< 66 ::com::sun::star::xml::sax::XAttributeList > & xAttrList ); 67 public: 68 sal_Bool bTextOnly; 69 String &m_rText; 70 71 // #110680# 72 SwXMLTextBlockImport( 73 const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > xServiceFactory, 74 SwXMLTextBlocks &rBlocks, String &rNewText, sal_Bool bNewTextOnly ); 75 getBlockList(void)76 SwXMLTextBlocks& getBlockList ( void ) 77 { 78 return rBlockList; 79 } 80 virtual ~SwXMLTextBlockImport ( void ) 81 throw(); 82 virtual void SAL_CALL endDocument(void) 83 throw( ::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException ); 84 }; 85 #endif 86