Branch data Line data Source code
1 : : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : : /*************************************************************************
3 : : *
4 : : * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 : : *
6 : : * Copyright 2000, 2010 Oracle and/or its affiliates.
7 : : *
8 : : * OpenOffice.org - a multi-platform office productivity suite
9 : : *
10 : : * This file is part of OpenOffice.org.
11 : : *
12 : : * OpenOffice.org is free software: you can redistribute it and/or modify
13 : : * it under the terms of the GNU Lesser General Public License version 3
14 : : * only, as published by the Free Software Foundation.
15 : : *
16 : : * OpenOffice.org is distributed in the hope that it will be useful,
17 : : * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 : : * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 : : * GNU Lesser General Public License version 3 for more details
20 : : * (a copy is included in the LICENSE file that accompanied this code).
21 : : *
22 : : * You should have received a copy of the GNU Lesser General Public License
23 : : * version 3 along with OpenOffice.org. If not, see
24 : : * <http://www.openoffice.org/license.html>
25 : : * for a copy of the LGPLv3 License.
26 : : *
27 : : ************************************************************************/
28 : : #ifndef _PORFLY_HXX
29 : : #define _PORFLY_HXX
30 : : // OD 28.10.2003 #113049#
31 : : #include <ascharanchoredobjectposition.hxx>
32 : :
33 : : #include "porglue.hxx"
34 : :
35 : : class SwDrawContact;
36 : : class SwFlyInCntFrm;
37 : : class SwTxtFrm;
38 : : struct SwCrsrMoveState;
39 : :
40 : : /*************************************************************************
41 : : * class SwFlyPortion
42 : : *************************************************************************/
43 : :
44 [ - + ]: 1458 : class SwFlyPortion : public SwFixPortion
45 : : {
46 : : KSHORT nBlankWidth;
47 : : public:
48 : 729 : inline SwFlyPortion( const SwRect &rFlyRect )
49 : 729 : : SwFixPortion(rFlyRect), nBlankWidth( 0 ) { SetWhichPor( POR_FLY ); }
50 : 0 : inline KSHORT GetBlankWidth( ) const { return nBlankWidth; }
51 : 0 : inline void SetBlankWidth( const KSHORT nNew ) { nBlankWidth = nNew; }
52 : : virtual void Paint( const SwTxtPaintInfo &rInf ) const;
53 : : virtual sal_Bool Format( SwTxtFormatInfo &rInf );
54 : : OUTPUT_OPERATOR
55 : : };
56 : :
57 : : /*************************************************************************
58 : : * class SwFlyCntPortion
59 : : *************************************************************************/
60 : :
61 : : /// This portion represents an as-character anchored fly (shape, frame, etc.)
62 [ - + ]: 2580 : class SwFlyCntPortion : public SwLinePortion
63 : : {
64 : : void *pContact; // bDraw ? DrawContact : FlyInCntFrm
65 : : Point aRef; // Relatively to this point we calculate the AbsPos
66 : : sal_Bool bDraw : 1; // DrawContact?
67 : : sal_Bool bMax : 1; // Line adjustment and height == line height
68 : : sal_uInt8 nAlign : 3; // Line adjustment? No, above, middle, bottom
69 : : virtual xub_StrLen GetCrsrOfst( const KSHORT nOfst ) const;
70 : :
71 : : public:
72 : : // OD 29.07.2003 #110978# - use new datatype for parameter <nFlags>
73 : : SwFlyCntPortion( const SwTxtFrm& rFrm, SwFlyInCntFrm *pFly,
74 : : const Point &rBase,
75 : : long nAscent, long nDescent, long nFlyAsc, long nFlyDesc,
76 : : objectpositioning::AsCharFlags nFlags );
77 : : // OD 29.07.2003 #110978# - use new datatype for parameter <nFlags>
78 : : SwFlyCntPortion( const SwTxtFrm& rFrm, SwDrawContact *pDrawContact,
79 : : const Point &rBase,
80 : : long nAscent, long nDescent, long nFlyAsc, long nFlyDesc,
81 : : objectpositioning::AsCharFlags nFlags );
82 : 1266 : inline const Point& GetRefPoint() const { return aRef; }
83 : 2012 : inline SwFlyInCntFrm *GetFlyFrm() { return (SwFlyInCntFrm*)pContact; }
84 : 1647 : inline const SwFlyInCntFrm *GetFlyFrm() const
85 : 1647 : { return (SwFlyInCntFrm*)pContact; }
86 : 4350 : inline SwDrawContact *GetDrawContact() { return (SwDrawContact*)pContact; }
87 : : inline const SwDrawContact* GetDrawContact() const
88 : : { return (SwDrawContact*)pContact; }
89 : 62 : inline sal_Bool IsDraw() const { return bDraw; }
90 : 6709 : inline sal_Bool IsMax() const { return bMax; }
91 : 2532 : inline sal_uInt8 GetAlign() const { return nAlign; }
92 : 4187 : inline void SetAlign( sal_uInt8 nNew ) { nAlign = nNew; }
93 : 0 : inline void SetMax( sal_Bool bNew ) { bMax = bNew; }
94 : : // OD 29.07.2003 #110978# - use new datatype for parameter <nFlags>
95 : : void SetBase( const SwTxtFrm& rFrm, const Point &rBase,
96 : : long nLnAscent, long nLnDescent,
97 : : long nFlyAscent, long nFlyDescent,
98 : : objectpositioning::AsCharFlags nFlags );
99 : : xub_StrLen GetFlyCrsrOfst( const KSHORT nOfst, const Point &rPoint,
100 : : SwPosition *pPos, SwCrsrMoveState* pCMS ) const;
101 : : virtual sal_Bool Format( SwTxtFormatInfo &rInf );
102 : : virtual void Paint( const SwTxtPaintInfo &rInf ) const;
103 : : OUTPUT_OPERATOR
104 : : };
105 : :
106 : : CLASSIO( SwFlyPortion )
107 : : CLASSIO( SwFlyCntPortion )
108 : :
109 : :
110 : : #endif
111 : :
112 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|