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 
30 namespace 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 
37 namespace com::sun::star::uno { template <class E> class Sequence; }
38 
39 typedef ::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> xEvents;
55 
56 protected:
57  // if no XNameReplace is given, use this vector to collect events
58  std::vector< EventNameValuesPair > aCollectEvents;
59 
60 public:
61 
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 
80  void SetEvents(
81  const css::uno::Reference<css::document::XEventsSupplier> & xEventsSupplier);
82 
85  void SetEvents(
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 
94 protected:
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: */
css::uno::Reference< css::container::XNameReplace > xEvents
exports com.sun.star. container
This class deliberately does not support XWeak, to improve performance when loading large documents...
Definition: xmlictxt.hxx:44
exports com.sun.star. beans
exports com.sun.star. document
::std::pair< OUString, css::uno::Sequence< css::beans::PropertyValue > > EventNameValuesPair
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
std::vector< EventNameValuesPair > aCollectEvents
#define XMLOFF_DLLPUBLIC
Definition: dllapi.h:29