bump product version to 5.0.4.1
[LibreOffice.git] / xmloff / source / text / XMLIndexTemplateContext.hxx
blob954c6cc5be12888d2bc3e7bd7c36a69b6c5fc3f9
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_XMLOFF_SOURCE_TEXT_XMLINDEXTEMPLATECONTEXT_HXX
21 #define INCLUDED_XMLOFF_SOURCE_TEXT_XMLINDEXTEMPLATECONTEXT_HXX
23 #include <xmloff/xmlictxt.hxx>
24 #include <xmloff/xmltoken.hxx>
26 #include <vector>
27 #include <com/sun/star/uno/Reference.h>
28 #include <com/sun/star/uno/Sequence.h>
29 #include <com/sun/star/beans/PropertyValues.hpp>
32 namespace com { namespace sun { namespace star {
33 namespace xml { namespace sax { class XAttributeList; } }
34 namespace beans { class XPropertySet; }
35 } } }
36 struct SvXMLEnumMapEntry;
39 // constants for the XMLIndexTemplateContext constructor
41 // TOC and user defined index:
42 extern const SvXMLEnumMapEntry aSvLevelNameTOCMap[];
43 extern const sal_Char* aLevelStylePropNameTOCMap[];
44 extern const sal_Bool aAllowedTokenTypesTOC[];
45 extern const sal_Bool aAllowedTokenTypesUser[];
47 // alphabetical index:
48 extern const SvXMLEnumMapEntry aLevelNameAlphaMap[];
49 extern const sal_Char* aLevelStylePropNameAlphaMap[];
50 extern const sal_Bool aAllowedTokenTypesAlpha[];
52 // bibliography:
53 extern const SvXMLEnumMapEntry aLevelNameBibliographyMap[];
54 extern const sal_Char* aLevelStylePropNameBibliographyMap[];
55 extern const sal_Bool aAllowedTokenTypesBibliography[];
57 // table, illustration and object tables:
58 extern const SvXMLEnumMapEntry* aLevelNameTableMap; // NULL: no outline-level
59 extern const sal_Char* aLevelStylePropNameTableMap[];
60 extern const sal_Bool aAllowedTokenTypesTable[];
63 /**
64 * Import index entry templates
66 class XMLIndexTemplateContext : public SvXMLImportContext
68 // pick up PropertyValues to be turned into a sequence.
69 ::std::vector< ::com::sun::star::beans::PropertyValues > aValueVector;
71 OUString sStyleName;
73 const SvXMLEnumMapEntry* pOutlineLevelNameMap;
74 enum ::xmloff::token::XMLTokenEnum eOutlineLevelAttrName;
75 const sal_Char** pOutlineLevelStylePropMap;
76 const sal_Bool* pAllowedTokenTypesMap;
78 sal_Int32 nOutlineLevel;
79 bool bStyleNameOK;
80 bool bOutlineLevelOK;
81 bool bTOC;
83 // PropertySet of current index
84 ::com::sun::star::uno::Reference<
85 ::com::sun::star::beans::XPropertySet> & rPropertySet;
87 public:
89 // constants made available to other contexts (template entry
90 // contexts, in particular)
91 const OUString sTokenEntryNumber;
92 const OUString sTokenEntryText;
93 const OUString sTokenTabStop;
94 const OUString sTokenText;
95 const OUString sTokenPageNumber;
96 const OUString sTokenChapterInfo;
97 const OUString sTokenHyperlinkStart;
98 const OUString sTokenHyperlinkEnd;
99 const OUString sTokenBibliographyDataField;
101 const OUString sCharacterStyleName;
102 const OUString sTokenType;
103 const OUString sText;
104 const OUString sTabStopRightAligned;
105 const OUString sTabStopPosition;
106 const OUString sTabStopFillCharacter;
107 const OUString sBibliographyDataField;
108 const OUString sChapterFormat;
109 const OUString sChapterLevel;//i53420
111 const OUString sLevelFormat;
112 const OUString sParaStyleLevel;
115 TYPEINFO_OVERRIDE();
117 XMLIndexTemplateContext(
118 SvXMLImport& rImport,
119 ::com::sun::star::uno::Reference<
120 ::com::sun::star::beans::XPropertySet> & rPropSet,
121 sal_uInt16 nPrfx,
122 const OUString& rLocalName,
123 const SvXMLEnumMapEntry* aLevelNameMap,
124 enum ::xmloff::token::XMLTokenEnum eLevelAttrName,
125 const sal_Char** aLevelStylePropNameMap,
126 const sal_Bool* aAllowedTokenTypes,
127 bool bTOC=false);
129 virtual ~XMLIndexTemplateContext();
131 /** add template; to be called by child template entry contexts */
132 void addTemplateEntry(
133 const ::com::sun::star::beans::PropertyValues& aValues);
135 protected:
137 virtual void StartElement(
138 const ::com::sun::star::uno::Reference<
139 ::com::sun::star::xml::sax::XAttributeList> & xAttrList) SAL_OVERRIDE;
141 virtual void EndElement() SAL_OVERRIDE;
143 virtual SvXMLImportContext *CreateChildContext(
144 sal_uInt16 nPrefix,
145 const OUString& rLocalName,
146 const ::com::sun::star::uno::Reference<
147 ::com::sun::star::xml::sax::XAttributeList> & xAttrList ) SAL_OVERRIDE;
150 #endif
152 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */