1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
27 /*************************************************************************
29 *************************************************************************/
31 class SwFtnPortion
: public SwFldPortion
33 SwTxtFrm
*pFrm
; // To be able to call RemoveFtn in the dtor
37 bool mbPreferredScriptTypeSet
;
38 sal_uInt8 mnPreferredScriptType
;
40 SwFtnPortion( const XubString
&rExpand
, SwTxtFrm
*pFrm
, SwTxtFtn
*pFtn
,
41 KSHORT nOrig
= KSHRT_MAX
);
42 inline KSHORT
& Orig() { return nOrigHeight
; }
44 virtual void Paint( const SwTxtPaintInfo
&rInf
) const;
45 virtual sal_Bool
GetExpTxt( const SwTxtSizeInfo
&rInf
, XubString
&rTxt
) const;
46 virtual SwPosSize
GetTxtSize( const SwTxtSizeInfo
&rInfo
) const;
47 virtual sal_Bool
Format( SwTxtFormatInfo
&rInf
);
50 void SetPreferredScriptType( sal_uInt8 nPreferredScriptType
);
52 const SwTxtFtn
* GetTxtFtn() const { return pFtn
; };
56 /*************************************************************************
57 * class SwFtnNumPortion
58 *************************************************************************/
60 class SwFtnNumPortion
: public SwNumberPortion
63 inline SwFtnNumPortion( const XubString
&rExpand
, SwFont
*pFntL
)
64 : SwNumberPortion( rExpand
, pFntL
, sal_True
, sal_False
, 0, false )
65 { SetWhichPor( POR_FTNNUM
); }
70 /*************************************************************************
71 * class SwQuoVadisPortion
72 *************************************************************************/
74 class SwQuoVadisPortion
: public SwFldPortion
78 SwQuoVadisPortion( const XubString
&rExp
, const XubString
& rStr
);
79 virtual sal_Bool
Format( SwTxtFormatInfo
&rInf
);
80 virtual void Paint( const SwTxtPaintInfo
&rInf
) const;
81 virtual sal_Bool
GetExpTxt( const SwTxtSizeInfo
&rInf
, XubString
&rTxt
) const;
83 inline void SetNumber( const XubString
& rStr
) { aErgo
= rStr
; }
84 inline const XubString
&GetQuoTxt() const { return aExpand
; }
85 inline const XubString
&GetContTxt() const { return aErgo
; }
87 // Field cloner for SplitGlue
88 virtual SwFldPortion
*Clone( const XubString
&rExpand
) const;
90 // Accessibility: pass information about this portion to the PortionHandler
91 virtual void HandlePortion( SwPortionHandler
& rPH
) const;
96 /*************************************************************************
97 * class SwErgoSumPortion
98 *************************************************************************/
100 class SwErgoSumPortion
: public SwFldPortion
103 SwErgoSumPortion( const XubString
&rExp
, const XubString
& rStr
);
104 virtual xub_StrLen
GetCrsrOfst( const KSHORT nOfst
) const;
105 virtual sal_Bool
Format( SwTxtFormatInfo
&rInf
);
107 // Field cloner for SplitGlue
108 virtual SwFldPortion
*Clone( const XubString
&rExpand
) const;
112 CLASSIO( SwFtnPortion
)
113 CLASSIO( SwFtnNumPortion
)
114 CLASSIO( SwQuoVadisPortion
)
115 CLASSIO( SwErgoSumPortion
)
120 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */