LibreOffice Module xmloff (master) 1
XMLEventImportHelper.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#pragma once
21
22#include <com/sun/star/uno/Reference.hxx>
23#include <xmloff/xmlevent.hxx>
24
25#include <map>
26#include <vector>
27#include <memory>
28
29
30namespace com::sun::star {
31 namespace xml::sax { class XFastAttributeList; }
32}
36
37typedef ::std::map< OUString, std::unique_ptr<XMLEventContextFactory> > FactoryMap;
38typedef ::std::map< XMLEventName, OUString > NameMap;
39
40
55{
58
60 std::unique_ptr<NameMap> pEventNameMap;
61
63 std::vector< std::unique_ptr<NameMap> > aEventNameMapVector;
64
65public:
67
69
71 void RegisterFactory( const OUString& rLanguage,
72 std::unique_ptr<XMLEventContextFactory> aFactory );
73
75 void AddTranslationTable( const XMLEventNameTranslation* pTransTable );
76
79
82
85 SvXMLImport& rImport,
86 const css::uno::Reference< css::xml::sax::XFastAttributeList> & xAttrList,
88 const OUString& rXmlEventName,
89 const OUString& rLanguage);
90
91};
92
93/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
::std::map< XMLEventName, OUString > NameMap
::std::map< OUString, std::unique_ptr< XMLEventContextFactory > > FactoryMap
This class deliberately does not support XWeak, to improve performance when loading large documents.
Definition: xmlictxt.hxx:48
Handle import of an event for a certain event type (as defined by the PropertyValue "EventType" in th...
Definition: xmlevent.hxx:126
Helps the XMLEventsImportContext.
FactoryMap aFactoryMap
map of XMLEventContextFactory objects
std::vector< std::unique_ptr< NameMap > > aEventNameMapVector
stack of previous aEventNameMap
void AddTranslationTable(const XMLEventNameTranslation *pTransTable)
add event name translation to the internal table
SvXMLImportContext * CreateContext(SvXMLImport &rImport, const css::uno::Reference< css::xml::sax::XFastAttributeList > &xAttrList, XMLEventsImportContext *rEvents, const OUString &rXmlEventName, const OUString &rLanguage)
create an appropriate import context for a particular event
std::unique_ptr< NameMap > pEventNameMap
map from XML to API names
void RegisterFactory(const OUString &rLanguage, std::unique_ptr< XMLEventContextFactory > aFactory)
register a handler for a particular language type
void PopTranslationTable()
recover the top-most previously saved translation table
void PushTranslationTable()
save the old translation table on a stack and install an empty table
Import <script:events> element.
XMLEventNameTranslation: define tables that translate between event names as used in the XML file for...
Definition: xmlevent.hxx:77