Line data Source code
1 : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : /*
3 : * This file is part of the LibreOffice project.
4 : *
5 : * This Source Code Form is subject to the terms of the Mozilla Public
6 : * License, v. 2.0. If a copy of the MPL was not distributed with this
7 : * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 : *
9 : * This file incorporates work covered by the following license notice:
10 : *
11 : * Licensed to the Apache Software Foundation (ASF) under one or more
12 : * contributor license agreements. See the NOTICE file distributed
13 : * with this work for additional information regarding copyright
14 : * ownership. The ASF licenses this file to you under the Apache
15 : * License, Version 2.0 (the "License"); you may not use this file
16 : * except in compliance with the License. You may obtain a copy of
17 : * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 : */
19 :
20 : #ifndef INCLUDED_SW_SOURCE_CORE_INC_FRMINF_HXX
21 : #define INCLUDED_SW_SOURCE_CORE_INC_FRMINF_HXX
22 :
23 : #include "swtypes.hxx"
24 :
25 : class SwTextFrm;
26 : class SwPaM;
27 : class SwTextCursor;
28 :
29 : class SwTextFrmInfo
30 : {
31 : const SwTextFrm *pFrm;
32 :
33 : // Where does the text (w/o whitespaces) start (document is global!)?
34 : static SwTwips GetLineStart( const SwTextCursor &rLine );
35 :
36 : public:
37 0 : inline SwTextFrmInfo( const SwTextFrm *pTextFrm ) : pFrm(pTextFrm) { }
38 :
39 : // Does the paragraph fit into a single line?
40 : bool IsOneLine() const;
41 :
42 : // Is the line filled to X%?
43 : bool IsFilled( const sal_uInt8 nPercent ) const;
44 :
45 : // Where does the text (w/o whitespaces) start (rel. in frame)?
46 : SwTwips GetLineStart() const;
47 :
48 : // return center position of the next character
49 : SwTwips GetCharPos( sal_Int32 nChar, bool bCenter = true ) const;
50 :
51 : // collect all whitespaces at the beginning and end of a line in Pam
52 : void GetSpaces( SwPaM &rPam, bool bWithLineBreak ) const;
53 :
54 : // Is a bullet point/symbol/etc. at the first text position?
55 : bool IsBullet( sal_Int32 nTextPos ) const;
56 :
57 : // determine intentation for first line
58 : SwTwips GetFirstIndent() const;
59 :
60 0 : const SwTextFrm* GetFrm() const { return pFrm; }
61 0 : SwTextFrmInfo& SetFrm( const SwTextFrm* pNew )
62 0 : { pFrm = pNew; return *this; }
63 :
64 : // Is it a comparison? Returns position in frame.
65 : sal_Int32 GetBigIndent( sal_Int32& rFndPos,
66 : const SwTextFrm *pNextFrm = 0 ) const;
67 : };
68 :
69 : #endif
70 :
71 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|