LibreOffice Module reportdesign (master)  1
xmlImportDocumentHandler.hxx
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3  * This file is part of the LibreOffice project.
4  *
5  * This Source Code Form is subject to the terms of the Mozilla Public
6  * License, v. 2.0. If a copy of the MPL was not distributed with this
7  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8  *
9  * This file incorporates work covered by the following license notice:
10  *
11  * Licensed to the Apache Software Foundation (ASF) under one or more
12  * contributor license agreements. See the NOTICE file distributed
13  * with this work for additional information regarding copyright
14  * ownership. The ASF licenses this file to you under the Apache
15  * License, Version 2.0 (the "License"); you may not use this file
16  * except in compliance with the License. You may obtain a copy of
17  * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18  */
19 #ifndef INCLUDED_REPORTDESIGN_SOURCE_FILTER_XML_XMLIMPORTDOCUMENTHANDLER_HXX
20 #define INCLUDED_REPORTDESIGN_SOURCE_FILTER_XML_XMLIMPORTDOCUMENTHANDLER_HXX
21 
22 #include <sal/config.h>
23 #include <com/sun/star/uno/XComponentContext.hpp>
24 #include <cppuhelper/implbase3.hxx>
25 #include <com/sun/star/xml/sax/XDocumentHandler.hpp>
26 #include <com/sun/star/xml/sax/XFastDocumentHandler.hpp>
27 #include <com/sun/star/lang/XInitialization.hpp>
28 #include <com/sun/star/lang/XServiceInfo.hpp>
29 #include <com/sun/star/lang/XTypeProvider.hpp>
30 #include <com/sun/star/chart2/XChartDocument.hpp>
31 #include <com/sun/star/chart2/data/XDatabaseDataProvider.hpp>
32 #include <comphelper/uno3.hxx>
33 #include <xmloff/xmlimp.hxx>
34 #include <memory>
35 
36 class SvXMLTokenMap;
37 namespace rptxml
38 {
39 typedef ::cppu::WeakAggImplHelper3< css::xml::sax::XDocumentHandler
40  , css::lang::XInitialization
41  , css::lang::XServiceInfo> ImportDocumentHandler_BASE;
42 
43 class ImportDocumentHandler : public ImportDocumentHandler_BASE
44 {
45 public:
46  explicit ImportDocumentHandler(css::uno::Reference< css::uno::XComponentContext > const & context);
47 
48 private:
49  // XServiceInfo
50  virtual OUString SAL_CALL getImplementationName( ) override;
51  virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override;
52  virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames( ) override;
53 
54  virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type& aType ) override;
55 
57 
58  // css::xml::sax::XDocumentHandler:
59  virtual void SAL_CALL startDocument() override;
60  virtual void SAL_CALL endDocument() override;
61  virtual void SAL_CALL startElement(const OUString & aName, const css::uno::Reference< css::xml::sax::XAttributeList > & xAttribs) override;
62  virtual void SAL_CALL endElement(const OUString & aName) override;
63  virtual void SAL_CALL characters(const OUString & aChars) override;
64  virtual void SAL_CALL ignorableWhitespace(const OUString & aWhitespaces) override;
65  virtual void SAL_CALL processingInstruction(const OUString & aTarget, const OUString & aData) override;
66  virtual void SAL_CALL setDocumentLocator(const css::uno::Reference< css::xml::sax::XLocator > & xLocator) override;
67 
68  virtual void SAL_CALL initialize( const css::uno::Sequence< css::uno::Any >& aArguments ) override;
69 
70 private:
72  void operator =(ImportDocumentHandler const &) = delete;
73 
74  virtual ~ImportDocumentHandler() override;
75 
76  ::osl::Mutex m_aMutex;
78  ::std::vector< OUString> m_aMasterFields;
79  ::std::vector< OUString> m_aDetailFields;
80  css::uno::Sequence< css::beans::PropertyValue > m_aArguments;
81  css::uno::Reference< css::uno::XComponentContext > m_xContext;
82  css::uno::Reference<css::xml::sax::XFastDocumentHandler> m_xDocumentHandler;
83  css::uno::Reference< css::xml::sax::XDocumentHandler > m_xDelegatee;
84  css::uno::Reference< css::uno::XAggregation > m_xProxy;
85  css::uno::Reference< css::lang::XTypeProvider > m_xTypeProvider;
86  css::uno::Reference< css::lang::XServiceInfo > m_xServiceInfo;
87  css::uno::Reference< css::chart2::XChartDocument > m_xModel;
88  css::uno::Reference< css::chart2::data::XDatabaseDataProvider > m_xDatabaseDataProvider;
89 
90  ::std::unique_ptr<SvXMLTokenMap> m_pReportElemTokenMap;
91 };
92 
93 } // namespace rptxml
94 
95 #endif // INCLUDED_REPORTDESIGN_SOURCE_FILTER_XML_XMLIMPORTDOCUMENTHANDLER_HXX
96 
97 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual void SAL_CALL setDocumentLocator(const css::uno::Reference< css::xml::sax::XLocator > &xLocator) override
virtual sal_Bool SAL_CALL supportsService(const OUString &ServiceName) override
css::uno::Sequence< css::beans::PropertyValue > m_aArguments
css::uno::Reference< css::chart2::data::XDatabaseDataProvider > m_xDatabaseDataProvider
void operator=(ImportDocumentHandler const &)=delete
::cppu::WeakAggImplHelper3< css::xml::sax::XDocumentHandler, css::lang::XInitialization, css::lang::XServiceInfo > ImportDocumentHandler_BASE
Sequence< PropertyValue > aArguments
virtual void SAL_CALL ignorableWhitespace(const OUString &aWhitespaces) override
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
css::uno::Reference< css::xml::sax::XFastDocumentHandler > m_xDocumentHandler
constexpr OUStringLiteral aData
css::uno::Reference< css::uno::XComponentContext > m_xContext
css::uno::Reference< css::lang::XTypeProvider > m_xTypeProvider
css::uno::Reference< css::uno::XAggregation > m_xProxy
css::uno::Reference< css::chart2::XChartDocument > m_xModel
#define DECLARE_XTYPEPROVIDER()
virtual css::uno::Any SAL_CALL queryInterface(const css::uno::Type &aType) override
ImportDocumentHandler(css::uno::Reference< css::uno::XComponentContext > const &context)
css::uno::Reference< css::lang::XServiceInfo > m_xServiceInfo
unsigned char sal_Bool
css::uno::Reference< css::xml::sax::XDocumentHandler > m_xDelegatee
::std::vector< OUString > m_aDetailFields
virtual void SAL_CALL startElement(const OUString &aName, const css::uno::Reference< css::xml::sax::XAttributeList > &xAttribs) override
virtual void SAL_CALL processingInstruction(const OUString &aTarget, const OUString &aData) override
OUString aName
virtual void SAL_CALL characters(const OUString &aChars) override
::std::unique_ptr< SvXMLTokenMap > m_pReportElemTokenMap
virtual void SAL_CALL endElement(const OUString &aName) override
virtual void SAL_CALL startDocument() override
virtual void SAL_CALL initialize(const css::uno::Sequence< css::uno::Any > &aArguments) override
virtual void SAL_CALL endDocument() override
::std::vector< OUString > m_aMasterFields
virtual OUString SAL_CALL getImplementationName() override