xref: /aoo42x/main/sw/source/core/inc/pamtyp.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 
24 #ifndef _PAMTYP_HXX
25 #define _PAMTYP_HXX
26 
27 #include <svtools/txtcmp.hxx>
28 #include <pam.hxx>
29 #include <node.hxx>
30 #include <tools/string.hxx>
31 
32 class SwpHints;
33 struct SwPosition;
34 class SwPaM;
35 class SwTxtAttr;
36 
37 // Funktions-Deklarationen fuer die Move/Find-Methoden vom SwPaM
38 
39 void GoStartDoc( SwPosition*);
40 void GoEndDoc( SwPosition*);
41 void GoStartSection( SwPosition*);
42 void GoEndSection( SwPosition*);
43 sal_Bool GoInDoc( SwPaM&, SwMoveFn);
44 sal_Bool GoInSection( SwPaM&, SwMoveFn);
45 sal_Bool GoInNode( SwPaM&, SwMoveFn);
46 sal_Bool GoInCntnt( SwPaM&, SwMoveFn);
47 sal_Bool GoInCntntCells( SwPaM&, SwMoveFn);
48 sal_Bool GoInCntntSkipHidden( SwPaM&, SwMoveFn);
49 sal_Bool GoInCntntCellsSkipHidden( SwPaM&, SwMoveFn);
50 const SwTxtAttr* GetFrwrdTxtHint( const SwpHints&, sal_uInt16&, xub_StrLen );
51 const SwTxtAttr* GetBkwrdTxtHint( const SwpHints&, sal_uInt16&, xub_StrLen );
52 
53 sal_Bool GoNext(SwNode* pNd, SwIndex * pIdx, sal_uInt16 nMode );
54 sal_Bool GoPrevious(SwNode* pNd, SwIndex * pIdx, sal_uInt16 nMode );
55 SW_DLLPUBLIC SwCntntNode* GoNextNds( SwNodeIndex * pIdx, sal_Bool );
56 SwCntntNode* GoPreviousNds( SwNodeIndex * pIdx, sal_Bool );
57 
58 // --------- Funktionsdefinitionen fuer die SwCrsrShell --------------
59 
60 sal_Bool GoPrevPara( SwPaM&, SwPosPara);
61 sal_Bool GoCurrPara( SwPaM&, SwPosPara);
62 sal_Bool GoNextPara( SwPaM&, SwPosPara);
63 sal_Bool GoPrevSection( SwPaM&, SwPosSection);
64 sal_Bool GoCurrSection( SwPaM&, SwPosSection);
65 sal_Bool GoNextSection( SwPaM&, SwPosSection);
66 
67 
68 // ------------ Typedefiniton fuer Funktionen ----------------------
69 
70 typedef sal_Bool (*GoNd)( SwNode*, SwIndex*, sal_uInt16 );
71 typedef SwCntntNode* (*GoNds)( SwNodeIndex*, sal_Bool );
72 typedef void (*GoDoc)( SwPosition* );
73 typedef void (*GoSection)( SwPosition* );
74 typedef sal_Bool (SwPosition:: *CmpOp)( const SwPosition& ) const;
75 typedef const SwTxtAttr* (*GetHint)( const SwpHints&, sal_uInt16&, xub_StrLen );
76 typedef int (utl::TextSearch:: *SearchTxt)( const String&, xub_StrLen*,
77 					xub_StrLen*, ::com::sun::star::util::SearchResult* );
78 typedef void (SwNodes:: *MvSection)( SwNodeIndex * ) const;
79 
80 
81 struct SwMoveFnCollection
82 {
83 	GoNd	  fnNd;
84 	GoNds	  fnNds;
85 	GoDoc	  fnDoc;
86 	GoSection fnSections;
87 	CmpOp	  fnCmpOp;
88 	GetHint   fnGetHint;
89 	SearchTxt fnSearch;
90 	MvSection fnSection;
91 };
92 
93 // --------- Funktionsdefinitionen fuers Suchen --------------
94 SwCntntNode* GetNode( SwPaM&, sal_Bool&, SwMoveFn, sal_Bool bInReadOnly = sal_False );
95 
96 
97 
98 #endif
99