nss: upgrade to release 3.73
[LibreOffice.git] / writerfilter / source / ooxml / OOXMLFactory.hxx
blobbf92bd6e2a5142366aeb807df5b1389a145c7d8f
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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
23 #include <dmapper/resourcemodel.hxx>
25 #include "OOXMLFastContextHandler.hxx"
27 namespace writerfilter::ooxml {
29 enum class ResourceType {
30 NoResource,
31 Table,
32 Stream,
33 List,
34 Integer,
35 Properties,
36 Hex,
37 HexColor,
38 String,
39 Shape,
40 Boolean,
41 Value,
42 XNote,
43 TextTableCell,
44 TextTableRow,
45 TextTable,
46 PropertyTable,
47 Math,
48 Any,
49 TwipsMeasure_asSigned,
50 TwipsMeasure_asZero,
51 HpsMeasure,
52 MeasurementOrPercent
55 struct AttributeInfo
57 Token_t m_nToken;
58 ResourceType m_nResource;
59 Id m_nRef;
62 class OOXMLFactory_ns : public virtual SvRefBase {
63 public:
64 typedef tools::SvRef<OOXMLFactory_ns> Pointer_t;
66 virtual void startAction(OOXMLFastContextHandler * pHandler);
67 virtual void charactersAction(OOXMLFastContextHandler * pHandler, const OUString & rString);
68 virtual void endAction(OOXMLFastContextHandler * pHandler);
69 virtual void attributeAction(OOXMLFastContextHandler * pHandler, Token_t nToken, const OOXMLValue::Pointer_t& pValue);
71 protected:
72 virtual ~OOXMLFactory_ns() override;
74 public:
75 virtual bool getListValue(Id nId, const OUString& rValue, sal_uInt32& rOutValue) = 0;
76 virtual Id getResourceId(Id nDefine, sal_Int32 nToken) = 0;
77 virtual const AttributeInfo* getAttributeInfoArray(Id nId) = 0;
78 virtual bool getElementId(Id nDefine, Id nId, ResourceType& rOutResource, Id& rOutElement) = 0;
81 class OOXMLFactory
83 public:
85 static css::uno::Reference< css::xml::sax::XFastContextHandler> createFastChildContext(OOXMLFastContextHandler * pHandler, Token_t Element);
87 static css::uno::Reference< css::xml::sax::XFastContextHandler> createFastChildContextFromStart(OOXMLFastContextHandler * pHandler, Token_t Element);
89 static void attributes(OOXMLFastContextHandler * pHandler, const css::uno::Reference< css::xml::sax::XFastAttributeList > & Attribs);
91 static void characters(OOXMLFastContextHandler * pHandler, const OUString & rString);
93 static void startAction(OOXMLFastContextHandler * pHandler);
94 static void endAction(OOXMLFastContextHandler * pHandler);
96 private:
97 OOXMLFactory() = delete;
98 static OOXMLFactory_ns::Pointer_t getFactoryForNamespace(Id id);
100 static css::uno::Reference< css::xml::sax::XFastContextHandler> createFastChildContextFromFactory(OOXMLFastContextHandler * pHandler, OOXMLFactory_ns::Pointer_t pFactory, Token_t Element);
106 #endif // INCLUDED_WRITERFILTER_SOURCE_OOXML_OOXMLFACTORY_HXX
108 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */