LibreOffice Module sw (master)  1
doctxm.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_SW_SOURCE_CORE_INC_DOCTXM_HXX
21 #define INCLUDED_SW_SOURCE_CORE_INC_DOCTXM_HXX
22 
23 #include <tools/gen.hxx>
24 #include <tox.hxx>
25 #include <section.hxx>
26 
27 class SwTOXInternational;
28 class SwPageDesc;
29 class SwTextNode;
30 class SwTextFormatColl;
31 struct SwPosition;
32 struct SwTOXSortTabBase;
33 
34 class SwTOXBaseSection : public SwTOXBase, public SwSection
35 {
36  std::vector<std::unique_ptr<SwTOXSortTabBase>> m_aSortArr;
37 
38  void UpdateMarks( const SwTOXInternational& rIntl,
39  const SwTextNode* pOwnChapterNode,
40  SwRootFrame const* pLayout );
41  void UpdateOutline( const SwTextNode* pOwnChapterNode,
42  SwRootFrame const* pLayout );
43  void UpdateTemplate( const SwTextNode* pOwnChapterNode,
44  SwRootFrame const* pLayout );
45  void UpdateContent( SwTOXElement eType,
46  const SwTextNode* pOwnChapterNode,
47  SwRootFrame const* pLayout );
48  void UpdateTable( const SwTextNode* pOwnChapterNode,
49  SwRootFrame const* pLayout );
50  void UpdateSequence( const SwTextNode* pOwnChapterNode,
51  SwRootFrame const* pLayout );
52  void UpdateAuthorities( const SwTOXInternational& rIntl,
53  SwRootFrame const* pLayout );
54 
55  // insert sorted into array for creation
56  void InsertSorted(std::unique_ptr<SwTOXSortTabBase> pBase);
57 
58  // insert alpha delimiter at creation
59  void InsertAlphaDelimiter( const SwTOXInternational& rIntl );
60 
61  // replace page num placeholder with actual page number
62  void UpdatePageNum_( SwTextNode* pNd,
63  const std::vector<sal_uInt16>& rNums,
64  const std::vector<SwPageDesc*>& rDescs,
65  const std::vector<sal_uInt16>* pMainEntryNums,
66  const SwTOXInternational& rIntl );
67 
68  // get section for entering keywords
69  Range GetKeyRange( const OUString& rStr, const OUString& rStrReading,
70  const SwTOXSortTabBase& rNew, sal_uInt16 nLevel,
71  const Range& rRange );
72 
73  // return text collection via name/ from format pool
75 
76 public:
77  SwTOXBaseSection(SwTOXBase const& rBase, SwSectionFormat & rFormat);
78  virtual ~SwTOXBaseSection() override;
79 
80  // <_bNewTOX> : distinguish between the creation of a new table-of-content
81  // (true) or an update of a table-of-content (false)
82  void Update( const SfxItemSet* pAttr = nullptr,
83  SwRootFrame const* pLayout = nullptr,
84  const bool _bNewTOX = false );
85  void UpdatePageNum(); // insert page numbering
86 
87  bool SetPosAtStartEnd( SwPosition& rPos ) const;
88 };
89 
91 {
92  std::unique_ptr<SwTOXBase> pContBase;
93  std::unique_ptr<SwTOXBase> pIdxBase;
94  std::unique_ptr<SwTOXBase> pUserBase;
95  std::unique_ptr<SwTOXBase> pTableBase;
96  std::unique_ptr<SwTOXBase> pObjBase;
97  std::unique_ptr<SwTOXBase> pIllBase;
98  std::unique_ptr<SwTOXBase> pAuthBase;
99  std::unique_ptr<SwTOXBase> pBiblioBase;
100 
102  {
103  }
104 };
105 
106 #endif
107 
108 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Represents the style of a paragraph.
Definition: fmtcol.hxx:55
std::unique_ptr< SwTOXBase > pContBase
Definition: doctxm.hxx:92
Marks a position in the document model.
Definition: pam.hxx:35
std::unique_ptr< SwTOXBase > pTableBase
Definition: doctxm.hxx:95
std::unique_ptr< SwTOXBase > pBiblioBase
Definition: doctxm.hxx:99
void InsertAlphaDelimiter(const SwTOXInternational &rIntl)
Definition: doctxm.cxx:1083
void UpdateTemplate(const SwTextNode *pOwnChapterNode, SwRootFrame const *pLayout)
Generate table of contents from template areas.
Definition: doctxm.cxx:1270
sal_uInt16 nLevel
Definition: tox.hxx:406
The root element of a Writer document layout.
Definition: rootfrm.hxx:79
std::unique_ptr< SwTOXBase > pUserBase
Definition: doctxm.hxx:94
std::unique_ptr< SwTOXBase > pAuthBase
Definition: doctxm.hxx:98
void UpdatePageNum()
Calculate PageNumber and insert after formatting.
Definition: doctxm.cxx:1600
Range GetKeyRange(const OUString &rStr, const OUString &rStrReading, const SwTOXSortTabBase &rNew, sal_uInt16 nLevel, const Range &rRange)
Find Key Range and insert if possible.
Definition: doctxm.cxx:1967
std::vector< std::unique_ptr< SwTOXSortTabBase > > m_aSortArr
Definition: doctxm.hxx:36
SwTOXBaseSection(SwTOXBase const &rBase, SwSectionFormat &rFormat)
Definition: doctxm.cxx:745
SwTOXElement
Definition: tox.hxx:328
void UpdateOutline(const SwTextNode *pOwnChapterNode, SwRootFrame const *pLayout)
Generate table of contents from outline.
Definition: doctxm.cxx:1243
bool SetPosAtStartEnd(SwPosition &rPos) const
Definition: doctxm.cxx:757
void UpdateTable(const SwTextNode *pOwnChapterNode, SwRootFrame const *pLayout)
Collect table entries.
Definition: doctxm.cxx:1547
SwTextFormatColl * GetTextFormatColl(sal_uInt16 nLevel)
Evaluate Template.
Definition: doctxm.cxx:1126
std::unique_ptr< SwTOXBase > pIdxBase
Definition: doctxm.hxx:93
void UpdateAuthorities(const SwTOXInternational &rIntl, SwRootFrame const *pLayout)
Definition: doctxm.cxx:1359
std::unique_ptr< SwTOXBase > pObjBase
Definition: doctxm.hxx:96
virtual ~SwTOXBaseSection() override
Definition: doctxm.cxx:753
void UpdateSequence(const SwTextNode *pOwnChapterNode, SwRootFrame const *pLayout)
Generate content from sequence fields.
Definition: doctxm.cxx:1313
SwTextNode is a paragraph in the document model.
Definition: ndtxt.hxx:79
void InsertSorted(std::unique_ptr< SwTOXSortTabBase > pBase)
Definition: doctxm.cxx:1880
void Update(const SfxItemSet *pAttr=nullptr, SwRootFrame const *pLayout=nullptr, const bool _bNewTOX=false)
Collect table of contents content.
Definition: doctxm.cxx:772
void UpdatePageNum_(SwTextNode *pNd, const std::vector< sal_uInt16 > &rNums, const std::vector< SwPageDesc * > &rDescs, const std::vector< sal_uInt16 > *pMainEntryNums, const SwTOXInternational &rIntl)
Definition: doctxm.cxx:1722
void UpdateMarks(const SwTOXInternational &rIntl, const SwTextNode *pOwnChapterNode, SwRootFrame const *pLayout)
Create from Marks.
Definition: doctxm.cxx:1176
Class for sorting directories.
Definition: txmsrt.hxx:120
void UpdateContent(SwTOXElement eType, const SwTextNode *pOwnChapterNode, SwRootFrame const *pLayout)
Definition: doctxm.cxx:1441
std::unique_ptr< SwTOXBase > pIllBase
Definition: doctxm.hxx:97