bump product version to 6.3.0.0.beta1
[LibreOffice.git] / include / xmloff / XMLEventsImportContext.hxx
blob0dd1a0194f4be597f4fcd707332780316918f534
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
20 #ifndef INCLUDED_XMLOFF_XMLEVENTSIMPORTCONTEXT_HXX
21 #define INCLUDED_XMLOFF_XMLEVENTSIMPORTCONTEXT_HXX
23 #include <sal/config.h>
24 #include <xmloff/dllapi.h>
25 #include <com/sun/star/uno/Reference.hxx>
26 #include <xmloff/xmlictxt.hxx>
28 #include <vector>
30 namespace com { namespace sun { namespace star {
31 namespace xml { namespace sax { class XAttributeList; } }
32 namespace beans { struct PropertyValue; }
33 namespace container { class XNameReplace; }
34 namespace document { class XEventsSupplier; }
35 } } }
37 namespace com { namespace sun { namespace star { namespace uno { template <class E> class Sequence; } } } }
39 typedef ::std::pair<
40 OUString,
41 css::uno::Sequence<css::beans::PropertyValue> > EventNameValuesPair;
43 typedef ::std::vector< EventNameValuesPair > EventsVector;
45 /**
46 * Import <script:events> element.
48 * The import context usually sets the events immediately at the event
49 * XNameReplace. If none was given on construction, it operates in
50 * delayed mode: All events are collected and may then be set
51 * with the setEvents() method.
53 class XMLOFF_DLLPUBLIC XMLEventsImportContext : public SvXMLImportContext
55 // the event XNameReplace; may be empty
56 css::uno::Reference<css::container::XNameReplace> xEvents;
58 protected:
59 // if no XNameReplace is given, use this vector to collect events
60 EventsVector aCollectEvents;
62 public:
65 XMLEventsImportContext(
66 SvXMLImport& rImport,
67 sal_uInt16 nPrfx,
68 const OUString& rLocalName);
70 XMLEventsImportContext(
71 SvXMLImport& rImport,
72 sal_uInt16 nPrfx,
73 const OUString& rLocalName,
74 const css::uno::Reference<css::document::XEventsSupplier> & xEventsSupplier);
76 XMLEventsImportContext(
77 SvXMLImport& rImport,
78 sal_uInt16 nPrfx,
79 const OUString& rLocalName,
80 const css::uno::Reference<css::container::XNameReplace> & xNameRepl);
82 virtual ~XMLEventsImportContext() override;
84 void AddEventValues(
85 const OUString& rEventName,
86 const css::uno::Sequence<css::beans::PropertyValue> & rValues);
88 /// if the import operates in delayed mode, you can use this method
89 /// to set all events that have been read on the XEventsSupplier
90 void SetEvents(
91 const css::uno::Reference<css::document::XEventsSupplier> & xEventsSupplier);
93 /// if the import operates in delayed mode, you can use this method
94 /// to set all events that have been read on the XNameReplace
95 void SetEvents(
96 const css::uno::Reference<css::container::XNameReplace> & xNameRepl);
98 /// if the import operates in delayed mode, you can use this method
99 /// to obtain the value sequence for a specific event
100 void GetEventSequence(
101 const OUString& rName,
102 css::uno::Sequence<css::beans::PropertyValue> & rSequence );
104 protected:
106 virtual void StartElement(
107 const css::uno::Reference<css::xml::sax::XAttributeList> & xAttrList) override;
109 virtual void EndElement() override;
111 virtual SvXMLImportContextRef CreateChildContext(
112 sal_uInt16 nPrefix,
113 const OUString& rLocalName,
114 const css::uno::Reference<css::xml::sax::XAttributeList> & xAttrList ) override;
117 #endif
119 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */