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