Version 7.6.3.2-android, tag libreoffice-7.6.3.2-android
[LibreOffice.git] / sw / source / core / inc / frminf.hxx
blob1e1d433c47ef5adf5e6dbe04f2d7d276ca25ab16
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
20 #ifndef INCLUDED_SW_SOURCE_CORE_INC_FRMINF_HXX
21 #define INCLUDED_SW_SOURCE_CORE_INC_FRMINF_HXX
23 #include <swtypes.hxx>
25 #include "TextFrameIndex.hxx"
27 #include <vector>
29 class SwTextFrame;
30 class SwTextCursor;
32 class SwTextFrameInfo
34 const SwTextFrame *m_pFrame;
36 // Where does the text (w/o whitespaces) start (document is global!)?
37 static SwTwips GetLineStart( const SwTextCursor &rLine );
39 public:
40 SwTextFrameInfo( const SwTextFrame *pTextFrame ) : m_pFrame(pTextFrame) { }
42 // Does the paragraph fit into a single line?
43 bool IsOneLine() const;
45 // Is the line filled to X%?
46 bool IsFilled( const sal_uInt8 nPercent ) const;
48 // Where does the text (w/o whitespaces) start (rel. in frame)?
49 SwTwips GetLineStart() const;
51 // return center position of the next character
52 SwTwips GetCharPos(TextFrameIndex nChar, bool bCenter = true) const;
54 // collect all whitespaces at the beginning and end of a line in Pam
55 void GetSpaces(std::vector<std::pair<TextFrameIndex, TextFrameIndex>> &,
56 bool bWithLineBreak) const;
58 // Is a bullet point/symbol/etc. at the first text position?
59 bool IsBullet(TextFrameIndex nTextPos) const;
61 // determine indentation for first line
62 SwTwips GetFirstIndent() const;
64 const SwTextFrame* GetFrame() const { return m_pFrame; }
65 SwTextFrameInfo& SetFrame( const SwTextFrame* pNew )
66 { m_pFrame = pNew; return *this; }
68 // Is it a comparison? Returns position in frame.
69 sal_Int32 GetBigIndent( TextFrameIndex & rFndPos,
70 const SwTextFrame *pNextFrame ) const;
73 #endif
75 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */