LibreOffice Module sw (master)  1
itrpaint.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 #pragma once
21 
22 #include "itrtxt.hxx"
23 
24 class SwSaveClip; // SwTextPainter
25 class SwMultiPortion;
26 
28 {
29  bool bPaintDrop;
30 
31  SwLinePortion *CalcPaintOfst( const SwRect &rPaint );
32  void CheckSpecialUnderline( const SwLinePortion* pPor,
33  long nAdjustBaseLine = 0 );
34 protected:
35  void CtorInitTextPainter( SwTextFrame *pFrame, SwTextPaintInfo *pInf );
36  explicit SwTextPainter(SwTextNode const * pTextNode)
37  : SwTextCursor(pTextNode)
38  , bPaintDrop(false)
39  {
40  }
41 
42 public:
43  SwTextPainter(SwTextFrame *pTextFrame, SwTextPaintInfo *pTextPaintInf)
44  : SwTextCursor(pTextFrame->GetTextNodeFirst())
45  {
46  CtorInitTextPainter( pTextFrame, pTextPaintInf );
47  }
48  void DrawTextLine( const SwRect &rPaint, SwSaveClip &rClip,
49  const bool bUnderSz );
50  void PaintDropPortion();
51  // if PaintMultiPortion is called recursively, we have to pass the
52  // surrounding SwBidiPortion
53  void PaintMultiPortion( const SwRect &rPaint, SwMultiPortion& rMulti,
54  const SwMultiPortion* pEnvPor = nullptr );
55  void SetPaintDrop( const bool bNew ) { bPaintDrop = bNew; }
56  bool IsPaintDrop() const { return bPaintDrop; }
58  { return static_cast<SwTextPaintInfo&>(SwTextIter::GetInfo()); }
59  const SwTextPaintInfo &GetInfo() const
60  { return static_cast<const SwTextPaintInfo&>(SwTextIter::GetInfo()); }
61 };
62 
63 bool IsUnderlineBreak( const SwLinePortion& rPor, const SwFont& rFnt );
64 
65 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Represents the visualization of a paragraph.
Definition: txtfrm.hxx:149
const SwTextPaintInfo & GetInfo() const
Definition: itrpaint.hxx:59
void CtorInitTextPainter(SwTextFrame *pFrame, SwTextPaintInfo *pInf)
Definition: itrpaint.cxx:79
Of course Writer needs its own rectangles.
Definition: swrect.hxx:34
bool IsPaintDrop() const
Definition: itrpaint.hxx:56
SwTextPaintInfo & GetInfo()
Definition: itrpaint.hxx:57
bool bPaintDrop
Definition: itrpaint.hxx:29
bool IsUnderlineBreak(const SwLinePortion &rPor, const SwFont &rFnt)
Definition: itrpaint.cxx:62
void PaintMultiPortion(const SwRect &rPaint, SwMultiPortion &rMulti, const SwMultiPortion *pEnvPor=nullptr)
Definition: pormulti.cxx:1494
SwLinePortion * CalcPaintOfst(const SwRect &rPaint)
Definition: itrpaint.cxx:88
SwTextPainter(SwTextNode const *pTextNode)
Definition: itrpaint.hxx:36
void CheckSpecialUnderline(const SwLinePortion *pPor, long nAdjustBaseLine=0)
Definition: itrpaint.cxx:490
Base class for anything that can be part of a line in the Writer layout.
Definition: porlin.hxx:50
SwTextPainter(SwTextFrame *pTextFrame, SwTextPaintInfo *pTextPaintInf)
Definition: itrpaint.hxx:43
SwTextNode is a paragraph in the document model.
Definition: ndtxt.hxx:79
void SetPaintDrop(const bool bNew)
Definition: itrpaint.hxx:55
SwTextInfo & GetInfo()
Definition: itrtxt.hxx:96
void PaintDropPortion()
Definition: txtdrop.cxx:650
void DrawTextLine(const SwRect &rPaint, SwSaveClip &rClip, const bool bUnderSz)
Definition: itrpaint.cxx:136