Update ooo320-m1
[ooovba.git] / sw / source / core / text / porhyph.hxx
blob8448e748f786325838f0a0d418710810d2aa044e
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: porhyph.hxx,v $
10 * $Revision: 1.5 $
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 ************************************************************************/
30 #ifndef _PORHYPH_HXX
31 #define _PORHYPH_HXX
33 #include "porexp.hxx"
35 /*************************************************************************
36 * class SwHyphPortion
37 *************************************************************************/
39 class SwHyphPortion : public SwExpandPortion
41 public:
42 inline SwHyphPortion( ) { SetWhichPor( POR_HYPH ); }
43 virtual sal_Bool GetExpTxt( const SwTxtSizeInfo &rInf, XubString &rTxt ) const;
44 virtual sal_Bool Format( SwTxtFormatInfo &rInf );
46 // Accessibility: pass information about this portion to the PortionHandler
47 virtual void HandlePortion( SwPortionHandler& rPH ) const;
49 OUTPUT_OPERATOR
52 /*************************************************************************
53 * class SwHyphStrPortion
54 *************************************************************************/
56 class SwHyphStrPortion : public SwHyphPortion
58 XubString aExpand;
59 public:
60 inline SwHyphStrPortion( const XubString &rStr );
61 virtual sal_Bool GetExpTxt( const SwTxtSizeInfo &rInf, XubString &rTxt ) const;
63 // Accessibility: pass information about this portion to the PortionHandler
64 virtual void HandlePortion( SwPortionHandler& rPH ) const;
66 OUTPUT_OPERATOR
69 /*************************************************************************
70 * class SwSoftHyphPortion
71 *************************************************************************/
73 class SwSoftHyphPortion : public SwHyphPortion
75 sal_Bool bExpand;
76 KSHORT nViewWidth;
77 KSHORT nHyphWidth;
79 public:
80 SwSoftHyphPortion();
81 virtual sal_Bool GetExpTxt( const SwTxtSizeInfo &rInf, XubString &rTxt ) const;
82 virtual SwLinePortion *Compress();
83 virtual void Paint( const SwTxtPaintInfo &rInf ) const;
84 virtual sal_Bool Format( SwTxtFormatInfo &rInf );
85 virtual void FormatEOL( SwTxtFormatInfo &rInf );
86 inline void SetExpand( const sal_Bool bNew ) { bExpand = bNew; }
87 sal_Bool IsExpand() const { return bExpand; }
89 virtual KSHORT GetViewWidth( const SwTxtSizeInfo &rInf ) const;
91 // Accessibility: pass information about this portion to the PortionHandler
92 virtual void HandlePortion( SwPortionHandler& rPH ) const;
94 OUTPUT_OPERATOR
97 /*************************************************************************
98 * class SwSoftHyphStrPortion
99 *************************************************************************/
101 class SwSoftHyphStrPortion : public SwHyphStrPortion
103 public:
104 SwSoftHyphStrPortion( const XubString &rStr );
105 virtual void Paint( const SwTxtPaintInfo &rInf ) const;
106 OUTPUT_OPERATOR
109 inline SwHyphStrPortion::SwHyphStrPortion( const XubString &rStr )
110 : aExpand( rStr )
112 aExpand += '-';
113 SetWhichPor( POR_HYPHSTR );
116 CLASSIO( SwHyphPortion )
117 CLASSIO( SwHyphStrPortion )
118 CLASSIO( SwSoftHyphPortion )
119 CLASSIO( SwSoftHyphStrPortion )
122 #endif