LibreOffice Module writerfilter (master) 1
OOXMLFactory.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
23
26
27namespace writerfilter::ooxml {
28
29enum class ResourceType {
31 Table,
32 Stream,
33 List,
34 Integer,
36 Hex,
38 String,
39 Shape,
40 Boolean,
41 Value,
42 XNote,
47 Math,
48 Any,
54 Theme,
55};
56
58{
62};
63
64class OOXMLFactory_ns : public virtual SvRefBase {
65public:
67
68 virtual void startAction(OOXMLFastContextHandler * pHandler);
69 virtual void charactersAction(OOXMLFastContextHandler * pHandler, const OUString & rString);
70 virtual void endAction(OOXMLFastContextHandler * pHandler);
71 virtual void attributeAction(OOXMLFastContextHandler * pHandler, Token_t nToken, const OOXMLValue::Pointer_t& pValue);
72
73protected:
74 virtual ~OOXMLFactory_ns() override;
75
76public:
77 virtual bool getListValue(Id nId, std::string_view aValue, sal_uInt32& rOutValue) = 0;
78 virtual Id getResourceId(Id nDefine, sal_Int32 nToken) = 0;
79 virtual const AttributeInfo* getAttributeInfoArray(Id nId) = 0;
80 virtual bool getElementId(Id nDefine, Id nId, ResourceType& rOutResource, Id& rOutElement) = 0;
81};
82
84{
85public:
86
87 static css::uno::Reference< css::xml::sax::XFastContextHandler> createFastChildContext(OOXMLFastContextHandler * pHandler, Token_t Element);
88
89 static css::uno::Reference< css::xml::sax::XFastContextHandler> createFastChildContextFromStart(OOXMLFastContextHandler * pHandler, Token_t Element);
90
91 static void attributes(OOXMLFastContextHandler * pHandler, const css::uno::Reference< css::xml::sax::XFastAttributeList > & Attribs);
92
93 static void characters(OOXMLFastContextHandler * pHandler, const OUString & rString);
94
95 static void startAction(OOXMLFastContextHandler * pHandler);
96 static void endAction(OOXMLFastContextHandler * pHandler);
97
98private:
99 OOXMLFactory() = delete;
101
102 static css::uno::Reference< css::xml::sax::XFastContextHandler> createFastChildContextFromFactory(OOXMLFastContextHandler * pHandler, OOXMLFactory_ns::Pointer_t pFactory, Token_t Element);
103};
104
105}
106
107
108/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Handler for properties.
Handler for a stream.
Handler for tables.
virtual void charactersAction(OOXMLFastContextHandler *pHandler, const OUString &rString)
virtual bool getListValue(Id nId, std::string_view aValue, sal_uInt32 &rOutValue)=0
virtual void endAction(OOXMLFastContextHandler *pHandler)
virtual const AttributeInfo * getAttributeInfoArray(Id nId)=0
virtual void startAction(OOXMLFastContextHandler *pHandler)
virtual Id getResourceId(Id nDefine, sal_Int32 nToken)=0
virtual bool getElementId(Id nDefine, Id nId, ResourceType &rOutResource, Id &rOutElement)=0
tools::SvRef< OOXMLFactory_ns > Pointer_t
virtual void attributeAction(OOXMLFastContextHandler *pHandler, Token_t nToken, const OOXMLValue::Pointer_t &pValue)
static css::uno::Reference< css::xml::sax::XFastContextHandler > createFastChildContextFromStart(OOXMLFastContextHandler *pHandler, Token_t Element)
static css::uno::Reference< css::xml::sax::XFastContextHandler > createFastChildContextFromFactory(OOXMLFastContextHandler *pHandler, OOXMLFactory_ns::Pointer_t pFactory, Token_t Element)
static void attributes(OOXMLFastContextHandler *pHandler, const css::uno::Reference< css::xml::sax::XFastAttributeList > &Attribs)
static void characters(OOXMLFastContextHandler *pHandler, const OUString &rString)
static void startAction(OOXMLFastContextHandler *pHandler)
static OOXMLFactory_ns::Pointer_t getFactoryForNamespace(Id id)
static void endAction(OOXMLFastContextHandler *pHandler)
static css::uno::Reference< css::xml::sax::XFastContextHandler > createFastChildContext(OOXMLFastContextHandler *pHandler, Token_t Element)
sal_Int32 Token_t
The classes in this file define the interfaces for the resource model of the DocTokenizer:
sal_uInt32 Id
Shape