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/lang/XInitialization.hpp>
27 #include <com/sun/star/lang/XServiceInfo.hpp>
28 #include <com/sun/star/lang/XTypeProvider.hpp>
29 #include <com/sun/star/chart2/XChartDocument.hpp>
30 #include <com/sun/star/chart2/data/XDatabaseDataProvider.hpp>
31 #include <comphelper/uno3.hxx>
32 #include <memory>
33 
34 class SvXMLTokenMap;
35 namespace rptxml
36 {
37 typedef ::cppu::WeakAggImplHelper3< css::xml::sax::XDocumentHandler
38  , css::lang::XInitialization
39  , css::lang::XServiceInfo> ImportDocumentHandler_BASE;
40 
41 class ImportDocumentHandler : public ImportDocumentHandler_BASE
42 {
43 public:
44  explicit ImportDocumentHandler(css::uno::Reference< css::uno::XComponentContext > const & context);
45 
46 private:
47  // XServiceInfo
48  virtual OUString SAL_CALL getImplementationName( ) override;
49  virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override;
50  virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames( ) override;
51 
52  virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type& aType ) override;
53 
55 
56  // css::xml::sax::XDocumentHandler:
57  virtual void SAL_CALL startDocument() override;
58  virtual void SAL_CALL endDocument() override;
59  virtual void SAL_CALL startElement(const OUString & aName, const css::uno::Reference< css::xml::sax::XAttributeList > & xAttribs) override;
60  virtual void SAL_CALL endElement(const OUString & aName) override;
61  virtual void SAL_CALL characters(const OUString & aChars) override;
62  virtual void SAL_CALL ignorableWhitespace(const OUString & aWhitespaces) override;
63  virtual void SAL_CALL processingInstruction(const OUString & aTarget, const OUString & aData) override;
64  virtual void SAL_CALL setDocumentLocator(const css::uno::Reference< css::xml::sax::XLocator > & xLocator) override;
65 
66  virtual void SAL_CALL initialize( const css::uno::Sequence< css::uno::Any >& aArguments ) override;
67 
68 private:
70  void operator =(ImportDocumentHandler const &) = delete;
71 
72  virtual ~ImportDocumentHandler() override;
73 
74  ::osl::Mutex m_aMutex;
76  ::std::vector< OUString> m_aMasterFields;
77  ::std::vector< OUString> m_aDetailFields;
78  css::uno::Sequence< css::beans::PropertyValue > m_aArguments;
79  css::uno::Reference< css::uno::XComponentContext > m_xContext;
80  css::uno::Reference< css::xml::sax::XDocumentHandler > m_xDelegatee;
81  css::uno::Reference< css::uno::XAggregation > m_xProxy;
82  css::uno::Reference< css::lang::XTypeProvider > m_xTypeProvider;
83  css::uno::Reference< css::lang::XServiceInfo > m_xServiceInfo;
84  css::uno::Reference< css::chart2::XChartDocument > m_xModel;
85  css::uno::Reference< css::chart2::data::XDatabaseDataProvider > m_xDatabaseDataProvider;
86 
87  ::std::unique_ptr<SvXMLTokenMap> m_pReportElemTokenMap;
88 };
89 
90 } // namespace rptxml
91 
92 #endif // INCLUDED_REPORTDESIGN_SOURCE_FILTER_XML_XMLIMPORTDOCUMENTHANDLER_HXX
93 
94 /* 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
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