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  // MARKER(update_precomp.py): autogen include statement, do not remove
23 //This file is about the conversion of the UOF v2.0 and ODF document format
24 #ifndef FILTER_SOURCE_XSLTFILTER_UOF2MERGE_HXX
25 #define FILTER_SOURCE_XSLTFILTER_UOF2MERGE_HXX
26 
27 #include "uof2storage.hxx"
28 
29 namespace com { namespace sun { namespace star {
30 	namespace xml {
31 		namespace sax {
32 			class XParser;
33 			class XExtendedDocumentHandler;
34 		}
35 	}
36 }}}
37 
38 namespace rtl{
39 	class OUStringBuffer;
40 }
41 
42 namespace XSLT{
43 
44 class UOF2Merge
45 {
46 public:
47 	UOF2Merge(UOF2Storage& rStorage, const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& rxFactory);
48 	~UOF2Merge();
49 
50 	bool merge();
51 
52 	::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream > getMergedInStream() const;
53 
54 	::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XExtendedDocumentHandler > getSaxWriter();
55 
56 	void addNamespace( const ::rtl::OUString& rName, const ::rtl::OUString& rURL );
57 	bool isInsertedNamespace( const ::rtl::OUString& rName ) const;
58 	bool getBase64Codec( ::rtl::OUStringBuffer& rBuffer, const ::rtl::OUString& rObjPath);
59 private:
60 	UOF2Storage& m_rUOF2Storage;
61 	::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > m_xServiceFactory;
62 	::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream > m_xPipeInStream;
63 	::com::sun::star::uno::Reference< ::com::sun::star::io::XOutputStream > m_xPipeOutStream;
64 	::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XParser > m_xSaxParser;
65 	::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XExtendedDocumentHandler > m_xExtDocHdl;
66 	::std::map< ::rtl::OUString, ::rtl::OUString > m_aNamespaceMap;
67 
68 	void init();
69 
70 	void startUOFRootXML( const ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >& xUOFXMLInStream );
71 	void endUOFRootXML();
72 };
73 
74 }
75 
76 #endif
77