1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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_WRITERFILTER_SOURCE_OOXML_OOXMLFACTORY_HXX
21 #define INCLUDED_WRITERFILTER_SOURCE_OOXML_OOXMLFACTORY_HXX
25 #include <dmapper/resourcemodel.hxx>
27 #include <oox/token/tokens.hxx>
29 #include "OOXMLFastContextHandler.hxx"
30 #include <boost/intrusive_ptr.hpp>
32 namespace writerfilter
{
35 enum class ResourceType
{
55 TwipsMeasure_asSigned
,
63 Token_t
const m_nToken
;
64 ResourceType
const m_nResource
;
68 class OOXMLFactory_ns
: public virtual SvRefBase
{
70 typedef tools::SvRef
<OOXMLFactory_ns
> Pointer_t
;
72 virtual void startAction(OOXMLFastContextHandler
* pHandler
);
73 virtual void charactersAction(OOXMLFastContextHandler
* pHandler
, const OUString
& rString
);
74 virtual void endAction(OOXMLFastContextHandler
* pHandler
);
75 virtual void attributeAction(OOXMLFastContextHandler
* pHandler
, Token_t nToken
, const OOXMLValue::Pointer_t
& pValue
);
78 virtual ~OOXMLFactory_ns() override
;
81 virtual bool getListValue(Id nId
, const OUString
& rValue
, sal_uInt32
& rOutValue
) = 0;
82 virtual Id
getResourceId(Id nDefine
, sal_Int32 nToken
) = 0;
83 virtual const AttributeInfo
* getAttributeInfoArray(Id nId
) = 0;
84 virtual bool getElementId(Id nDefine
, Id nId
, ResourceType
& rOutResource
, Id
& rOutElement
) = 0;
91 static css::uno::Reference
< css::xml::sax::XFastContextHandler
> createFastChildContext(OOXMLFastContextHandler
* pHandler
, Token_t Element
);
93 static css::uno::Reference
< css::xml::sax::XFastContextHandler
> createFastChildContextFromStart(OOXMLFastContextHandler
* pHandler
, Token_t Element
);
95 static void attributes(OOXMLFastContextHandler
* pHandler
, const css::uno::Reference
< css::xml::sax::XFastAttributeList
> & Attribs
);
97 static void characters(OOXMLFastContextHandler
* pHandler
, const OUString
& rString
);
99 static void startAction(OOXMLFastContextHandler
* pHandler
);
100 static void endAction(OOXMLFastContextHandler
* pHandler
);
103 OOXMLFactory() = delete;
104 static OOXMLFactory_ns::Pointer_t
getFactoryForNamespace(Id id
);
106 static css::uno::Reference
< css::xml::sax::XFastContextHandler
> createFastChildContextFromFactory(OOXMLFastContextHandler
* pHandler
, OOXMLFactory_ns::Pointer_t pFactory
, Token_t Element
);
112 #endif // INCLUDED_WRITERFILTER_SOURCE_OOXML_OOXMLFACTORY_HXX
114 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */