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 
28 class SvXMLExport;
30 namespace 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 
73 public:
75  XMLTextParagraphExport& rParaExp);
76 
82  void ExportSectionStart(
83  const css::uno::Reference < css::text::XTextSection > & rSection,
84  bool bAutoStyles);
85 
89  void ExportSectionEnd(
90  const css::uno::Reference < css::text::XTextSection > & rSection,
91  bool bAutoStyles);
92 
97  bool IsMuteSection(
98  const css::uno::Reference < css::text::XTextSection > & rSection) const;
99 
104  bool IsMuteSection(
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 
125  static void ExportBibliographyConfiguration(SvXMLExport& rExport);
126 
132 
133 
134 private:
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 
206  ::xmloff::token::XMLTokenEnum eElement,
207  const css::uno::Reference < css::beans::XPropertySet > & rSection);
208 
216  SectionTypeEnum eType,
217  const css::uno::Reference <
218  css::beans::XPropertySet > & rSection);
219 
223  void ExportBaseIndexBody(
224  SectionTypeEnum eType,
225  const css::uno::Reference < css::beans::XPropertySet > & rSection);
226 
227 
233  const css::uno::Reference < css::beans::XPropertySet > & rSection);
234 
236  bool ExportIndexTemplate(
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,
257  enum ::xmloff::token::XMLTokenEnum eAttributeName,
258  bool bDefault,
259  bool bInvert = false);
260 };
261 
262 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
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
void ExportTableOfContentStart(const css::uno::Reference< css::beans::XPropertySet > &rSection)
export a table of content (and source element)
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.
void ExportUserIndexStart(const css::uno::Reference< css::beans::XPropertySet > &rSection)
export a user index (and source element)
SectionTypeEnum
void ExportTableAndIllustrationIndexSourceAttributes(const css::uno::Reference< css::beans::XPropertySet > &rSection)
Helper method to export common attributes for table and illustration indices.
void ExportSectionEnd(const css::uno::Reference< css::text::XTextSection > &rSection, bool bAutoStyles)
export section or index end elements
void ExportRegularSectionStart(const css::uno::Reference< css::text::XTextSection > &rSection)
export a proper section (and source elements)
XMLTextParagraphExport & GetParaExport()
exports com.sun.star. container
void ExportObjectIndexStart(const css::uno::Reference< css::beans::XPropertySet > &rSection)
export an object index (and source element)
XMLSectionExport(SvXMLExport &rExp, XMLTextParagraphExport &rParaExp)
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).
SvXMLExport & GetExport()
bool IsMuteSection(const css::uno::Reference< css::text::XTextSection > &rSection) const
Should the content of this section be exported? (E.g.
void ExportAlphabeticalIndexStart(const css::uno::Reference< css::beans::XPropertySet > &rSection)
export an alphabetical/keyword index (and source element)
exports com.sun.star. text
SvXMLExport & rExport
class SAL_NO_VTABLE XPropertySet
This class handles the export of sections and indices (which are, internally, just sections)...
void ExportIndexStart(const css::uno::Reference< css::text::XDocumentIndex > &rSection)
export an index start element.
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.
exports com.sun.star. beans
void ExportSectionStart(const css::uno::Reference< css::text::XTextSection > &rSection, bool bAutoStyles)
export section or index start and source elements.
XMLTextParagraphExport & rParaExport
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 ExportBibliographyStart(const css::uno::Reference< css::beans::XPropertySet > &rIndex)
export the bibliography (and source element)
XMLTokenEnum
The enumeration of all XML tokens.
Definition: xmltoken.hxx:49
void ExportTableIndexStart(const css::uno::Reference< css::beans::XPropertySet > &rSection)
export a table index (and source element)
void ExportLevelParagraphStyles(css::uno::Reference< css::container::XIndexReplace > const &xStyles)
export level paragraph styles
void ExportIndexHeaderStart(const css::uno::Reference< css::text::XTextSection > &rSection)
export an index header start element.
void ExportIllustrationIndexStart(const css::uno::Reference< css::beans::XPropertySet > &rSection)
export an illustration index (and source element)
void ExportBaseIndexSource(SectionTypeEnum eType, const css::uno::Reference< css::beans::XPropertySet > &rSection)
Export the index source element (common for all index types).
static enum SectionTypeEnum MapSectionType(std::u16string_view rSectionName)
map service name to section type
void ExportBaseIndexStart(::xmloff::token::XMLTokenEnum eElement, const css::uno::Reference< css::beans::XPropertySet > &rSection)
Export the index element start (for all index types).
static void ExportBibliographyConfiguration(SvXMLExport &rExport)
Export the configuration element for bibliography indices.