xref: /trunk/main/sw/source/core/text/porftn.hxx (revision cdf0e10c)
1 /*************************************************************************
2  *
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
5  * Copyright 2000, 2010 Oracle and/or its affiliates.
6  *
7  * OpenOffice.org - a multi-platform office productivity suite
8  *
9  * This file is part of OpenOffice.org.
10  *
11  * OpenOffice.org is free software: you can redistribute it and/or modify
12  * it under the terms of the GNU Lesser General Public License version 3
13  * only, as published by the Free Software Foundation.
14  *
15  * OpenOffice.org is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU Lesser General Public License version 3 for more details
19  * (a copy is included in the LICENSE file that accompanied this code).
20  *
21  * You should have received a copy of the GNU Lesser General Public License
22  * version 3 along with OpenOffice.org.  If not, see
23  * <http://www.openoffice.org/license.html>
24  * for a copy of the LGPLv3 License.
25  *
26  ************************************************************************/
27 #ifndef _PORFTN_HXX
28 #define _PORFTN_HXX
29 
30 #include "porfld.hxx"
31 
32 class SwTxtFrm;
33 class SwTxtFtn;
34 
35 /*************************************************************************
36  *						class SwFtnPortion
37  *************************************************************************/
38 
39 class SwFtnPortion : public SwFldPortion
40 {
41     SwTxtFrm *pFrm; 		// um im Dtor RemoveFtn rufen zu koennen.
42     SwTxtFtn *pFtn;
43     KSHORT nOrigHeight;
44     // --> OD 2009-01-29 #i98418#
45     bool mbPreferredScriptTypeSet;
46     sal_uInt8 mnPreferredScriptType;
47     // <--
48 public:
49     SwFtnPortion( const XubString &rExpand, SwTxtFrm *pFrm, SwTxtFtn *pFtn,
50                   KSHORT nOrig = KSHRT_MAX );
51 	inline KSHORT& Orig() {	return nOrigHeight; }
52 
53 	virtual void Paint( const SwTxtPaintInfo &rInf ) const;
54 	virtual sal_Bool GetExpTxt( const SwTxtSizeInfo &rInf, XubString &rTxt ) const;
55 	virtual SwPosSize GetTxtSize( const SwTxtSizeInfo &rInfo ) const;
56 	virtual sal_Bool Format( SwTxtFormatInfo &rInf );
57 
58     // --> OD 2009-01-29 #i98418#
59     void SetPreferredScriptType( sal_uInt8 nPreferredScriptType );
60     // <--
61 
62     const SwTxtFtn* GetTxtFtn() const { return pFtn; };
63 	OUTPUT_OPERATOR
64 };
65 
66 /*************************************************************************
67  *						class SwFtnNumPortion
68  *************************************************************************/
69 
70 class SwFtnNumPortion : public SwNumberPortion
71 {
72 public:
73     inline SwFtnNumPortion( const XubString &rExpand, SwFont *pFntL )
74          // --> OD 2008-01-23 #newlistlevelattrs#
75          : SwNumberPortion( rExpand, pFntL, sal_True, sal_False, 0, false )
76          // <--
77 		 { SetWhichPor( POR_FTNNUM ); }
78 
79     OUTPUT_OPERATOR
80 };
81 
82 /*************************************************************************
83  *						class SwQuoVadisPortion
84  *************************************************************************/
85 
86 class SwQuoVadisPortion : public SwFldPortion
87 {
88 	XubString	aErgo;
89 public:
90 			SwQuoVadisPortion( const XubString &rExp, const XubString& rStr );
91 	virtual sal_Bool Format( SwTxtFormatInfo &rInf );
92 	virtual void Paint( const SwTxtPaintInfo &rInf ) const;
93 	virtual sal_Bool GetExpTxt( const SwTxtSizeInfo &rInf, XubString &rTxt ) const;
94 
95 	inline void SetNumber( const XubString& rStr ) { aErgo = rStr; }
96 	inline const XubString &GetQuoTxt() const { return aExpand; }
97 	inline const XubString &GetContTxt() const { return aErgo; }
98 
99 	// Felder-Cloner fuer SplitGlue
100 	virtual SwFldPortion *Clone( const XubString &rExpand ) const;
101 
102     // Accessibility: pass information about this portion to the PortionHandler
103     virtual void HandlePortion( SwPortionHandler& rPH ) const;
104 
105 	OUTPUT_OPERATOR
106 };
107 
108 /*************************************************************************
109  *						class SwErgoSumPortion
110  *************************************************************************/
111 
112 class SwErgoSumPortion : public SwFldPortion
113 {
114 public:
115 			SwErgoSumPortion( const XubString &rExp, const XubString& rStr );
116 	virtual xub_StrLen GetCrsrOfst( const KSHORT nOfst ) const;
117 	virtual sal_Bool Format( SwTxtFormatInfo &rInf );
118 
119 	// Felder-Cloner fuer SplitGlue
120 	virtual SwFldPortion *Clone( const XubString &rExpand ) const;
121 	OUTPUT_OPERATOR
122 };
123 
124 CLASSIO( SwFtnPortion )
125 CLASSIO( SwFtnNumPortion )
126 CLASSIO( SwQuoVadisPortion )
127 CLASSIO( SwErgoSumPortion )
128 
129 
130 #endif
131