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 _XMLSCRIPT_XMLLIB_IMEXP_HXX_ 24 #define _XMLSCRIPT_XMLLIB_IMEXP_HXX_ 25 26 #include <com/sun/star/xml/sax/XExtendedDocumentHandler.hpp> 27 #include <com/sun/star/uno/Sequence.hxx> 28 29 #include "xmlscript/xmlns.h" 30 31 32 namespace xmlscript 33 { 34 35 //============================================================================== 36 // Library container export 37 // HACK C++ struct to transport info. Later the container 38 // itself should do the export/import and use exportet XML 39 // functionality from xmlscript 40 struct LibDescriptor 41 { 42 ::rtl::OUString aName; 43 ::rtl::OUString aStorageURL; 44 sal_Bool bLink; 45 sal_Bool bReadOnly; 46 sal_Bool bPasswordProtected; 47 ::com::sun::star::uno::Sequence< ::rtl::OUString > aElementNames; 48 sal_Bool bPreload; 49 }; 50 51 struct LibDescriptorArray 52 { 53 LibDescriptor* mpLibs; 54 sal_Int32 mnLibCount; 55 LibDescriptorArrayxmlscript::LibDescriptorArray56 LibDescriptorArray( void ) { mpLibs = NULL; mnLibCount = 0; } 57 LibDescriptorArray( sal_Int32 nLibCount ); 58 59 ~LibDescriptorArray(); 60 61 }; 62 63 void 64 SAL_CALL exportLibraryContainer( 65 ::com::sun::star::uno::Reference< 66 ::com::sun::star::xml::sax::XExtendedDocumentHandler > const & xOut, 67 const LibDescriptorArray* pLibArray ) 68 SAL_THROW( (::com::sun::star::uno::Exception) ); 69 70 ::com::sun::star::uno::Reference< 71 ::com::sun::star::xml::sax::XDocumentHandler > 72 SAL_CALL importLibraryContainer( LibDescriptorArray* pLibArray ) 73 SAL_THROW( (::com::sun::star::uno::Exception) ); 74 75 76 void 77 SAL_CALL exportLibrary( 78 ::com::sun::star::uno::Reference< 79 ::com::sun::star::xml::sax::XExtendedDocumentHandler > const & xOut, 80 const LibDescriptor& rLib ) 81 SAL_THROW( (::com::sun::star::uno::Exception) ); 82 83 ::com::sun::star::uno::Reference< 84 ::com::sun::star::xml::sax::XDocumentHandler > 85 SAL_CALL importLibrary( LibDescriptor& rLib ) 86 SAL_THROW( (::com::sun::star::uno::Exception) ); 87 88 } 89 90 #endif 91