xref: /aoo42x/main/sw/inc/docary.hxx (revision cdf0e10c)
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 _DOCARY_HXX
28 #define _DOCARY_HXX
29 
30 #include <com/sun/star/i18n/ForbiddenCharacters.hpp>
31 
32 class SwFieldType;
33 class SwFrmFmt;
34 class SwCharFmt;
35 class SwTOXType;
36 class SwUndo;
37 class SwSectionFmt;
38 class SwNumRule;
39 class SwRedline;
40 class SwUnoCrsr;
41 class SwOLENode;
42 
43 namespace com { namespace sun { namespace star { namespace i18n {
44 	struct ForbiddenCharacters;    // comes from the I18N UNO interface
45 }}}}
46 
47 #ifndef _TABLE_HXX //autogen
48 #include <tools/table.hxx>
49 #endif
50 #include <swtypes.hxx>
51 #include <svl/svarray.hxx>
52 
53 typedef SwFieldType* SwFldTypePtr;
54 #define GROW_FLDTYPES	16
55 
56 //PageDescriptor-Schnittstelle
57 //typedef SwPageDesc * SwPageDescPtr;
58 //SV_DECL_PTRARR_DEL(SwPageDescs, SwPageDescPtr,1,1);
59 
60 typedef SwFrmFmt* SwFrmFmtPtr;
61 SV_DECL_PTRARR_DEL(SwFrmFmts,SwFrmFmtPtr,4,4)
62 
63 //Spezifische Frameformate (Rahmen, DrawObjecte)
64 SV_DECL_PTRARR_DEL(SwSpzFrmFmts,SwFrmFmtPtr,0,4)
65 
66 typedef SwCharFmt* SwCharFmtPtr;
67 SV_DECL_PTRARR_DEL(SwCharFmts,SwCharFmtPtr,4,4)
68 
69 SV_DECL_PTRARR_DEL( SwFldTypes, SwFldTypePtr, INIT_FLDTYPES, GROW_FLDTYPES )
70 
71 typedef SwTOXType* SwTOXTypePtr;
72 SV_DECL_PTRARR_DEL( SwTOXTypes, SwTOXTypePtr, 0, 1 )
73 
74 typedef SwSectionFmt* SwSectionFmtPtr;
75 SV_DECL_PTRARR_DEL(SwSectionFmts,SwSectionFmtPtr,0,4)
76 
77 
78 typedef SwNumRule* SwNumRulePtr;
79 SV_DECL_PTRARR_DEL_VISIBILITY( SwNumRuleTbl, SwNumRulePtr, 0, 5, SW_DLLPUBLIC )
80 
81 typedef SwRedline* SwRedlinePtr;
82 SV_DECL_PTRARR_SORT_DEL( _SwRedlineTbl, SwRedlinePtr, 0, 16 )
83 
84 class SwRedlineTbl : private _SwRedlineTbl
85 {
86 public:
87 	SwRedlineTbl( sal_uInt8 nSize = 0, sal_uInt8 nG = 16 )
88 		: _SwRedlineTbl( nSize, nG ) {}
89 	~SwRedlineTbl() {}
90 
91 	sal_Bool SavePtrInArr( SwRedlinePtr p ) { return _SwRedlineTbl::Insert( p ); }
92 
93 	sal_Bool Insert( SwRedlinePtr& p, sal_Bool bIns = sal_True );
94 	sal_Bool Insert( SwRedlinePtr& p, sal_uInt16& rInsPos, sal_Bool bIns = sal_True );
95 	sal_Bool InsertWithValidRanges( SwRedlinePtr& p, sal_uInt16* pInsPos = 0 );
96 
97 	void Remove( sal_uInt16 nP, sal_uInt16 nL = 1 );
98 	void DeleteAndDestroy( sal_uInt16 nP, sal_uInt16 nL=1 );
99 
100 	// suche den naechsten oder vorherigen Redline mit dergleichen Seq.No
101 	// Mit dem Lookahead kann die Suche eingeschraenkt werden. 0 oder
102 	// USHRT_MAX suchen im gesamten Array.
103 	sal_uInt16 FindNextOfSeqNo( sal_uInt16 nSttPos, sal_uInt16 nLookahead = 20 ) const;
104 	sal_uInt16 FindPrevOfSeqNo( sal_uInt16 nSttPos, sal_uInt16 nLookahead = 20 ) const;
105 	sal_uInt16 FindNextSeqNo( sal_uInt16 nSeqNo, sal_uInt16 nSttPos,
106 							sal_uInt16 nLookahead = 20 ) const;
107 	sal_uInt16 FindPrevSeqNo( sal_uInt16 nSeqNo, sal_uInt16 nSttPos,
108 							sal_uInt16 nLookahead = 20 ) const;
109 
110 	using _SwRedlineTbl::Count;
111 	using _SwRedlineTbl::operator[];
112 	using _SwRedlineTbl::GetObject;
113 	using _SwRedlineTbl::Seek_Entry;
114 	using _SwRedlineTbl::GetPos;
115 };
116 
117 typedef SwUnoCrsr* SwUnoCrsrPtr;
118 SV_DECL_PTRARR_DEL( SwUnoCrsrTbl, SwUnoCrsrPtr, 0, 4 )
119 
120 typedef SwOLENode* SwOLENodePtr;
121 SV_DECL_PTRARR(SwOLENodes,SwOLENodePtr,16,16)
122 
123 
124 #endif	//_DOCARY_HXX
125 
126