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>
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#include <mutex>
34
35namespace rptxml
36{
37
38OUString lcl_createAttribute(const xmloff::token::XMLTokenEnum& _eNamespace,const xmloff::token::XMLTokenEnum& _eAttribute);
39
40typedef ::cppu::WeakImplHelper< css::xml::sax::XDocumentHandler
41 , css::lang::XInitialization
42 , css::lang::XServiceInfo> ExportDocumentHandler_BASE;
43
45{
46public:
47 explicit ExportDocumentHandler(css::uno::Reference< css::uno::XComponentContext > context);
48
49private:
50 // XServiceInfo
51 virtual OUString SAL_CALL getImplementationName( ) override;
52 virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override;
53 virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames( ) override;
54
55 virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type& aType ) override;
56
58
59 // css::xml::sax::XDocumentHandler:
60 virtual void SAL_CALL startDocument() override;
61 virtual void SAL_CALL endDocument() override;
62 virtual void SAL_CALL startElement(const OUString & aName, const css::uno::Reference< css::xml::sax::XAttributeList > & xAttribs) override;
63 virtual void SAL_CALL endElement(const OUString & aName) override;
64 virtual void SAL_CALL characters(const OUString & aChars) override;
65 virtual void SAL_CALL ignorableWhitespace(const OUString & aWhitespaces) override;
66 virtual void SAL_CALL processingInstruction(const OUString & aTarget, const OUString & aData) override;
67 virtual void SAL_CALL setDocumentLocator(const css::uno::Reference< css::xml::sax::XLocator > & xLocator) override;
68
69 virtual void SAL_CALL initialize( const css::uno::Sequence< css::uno::Any >& aArguments ) override;
70
71 void exportTableRows();
72private:
74 void operator =(ExportDocumentHandler const &) = delete;
75
76 virtual ~ExportDocumentHandler() override;
77
78 std::mutex m_aMutex;
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 css::uno::Sequence< OUString > m_aColumns;
87 sal_Int32 m_nColumnCount;
91};
92
93} // namespace rptxml
94
95#endif // INCLUDED_REPORTDESIGN_SOURCE_FILTER_XML_XMLEXPORTDOCUMENTHANDLER_HXX
96
97/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual void SAL_CALL startDocument() override
virtual void SAL_CALL processingInstruction(const OUString &aTarget, const OUString &aData) override
css::uno::Reference< css::lang::XTypeProvider > m_xTypeProvider
css::uno::Reference< css::uno::XComponentContext > m_xContext
virtual void SAL_CALL setDocumentLocator(const css::uno::Reference< css::xml::sax::XLocator > &xLocator) override
virtual void SAL_CALL startElement(const OUString &aName, const css::uno::Reference< css::xml::sax::XAttributeList > &xAttribs) override
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
css::uno::Reference< css::lang::XServiceInfo > m_xServiceInfo
css::uno::Reference< css::chart2::data::XDatabaseDataProvider > m_xDatabaseDataProvider
css::uno::Sequence< OUString > m_aColumns
css::uno::Reference< css::xml::sax::XDocumentHandler > m_xDelegatee
virtual css::uno::Any SAL_CALL queryInterface(const css::uno::Type &aType) override
virtual void SAL_CALL characters(const OUString &aChars) override
css::uno::Reference< css::uno::XAggregation > m_xProxy
virtual void SAL_CALL ignorableWhitespace(const OUString &aWhitespaces) override
virtual void SAL_CALL initialize(const css::uno::Sequence< css::uno::Any > &aArguments) override
virtual sal_Bool SAL_CALL supportsService(const OUString &ServiceName) override
ExportDocumentHandler(css::uno::Reference< css::uno::XComponentContext > context)
virtual void SAL_CALL endElement(const OUString &aName) override
virtual void SAL_CALL endDocument() override
css::uno::Reference< css::chart2::XChartDocument > m_xModel
virtual OUString SAL_CALL getImplementationName() override
::cppu::WeakImplHelper< css::xml::sax::XDocumentHandler, css::lang::XInitialization, css::lang::XServiceInfo > ExportDocumentHandler_BASE
OUString lcl_createAttribute(const xmloff::token::XMLTokenEnum &_eNamespace, const xmloff::token::XMLTokenEnum &_eAttribute)
unsigned char sal_Bool
#define DECLARE_XTYPEPROVIDER()