1 /************************************************************************* 2 * 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 * 5 * Copyright 2000, 2010 Oracle and/or its affiliates. 6 * 7 * OpenOffice.org - a multi-platform office productivity suite 8 * 9 * This file is part of OpenOffice.org. 10 * 11 * OpenOffice.org is free software: you can redistribute it and/or modify 12 * it under the terms of the GNU Lesser General Public License version 3 13 * only, as published by the Free Software Foundation. 14 * 15 * OpenOffice.org is distributed in the hope that it will be useful, 16 * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 * GNU Lesser General Public License version 3 for more details 19 * (a copy is included in the LICENSE file that accompanied this code). 20 * 21 * You should have received a copy of the GNU Lesser General Public License 22 * version 3 along with OpenOffice.org. If not, see 23 * <http://www.openoffice.org/license.html> 24 * for a copy of the LGPLv3 License. 25 * 26 ************************************************************************/ 27 #ifndef _DOCTXM_HXX 28 #define _DOCTXM_HXX 29 30 31 #include <svl/svarray.hxx> 32 #include <tools/gen.hxx> 33 #include <tox.hxx> 34 #include <section.hxx> 35 36 class SwTOXInternational; 37 class SvUShorts; 38 class SvStringsDtor; 39 class SvPtrarr; 40 class SwPageDesc; 41 class SwTxtNode; 42 class SwTxtFmtColl; 43 struct SwPosition; 44 struct SwTOXSortTabBase; 45 46 typedef SwTOXSortTabBase* SwTOXSortTabBasePtr; 47 48 SV_DECL_PTRARR(SwTOXSortTabBases, SwTOXSortTabBasePtr, 0, 5 ) 49 50 /*-------------------------------------------------------------------- 51 Beschreibung: Ring der speziellen Verzeichnisse 52 --------------------------------------------------------------------*/ 53 54 class SwTOXBaseSection : public SwTOXBase, public SwSection 55 { 56 SwTOXSortTabBases aSortArr; 57 58 void UpdateMarks( const SwTOXInternational& rIntl, 59 const SwTxtNode* pOwnChapterNode ); 60 void UpdateOutline( const SwTxtNode* pOwnChapterNode ); 61 void UpdateTemplate( const SwTxtNode* pOwnChapterNode ); 62 void UpdateCntnt( SwTOXElement eType, 63 const SwTxtNode* pOwnChapterNode ); 64 void UpdateTable( const SwTxtNode* pOwnChapterNode ); 65 void UpdateSequence( const SwTxtNode* pOwnChapterNode ); 66 void UpdateAuthorities( const SwTOXInternational& rIntl ); 67 void UpdateAll(); 68 69 // Sortiert einfuegen ins Array fuer die Generierung 70 void InsertSorted(SwTOXSortTabBase* pBase); 71 72 // Alpha-Trennzeichen bei der Generierung einfuegen 73 void InsertAlphaDelimitter( const SwTOXInternational& rIntl ); 74 75 // Textrumpf generieren 76 // OD 18.03.2003 #106329# - add parameter <_TOXSectNdIdx> and <_pDefaultPageDesc> 77 void GenerateText( sal_uInt16 nArrayIdx, 78 sal_uInt16 nCount, 79 SvStringsDtor&, 80 const sal_uInt32 _nTOXSectNdIdx, 81 const SwPageDesc* _pDefaultPageDesc ); 82 83 // Seitennummerplatzhalter gegen aktuelle Nummern austauschen 84 void _UpdatePageNum( SwTxtNode* pNd, 85 const SvUShorts& rNums, 86 const SvPtrarr &rDescs, 87 const SvUShorts* pMainEntryNums, 88 const SwTOXInternational& rIntl ); 89 90 // Bereich fuer Stichwort einfuegen suchen 91 Range GetKeyRange( const String& rStr, const String& rStrReading, 92 const SwTOXSortTabBase& rNew, sal_uInt16 nLevel, 93 const Range& rRange ); 94 95 // returne die TextCollection ueber den Namen / aus Format-Pool 96 SwTxtFmtColl* GetTxtFmtColl( sal_uInt16 nLevel ); 97 98 public: 99 SwTOXBaseSection(SwTOXBase const& rBase, SwSectionFmt & rFmt); 100 virtual ~SwTOXBaseSection(); 101 102 // OD 19.03.2003 #106329# - add parameter <_bNewTOX> in order to distinguish 103 // between the creation of a new table-of-content or an update of 104 // a table-of-content. Default value: false 105 void Update( const SfxItemSet* pAttr = 0, 106 const bool _bNewTOX = false ); // Formatieren 107 void UpdatePageNum(); // Seitennummern einfuegen 108 TYPEINFO(); // fuers rtti 109 110 sal_Bool SetPosAtStartEnd( SwPosition& rPos, sal_Bool bAtStart = sal_True ) const; 111 }; 112 /* -----------------02.09.99 07:52------------------- 113 114 --------------------------------------------------*/ 115 struct SwDefTOXBase_Impl 116 { 117 SwTOXBase* pContBase; 118 SwTOXBase* pIdxBase; 119 SwTOXBase* pUserBase; 120 SwTOXBase* pTblBase; 121 SwTOXBase* pObjBase; 122 SwTOXBase* pIllBase; 123 SwTOXBase* pAuthBase; 124 125 SwDefTOXBase_Impl() : 126 pContBase(0), 127 pIdxBase(0), 128 pUserBase(0), 129 pTblBase(0), 130 pObjBase(0), 131 pIllBase(0), 132 pAuthBase(0) 133 {} 134 ~SwDefTOXBase_Impl() 135 { 136 delete pContBase; 137 delete pIdxBase; 138 delete pUserBase; 139 delete pTblBase; 140 delete pObjBase; 141 delete pIllBase; 142 delete pAuthBase; 143 } 144 145 }; 146 147 #endif // _DOCTXM_HXX 148