xref: /aoo4110/main/sw/source/core/inc/doctxm.hxx (revision b1cdbd2c)
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
GetTOXSortTabBases()105 	SwTOXSortTabBases* GetTOXSortTabBases() { return &aSortArr; }
106 
107 	sal_Bool SetPosAtStartEnd( SwPosition& rPos, sal_Bool bAtStart = sal_True ) const;
108 };
109 /* -----------------02.09.99 07:52-------------------
110 
111  --------------------------------------------------*/
112 struct SwDefTOXBase_Impl
113 {
114 	SwTOXBase* pContBase;
115 	SwTOXBase* pIdxBase;
116 	SwTOXBase* pUserBase;
117 	SwTOXBase* pTblBase;
118 	SwTOXBase* pObjBase;
119 	SwTOXBase* pIllBase;
120 	SwTOXBase* pAuthBase;
121 
SwDefTOXBase_ImplSwDefTOXBase_Impl122 	SwDefTOXBase_Impl() :
123 	pContBase(0),
124 	pIdxBase(0),
125 	pUserBase(0),
126 	pTblBase(0),
127 	pObjBase(0),
128 	pIllBase(0),
129 	pAuthBase(0)
130 	{}
~SwDefTOXBase_ImplSwDefTOXBase_Impl131 	~SwDefTOXBase_Impl()
132 	{
133 		delete pContBase;
134 		delete pIdxBase;
135 		delete pUserBase;
136 		delete pTblBase;
137 		delete pObjBase;
138 		delete pIllBase;
139 		delete pAuthBase;
140 	}
141 
142 };
143 
144 #endif	// _DOCTXM_HXX
145