xref: /aoo4110/main/sw/inc/ftnidx.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 _FTNIDX_HXX
24 #define _FTNIDX_HXX
25 
26 
27 #define _SVSTDARR_USHORTS
28 #include <svl/svstdarr.hxx>
29 
30 class SwTxtFtn;
31 class SwNodeIndex;
32 class SwSectionNode;
33 
34 // ueberall, wo der NodeIndex gebraucht wird, werden die hier fehlenden
35 // Headerfiles schon includes. Darum hier nur als define und nicht als
36 // inline Methode (spart Compile-Zeit)
37 #define _SwTxtFtn_GetIndex( pFIdx )	(pFIdx->GetTxtNode().GetIndex())
38 
39 
40 typedef SwTxtFtn* SwTxtFtnPtr;
41 SV_DECL_PTRARR_SORT( _SwFtnIdxs, SwTxtFtnPtr, 0, 10 )
42 
43 class SwFtnIdxs : public _SwFtnIdxs
44 {
45 public:
SwFtnIdxs()46 	SwFtnIdxs() {}
47 
48 	void UpdateFtn( const SwNodeIndex& rStt );   	// ab Pos. alle Updaten
49 	void UpdateAllFtn();					// alle Fussnoten updaten
50 
51 	SwTxtFtn* SeekEntry( const SwNodeIndex& rIdx, sal_uInt16* pPos = 0 ) const;
52 };
53 
54 
55 class SwUpdFtnEndNtAtEnd
56 {
57 	SvPtrarr aFtnSects, aEndSects;
58 	SvUShorts aFtnNums, aEndNums;
59 
60 public:
SwUpdFtnEndNtAtEnd()61 	SwUpdFtnEndNtAtEnd() : aFtnSects( 0, 4 ), aEndSects( 0, 4 ),
62 						   aFtnNums( 0, 4 ), aEndNums( 0, 4 )
63 		{}
64 
65 	static const SwSectionNode* FindSectNdWithEndAttr(
66 											const SwTxtFtn& rTxtFtn );
67 
68 	sal_uInt16 GetNumber( const SwTxtFtn& rTxtFtn, const SwSectionNode& rNd );
69 	sal_uInt16 ChkNumber( const SwTxtFtn& rTxtFtn );
70 };
71 
72 
73 
74 #endif // _FTNIDX_HXX
75 
76