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 : #ifndef INCLUDED_SW_SOURCE_CORE_TEXT_ITRPAINT_HXX
20 : #define INCLUDED_SW_SOURCE_CORE_TEXT_ITRPAINT_HXX
21 : #include "itrtxt.hxx"
22 :
23 : class SwSaveClip; // SwTextPainter
24 : class SwMultiPortion;
25 :
26 69633 : class SwTextPainter : public SwTextCursor
27 : {
28 : bool bPaintDrop;
29 :
30 : SwLinePortion *CalcPaintOfst( const SwRect &rPaint );
31 : void CheckSpecialUnderline( const SwLinePortion* pPor,
32 : long nAdjustBaseLine = 0 );
33 : protected:
34 : void CtorInitTextPainter( SwTextFrm *pFrm, SwTextPaintInfo *pInf );
35 55817 : explicit SwTextPainter(SwTextNode* pTextNode)
36 : : SwTextCursor(pTextNode)
37 55817 : , bPaintDrop(false)
38 : {
39 55817 : }
40 :
41 : public:
42 13816 : SwTextPainter(SwTextFrm *pTextFrm, SwTextPaintInfo *pTextPaintInf)
43 13816 : : SwTextCursor(pTextFrm->GetTextNode())
44 : {
45 13816 : CtorInitTextPainter( pTextFrm, pTextPaintInf );
46 13816 : }
47 : void DrawTextLine( const SwRect &rPaint, SwSaveClip &rClip,
48 : const bool bUnderSz );
49 : void PaintDropPortion();
50 : // if PaintMultiPortion is called recursively, we have to pass the
51 : // surrounding SwBidiPortion
52 : void PaintMultiPortion( const SwRect &rPaint, SwMultiPortion& rMulti,
53 : const SwMultiPortion* pEnvPor = 0 );
54 12 : inline void SetPaintDrop( const bool bNew ) { bPaintDrop = bNew; }
55 12654 : inline bool IsPaintDrop() const { return bPaintDrop; }
56 1025523 : inline SwTextPaintInfo &GetInfo()
57 1025523 : { return static_cast<SwTextPaintInfo&>(SwTextIter::GetInfo()); }
58 0 : inline const SwTextPaintInfo &GetInfo() const
59 0 : { return static_cast<const SwTextPaintInfo&>(SwTextIter::GetInfo()); }
60 : };
61 :
62 : bool IsUnderlineBreak( const SwLinePortion& rPor, const SwFont& rFnt );
63 :
64 : #endif
65 :
66 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|