Line data Source code
1 : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : /*
3 : * This file is part of the LibreOffice project.
4 : *
5 : * This Source Code Form is subject to the terms of the Mozilla Public
6 : * License, v. 2.0. If a copy of the MPL was not distributed with this
7 : * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 : *
9 : * This file incorporates work covered by the following license notice:
10 : *
11 : * Licensed to the Apache Software Foundation (ASF) under one or more
12 : * contributor license agreements. See the NOTICE file distributed
13 : * with this work for additional information regarding copyright
14 : * ownership. The ASF licenses this file to you under the Apache
15 : * License, Version 2.0 (the "License"); you may not use this file
16 : * except in compliance with the License. You may obtain a copy of
17 : * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 : */
19 : #ifndef INCLUDED_SW_SOURCE_CORE_TEXT_PORFLY_HXX
20 : #define INCLUDED_SW_SOURCE_CORE_TEXT_PORFLY_HXX
21 : // OD 28.10.2003 #113049#
22 : #include <ascharanchoredobjectposition.hxx>
23 :
24 : #include "porglue.hxx"
25 :
26 : class SwDrawContact;
27 : class SwFlyInCntFrm;
28 : class SwTxtFrm;
29 : struct SwCrsrMoveState;
30 :
31 : /*************************************************************************
32 : * class SwFlyPortion
33 : *************************************************************************/
34 :
35 0 : class SwFlyPortion : public SwFixPortion
36 : {
37 : KSHORT nBlankWidth;
38 : public:
39 0 : inline SwFlyPortion( const SwRect &rFlyRect )
40 0 : : SwFixPortion(rFlyRect), nBlankWidth( 0 ) { SetWhichPor( POR_FLY ); }
41 0 : inline KSHORT GetBlankWidth( ) const { return nBlankWidth; }
42 0 : inline void SetBlankWidth( const KSHORT nNew ) { nBlankWidth = nNew; }
43 : virtual void Paint( const SwTxtPaintInfo &rInf ) const SAL_OVERRIDE;
44 : virtual bool Format( SwTxtFormatInfo &rInf ) SAL_OVERRIDE;
45 : OUTPUT_OPERATOR_OVERRIDE
46 : };
47 :
48 : /*************************************************************************
49 : * class SwFlyCntPortion
50 : *************************************************************************/
51 :
52 : /// This portion represents an as-character anchored fly (shape, frame, etc.)
53 0 : class SwFlyCntPortion : public SwLinePortion
54 : {
55 : void *pContact; // bDraw ? DrawContact : FlyInCntFrm
56 : Point aRef; // Relatively to this point we calculate the AbsPos
57 : bool bDraw : 1; // DrawContact?
58 : bool bMax : 1; // Line adjustment and height == line height
59 : sal_uInt8 nAlign : 3; // Line adjustment? No, above, middle, bottom
60 : virtual sal_Int32 GetCrsrOfst( const KSHORT nOfst ) const SAL_OVERRIDE;
61 :
62 : public:
63 : // OD 29.07.2003 #110978# - use new datatype for parameter <nFlags>
64 : SwFlyCntPortion( const SwTxtFrm& rFrm, SwFlyInCntFrm *pFly,
65 : const Point &rBase,
66 : long nAscent, long nDescent, long nFlyAsc, long nFlyDesc,
67 : objectpositioning::AsCharFlags nFlags );
68 : // OD 29.07.2003 #110978# - use new datatype for parameter <nFlags>
69 : SwFlyCntPortion( const SwTxtFrm& rFrm, SwDrawContact *pDrawContact,
70 : const Point &rBase,
71 : long nAscent, long nDescent, long nFlyAsc, long nFlyDesc,
72 : objectpositioning::AsCharFlags nFlags );
73 0 : inline const Point& GetRefPoint() const { return aRef; }
74 0 : inline SwFlyInCntFrm *GetFlyFrm() { return (SwFlyInCntFrm*)pContact; }
75 0 : inline const SwFlyInCntFrm *GetFlyFrm() const
76 0 : { return (SwFlyInCntFrm*)pContact; }
77 0 : inline SwDrawContact *GetDrawContact() { return (SwDrawContact*)pContact; }
78 : inline const SwDrawContact* GetDrawContact() const
79 : { return (SwDrawContact*)pContact; }
80 0 : inline bool IsDraw() const { return bDraw; }
81 0 : inline bool IsMax() const { return bMax; }
82 0 : inline sal_uInt8 GetAlign() const { return nAlign; }
83 0 : inline void SetAlign( sal_uInt8 nNew ) { nAlign = nNew; }
84 0 : inline void SetMax( bool bNew ) { bMax = bNew; }
85 : // OD 29.07.2003 #110978# - use new datatype for parameter <nFlags>
86 : void SetBase( const SwTxtFrm& rFrm, const Point &rBase,
87 : long nLnAscent, long nLnDescent,
88 : long nFlyAscent, long nFlyDescent,
89 : objectpositioning::AsCharFlags nFlags );
90 : sal_Int32 GetFlyCrsrOfst( const KSHORT nOfst, const Point &rPoint,
91 : SwPosition *pPos, SwCrsrMoveState* pCMS ) const;
92 : virtual bool Format( SwTxtFormatInfo &rInf ) SAL_OVERRIDE;
93 : virtual void Paint( const SwTxtPaintInfo &rInf ) const SAL_OVERRIDE;
94 : OUTPUT_OPERATOR_OVERRIDE
95 : };
96 :
97 : #endif
98 :
99 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|