1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: porhyph.hxx,v $
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 ************************************************************************/
35 /*************************************************************************
37 *************************************************************************/
39 class SwHyphPortion
: public SwExpandPortion
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;
52 /*************************************************************************
53 * class SwHyphStrPortion
54 *************************************************************************/
56 class SwHyphStrPortion
: public SwHyphPortion
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;
69 /*************************************************************************
70 * class SwSoftHyphPortion
71 *************************************************************************/
73 class SwSoftHyphPortion
: public SwHyphPortion
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;
97 /*************************************************************************
98 * class SwSoftHyphStrPortion
99 *************************************************************************/
101 class SwSoftHyphStrPortion
: public SwHyphStrPortion
104 SwSoftHyphStrPortion( const XubString
&rStr
);
105 virtual void Paint( const SwTxtPaintInfo
&rInf
) const;
109 inline SwHyphStrPortion::SwHyphStrPortion( const XubString
&rStr
)
113 SetWhichPor( POR_HYPHSTR
);
116 CLASSIO( SwHyphPortion
)
117 CLASSIO( SwHyphStrPortion
)
118 CLASSIO( SwSoftHyphPortion
)
119 CLASSIO( SwSoftHyphStrPortion
)