LibreOffice Module sw (master)  1
frminf.hxx
Go to the documentation of this file.
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 #include "TextFrameIndex.hxx"
26 
27 #include <vector>
28 
29 class SwTextFrame;
30 class SwTextCursor;
31 
33 {
35 
36  // Where does the text (w/o whitespaces) start (document is global!)?
37  static SwTwips GetLineStart( const SwTextCursor &rLine );
38 
39 public:
40  SwTextFrameInfo( const SwTextFrame *pTextFrame ) : pFrame(pTextFrame) { }
41 
42  // Does the paragraph fit into a single line?
43  bool IsOneLine() const;
44 
45  // Is the line filled to X%?
46  bool IsFilled( const sal_uInt8 nPercent ) const;
47 
48  // Where does the text (w/o whitespaces) start (rel. in frame)?
49  SwTwips GetLineStart() const;
50 
51  // return center position of the next character
52  SwTwips GetCharPos(TextFrameIndex nChar, bool bCenter = true) const;
53 
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;
57 
58  // Is a bullet point/symbol/etc. at the first text position?
59  bool IsBullet(TextFrameIndex nTextPos) const;
60 
61  // determine indentation for first line
62  SwTwips GetFirstIndent() const;
63 
64  const SwTextFrame* GetFrame() const { return pFrame; }
66  { pFrame = pNew; return *this; }
67 
68  // Is it a comparison? Returns position in frame.
69  sal_Int32 GetBigIndent( TextFrameIndex & rFndPos,
70  const SwTextFrame *pNextFrame ) const;
71 };
72 
73 #endif
74 
75 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Represents the visualization of a paragraph.
Definition: txtfrm.hxx:149
const SwTextFrame * pFrame
Definition: frminf.hxx:34
long SwTwips
Definition: swtypes.hxx:49
sal_Int32 GetBigIndent(TextFrameIndex &rFndPos, const SwTextFrame *pNextFrame) const
Definition: frminf.cxx:236
SwTwips GetLineStart() const
Definition: frminf.cxx:98
bool IsBullet(TextFrameIndex nTextPos) const
Definition: frminf.cxx:192
SwTextFrameInfo(const SwTextFrame *pTextFrame)
Definition: frminf.hxx:40
bool IsFilled(const sal_uInt8 nPercent) const
Definition: frminf.cxx:73
SwTwips GetFirstIndent() const
Definition: frminf.cxx:204
bool IsOneLine() const
Definition: frminf.cxx:52
SwTextFrameInfo & SetFrame(const SwTextFrame *pNew)
Definition: frminf.hxx:65
unsigned char sal_uInt8
const SwTextFrame * GetFrame() const
Definition: frminf.hxx:64
void GetSpaces(std::vector< std::pair< TextFrameIndex, TextFrameIndex >> &, bool bWithLineBreak) const
Definition: frminf.cxx:153
SwTwips GetCharPos(TextFrameIndex nChar, bool bCenter=true) const
Definition: frminf.cxx:106