LibreOffice Module reportdesign (master)  1
xmlExportDocumentHandler.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_XMLEXPORTDOCUMENTHANDLER_HXX
20 #define INCLUDED_REPORTDESIGN_SOURCE_FILTER_XML_XMLEXPORTDOCUMENTHANDLER_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 <xmloff/xmltoken.hxx>
33 
34 namespace rptxml
35 {
36 
37 OUString lcl_createAttribute(const xmloff::token::XMLTokenEnum& _eNamespace,const xmloff::token::XMLTokenEnum& _eAttribute);
38 
39 typedef ::cppu::WeakAggImplHelper3< css::xml::sax::XDocumentHandler
40  , css::lang::XInitialization
41  , css::lang::XServiceInfo> ExportDocumentHandler_BASE;
42 
43 class ExportDocumentHandler : public ExportDocumentHandler_BASE
44 {
45 public:
46  explicit ExportDocumentHandler(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  void exportTableRows();
71 private:
73  void operator =(ExportDocumentHandler const &) = delete;
74 
75  virtual ~ExportDocumentHandler() override;
76 
77  ::osl::Mutex m_aMutex;
78  css::uno::Reference< css::uno::XComponentContext > m_xContext;
79  css::uno::Reference< css::xml::sax::XDocumentHandler > m_xDelegatee;
80  css::uno::Reference< css::uno::XAggregation > m_xProxy;
81  css::uno::Reference< css::lang::XTypeProvider > m_xTypeProvider;
82  css::uno::Reference< css::lang::XServiceInfo > m_xServiceInfo;
83  css::uno::Reference< css::chart2::XChartDocument > m_xModel;
84  css::uno::Reference< css::chart2::data::XDatabaseDataProvider > m_xDatabaseDataProvider;
85  css::uno::Sequence< OUString > m_aColumns;
86  sal_Int32 m_nColumnCount;
90 };
91 
92 } // namespace rptxml
93 
94 #endif // INCLUDED_REPORTDESIGN_SOURCE_FILTER_XML_XMLEXPORTDOCUMENTHANDLER_HXX
95 
96 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
void operator=(ExportDocumentHandler const &)=delete
css::uno::Reference< css::uno::XComponentContext > m_xContext
virtual void SAL_CALL ignorableWhitespace(const OUString &aWhitespaces) override
css::uno::Reference< css::lang::XTypeProvider > m_xTypeProvider
virtual void SAL_CALL endElement(const OUString &aName) override
virtual void SAL_CALL characters(const OUString &aChars) override
virtual void SAL_CALL initialize(const css::uno::Sequence< css::uno::Any > &aArguments) override
virtual OUString SAL_CALL getImplementationName() override
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
Sequence< PropertyValue > aArguments
virtual void SAL_CALL processingInstruction(const OUString &aTarget, const OUString &aData) override
constexpr OUStringLiteral aData
virtual sal_Bool SAL_CALL supportsService(const OUString &ServiceName) override
css::uno::Reference< css::chart2::data::XDatabaseDataProvider > m_xDatabaseDataProvider
#define DECLARE_XTYPEPROVIDER()
css::uno::Sequence< OUString > m_aColumns
unsigned char sal_Bool
::cppu::WeakAggImplHelper3< css::xml::sax::XDocumentHandler, css::lang::XInitialization, css::lang::XServiceInfo > ExportDocumentHandler_BASE
css::uno::Reference< css::uno::XAggregation > m_xProxy
css::uno::Reference< css::xml::sax::XDocumentHandler > m_xDelegatee
virtual void SAL_CALL startDocument() override
ExportDocumentHandler(css::uno::Reference< css::uno::XComponentContext > const &context)
css::uno::Reference< css::lang::XServiceInfo > m_xServiceInfo
OUString aName
virtual void SAL_CALL setDocumentLocator(const css::uno::Reference< css::xml::sax::XLocator > &xLocator) override
virtual void SAL_CALL endDocument() override
virtual css::uno::Any SAL_CALL queryInterface(const css::uno::Type &aType) override
css::uno::Reference< css::chart2::XChartDocument > m_xModel
virtual void SAL_CALL startElement(const OUString &aName, const css::uno::Reference< css::xml::sax::XAttributeList > &xAttribs) override
OUString lcl_createAttribute(const xmloff::token::XMLTokenEnum &_eNamespace, const xmloff::token::XMLTokenEnum &_eAttribute)