LibreOffice Module xmloff (master) 1
XMLSectionExport.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 <rtl/ustring.hxx>
23#include <com/sun/star/uno/Reference.h>
24#include <com/sun/star/uno/Sequence.h>
25#include <com/sun/star/beans/PropertyValue.hpp>
26#include <xmloff/xmltoken.hxx>
27
28class SvXMLExport;
30namespace com::sun::star {
31 namespace text
32 {
33 class XTextSection;
34 class XDocumentIndex;
35 class XTextContent;
36 }
37 namespace beans
38 {
39 class XPropertySet;
40 }
41 namespace container
42 {
43 class XIndexReplace;
44 }
45}
46
47
49{
58};
59
60
67{
70
72
73public:
75 XMLTextParagraphExport& rParaExp);
76
83 const css::uno::Reference < css::text::XTextSection > & rSection,
84 bool bAutoStyles);
85
90 const css::uno::Reference < css::text::XTextSection > & rSection,
91 bool bAutoStyles);
92
98 const css::uno::Reference < css::text::XTextSection > & rSection) const;
99
105 const css::uno::Reference < css::text::XTextContent > & rSection,
107 bool bDefault) const;
108
113 static bool IsInSection(
114 const css::uno::Reference < css::text::XTextSection > & rEnclosingSection,
115 const css::uno::Reference < css::text::XTextContent > & rContent,
117 bool bDefault);
118
126
132
133
134private:
135
138
139 // export methods for section and index start:
140
142 void ExportIndexStart(
143 const css::uno::Reference < css::text::XDocumentIndex > & rSection);
144
147 const css::uno::Reference < css::text::XTextSection > & rSection);
148
151 const css::uno::Reference < css::text::XTextSection > & rSection);
152
155 const css::uno::Reference < css::beans::XPropertySet > & rSection);
156
159 const css::uno::Reference < css::beans::XPropertySet > & rSection);
160
163 const css::uno::Reference < css::beans::XPropertySet > & rSection);
164
167 const css::uno::Reference < css::beans::XPropertySet > & rSection);
168
171 const css::uno::Reference < css::beans::XPropertySet > & rSection);
172
175 const css::uno::Reference < css::beans::XPropertySet > & rSection);
176
179 const css::uno::Reference < css::beans::XPropertySet > & rIndex);
180
181 // helper methods:
182
192 static bool GetIndex(
193 const css::uno::Reference < css::text::XTextSection > & rSection,
194 css::uno::Reference < css::text::XDocumentIndex > & rIndex);
195
197 static enum SectionTypeEnum MapSectionType(std::u16string_view rSectionName);
198
207 const css::uno::Reference < css::beans::XPropertySet > & rSection);
208
216 SectionTypeEnum eType,
217 const css::uno::Reference <
218 css::beans::XPropertySet > & rSection);
219
224 SectionTypeEnum eType,
225 const css::uno::Reference < css::beans::XPropertySet > & rSection);
226
227
233 const css::uno::Reference < css::beans::XPropertySet > & rSection);
234
237 SectionTypeEnum eType,
238 sal_Int32 nLevel,
239 const css::uno::Reference< css::beans::XPropertySet> & rPropSet,
240 const css::uno::Sequence< css::uno::Sequence< css::beans::PropertyValue> > & rValues);
241
244 SectionTypeEnum eType, //i90246, needed for ODF 1.0, 1.0 and 1.2 management
245 const css::uno::Sequence<
246 css::beans::PropertyValue> & rValues);
247
250 css::uno::Reference< css::container::XIndexReplace> const & xStyles);
251
252
254 void ExportBoolean(
255 const css::uno::Reference<css::beans::XPropertySet> & rPropSet,
256 const OUString& sPropertyName,
258 bool bDefault,
259 bool bInvert = false);
260};
261
262/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
SectionTypeEnum
@ TEXT_SECTION_TYPE_ALPHABETICAL
@ TEXT_SECTION_TYPE_BIBLIOGRAPHY
@ TEXT_SECTION_TYPE_OBJECT
@ TEXT_SECTION_TYPE_ILLUSTRATION
@ TEXT_SECTION_TYPE_TABLE
@ TEXT_SECTION_TYPE_UNKNOWN
@ TEXT_SECTION_TYPE_USER
@ TEXT_SECTION_TYPE_TOC
This class handles the export of sections and indices (which are, internally, just sections).
XMLTextParagraphExport & GetParaExport()
void ExportLevelParagraphStyles(css::uno::Reference< css::container::XIndexReplace > const &xStyles)
export level paragraph styles
void ExportSectionStart(const css::uno::Reference< css::text::XTextSection > &rSection, bool bAutoStyles)
export section or index start and source elements.
void ExportUserIndexStart(const css::uno::Reference< css::beans::XPropertySet > &rSection)
export a user index (and source element)
static enum SectionTypeEnum MapSectionType(std::u16string_view rSectionName)
map service name to section type
static bool IsInSection(const css::uno::Reference< css::text::XTextSection > &rEnclosingSection, const css::uno::Reference< css::text::XTextContent > &rContent, bool bDefault)
Determine whether rContent is contained in rEnclosingSection.
void ExportSectionEnd(const css::uno::Reference< css::text::XTextSection > &rSection, bool bAutoStyles)
export section or index end elements
void ExportBibliographyStart(const css::uno::Reference< css::beans::XPropertySet > &rIndex)
export the bibliography (and source element)
void ExportBaseIndexStart(::xmloff::token::XMLTokenEnum eElement, const css::uno::Reference< css::beans::XPropertySet > &rSection)
Export the index element start (for all index types).
void ExportObjectIndexStart(const css::uno::Reference< css::beans::XPropertySet > &rSection)
export an object index (and source element)
XMLSectionExport(SvXMLExport &rExp, XMLTextParagraphExport &rParaExp)
void ExportTableOfContentStart(const css::uno::Reference< css::beans::XPropertySet > &rSection)
export a table of content (and source element)
void ExportTableIndexStart(const css::uno::Reference< css::beans::XPropertySet > &rSection)
export a table index (and source element)
void ExportBoolean(const css::uno::Reference< css::beans::XPropertySet > &rPropSet, const OUString &sPropertyName, enum ::xmloff::token::XMLTokenEnum eAttributeName, bool bDefault, bool bInvert=false)
helper to export boolean properties
void ExportBaseIndexBody(SectionTypeEnum eType, const css::uno::Reference< css::beans::XPropertySet > &rSection)
Export the index body (common for all index types).
void ExportIndexTemplateElement(SectionTypeEnum eType, const css::uno::Sequence< css::beans::PropertyValue > &rValues)
export a single template element (e.g. span or tab-stop)
void ExportMasterDocHeadingDummies()
export a heading for every level.
void ExportRegularSectionStart(const css::uno::Reference< css::text::XTextSection > &rSection)
export a proper section (and source elements)
void ExportAlphabeticalIndexStart(const css::uno::Reference< css::beans::XPropertySet > &rSection)
export an alphabetical/keyword index (and source element)
XMLTextParagraphExport & rParaExport
void ExportTableAndIllustrationIndexSourceAttributes(const css::uno::Reference< css::beans::XPropertySet > &rSection)
Helper method to export common attributes for table and illustration indices.
static bool GetIndex(const css::uno::Reference< css::text::XTextSection > &rSection, css::uno::Reference< css::text::XDocumentIndex > &rIndex)
If this section is an index, the index is written in the rIndex parameter.
SvXMLExport & rExport
void ExportIndexHeaderStart(const css::uno::Reference< css::text::XTextSection > &rSection)
export an index header start element.
static void ExportBibliographyConfiguration(SvXMLExport &rExport)
Export the configuration element for bibliography indices.
SvXMLExport & GetExport()
void ExportBaseIndexSource(SectionTypeEnum eType, const css::uno::Reference< css::beans::XPropertySet > &rSection)
Export the index source element (common for all index types).
void ExportIndexStart(const css::uno::Reference< css::text::XDocumentIndex > &rSection)
export an index start element.
bool IsMuteSection(const css::uno::Reference< css::text::XTextContent > &rSection, bool bDefault) const
XTextContent-version of IsMuteSection(Reference<XTextSection>&) returns true for all non-section elem...
bool ExportIndexTemplate(SectionTypeEnum eType, sal_Int32 nLevel, const css::uno::Reference< css::beans::XPropertySet > &rPropSet, const css::uno::Sequence< css::uno::Sequence< css::beans::PropertyValue > > &rValues)
export one template for the specific index type
bool IsMuteSection(const css::uno::Reference< css::text::XTextSection > &rSection) const
Should the content of this section be exported? (E.g.
void ExportIllustrationIndexStart(const css::uno::Reference< css::beans::XPropertySet > &rSection)
export an illustration index (and source element)
def text(shape, orig_st)
class SAL_NO_VTABLE XPropertySet
XMLTokenEnum
The enumeration of all XML tokens.
Definition: xmltoken.hxx:50