LibreOffice Module xmloff (master) 1
XMLIndexTemplateContext.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
22#include <xmloff/xmlictxt.hxx>
23#include <xmloff/xmltoken.hxx>
24
25#include <vector>
26#include <com/sun/star/uno/Reference.h>
27#include <com/sun/star/beans/PropertyValues.hpp>
28
29
30namespace com::sun::star {
31 namespace xml::sax { class XAttributeList; }
32 namespace beans { class XPropertySet; }
33}
34template<typename EnumT> struct SvXMLEnumMapEntry;
35
36
37// constants for the XMLIndexTemplateContext constructor
38
39// TOC and user defined index:
41extern const char* aLevelStylePropNameTOCMap[];
42extern const bool aAllowedTokenTypesTOC[];
43extern const bool aAllowedTokenTypesUser[];
44
45// alphabetical index:
47extern const char* aLevelStylePropNameAlphaMap[];
48extern const bool aAllowedTokenTypesAlpha[];
49
50// bibliography:
52extern const char* aLevelStylePropNameBibliographyMap[];
53extern const bool aAllowedTokenTypesBibliography[];
54
55// table, illustration and object tables:
56extern const SvXMLEnumMapEntry<sal_uInt16>* aLevelNameTableMap; // NULL: no outline-level
57extern const char* aLevelStylePropNameTableMap[];
58extern const bool aAllowedTokenTypesTable[];
59
60
65{
66 // pick up PropertyValues to be turned into a sequence.
67 ::std::vector< css::beans::PropertyValues > aValueVector;
68
69 OUString sStyleName;
70
75
76 sal_Int32 nOutlineLevel;
79 bool bTOC;
80
81 // PropertySet of current index
82 css::uno::Reference<css::beans::XPropertySet> & rPropertySet;
83
84public:
85 template<typename EnumT>
87 SvXMLImport& rImport,
88 css::uno::Reference<css::beans::XPropertySet> & rPropSet,
89 const SvXMLEnumMapEntry<EnumT>* aLevelNameMap,
91 const char** aLevelStylePropNameMap,
92 const bool* aAllowedTokenTypes,
93 bool bTOC_=false)
94 : XMLIndexTemplateContext(rImport,rPropSet,
95 reinterpret_cast<const SvXMLEnumMapEntry<sal_uInt16>*>(aLevelNameMap),
96 eLevelAttrName, aLevelStylePropNameMap, aAllowedTokenTypes, bTOC_) {}
98 SvXMLImport& rImport,
99 css::uno::Reference<css::beans::XPropertySet> & rPropSet,
100 const SvXMLEnumMapEntry<sal_uInt16>* aLevelNameMap,
102 const char** aLevelStylePropNameMap,
103 const bool* aAllowedTokenTypes,
104 bool bTOC);
105
106 virtual ~XMLIndexTemplateContext() override;
107
109 void addTemplateEntry(
110 const css::beans::PropertyValues& aValues);
111
112protected:
113
114 virtual void SAL_CALL startFastElement(
115 sal_Int32 nElement,
116 const css::uno::Reference< css::xml::sax::XFastAttributeList >& xAttrList ) override;
117
118 virtual void SAL_CALL endFastElement(sal_Int32 nElement) override;
119
120 virtual css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext(
121 sal_Int32 nElement,
122 const css::uno::Reference< css::xml::sax::XFastAttributeList >& xAttrList ) override;
123};
124
125/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
const char * aLevelStylePropNameTOCMap[]
const SvXMLEnumMapEntry< sal_uInt16 > aLevelNameBibliographyMap[]
const char * aLevelStylePropNameTableMap[]
const bool aAllowedTokenTypesBibliography[]
const bool aAllowedTokenTypesAlpha[]
const char * aLevelStylePropNameBibliographyMap[]
const bool aAllowedTokenTypesTOC[]
const bool aAllowedTokenTypesTable[]
const bool aAllowedTokenTypesUser[]
const SvXMLEnumMapEntry< sal_uInt16 > aLevelNameAlphaMap[]
const SvXMLEnumMapEntry< sal_uInt16 > aSvLevelNameTOCMap[]
const SvXMLEnumMapEntry< sal_uInt16 > * aLevelNameTableMap
const char * aLevelStylePropNameAlphaMap[]
This class deliberately does not support XWeak, to improve performance when loading large documents.
Definition: xmlictxt.hxx:48
Import index entry templates.
::std::vector< css::beans::PropertyValues > aValueVector
virtual ~XMLIndexTemplateContext() override
virtual void SAL_CALL endFastElement(sal_Int32 nElement) override
endFastElement is called before a context will be destructed, but after an elements context has been ...
XMLIndexTemplateContext(SvXMLImport &rImport, css::uno::Reference< css::beans::XPropertySet > &rPropSet, const SvXMLEnumMapEntry< EnumT > *aLevelNameMap, enum ::xmloff::token::XMLTokenEnum eLevelAttrName, const char **aLevelStylePropNameMap, const bool *aAllowedTokenTypes, bool bTOC_=false)
enum::xmloff::token::XMLTokenEnum eOutlineLevelAttrName
virtual void SAL_CALL startFastElement(sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList > &xAttrList) override
virtual css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext(sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList > &xAttrList) override
void addTemplateEntry(const css::beans::PropertyValues &aValues)
add template; to be called by child template entry contexts
XMLIndexTemplateContext(SvXMLImport &rImport, css::uno::Reference< css::beans::XPropertySet > &rPropSet, const SvXMLEnumMapEntry< sal_uInt16 > *aLevelNameMap, enum ::xmloff::token::XMLTokenEnum eLevelAttrName, const char **aLevelStylePropNameMap, const bool *aAllowedTokenTypes, bool bTOC)
const SvXMLEnumMapEntry< sal_uInt16 > * pOutlineLevelNameMap
css::uno::Reference< css::beans::XPropertySet > & rPropertySet
class SAL_NO_VTABLE XPropertySet
XMLTokenEnum
The enumeration of all XML tokens.
Definition: xmltoken.hxx:50