1 /************************************************************************* 2 * 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 * 5 * Copyright 2000, 2010 Oracle and/or its affiliates. 6 * 7 * OpenOffice.org - a multi-platform office productivity suite 8 * 9 * This file is part of OpenOffice.org. 10 * 11 * OpenOffice.org is free software: you can redistribute it and/or modify 12 * it under the terms of the GNU Lesser General Public License version 3 13 * only, as published by the Free Software Foundation. 14 * 15 * OpenOffice.org is distributed in the hope that it will be useful, 16 * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 * GNU Lesser General Public License version 3 for more details 19 * (a copy is included in the LICENSE file that accompanied this code). 20 * 21 * You should have received a copy of the GNU Lesser General Public License 22 * version 3 along with OpenOffice.org. If not, see 23 * <http://www.openoffice.org/license.html> 24 * for a copy of the LGPLv3 License. 25 * 26 ************************************************************************/ 27 28 #ifndef XMLSCRIPT_XMLBAS_EXPORT_HXX 29 #define XMLSCRIPT_XMLBAS_EXPORT_HXX 30 31 #include <com/sun/star/xml/sax/XDocumentHandler.hpp> 32 #include <com/sun/star/document/XExporter.hpp> 33 #include <com/sun/star/document/XFilter.hpp> 34 #include <com/sun/star/frame/XModel.hpp> 35 #include <com/sun/star/lang/XServiceInfo.hpp> 36 #include <com/sun/star/lang/XInitialization.hpp> 37 #include <com/sun/star/uno/XComponentContext.hpp> 38 #include <cppuhelper/implbase4.hxx> 39 #include <osl/mutex.hxx> 40 41 42 //......................................................................... 43 namespace xmlscript 44 { 45 //......................................................................... 46 47 // ============================================================================= 48 // class XMLBasicExporterBase 49 // ============================================================================= 50 51 typedef ::cppu::WeakImplHelper4< 52 ::com::sun::star::lang::XServiceInfo, 53 ::com::sun::star::lang::XInitialization, 54 ::com::sun::star::document::XExporter, 55 ::com::sun::star::document::XFilter > XMLBasicExporterBase_BASE; 56 57 class XMLBasicExporterBase : public XMLBasicExporterBase_BASE 58 { 59 private: 60 ::osl::Mutex m_aMutex; 61 ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > m_xContext; 62 ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XDocumentHandler > m_xHandler; 63 ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel > m_xModel; 64 sal_Bool m_bOasis; 65 66 public: 67 XMLBasicExporterBase( 68 const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext, sal_Bool bOasis ); 69 virtual ~XMLBasicExporterBase(); 70 71 // XServiceInfo 72 virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName ) 73 throw (::com::sun::star::uno::RuntimeException); 74 75 // XInitialization 76 virtual void SAL_CALL initialize( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aArguments ) 77 throw (::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException); 78 79 // XExporter 80 virtual void SAL_CALL setSourceDocument( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent >& rxDoc ) 81 throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException); 82 83 // XFilter 84 virtual sal_Bool SAL_CALL filter( const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& aDescriptor ) 85 throw (::com::sun::star::uno::RuntimeException); 86 virtual void SAL_CALL cancel() 87 throw (::com::sun::star::uno::RuntimeException); 88 }; 89 90 91 // ============================================================================= 92 // class XMLBasicExporter 93 // ============================================================================= 94 95 class XMLBasicExporter : public XMLBasicExporterBase 96 { 97 public: 98 XMLBasicExporter( 99 const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext ); 100 virtual ~XMLBasicExporter(); 101 102 // XServiceInfo 103 virtual ::rtl::OUString SAL_CALL getImplementationName( ) 104 throw (::com::sun::star::uno::RuntimeException); 105 virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames( ) 106 throw (::com::sun::star::uno::RuntimeException); 107 }; 108 109 110 // ============================================================================= 111 // class XMLOasisBasicExporter 112 // ============================================================================= 113 114 class XMLOasisBasicExporter : public XMLBasicExporterBase 115 { 116 public: 117 XMLOasisBasicExporter( 118 const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext ); 119 virtual ~XMLOasisBasicExporter(); 120 121 // XServiceInfo 122 virtual ::rtl::OUString SAL_CALL getImplementationName( ) 123 throw (::com::sun::star::uno::RuntimeException); 124 virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames( ) 125 throw (::com::sun::star::uno::RuntimeException); 126 }; 127 128 //......................................................................... 129 } // namespace xmlscript 130 //......................................................................... 131 132 #endif // XMLSCRIPT_XMLBAS_EXPORT_HXX 133