android: Update app-specific/MIME type icons
[LibreOffice.git] / writerfilter / source / ooxml / OOXMLFactory.hxx
bloba3f9dd85382a35f022449ec01a9ad37bd5252ae0
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 #pragma once
22 #include <dmapper/resourcemodel.hxx>
24 #include "OOXMLFastContextHandler.hxx"
25 #include "OOXMLFastContextHandlerTheme.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,
53 CommentEx,
54 Theme,
57 struct AttributeInfo
59 Token_t m_nToken;
60 ResourceType m_nResource;
61 Id m_nRef;
64 class OOXMLFactory_ns : public virtual SvRefBase {
65 public:
66 typedef tools::SvRef<OOXMLFactory_ns> Pointer_t;
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);
73 protected:
74 virtual ~OOXMLFactory_ns() override;
76 public:
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;
83 class OOXMLFactory
85 public:
87 static css::uno::Reference< css::xml::sax::XFastContextHandler> createFastChildContext(OOXMLFastContextHandler * pHandler, Token_t Element);
89 static css::uno::Reference< css::xml::sax::XFastContextHandler> createFastChildContextFromStart(OOXMLFastContextHandler * pHandler, Token_t Element);
91 static void attributes(OOXMLFastContextHandler * pHandler, const css::uno::Reference< css::xml::sax::XFastAttributeList > & Attribs);
93 static void characters(OOXMLFastContextHandler * pHandler, const OUString & rString);
95 static void startAction(OOXMLFastContextHandler * pHandler);
96 static void endAction(OOXMLFastContextHandler * pHandler);
98 private:
99 OOXMLFactory() = delete;
100 static OOXMLFactory_ns::Pointer_t getFactoryForNamespace(Id id);
102 static css::uno::Reference< css::xml::sax::XFastContextHandler> createFastChildContextFromFactory(OOXMLFastContextHandler * pHandler, OOXMLFactory_ns::Pointer_t pFactory, Token_t Element);
108 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */