xref: /aoo4110/main/sw/source/core/text/porftn.hxx (revision b1cdbd2c)
1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 #ifndef _PORFTN_HXX
24 #define _PORFTN_HXX
25 
26 #include "porfld.hxx"
27 
28 class SwTxtFrm;
29 class SwTxtFtn;
30 
31 /*************************************************************************
32  *						class SwFtnPortion
33  *************************************************************************/
34 
35 class SwFtnPortion : public SwFldPortion
36 {
37     SwTxtFrm *pFrm; 		// um im Dtor RemoveFtn rufen zu koennen.
38     SwTxtFtn *pFtn;
39     KSHORT nOrigHeight;
40     // --> OD 2009-01-29 #i98418#
41     bool mbPreferredScriptTypeSet;
42     sal_uInt8 mnPreferredScriptType;
43     // <--
44 public:
45     SwFtnPortion( const XubString &rExpand, SwTxtFrm *pFrm, SwTxtFtn *pFtn,
46                   KSHORT nOrig = KSHRT_MAX );
Orig()47 	inline KSHORT& Orig() {	return nOrigHeight; }
48 
49 	virtual void Paint( const SwTxtPaintInfo &rInf ) const;
50 	virtual sal_Bool GetExpTxt( const SwTxtSizeInfo &rInf, XubString &rTxt ) const;
51 	virtual SwPosSize GetTxtSize( const SwTxtSizeInfo &rInfo ) const;
52 	virtual sal_Bool Format( SwTxtFormatInfo &rInf );
53 
54     // --> OD 2009-01-29 #i98418#
55     void SetPreferredScriptType( sal_uInt8 nPreferredScriptType );
56     // <--
57 
GetTxtFtn() const58     const SwTxtFtn* GetTxtFtn() const { return pFtn; };
59 	OUTPUT_OPERATOR
60 };
61 
62 /*************************************************************************
63  *						class SwFtnNumPortion
64  *************************************************************************/
65 
66 class SwFtnNumPortion : public SwNumberPortion
67 {
68 public:
SwFtnNumPortion(const XubString & rExpand,SwFont * pFntL)69     inline SwFtnNumPortion( const XubString &rExpand, SwFont *pFntL )
70          // --> OD 2008-01-23 #newlistlevelattrs#
71          : SwNumberPortion( rExpand, pFntL, sal_True, sal_False, 0, false )
72          // <--
73 		 { SetWhichPor( POR_FTNNUM ); }
74 
75     OUTPUT_OPERATOR
76 };
77 
78 /*************************************************************************
79  *						class SwQuoVadisPortion
80  *************************************************************************/
81 
82 class SwQuoVadisPortion : public SwFldPortion
83 {
84 	XubString	aErgo;
85 public:
86 			SwQuoVadisPortion( const XubString &rExp, const XubString& rStr );
87 	virtual sal_Bool Format( SwTxtFormatInfo &rInf );
88 	virtual void Paint( const SwTxtPaintInfo &rInf ) const;
89 	virtual sal_Bool GetExpTxt( const SwTxtSizeInfo &rInf, XubString &rTxt ) const;
90 
SetNumber(const XubString & rStr)91 	inline void SetNumber( const XubString& rStr ) { aErgo = rStr; }
GetQuoTxt() const92 	inline const XubString &GetQuoTxt() const { return aExpand; }
GetContTxt() const93 	inline const XubString &GetContTxt() const { return aErgo; }
94 
95 	// Felder-Cloner fuer SplitGlue
96 	virtual SwFldPortion *Clone( const XubString &rExpand ) const;
97 
98     // Accessibility: pass information about this portion to the PortionHandler
99     virtual void HandlePortion( SwPortionHandler& rPH ) const;
100 
101 	OUTPUT_OPERATOR
102 };
103 
104 /*************************************************************************
105  *						class SwErgoSumPortion
106  *************************************************************************/
107 
108 class SwErgoSumPortion : public SwFldPortion
109 {
110 public:
111 			SwErgoSumPortion( const XubString &rExp, const XubString& rStr );
112 	virtual xub_StrLen GetCrsrOfst( const KSHORT nOfst ) const;
113 	virtual sal_Bool Format( SwTxtFormatInfo &rInf );
114 
115 	// Felder-Cloner fuer SplitGlue
116 	virtual SwFldPortion *Clone( const XubString &rExpand ) const;
117 	OUTPUT_OPERATOR
118 };
119 
120 CLASSIO( SwFtnPortion )
121 CLASSIO( SwFtnNumPortion )
122 CLASSIO( SwQuoVadisPortion )
123 CLASSIO( SwErgoSumPortion )
124 
125 
126 #endif
127