xref: /aoo4110/main/sw/source/core/inc/frminf.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 _FRMINF_HXX
24 #define _FRMINF_HXX
25 
26 #include "swtypes.hxx"
27 
28 class SwTxtFrm; 	// SwTxtFrmInfo
29 class SwPaM;		// SwTxtFrmInfo
30 class SwTxtCursor;	// SwTxtFrmInfo
31 
32 
33 /*************************************************************************
34  *						class SwTxtFrmInfo
35  *************************************************************************/
36 
37 class SwTxtFrmInfo
38 {
39 	const SwTxtFrm *pFrm;
40 
41 	// Wo beginnt der Text (ohne whitespaces)? (Dokument global !!)
42 	SwTwips GetLineStart( const SwTxtCursor &rLine ) const;
43 
44 public:
SwTxtFrmInfo(const SwTxtFrm * pTxtFrm)45     inline SwTxtFrmInfo( const SwTxtFrm *pTxtFrm ) : pFrm(pTxtFrm) { }
46 
47 	// Passt der Absatz in eine Zeile?
48 	sal_Bool IsOneLine() const;
49 
50 	// Ist die Zeile zu X% gefuellt?
51 	sal_Bool IsFilled( const sal_uInt8 nPercent ) const;
52 
53 	// Wo beginnt der Text (ohne whitespaces)? (rel. im Frame !!)
54 	SwTwips GetLineStart() const;
55 
56 	//returne die mittel Position des n. Charakters
57 	SwTwips GetCharPos( xub_StrLen nChar, sal_Bool bCenter = sal_True ) const;
58 
59 	// Sammelt die whitespaces am Zeilenbeginn und -ende im Pam
60 	void GetSpaces( SwPaM &rPam, sal_Bool bWithLineBreak ) const;
61 
62 	// Ist an der ersten Textposition ein Bullet/Symbol etc?
63 	sal_Bool IsBullet( xub_StrLen nTxtPos ) const;
64 
65 	// Ermittelt Erstzeileneinzug
66 	SwTwips GetFirstIndent() const;
67 
68 	// setze und erfrage den Frame;
GetFrm() const69 	const SwTxtFrm* GetFrm() const { return pFrm; }
SetFrm(const SwTxtFrm * pNew)70 	SwTxtFrmInfo& SetFrm( const SwTxtFrm* pNew )
71 		{ pFrm = pNew; return *this; }
72 
73 	// liegt eine Gegenueberstellung vor? (returnt Pos im Frame)
74 	sal_uInt16 GetBigIndent( xub_StrLen& rFndPos,
75 						const SwTxtFrm *pNextFrm = 0 ) const;
76 };
77 
78 
79 
80 #endif
81 
82