LibreOffice Module xmloff (master) 1
XMLEventsImportContext.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
20#ifndef INCLUDED_XMLOFF_XMLEVENTSIMPORTCONTEXT_HXX
21#define INCLUDED_XMLOFF_XMLEVENTSIMPORTCONTEXT_HXX
22
23#include <sal/config.h>
24#include <xmloff/dllapi.h>
25#include <com/sun/star/uno/Reference.hxx>
26#include <xmloff/xmlictxt.hxx>
27
28#include <vector>
29
30namespace com::sun::star {
31 namespace xml::sax { class XAttributeList; }
32 namespace beans { struct PropertyValue; }
33 namespace container { class XNameReplace; }
34 namespace document { class XEventsSupplier; }
35}
36
37namespace com::sun::star::uno { template <class E> class Sequence; }
38
39typedef ::std::pair<
40 OUString,
41 css::uno::Sequence<css::beans::PropertyValue> > EventNameValuesPair;
42
52{
53 // the event XNameReplace; may be empty
54 css::uno::Reference<css::container::XNameReplace> m_xEvents;
55
56protected:
57 // if no XNameReplace is given, use this vector to collect events
58 std::vector< EventNameValuesPair > m_aCollectEvents;
59
60public:
61
62 XMLEventsImportContext(SvXMLImport& rImport);
63
65 SvXMLImport& rImport,
66 const css::uno::Reference<css::document::XEventsSupplier> & xEventsSupplier);
67
69 SvXMLImport& rImport,
70 const css::uno::Reference<css::container::XNameReplace> & xNameRepl);
71
72 virtual ~XMLEventsImportContext() override;
73
74 void AddEventValues(
75 const OUString& rEventName,
76 const css::uno::Sequence<css::beans::PropertyValue> & rValues);
77
81 const css::uno::Reference<css::document::XEventsSupplier> & xEventsSupplier);
82
86 const css::uno::Reference<css::container::XNameReplace> & xNameRepl);
87
90 void GetEventSequence(
91 const OUString& rName,
92 css::uno::Sequence<css::beans::PropertyValue> & rSequence );
93
94protected:
95
96 virtual css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext(
97 sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList >& AttrList ) override;
98};
99
100#endif
101
102/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
::std::pair< OUString, css::uno::Sequence< css::beans::PropertyValue > > EventNameValuesPair
This class deliberately does not support XWeak, to improve performance when loading large documents.
Definition: xmlictxt.hxx:48
virtual css::uno::Reference< XFastContextHandler > SAL_CALL createFastChildContext(sal_Int32 Element, const css::uno::Reference< css::xml::sax::XFastAttributeList > &Attribs) override
Definition: xmlictxt.cxx:59
Import <script:events> element.
css::uno::Reference< css::container::XNameReplace > m_xEvents
std::vector< EventNameValuesPair > m_aCollectEvents
XMLEventsImportContext(SvXMLImport &rImport, const css::uno::Reference< css::document::XEventsSupplier > &xEventsSupplier)
XMLEventsImportContext(SvXMLImport &rImport, const css::uno::Reference< css::container::XNameReplace > &xNameRepl)
void SetEvents(const css::uno::Reference< css::document::XEventsSupplier > &xEventsSupplier)
if the import operates in delayed mode, you can use this method to set all events that have been read...
void SetEvents(const css::uno::Reference< css::container::XNameReplace > &xNameRepl)
if the import operates in delayed mode, you can use this method to set all events that have been read...
#define XMLOFF_DLLPUBLIC
Definition: dllapi.h:29