1 /************************************************************** 2 * 3 * Licensed to the Apache Software Foundation (ASF) under one 4 * or more contributor license agreements. See the NOTICE file 5 * distributed with this work for additional information 6 * regarding copyright ownership. The ASF licenses this file 7 * to you under the Apache License, Version 2.0 (the 8 * "License"); you may not use this file except in compliance 9 * with the License. You may obtain a copy of the License at 10 * 11 * http://www.apache.org/licenses/LICENSE-2.0 12 * 13 * Unless required by applicable law or agreed to in writing, 14 * software distributed under the License is distributed on an 15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 * KIND, either express or implied. See the License for the 17 * specific language governing permissions and limitations 18 * under the License. 19 * 20 *************************************************************/ 21 22 23 #ifndef _DOCTXM_HXX 24 #define _DOCTXM_HXX 25 26 27 #include <svl/svarray.hxx> 28 #include <tools/gen.hxx> 29 #include <tox.hxx> 30 #include <section.hxx> 31 32 class SwTOXInternational; 33 class SvUShorts; 34 class SvStringsDtor; 35 class SvPtrarr; 36 class SwPageDesc; 37 class SwTxtNode; 38 class SwTxtFmtColl; 39 struct SwPosition; 40 struct SwTOXSortTabBase; 41 42 typedef SwTOXSortTabBase* SwTOXSortTabBasePtr; 43 44 SV_DECL_PTRARR(SwTOXSortTabBases, SwTOXSortTabBasePtr, 0, 5 ) 45 46 /*-------------------------------------------------------------------- 47 Beschreibung: Ring der speziellen Verzeichnisse 48 --------------------------------------------------------------------*/ 49 50 class SwTOXBaseSection : public SwTOXBase, public SwSection 51 { 52 SwTOXSortTabBases aSortArr; 53 54 void UpdateMarks( const SwTOXInternational& rIntl, 55 const SwTxtNode* pOwnChapterNode ); 56 void UpdateOutline( const SwTxtNode* pOwnChapterNode ); 57 void UpdateTemplate( const SwTxtNode* pOwnChapterNode ); 58 void UpdateCntnt( SwTOXElement eType, 59 const SwTxtNode* pOwnChapterNode ); 60 void UpdateTable( const SwTxtNode* pOwnChapterNode ); 61 void UpdateSequence( const SwTxtNode* pOwnChapterNode ); 62 void UpdateAuthorities( const SwTOXInternational& rIntl ); 63 void UpdateAll(); 64 65 // Sortiert einfuegen ins Array fuer die Generierung 66 void InsertSorted(SwTOXSortTabBase* pBase); 67 68 // Alpha-Trennzeichen bei der Generierung einfuegen 69 void InsertAlphaDelimitter( const SwTOXInternational& rIntl ); 70 71 // Textrumpf generieren 72 // OD 18.03.2003 #106329# - add parameter <_TOXSectNdIdx> and <_pDefaultPageDesc> 73 void GenerateText( sal_uInt16 nArrayIdx, 74 sal_uInt16 nCount, 75 SvStringsDtor&, 76 const sal_uInt32 _nTOXSectNdIdx, 77 const SwPageDesc* _pDefaultPageDesc ); 78 79 // Seitennummerplatzhalter gegen aktuelle Nummern austauschen 80 void _UpdatePageNum( SwTxtNode* pNd, 81 const SvUShorts& rNums, 82 const SvPtrarr &rDescs, 83 const SvUShorts* pMainEntryNums, 84 const SwTOXInternational& rIntl ); 85 86 // Bereich fuer Stichwort einfuegen suchen 87 Range GetKeyRange( const String& rStr, const String& rStrReading, 88 const SwTOXSortTabBase& rNew, sal_uInt16 nLevel, 89 const Range& rRange ); 90 91 // returne die TextCollection ueber den Namen / aus Format-Pool 92 SwTxtFmtColl* GetTxtFmtColl( sal_uInt16 nLevel ); 93 94 public: 95 SwTOXBaseSection(SwTOXBase const& rBase, SwSectionFmt & rFmt); 96 virtual ~SwTOXBaseSection(); 97 98 // OD 19.03.2003 #106329# - add parameter <_bNewTOX> in order to distinguish 99 // between the creation of a new table-of-content or an update of 100 // a table-of-content. Default value: false 101 void Update( const SfxItemSet* pAttr = 0, 102 const bool _bNewTOX = false ); // Formatieren 103 void UpdatePageNum(); // Seitennummern einfuegen 104 TYPEINFO(); // fuers rtti 105 //IAccessibility2 Implementation 2009----- 106 SwTOXSortTabBases* GetTOXSortTabBases() { return &aSortArr; } 107 //-----IAccessibility2 Implementation 2009 108 109 sal_Bool SetPosAtStartEnd( SwPosition& rPos, sal_Bool bAtStart = sal_True ) const; 110 }; 111 /* -----------------02.09.99 07:52------------------- 112 113 --------------------------------------------------*/ 114 struct SwDefTOXBase_Impl 115 { 116 SwTOXBase* pContBase; 117 SwTOXBase* pIdxBase; 118 SwTOXBase* pUserBase; 119 SwTOXBase* pTblBase; 120 SwTOXBase* pObjBase; 121 SwTOXBase* pIllBase; 122 SwTOXBase* pAuthBase; 123 124 SwDefTOXBase_Impl() : 125 pContBase(0), 126 pIdxBase(0), 127 pUserBase(0), 128 pTblBase(0), 129 pObjBase(0), 130 pIllBase(0), 131 pAuthBase(0) 132 {} 133 ~SwDefTOXBase_Impl() 134 { 135 delete pContBase; 136 delete pIdxBase; 137 delete pUserBase; 138 delete pTblBase; 139 delete pObjBase; 140 delete pIllBase; 141 delete pAuthBase; 142 } 143 144 }; 145 146 #endif // _DOCTXM_HXX 147