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 #ifndef INCLUDED_XMLOFF_SOURCE_TEXT_XMLSECTIONEXPORT_HXX
21 #define INCLUDED_XMLOFF_SOURCE_TEXT_XMLSECTIONEXPORT_HXX
22 
23 #include <rtl/ustring.hxx>
24 #include <com/sun/star/uno/Reference.h>
25 #include <com/sun/star/uno/Sequence.h>
26 #include <com/sun/star/beans/PropertyValue.hpp>
27 #include <xmloff/xmltoken.hxx>
28 
29 class SvXMLExport;
31 namespace com::sun::star {
32  namespace text
33  {
34  class XTextSection;
35  class XDocumentIndex;
36  class XTextContent;
37  }
38  namespace beans
39  {
40  class XPropertySet;
41  }
42  namespace container
43  {
44  class XIndexReplace;
45  }
46 }
47 
48 
50 {
59 };
60 
61 
68 {
71 
73 
74 public:
76  XMLTextParagraphExport& rParaExp);
77 
83  void ExportSectionStart(
84  const css::uno::Reference < css::text::XTextSection > & rSection,
85  bool bAutoStyles);
86 
90  void ExportSectionEnd(
91  const css::uno::Reference < css::text::XTextSection > & rSection,
92  bool bAutoStyles);
93 
98  bool IsMuteSection(
99  const css::uno::Reference < css::text::XTextSection > & rSection) const;
100 
105  bool IsMuteSection(
106  const css::uno::Reference < css::text::XTextContent > & rSection,
108  bool bDefault) const;
109 
114  static bool IsInSection(
115  const css::uno::Reference < css::text::XTextSection > & rEnclosingSection,
116  const css::uno::Reference < css::text::XTextContent > & rContent,
118  bool bDefault);
119 
126  static void ExportBibliographyConfiguration(SvXMLExport& rExport);
127 
133 
134 
135 private:
136 
139 
140  // export methods for section and index start:
141 
143  void ExportIndexStart(
144  const css::uno::Reference < css::text::XDocumentIndex > & rSection);
145 
148  const css::uno::Reference < css::text::XTextSection > & rSection);
149 
152  const css::uno::Reference < css::text::XTextSection > & rSection);
153 
156  const css::uno::Reference < css::beans::XPropertySet > & rSection);
157 
160  const css::uno::Reference < css::beans::XPropertySet > & rSection);
161 
164  const css::uno::Reference < css::beans::XPropertySet > & rSection);
165 
168  const css::uno::Reference < css::beans::XPropertySet > & rSection);
169 
172  const css::uno::Reference < css::beans::XPropertySet > & rSection);
173 
176  const css::uno::Reference < css::beans::XPropertySet > & rSection);
177 
180  const css::uno::Reference < css::beans::XPropertySet > & rIndex);
181 
182  // helper methods:
183 
193  static bool GetIndex(
194  const css::uno::Reference < css::text::XTextSection > & rSection,
195  css::uno::Reference < css::text::XDocumentIndex > & rIndex);
196 
198  static enum SectionTypeEnum MapSectionType(const OUString& rSectionName);
199 
207  ::xmloff::token::XMLTokenEnum eElement,
208  const css::uno::Reference < css::beans::XPropertySet > & rSection);
209 
217  SectionTypeEnum eType,
218  const css::uno::Reference <
219  css::beans::XPropertySet > & rSection);
220 
224  void ExportBaseIndexBody(
225  SectionTypeEnum eType,
226  const css::uno::Reference < css::beans::XPropertySet > & rSection);
227 
228 
234  const css::uno::Reference < css::beans::XPropertySet > & rSection);
235 
237  bool ExportIndexTemplate(
238  SectionTypeEnum eType,
239  sal_Int32 nLevel,
240  const css::uno::Reference< css::beans::XPropertySet> & rPropSet,
241  const css::uno::Sequence< css::uno::Sequence< css::beans::PropertyValue> > & rValues);
242 
245  SectionTypeEnum eType, //i90246, needed for ODF 1.0, 1.0 and 1.2 management
246  const css::uno::Sequence<
247  css::beans::PropertyValue> & rValues);
248 
251  css::uno::Reference< css::container::XIndexReplace> const & xStyles);
252 
253 
255  void ExportBoolean(
256  const css::uno::Reference<css::beans::XPropertySet> & rPropSet,
257  const OUString& sPropertyName,
258  enum ::xmloff::token::XMLTokenEnum eAttributeName,
259  bool bDefault,
260  bool bInvert = false);
261 };
262 
263 #endif
264 
265 /* 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()
XMLTokenEnum
The enumeration of all XML tokens.
Definition: xmltoken.hxx:49
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)
static enum SectionTypeEnum MapSectionType(const OUString &rSectionName)
map service name to section type
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)
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).
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.