update dev300-m58
[ooovba.git] / sw / source / core / text / porexp.hxx
blob165d95da9fdca0d7de53b8a2107e8a1619abd510
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: porexp.hxx,v $
10 * $Revision: 1.7 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #ifndef _POREXP_HXX
32 #define _POREXP_HXX
34 #include "portxt.hxx"
36 /*************************************************************************
37 * class SwExpandPortion
38 *************************************************************************/
40 class SwExpandPortion : public SwTxtPortion
42 public:
43 inline SwExpandPortion() { SetWhichPor( POR_EXP ); }
44 virtual sal_Bool Format( SwTxtFormatInfo &rInf );
45 virtual xub_StrLen GetCrsrOfst( const MSHORT nOfst ) const;
46 virtual sal_Bool GetExpTxt( const SwTxtSizeInfo &rInf, XubString &rTxt ) const;
47 virtual SwPosSize GetTxtSize( const SwTxtSizeInfo &rInfo ) const;
48 virtual void Paint( const SwTxtPaintInfo &rInf ) const;
50 // Accessibility: pass information about this portion to the PortionHandler
51 virtual void HandlePortion( SwPortionHandler& rPH ) const;
53 OUTPUT_OPERATOR
57 /*************************************************************************
58 * class SwBlankPortion
59 *************************************************************************/
61 class SwBlankPortion : public SwExpandPortion
63 xub_Unicode cChar;
64 BOOL bMulti; // For multiportion brackets
65 public:
66 inline SwBlankPortion( xub_Unicode cCh, BOOL bMult = sal_False )
67 : cChar( cCh ), bMulti( bMult )
68 { cChar = cCh; SetLen(1); SetWhichPor( POR_BLANK ); }
70 BOOL IsMulti() const { return bMulti; }
71 void SetMulti( BOOL bNew ) { bMulti = bNew; }
73 virtual SwLinePortion *Compress();
74 virtual sal_Bool GetExpTxt( const SwTxtSizeInfo &rInf, XubString &rTxt ) const;
75 virtual void FormatEOL( SwTxtFormatInfo &rInf );
76 virtual sal_Bool Format( SwTxtFormatInfo &rInf );
77 virtual void Paint( const SwTxtPaintInfo &rInf ) const;
78 MSHORT MayUnderFlow( const SwTxtFormatInfo &rInf, xub_StrLen nIdx,
79 sal_Bool bUnderFlow ) const;
81 // Accessibility: pass information about this portion to the PortionHandler
82 virtual void HandlePortion( SwPortionHandler& rPH ) const;
84 OUTPUT_OPERATOR
87 /*************************************************************************
88 * class SwPostItsPortion
89 *************************************************************************/
91 class SwPostItsPortion : public SwExpandPortion
93 KSHORT nViewWidth;
94 sal_Bool bScript;
95 public:
96 SwPostItsPortion( sal_Bool bScrpt );
97 virtual void Paint( const SwTxtPaintInfo &rInf ) const;
98 virtual sal_Bool Format( SwTxtFormatInfo &rInf );
99 virtual KSHORT GetViewWidth( const SwTxtSizeInfo &rInf ) const;
100 virtual sal_Bool GetExpTxt( const SwTxtSizeInfo &rInf, XubString &rTxt ) const;
101 sal_Bool IsScript() const { return bScript; }
102 OUTPUT_OPERATOR
106 CLASSIO( SwExpandPortion )
107 CLASSIO( SwBlankPortion )
108 CLASSIO( SwPostItsPortion )
111 #endif