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