xref: /AOO41X/main/sw/source/core/text/porfly.hxx (revision 1d2dbeb0b7301723c6d13094e87a8714ef81a328)
1*1d2dbeb0SAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3*1d2dbeb0SAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*1d2dbeb0SAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*1d2dbeb0SAndrew Rist  * distributed with this work for additional information
6*1d2dbeb0SAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*1d2dbeb0SAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*1d2dbeb0SAndrew Rist  * "License"); you may not use this file except in compliance
9*1d2dbeb0SAndrew Rist  * with the License.  You may obtain a copy of the License at
10cdf0e10cSrcweir  *
11*1d2dbeb0SAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12cdf0e10cSrcweir  *
13*1d2dbeb0SAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*1d2dbeb0SAndrew Rist  * software distributed under the License is distributed on an
15*1d2dbeb0SAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*1d2dbeb0SAndrew Rist  * KIND, either express or implied.  See the License for the
17*1d2dbeb0SAndrew Rist  * specific language governing permissions and limitations
18*1d2dbeb0SAndrew Rist  * under the License.
19cdf0e10cSrcweir  *
20*1d2dbeb0SAndrew Rist  *************************************************************/
21*1d2dbeb0SAndrew Rist 
22*1d2dbeb0SAndrew Rist 
23cdf0e10cSrcweir #ifndef _PORFLY_HXX
24cdf0e10cSrcweir #define _PORFLY_HXX
25cdf0e10cSrcweir // OD 28.10.2003 #113049#
26cdf0e10cSrcweir #include <ascharanchoredobjectposition.hxx>
27cdf0e10cSrcweir 
28cdf0e10cSrcweir #include "porglue.hxx"
29cdf0e10cSrcweir 
30cdf0e10cSrcweir class SwDrawContact;
31cdf0e10cSrcweir class SwFlyInCntFrm;
32cdf0e10cSrcweir class SwTxtFrm;
33cdf0e10cSrcweir struct SwCrsrMoveState;
34cdf0e10cSrcweir 
35cdf0e10cSrcweir /*************************************************************************
36cdf0e10cSrcweir  *				  class SwFlyPortion
37cdf0e10cSrcweir  *************************************************************************/
38cdf0e10cSrcweir 
39cdf0e10cSrcweir class SwFlyPortion : public SwFixPortion
40cdf0e10cSrcweir {
41cdf0e10cSrcweir 	KSHORT nBlankWidth;
42cdf0e10cSrcweir public:
SwFlyPortion(const SwRect & rFlyRect)43cdf0e10cSrcweir 	inline	SwFlyPortion( const SwRect &rFlyRect )
44cdf0e10cSrcweir 		: SwFixPortion(rFlyRect), nBlankWidth( 0 ) { SetWhichPor( POR_FLY ); }
GetBlankWidth() const45cdf0e10cSrcweir 	inline KSHORT GetBlankWidth( ) const { return nBlankWidth; }
SetBlankWidth(const KSHORT nNew)46cdf0e10cSrcweir 	inline void SetBlankWidth( const KSHORT nNew ) { nBlankWidth = nNew; }
47cdf0e10cSrcweir 	virtual void Paint( const SwTxtPaintInfo &rInf ) const;
48cdf0e10cSrcweir 	virtual sal_Bool Format( SwTxtFormatInfo &rInf );
49cdf0e10cSrcweir 	OUTPUT_OPERATOR
50cdf0e10cSrcweir };
51cdf0e10cSrcweir 
52cdf0e10cSrcweir /*************************************************************************
53cdf0e10cSrcweir  *				  class SwFlyCntPortion
54cdf0e10cSrcweir  *************************************************************************/
55cdf0e10cSrcweir 
56cdf0e10cSrcweir class SwFlyCntPortion : public SwLinePortion
57cdf0e10cSrcweir {
58cdf0e10cSrcweir 	void *pContact; // bDraw ? DrawContact : FlyInCntFrm
59cdf0e10cSrcweir 	Point aRef;	 	// Relativ zu diesem Point wird die AbsPos berechnet.
60cdf0e10cSrcweir 	sal_Bool bDraw : 1;  // DrawContact?
61cdf0e10cSrcweir 	sal_Bool bMax : 1;   // Zeilenausrichtung und Hoehe == Zeilenhoehe
62cdf0e10cSrcweir 	sal_uInt8 nAlign : 3; // Zeilenausrichtung? Nein, oben, mitte, unten
63cdf0e10cSrcweir 	virtual xub_StrLen GetCrsrOfst( const KSHORT nOfst ) const;
64cdf0e10cSrcweir 
65cdf0e10cSrcweir public:
66cdf0e10cSrcweir     // OD 29.07.2003 #110978# - use new datatype for parameter <nFlags>
67cdf0e10cSrcweir     SwFlyCntPortion( const SwTxtFrm& rFrm, SwFlyInCntFrm *pFly,
68cdf0e10cSrcweir                      const Point &rBase,
69cdf0e10cSrcweir                      long nAscent, long nDescent, long nFlyAsc, long nFlyDesc,
70cdf0e10cSrcweir                      objectpositioning::AsCharFlags nFlags );
71cdf0e10cSrcweir     // OD 29.07.2003 #110978# - use new datatype for parameter <nFlags>
72cdf0e10cSrcweir     SwFlyCntPortion( const SwTxtFrm& rFrm, SwDrawContact *pDrawContact,
73cdf0e10cSrcweir                      const Point &rBase,
74cdf0e10cSrcweir                      long nAscent, long nDescent, long nFlyAsc, long nFlyDesc,
75cdf0e10cSrcweir                      objectpositioning::AsCharFlags nFlags );
GetRefPoint() const76cdf0e10cSrcweir 	inline const Point& GetRefPoint() const { return aRef; }
GetFlyFrm()77cdf0e10cSrcweir 	inline SwFlyInCntFrm *GetFlyFrm() { return (SwFlyInCntFrm*)pContact; }
GetFlyFrm() const78cdf0e10cSrcweir 	inline const SwFlyInCntFrm *GetFlyFrm() const
79cdf0e10cSrcweir 		{ return (SwFlyInCntFrm*)pContact; }
GetDrawContact()80cdf0e10cSrcweir 	inline SwDrawContact *GetDrawContact() { return (SwDrawContact*)pContact; }
GetDrawContact() const81cdf0e10cSrcweir 	inline const SwDrawContact* GetDrawContact() const
82cdf0e10cSrcweir 		{ return (SwDrawContact*)pContact; }
IsDraw() const83cdf0e10cSrcweir 	inline sal_Bool IsDraw() const { return bDraw; }
IsMax() const84cdf0e10cSrcweir 	inline sal_Bool IsMax() const { return bMax; }
GetAlign() const85cdf0e10cSrcweir 	inline sal_uInt8 GetAlign() const { return nAlign; }
SetAlign(sal_uInt8 nNew)86cdf0e10cSrcweir 	inline void SetAlign( sal_uInt8 nNew ) { nAlign = nNew; }
SetMax(sal_Bool bNew)87cdf0e10cSrcweir 	inline void SetMax( sal_Bool bNew ) { bMax = bNew; }
88cdf0e10cSrcweir     // OD 29.07.2003 #110978# - use new datatype for parameter <nFlags>
89cdf0e10cSrcweir     void SetBase( const SwTxtFrm& rFrm, const Point &rBase,
90cdf0e10cSrcweir                   long nLnAscent, long nLnDescent,
91cdf0e10cSrcweir                   long nFlyAscent, long nFlyDescent,
92cdf0e10cSrcweir                   objectpositioning::AsCharFlags nFlags );
93cdf0e10cSrcweir 	xub_StrLen GetFlyCrsrOfst( const KSHORT nOfst, const Point &rPoint,
94cdf0e10cSrcweir 						SwPosition *pPos, SwCrsrMoveState* pCMS ) const;
95cdf0e10cSrcweir 	virtual sal_Bool Format( SwTxtFormatInfo &rInf );
96cdf0e10cSrcweir 	virtual void Paint( const SwTxtPaintInfo &rInf ) const;
97cdf0e10cSrcweir 	OUTPUT_OPERATOR
98cdf0e10cSrcweir };
99cdf0e10cSrcweir 
100cdf0e10cSrcweir CLASSIO( SwFlyPortion )
101cdf0e10cSrcweir CLASSIO( SwFlyCntPortion )
102cdf0e10cSrcweir 
103cdf0e10cSrcweir 
104cdf0e10cSrcweir #endif
105