1*05236b1aSAndrew Rist /************************************************************** 2cdf0e10cSrcweir * 3*05236b1aSAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one 4*05236b1aSAndrew Rist * or more contributor license agreements. See the NOTICE file 5*05236b1aSAndrew Rist * distributed with this work for additional information 6*05236b1aSAndrew Rist * regarding copyright ownership. The ASF licenses this file 7*05236b1aSAndrew Rist * to you under the Apache License, Version 2.0 (the 8*05236b1aSAndrew Rist * "License"); you may not use this file except in compliance 9*05236b1aSAndrew Rist * with the License. You may obtain a copy of the License at 10*05236b1aSAndrew Rist * 11*05236b1aSAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0 12*05236b1aSAndrew Rist * 13*05236b1aSAndrew Rist * Unless required by applicable law or agreed to in writing, 14*05236b1aSAndrew Rist * software distributed under the License is distributed on an 15*05236b1aSAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16*05236b1aSAndrew Rist * KIND, either express or implied. See the License for the 17*05236b1aSAndrew Rist * specific language governing permissions and limitations 18*05236b1aSAndrew Rist * under the License. 19*05236b1aSAndrew Rist * 20*05236b1aSAndrew Rist *************************************************************/ 21*05236b1aSAndrew Rist 22*05236b1aSAndrew Rist 23cdf0e10cSrcweir 24cdf0e10cSrcweir #ifndef XMLSCRIPT_XMLBAS_EXPORT_HXX 25cdf0e10cSrcweir #define XMLSCRIPT_XMLBAS_EXPORT_HXX 26cdf0e10cSrcweir 27cdf0e10cSrcweir #include <com/sun/star/xml/sax/XDocumentHandler.hpp> 28cdf0e10cSrcweir #include <com/sun/star/document/XExporter.hpp> 29cdf0e10cSrcweir #include <com/sun/star/document/XFilter.hpp> 30cdf0e10cSrcweir #include <com/sun/star/frame/XModel.hpp> 31cdf0e10cSrcweir #include <com/sun/star/lang/XServiceInfo.hpp> 32cdf0e10cSrcweir #include <com/sun/star/lang/XInitialization.hpp> 33cdf0e10cSrcweir #include <com/sun/star/uno/XComponentContext.hpp> 34cdf0e10cSrcweir #include <cppuhelper/implbase4.hxx> 35cdf0e10cSrcweir #include <osl/mutex.hxx> 36cdf0e10cSrcweir 37cdf0e10cSrcweir 38cdf0e10cSrcweir //......................................................................... 39cdf0e10cSrcweir namespace xmlscript 40cdf0e10cSrcweir { 41cdf0e10cSrcweir //......................................................................... 42cdf0e10cSrcweir 43cdf0e10cSrcweir // ============================================================================= 44cdf0e10cSrcweir // class XMLBasicExporterBase 45cdf0e10cSrcweir // ============================================================================= 46cdf0e10cSrcweir 47cdf0e10cSrcweir typedef ::cppu::WeakImplHelper4< 48cdf0e10cSrcweir ::com::sun::star::lang::XServiceInfo, 49cdf0e10cSrcweir ::com::sun::star::lang::XInitialization, 50cdf0e10cSrcweir ::com::sun::star::document::XExporter, 51cdf0e10cSrcweir ::com::sun::star::document::XFilter > XMLBasicExporterBase_BASE; 52cdf0e10cSrcweir 53cdf0e10cSrcweir class XMLBasicExporterBase : public XMLBasicExporterBase_BASE 54cdf0e10cSrcweir { 55cdf0e10cSrcweir private: 56cdf0e10cSrcweir ::osl::Mutex m_aMutex; 57cdf0e10cSrcweir ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > m_xContext; 58cdf0e10cSrcweir ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XDocumentHandler > m_xHandler; 59cdf0e10cSrcweir ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel > m_xModel; 60cdf0e10cSrcweir sal_Bool m_bOasis; 61cdf0e10cSrcweir 62cdf0e10cSrcweir public: 63cdf0e10cSrcweir XMLBasicExporterBase( 64cdf0e10cSrcweir const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext, sal_Bool bOasis ); 65cdf0e10cSrcweir virtual ~XMLBasicExporterBase(); 66cdf0e10cSrcweir 67cdf0e10cSrcweir // XServiceInfo 68cdf0e10cSrcweir virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName ) 69cdf0e10cSrcweir throw (::com::sun::star::uno::RuntimeException); 70cdf0e10cSrcweir 71cdf0e10cSrcweir // XInitialization 72cdf0e10cSrcweir virtual void SAL_CALL initialize( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aArguments ) 73cdf0e10cSrcweir throw (::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException); 74cdf0e10cSrcweir 75cdf0e10cSrcweir // XExporter 76cdf0e10cSrcweir virtual void SAL_CALL setSourceDocument( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent >& rxDoc ) 77cdf0e10cSrcweir throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException); 78cdf0e10cSrcweir 79cdf0e10cSrcweir // XFilter 80cdf0e10cSrcweir virtual sal_Bool SAL_CALL filter( const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& aDescriptor ) 81cdf0e10cSrcweir throw (::com::sun::star::uno::RuntimeException); 82cdf0e10cSrcweir virtual void SAL_CALL cancel() 83cdf0e10cSrcweir throw (::com::sun::star::uno::RuntimeException); 84cdf0e10cSrcweir }; 85cdf0e10cSrcweir 86cdf0e10cSrcweir 87cdf0e10cSrcweir // ============================================================================= 88cdf0e10cSrcweir // class XMLBasicExporter 89cdf0e10cSrcweir // ============================================================================= 90cdf0e10cSrcweir 91cdf0e10cSrcweir class XMLBasicExporter : public XMLBasicExporterBase 92cdf0e10cSrcweir { 93cdf0e10cSrcweir public: 94cdf0e10cSrcweir XMLBasicExporter( 95cdf0e10cSrcweir const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext ); 96cdf0e10cSrcweir virtual ~XMLBasicExporter(); 97cdf0e10cSrcweir 98cdf0e10cSrcweir // XServiceInfo 99cdf0e10cSrcweir virtual ::rtl::OUString SAL_CALL getImplementationName( ) 100cdf0e10cSrcweir throw (::com::sun::star::uno::RuntimeException); 101cdf0e10cSrcweir virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames( ) 102cdf0e10cSrcweir throw (::com::sun::star::uno::RuntimeException); 103cdf0e10cSrcweir }; 104cdf0e10cSrcweir 105cdf0e10cSrcweir 106cdf0e10cSrcweir // ============================================================================= 107cdf0e10cSrcweir // class XMLOasisBasicExporter 108cdf0e10cSrcweir // ============================================================================= 109cdf0e10cSrcweir 110cdf0e10cSrcweir class XMLOasisBasicExporter : public XMLBasicExporterBase 111cdf0e10cSrcweir { 112cdf0e10cSrcweir public: 113cdf0e10cSrcweir XMLOasisBasicExporter( 114cdf0e10cSrcweir const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext ); 115cdf0e10cSrcweir virtual ~XMLOasisBasicExporter(); 116cdf0e10cSrcweir 117cdf0e10cSrcweir // XServiceInfo 118cdf0e10cSrcweir virtual ::rtl::OUString SAL_CALL getImplementationName( ) 119cdf0e10cSrcweir throw (::com::sun::star::uno::RuntimeException); 120cdf0e10cSrcweir virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames( ) 121cdf0e10cSrcweir throw (::com::sun::star::uno::RuntimeException); 122cdf0e10cSrcweir }; 123cdf0e10cSrcweir 124cdf0e10cSrcweir //......................................................................... 125cdf0e10cSrcweir } // namespace xmlscript 126cdf0e10cSrcweir //......................................................................... 127cdf0e10cSrcweir 128cdf0e10cSrcweir #endif // XMLSCRIPT_XMLBAS_EXPORT_HXX 129