merge the formfield patch from ooo-build
[ooovba.git] / sw / source / core / text / porfly.hxx
blob7f754ef94ffa41ea685fff5617061668bc9f52d3
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: porfly.hxx,v $
10 * $Revision: 1.14.214.1 $
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 ************************************************************************/
30 #ifndef _PORFLY_HXX
31 #define _PORFLY_HXX
32 // OD 28.10.2003 #113049#
33 #include <ascharanchoredobjectposition.hxx>
35 #include "porglue.hxx"
37 class SwDrawContact;
38 class SwFlyInCntFrm;
39 class SwTxtFrm;
40 struct SwCrsrMoveState;
42 /*************************************************************************
43 * class SwFlyPortion
44 *************************************************************************/
46 class SwFlyPortion : public SwFixPortion
48 KSHORT nBlankWidth;
49 public:
50 inline SwFlyPortion( const SwRect &rFlyRect )
51 : SwFixPortion(rFlyRect), nBlankWidth( 0 ) { SetWhichPor( POR_FLY ); }
52 inline KSHORT GetBlankWidth( ) const { return nBlankWidth; }
53 inline void SetBlankWidth( const KSHORT nNew ) { nBlankWidth = nNew; }
54 virtual void Paint( const SwTxtPaintInfo &rInf ) const;
55 virtual sal_Bool Format( SwTxtFormatInfo &rInf );
56 OUTPUT_OPERATOR
59 /*************************************************************************
60 * class SwFlyCntPortion
61 *************************************************************************/
63 class SwFlyCntPortion : public SwLinePortion
65 void *pContact; // bDraw ? DrawContact : FlyInCntFrm
66 Point aRef; // Relativ zu diesem Point wird die AbsPos berechnet.
67 sal_Bool bDraw : 1; // DrawContact?
68 sal_Bool bMax : 1; // Zeilenausrichtung und Hoehe == Zeilenhoehe
69 sal_uInt8 nAlign : 3; // Zeilenausrichtung? Nein, oben, mitte, unten
70 virtual xub_StrLen GetCrsrOfst( const KSHORT nOfst ) const;
72 public:
73 // OD 29.07.2003 #110978# - use new datatype for parameter <nFlags>
74 SwFlyCntPortion( const SwTxtFrm& rFrm, SwFlyInCntFrm *pFly,
75 const Point &rBase,
76 long nAscent, long nDescent, long nFlyAsc, long nFlyDesc,
77 objectpositioning::AsCharFlags nFlags );
78 // OD 29.07.2003 #110978# - use new datatype for parameter <nFlags>
79 SwFlyCntPortion( const SwTxtFrm& rFrm, SwDrawContact *pDrawContact,
80 const Point &rBase,
81 long nAscent, long nDescent, long nFlyAsc, long nFlyDesc,
82 objectpositioning::AsCharFlags nFlags );
83 inline const Point& GetRefPoint() const { return aRef; }
84 inline SwFlyInCntFrm *GetFlyFrm() { return (SwFlyInCntFrm*)pContact; }
85 inline const SwFlyInCntFrm *GetFlyFrm() const
86 { return (SwFlyInCntFrm*)pContact; }
87 inline SwDrawContact *GetDrawContact() { return (SwDrawContact*)pContact; }
88 inline const SwDrawContact* GetDrawContact() const
89 { return (SwDrawContact*)pContact; }
90 inline sal_Bool IsDraw() const { return bDraw; }
91 inline sal_Bool IsMax() const { return bMax; }
92 inline sal_uInt8 GetAlign() const { return nAlign; }
93 inline void SetAlign( sal_uInt8 nNew ) { nAlign = nNew; }
94 inline void SetMax( sal_Bool bNew ) { bMax = bNew; }
95 // OD 29.07.2003 #110978# - use new datatype for parameter <nFlags>
96 void SetBase( const SwTxtFrm& rFrm, const Point &rBase,
97 long nLnAscent, long nLnDescent,
98 long nFlyAscent, long nFlyDescent,
99 objectpositioning::AsCharFlags nFlags );
100 xub_StrLen GetFlyCrsrOfst( const KSHORT nOfst, const Point &rPoint,
101 SwPosition *pPos, SwCrsrMoveState* pCMS ) const;
102 virtual sal_Bool Format( SwTxtFormatInfo &rInf );
103 virtual void Paint( const SwTxtPaintInfo &rInf ) const;
104 OUTPUT_OPERATOR
107 CLASSIO( SwFlyPortion )
108 CLASSIO( SwFlyCntPortion )
111 #endif