LibreOffice Module reportdesign (master) 1
xmlfilter.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_XMLFILTER_HXX
20#define INCLUDED_REPORTDESIGN_SOURCE_FILTER_XML_XMLFILTER_HXX
21
22#include <com/sun/star/container/XNamed.hpp>
23#include <com/sun/star/document/XFilter.hpp>
24#include <com/sun/star/document/XImporter.hpp>
25#include <com/sun/star/io/XActiveDataSource.hpp>
26#include <com/sun/star/report/XReportDefinition.hpp>
27#include <xmloff/xmlimp.hxx>
28#include <com/sun/star/uno/XComponentContext.hpp>
29#include <map>
30#include <memory>
31#include <xmloff/prhdlfac.hxx>
32#include <xmloff/xmlprmap.hxx>
33
34namespace rptui
35{
36class OReportModel;
37}
38namespace rptxml
39{
40using namespace ::xmloff::token;
41using namespace ::com::sun::star::uno;
42using namespace ::com::sun::star::container;
43using namespace ::com::sun::star::lang;
44using namespace ::com::sun::star::beans;
45using namespace ::com::sun::star::document;
46using namespace ::com::sun::star::text;
47using namespace ::com::sun::star::io;
48using namespace ::com::sun::star::report;
49using namespace ::com::sun::star::xml::sax;
50
51
52class ORptFilter : public SvXMLImport
53{
54public:
55 typedef std::map< OUString, Sequence<PropertyValue> > TPropertyNameMap;
56 typedef std::map< OUString, Reference<XFunction> > TGroupFunctionMap;
57private:
58
60
65
66 Reference<XReportDefinition> m_xReportDefinition;
67 std::shared_ptr<rptui::OReportModel> m_pReportModel;
68
70 bool implImport( const Sequence< PropertyValue >& rDescriptor );
71
72public:
74 SvXMLImportContext* CreateStylesContext( bool bIsAutoStyle );
75 SvXMLImportContext* CreateMetaContext(const sal_Int32 nElement);
77protected:
78 // SvXMLImport
79 virtual SvXMLImportContext *CreateFastContext( sal_Int32 nElement,
80 const css::uno::Reference< css::xml::sax::XFastAttributeList >& xAttrList ) override;
81
82 virtual XMLShapeImportHelper* CreateShapeImport() override;
83
84 virtual ~ORptFilter() noexcept override;
85public:
86
87 ORptFilter( const Reference< XComponentContext >& _rxContext, OUString const & rImplementationName, SvXMLImportFlags nImportFlags );
88
89 // XFilter
90 virtual sal_Bool SAL_CALL filter( const Sequence< PropertyValue >& rDescriptor ) override;
91
92 const Reference<XReportDefinition>& getReportDefinition() const {
94 }
95 void FinishStyles();
96
97 virtual void SAL_CALL startDocument() override;
98 virtual void SAL_CALL endDocument() override;
99
102 }
105 }
108 }
109 static const OUString& convertFormula(const OUString& _sFormula);
114 void insertFunction(const css::uno::Reference< css::report::XFunction > & _xFunction);
115 void removeFunction(const OUString& _sFunctionName);
117 return m_aFunctions;
118 }
119
120 bool isOldFormat() const;
121};
122
123
125{
126public:
128 : SvXMLImportContext(rImport)
129 {
130 }
131
132 virtual css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext(
133 sal_Int32 /*nElement*/, const css::uno::Reference< css::xml::sax::XFastAttributeList >& /*xAttrList*/ ) override;
134};
135
136} // rptxml
137
138#endif // INCLUDED_REPORTDESIGN_SOURCE_FILTER_XML_XMLFILTER_HXX
139
140/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
void SetMasterStyles(SvXMLStylesContext *pMasterStyles)
bool implImport(const Sequence< PropertyValue > &rDescriptor)
Definition: xmlfilter.cxx:345
void removeFunction(const OUString &_sFunctionName)
Definition: xmlfilter.cxx:723
static const OUString & convertFormula(const OUString &_sFormula)
Definition: xmlfilter.cxx:691
rtl::Reference< XMLPropertySetMapper > m_xRowStylesPropertySetMapper
Definition: xmlfilter.hxx:64
std::shared_ptr< rptui::OReportModel > m_pReportModel
Definition: xmlfilter.hxx:67
rtl::Reference< XMLPropertySetMapper > m_xColumnStylesPropertySetMapper
Definition: xmlfilter.hxx:63
bool isOldFormat() const
Definition: xmlfilter.cxx:745
SvXMLImportContext * CreateMetaContext(const sal_Int32 nElement)
Definition: xmlfilter.cxx:733
const rtl::Reference< XMLPropertySetMapper > & GetColumnStylesPropertySetMapper() const
Definition: xmlfilter.hxx:103
SvXMLImportContext * CreateStylesContext(bool bIsAutoStyle)
Definition: xmlfilter.cxx:658
SvXMLImportContext * CreateFontDeclsContext()
Definition: xmlfilter.cxx:672
virtual void SAL_CALL startDocument() override
Definition: xmlfilter.cxx:696
TGroupFunctionMap m_aFunctions
Definition: xmlfilter.hxx:59
std::map< OUString, Sequence< PropertyValue > > TPropertyNameMap
Definition: xmlfilter.hxx:55
virtual SvXMLImportContext * CreateFastContext(sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList > &xAttrList) override
Definition: xmlfilter.cxx:633
void insertFunction(const css::uno::Reference< css::report::XFunction > &_xFunction)
inserts a new function
Definition: xmlfilter.cxx:728
const Reference< XReportDefinition > & getReportDefinition() const
Definition: xmlfilter.hxx:92
const TGroupFunctionMap & getFunctions() const
Definition: xmlfilter.hxx:116
virtual XMLShapeImportHelper * CreateShapeImport() override
Definition: xmlfilter.cxx:680
const rtl::Reference< XMLPropertySetMapper > & GetCellStylesPropertySetMapper() const
Definition: xmlfilter.hxx:100
std::map< OUString, Reference< XFunction > > TGroupFunctionMap
Definition: xmlfilter.hxx:56
rtl::Reference< XMLPropertyHandlerFactory > m_xPropHdlFactory
Definition: xmlfilter.hxx:61
const rtl::Reference< XMLPropertySetMapper > & GetRowStylesPropertySetMapper() const
Definition: xmlfilter.hxx:106
virtual ~ORptFilter() noexcept override
Definition: xmlfilter.cxx:315
virtual void SAL_CALL endDocument() override
Definition: xmlfilter.cxx:705
rtl::Reference< XMLPropertySetMapper > m_xCellStylesPropertySetMapper
Definition: xmlfilter.hxx:62
Reference< XReportDefinition > m_xReportDefinition
Definition: xmlfilter.hxx:66
virtual css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext(sal_Int32, const css::uno::Reference< css::xml::sax::XFastAttributeList > &) override
Definition: xmlfilter.cxx:580
RptXMLDocumentBodyContext(SvXMLImport &rImport)
Definition: xmlfilter.hxx:127
unsigned char sal_Bool
SvXMLImportFlags