Branch data 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 _POREXP_HXX
21 : : #define _POREXP_HXX
22 : :
23 : : #include "portxt.hxx"
24 : :
25 : : /*************************************************************************
26 : : * class SwExpandPortion
27 : : *************************************************************************/
28 : :
29 [ - + ][ # # ]: 2167 : class SwExpandPortion : public SwTxtPortion
30 : : {
31 : : public:
32 : 2167 : inline SwExpandPortion() { SetWhichPor( POR_EXP ); }
33 : : virtual sal_Bool Format( SwTxtFormatInfo &rInf );
34 : : virtual xub_StrLen GetCrsrOfst( const MSHORT nOfst ) const;
35 : : virtual sal_Bool GetExpTxt( const SwTxtSizeInfo &rInf, XubString &rTxt ) const;
36 : : virtual SwPosSize GetTxtSize( const SwTxtSizeInfo &rInfo ) const;
37 : : virtual void Paint( const SwTxtPaintInfo &rInf ) const;
38 : :
39 : : // Accessibility: pass information about this portion to the PortionHandler
40 : : virtual void HandlePortion( SwPortionHandler& rPH ) const;
41 : :
42 : : OUTPUT_OPERATOR
43 : : };
44 : :
45 : :
46 : : /*************************************************************************
47 : : * class SwBlankPortion
48 : : *************************************************************************/
49 : :
50 [ - + ]: 72 : class SwBlankPortion : public SwExpandPortion
51 : : {
52 : : xub_Unicode cChar;
53 : : sal_Bool bMulti; // For multiportion brackets
54 : : public:
55 : 54 : inline SwBlankPortion( xub_Unicode cCh, sal_Bool bMult = sal_False )
56 : 54 : : cChar( cCh ), bMulti( bMult )
57 : 54 : { cChar = cCh; SetLen(1); SetWhichPor( POR_BLANK ); }
58 : :
59 : : sal_Bool IsMulti() const { return bMulti; }
60 : : void SetMulti( sal_Bool bNew ) { bMulti = bNew; }
61 : :
62 : : virtual SwLinePortion *Compress();
63 : : virtual sal_Bool GetExpTxt( const SwTxtSizeInfo &rInf, XubString &rTxt ) const;
64 : : virtual void FormatEOL( SwTxtFormatInfo &rInf );
65 : : virtual sal_Bool Format( SwTxtFormatInfo &rInf );
66 : : virtual void Paint( const SwTxtPaintInfo &rInf ) const;
67 : : MSHORT MayUnderFlow( const SwTxtFormatInfo &rInf, xub_StrLen nIdx,
68 : : sal_Bool bUnderFlow ) const;
69 : :
70 : : // Accessibility: pass information about this portion to the PortionHandler
71 : : virtual void HandlePortion( SwPortionHandler& rPH ) const;
72 : :
73 : : OUTPUT_OPERATOR
74 : : };
75 : :
76 : : /*************************************************************************
77 : : * class SwPostItsPortion
78 : : *************************************************************************/
79 : :
80 [ - + ]: 36 : class SwPostItsPortion : public SwExpandPortion
81 : : {
82 : : KSHORT nViewWidth;
83 : : sal_Bool bScript;
84 : : public:
85 : : SwPostItsPortion( sal_Bool bScrpt );
86 : : virtual void Paint( const SwTxtPaintInfo &rInf ) const;
87 : : virtual sal_Bool Format( SwTxtFormatInfo &rInf );
88 : : virtual KSHORT GetViewWidth( const SwTxtSizeInfo &rInf ) const;
89 : : virtual sal_Bool GetExpTxt( const SwTxtSizeInfo &rInf, XubString &rTxt ) const;
90 : 3 : sal_Bool IsScript() const { return bScript; }
91 : : OUTPUT_OPERATOR
92 : : };
93 : :
94 : :
95 : : CLASSIO( SwExpandPortion )
96 : : CLASSIO( SwBlankPortion )
97 : : CLASSIO( SwPostItsPortion )
98 : :
99 : :
100 : : #endif
101 : :
102 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|