1*9ee13d13SAndrew Rist /************************************************************** 2cdf0e10cSrcweir * 3*9ee13d13SAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one 4*9ee13d13SAndrew Rist * or more contributor license agreements. See the NOTICE file 5*9ee13d13SAndrew Rist * distributed with this work for additional information 6*9ee13d13SAndrew Rist * regarding copyright ownership. The ASF licenses this file 7*9ee13d13SAndrew Rist * to you under the Apache License, Version 2.0 (the 8*9ee13d13SAndrew Rist * "License"); you may not use this file except in compliance 9*9ee13d13SAndrew Rist * with the License. You may obtain a copy of the License at 10*9ee13d13SAndrew Rist * 11*9ee13d13SAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0 12*9ee13d13SAndrew Rist * 13*9ee13d13SAndrew Rist * Unless required by applicable law or agreed to in writing, 14*9ee13d13SAndrew Rist * software distributed under the License is distributed on an 15*9ee13d13SAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16*9ee13d13SAndrew Rist * KIND, either express or implied. See the License for the 17*9ee13d13SAndrew Rist * specific language governing permissions and limitations 18*9ee13d13SAndrew Rist * under the License. 19*9ee13d13SAndrew Rist * 20*9ee13d13SAndrew Rist *************************************************************/ 21*9ee13d13SAndrew Rist 22*9ee13d13SAndrew Rist 23cdf0e10cSrcweir #ifndef RPT_IMPORTDOCUMENTHANDLER_HXX_INCLUDED 24cdf0e10cSrcweir #define RPT_IMPORTDOCUMENTHANDLER_HXX_INCLUDED 25cdf0e10cSrcweir 26cdf0e10cSrcweir #include "sal/config.h" 27cdf0e10cSrcweir #include "com/sun/star/uno/XComponentContext.hpp" 28cdf0e10cSrcweir #include <cppuhelper/implbase3.hxx> 29cdf0e10cSrcweir #include "com/sun/star/xml/sax/XDocumentHandler.hpp" 30cdf0e10cSrcweir #include <com/sun/star/lang/XInitialization.hpp> 31cdf0e10cSrcweir #include <com/sun/star/lang/XServiceInfo.hpp> 32cdf0e10cSrcweir #include <com/sun/star/lang/XTypeProvider.hpp> 33cdf0e10cSrcweir #include <com/sun/star/chart2/XChartDocument.hpp> 34cdf0e10cSrcweir #include "com/sun/star/chart2/data/XDatabaseDataProvider.hpp" 35cdf0e10cSrcweir #include <comphelper/uno3.hxx> 36cdf0e10cSrcweir #include <memory> 37cdf0e10cSrcweir 38cdf0e10cSrcweir class SvXMLTokenMap; 39cdf0e10cSrcweir namespace rptxml 40cdf0e10cSrcweir { 41cdf0e10cSrcweir typedef ::cppu::WeakAggImplHelper3< ::com::sun::star::xml::sax::XDocumentHandler 42cdf0e10cSrcweir , ::com::sun::star::lang::XInitialization 43cdf0e10cSrcweir , ::com::sun::star::lang::XServiceInfo> ImportDocumentHandler_BASE; 44cdf0e10cSrcweir 45cdf0e10cSrcweir class ImportDocumentHandler : public ImportDocumentHandler_BASE 46cdf0e10cSrcweir { 47cdf0e10cSrcweir public: 48cdf0e10cSrcweir // XServiceInfo - static versions 49cdf0e10cSrcweir static ::rtl::OUString getImplementationName_Static( ) throw(::com::sun::star::uno::RuntimeException); 50cdf0e10cSrcweir static ::com::sun::star::uno::Sequence< ::rtl::OUString > getSupportedServiceNames_static( ) throw(::com::sun::star::uno::RuntimeException); 51cdf0e10cSrcweir static ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL 52cdf0e10cSrcweir create(const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >&); 53cdf0e10cSrcweir public: 54cdf0e10cSrcweir explicit ImportDocumentHandler(::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > const & context); 55cdf0e10cSrcweir 56cdf0e10cSrcweir private: 57cdf0e10cSrcweir // XServiceInfo 58cdf0e10cSrcweir virtual ::rtl::OUString SAL_CALL getImplementationName( ) throw(::com::sun::star::uno::RuntimeException); 59cdf0e10cSrcweir virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName ) throw(::com::sun::star::uno::RuntimeException); 60cdf0e10cSrcweir virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames( ) throw(::com::sun::star::uno::RuntimeException); 61cdf0e10cSrcweir 62cdf0e10cSrcweir DECLARE_XINTERFACE( ) 63cdf0e10cSrcweir DECLARE_XTYPEPROVIDER( ) 64cdf0e10cSrcweir 65cdf0e10cSrcweir // ::com::sun::star::xml::sax::XDocumentHandler: 66cdf0e10cSrcweir virtual void SAL_CALL startDocument() throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::xml::sax::SAXException); 67cdf0e10cSrcweir virtual void SAL_CALL endDocument() throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::xml::sax::SAXException); 68cdf0e10cSrcweir virtual void SAL_CALL startElement(const ::rtl::OUString & aName, const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList > & xAttribs) throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::xml::sax::SAXException); 69cdf0e10cSrcweir virtual void SAL_CALL endElement(const ::rtl::OUString & aName) throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::xml::sax::SAXException); 70cdf0e10cSrcweir virtual void SAL_CALL characters(const ::rtl::OUString & aChars) throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::xml::sax::SAXException); 71cdf0e10cSrcweir virtual void SAL_CALL ignorableWhitespace(const ::rtl::OUString & aWhitespaces) throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::xml::sax::SAXException); 72cdf0e10cSrcweir virtual void SAL_CALL processingInstruction(const ::rtl::OUString & aTarget, const ::rtl::OUString & aData) throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::xml::sax::SAXException); 73cdf0e10cSrcweir virtual void SAL_CALL setDocumentLocator(const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XLocator > & xLocator) throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::xml::sax::SAXException); 74cdf0e10cSrcweir 75cdf0e10cSrcweir virtual void SAL_CALL initialize( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aArguments ) throw (::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException); 76cdf0e10cSrcweir 77cdf0e10cSrcweir private: 78cdf0e10cSrcweir ImportDocumentHandler(ImportDocumentHandler &); // not defined 79cdf0e10cSrcweir void operator =(ImportDocumentHandler &); // not defined 80cdf0e10cSrcweir 81cdf0e10cSrcweir virtual ~ImportDocumentHandler(); 82cdf0e10cSrcweir 83cdf0e10cSrcweir ::osl::Mutex m_aMutex; 84cdf0e10cSrcweir bool m_bImportedChart; 85cdf0e10cSrcweir ::std::vector< ::rtl::OUString> m_aMasterFields; 86cdf0e10cSrcweir ::std::vector< ::rtl::OUString> m_aDetailFields; 87cdf0e10cSrcweir ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > m_aArguments; 88cdf0e10cSrcweir ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > m_xContext; 89cdf0e10cSrcweir ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XDocumentHandler > m_xDelegatee; 90cdf0e10cSrcweir ::com::sun::star::uno::Reference< ::com::sun::star::uno::XAggregation > m_xProxy; 91cdf0e10cSrcweir ::com::sun::star::uno::Reference< ::com::sun::star::lang::XTypeProvider > m_xTypeProvider; 92cdf0e10cSrcweir ::com::sun::star::uno::Reference< ::com::sun::star::lang::XServiceInfo > m_xServiceInfo; 93cdf0e10cSrcweir ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XChartDocument > m_xModel; 94cdf0e10cSrcweir ::com::sun::star::uno::Reference< ::com::sun::star::chart2::data::XDatabaseDataProvider > m_xDatabaseDataProvider; 95cdf0e10cSrcweir 96cdf0e10cSrcweir ::std::auto_ptr<SvXMLTokenMap> m_pReportElemTokenMap; 97cdf0e10cSrcweir }; 98cdf0e10cSrcweir // ----------------------------------------------------------------------------- 99cdf0e10cSrcweir } // namespace rptxml 100cdf0e10cSrcweir // ----------------------------------------------------------------------------- 101cdf0e10cSrcweir #endif // RPT_IMPORTDOCUMENTHANDLER_HXX_INCLUDED 102