LibreOffice Module xmloff (master) 1
xmlevent.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_XMLEVENT_HXX
21#define INCLUDED_XMLOFF_XMLEVENT_HXX
22
23#include <rtl/ustring.hxx>
24#include <utility>
25
26namespace com::sun::star::uno { template <class interface_type> class Reference; }
27namespace com::sun::star::uno { template <typename > class Sequence; }
28
29
36namespace com::sun::star {
37 namespace xml::sax { class XFastAttributeList; }
38 namespace beans { struct PropertyValue; }
39}
40
41class SvXMLExport;
43class SvXMLImport;
45
46
48{
49 sal_uInt16 m_nPrefix;
50 OUString m_aName;
51
53 XMLEventName( sal_uInt16 n, const char *p ) :
54 m_nPrefix( n ),
55 m_aName( OUString::createFromAscii(p) )
56 {}
57
58 XMLEventName( sal_uInt16 n, OUString s ) :
59 m_nPrefix( n ),
60 m_aName(std::move( s ))
61 {}
62
63 bool operator<( const XMLEventName& r ) const
64 {
65 return m_nPrefix < r.m_nPrefix ||
66 (m_nPrefix == r.m_nPrefix && m_aName < r.m_aName );
67 }
68
69};
70
77{
78 const char* sAPIName;
79 sal_uInt16 nPrefix; // namespace prefix
80 const char* sXMLName;
81};
82
86
87
95{
96public:
98
99 virtual void Export(
100 SvXMLExport& rExport,
101 const OUString& rEventQName,
102 const css::uno::Sequence<css::beans::PropertyValue> & rValues,
103 bool bUseWhitespace) = 0;
104};
105
106
126{
127public:
129
131 SvXMLImport& rImport,
132 const css::uno::Reference<css::xml::sax::XFastAttributeList> & xAttrList,
134 XMLEventsImportContext* rEvents,
136 const OUString& rApiEventName) = 0;
137};
138
139
140#endif
141
142/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
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
virtual SvXMLImportContext * CreateContext(SvXMLImport &rImport, const css::uno::Reference< css::xml::sax::XFastAttributeList > &xAttrList, XMLEventsImportContext *rEvents, const OUString &rApiEventName)=0
virtual ~XMLEventContextFactory()
Definition: xmlevent.hxx:128
Handle export of an event for a certain event type (event type as defined by the PropertyValue "Event...
Definition: xmlevent.hxx:95
virtual void Export(SvXMLExport &rExport, const OUString &rEventQName, const css::uno::Sequence< css::beans::PropertyValue > &rValues, bool bUseWhitespace)=0
virtual ~XMLEventExportHandler()
Definition: xmlevent.hxx:97
Import <script:events> element.
void * p
sal_Int64 n
Reference
XMLEventNameTranslation: define tables that translate between event names as used in the XML file for...
Definition: xmlevent.hxx:77
const char * sXMLName
Definition: xmlevent.hxx:80
const char * sAPIName
Definition: xmlevent.hxx:78
sal_uInt16 m_nPrefix
Definition: xmlevent.hxx:49
XMLEventName(sal_uInt16 n, OUString s)
Definition: xmlevent.hxx:58
XMLEventName(sal_uInt16 n, const char *p)
Definition: xmlevent.hxx:53
bool operator<(const XMLEventName &r) const
Definition: xmlevent.hxx:63
OUString m_aName
Definition: xmlevent.hxx:50
const XMLEventNameTranslation aStandardEventTable[]
a translation table for the events defined in the XEventsSupplier service (implemented in XMLEventExp...