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 _PORFLY_HXX 28 #define _PORFLY_HXX 29 // OD 28.10.2003 #113049# 30 #include <ascharanchoredobjectposition.hxx> 31 32 #include "porglue.hxx" 33 34 class SwDrawContact; 35 class SwFlyInCntFrm; 36 class SwTxtFrm; 37 struct SwCrsrMoveState; 38 39 /************************************************************************* 40 * class SwFlyPortion 41 *************************************************************************/ 42 43 class SwFlyPortion : public SwFixPortion 44 { 45 KSHORT nBlankWidth; 46 public: 47 inline SwFlyPortion( const SwRect &rFlyRect ) 48 : SwFixPortion(rFlyRect), nBlankWidth( 0 ) { SetWhichPor( POR_FLY ); } 49 inline KSHORT GetBlankWidth( ) const { return nBlankWidth; } 50 inline void SetBlankWidth( const KSHORT nNew ) { nBlankWidth = nNew; } 51 virtual void Paint( const SwTxtPaintInfo &rInf ) const; 52 virtual sal_Bool Format( SwTxtFormatInfo &rInf ); 53 OUTPUT_OPERATOR 54 }; 55 56 /************************************************************************* 57 * class SwFlyCntPortion 58 *************************************************************************/ 59 60 class SwFlyCntPortion : public SwLinePortion 61 { 62 void *pContact; // bDraw ? DrawContact : FlyInCntFrm 63 Point aRef; // Relativ zu diesem Point wird die AbsPos berechnet. 64 sal_Bool bDraw : 1; // DrawContact? 65 sal_Bool bMax : 1; // Zeilenausrichtung und Hoehe == Zeilenhoehe 66 sal_uInt8 nAlign : 3; // Zeilenausrichtung? Nein, oben, mitte, unten 67 virtual xub_StrLen GetCrsrOfst( const KSHORT nOfst ) const; 68 69 public: 70 // OD 29.07.2003 #110978# - use new datatype for parameter <nFlags> 71 SwFlyCntPortion( const SwTxtFrm& rFrm, SwFlyInCntFrm *pFly, 72 const Point &rBase, 73 long nAscent, long nDescent, long nFlyAsc, long nFlyDesc, 74 objectpositioning::AsCharFlags nFlags ); 75 // OD 29.07.2003 #110978# - use new datatype for parameter <nFlags> 76 SwFlyCntPortion( const SwTxtFrm& rFrm, SwDrawContact *pDrawContact, 77 const Point &rBase, 78 long nAscent, long nDescent, long nFlyAsc, long nFlyDesc, 79 objectpositioning::AsCharFlags nFlags ); 80 inline const Point& GetRefPoint() const { return aRef; } 81 inline SwFlyInCntFrm *GetFlyFrm() { return (SwFlyInCntFrm*)pContact; } 82 inline const SwFlyInCntFrm *GetFlyFrm() const 83 { return (SwFlyInCntFrm*)pContact; } 84 inline SwDrawContact *GetDrawContact() { return (SwDrawContact*)pContact; } 85 inline const SwDrawContact* GetDrawContact() const 86 { return (SwDrawContact*)pContact; } 87 inline sal_Bool IsDraw() const { return bDraw; } 88 inline sal_Bool IsMax() const { return bMax; } 89 inline sal_uInt8 GetAlign() const { return nAlign; } 90 inline void SetAlign( sal_uInt8 nNew ) { nAlign = nNew; } 91 inline void SetMax( sal_Bool bNew ) { bMax = bNew; } 92 // OD 29.07.2003 #110978# - use new datatype for parameter <nFlags> 93 void SetBase( const SwTxtFrm& rFrm, const Point &rBase, 94 long nLnAscent, long nLnDescent, 95 long nFlyAscent, long nFlyDescent, 96 objectpositioning::AsCharFlags nFlags ); 97 xub_StrLen GetFlyCrsrOfst( const KSHORT nOfst, const Point &rPoint, 98 SwPosition *pPos, SwCrsrMoveState* pCMS ) const; 99 virtual sal_Bool Format( SwTxtFormatInfo &rInf ); 100 virtual void Paint( const SwTxtPaintInfo &rInf ) const; 101 OUTPUT_OPERATOR 102 }; 103 104 CLASSIO( SwFlyPortion ) 105 CLASSIO( SwFlyCntPortion ) 106 107 108 #endif 109