LCOV - code coverage report
Current view: top level - libreoffice/sw/source/core/text - porfly.hxx (source / functions) Hit Total Coverage
Test: libreoffice_filtered.info Lines: 12 16 75.0 %
Date: 2012-12-27 Functions: 12 16 75.0 %
Legend: Lines: hit not hit

          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 _PORFLY_HXX
      20             : #define _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         150 : class SwFlyPortion : public SwFixPortion
      36             : {
      37             :     KSHORT nBlankWidth;
      38             : public:
      39          75 :     inline  SwFlyPortion( const SwRect &rFlyRect )
      40          75 :         : 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;
      44             :     virtual sal_Bool Format( SwTxtFormatInfo &rInf );
      45             :     OUTPUT_OPERATOR
      46             : };
      47             : 
      48             : /*************************************************************************
      49             :  *                class SwFlyCntPortion
      50             :  *************************************************************************/
      51             : 
      52             : /// This portion represents an as-character anchored fly (shape, frame, etc.)
      53         330 : class SwFlyCntPortion : public SwLinePortion
      54             : {
      55             :     void *pContact; // bDraw ? DrawContact : FlyInCntFrm
      56             :     Point aRef;     // Relatively to this point we calculate the AbsPos
      57             :     sal_Bool bDraw : 1;  // DrawContact?
      58             :     sal_Bool bMax : 1;   // Line adjustment and height == line height
      59             :     sal_uInt8 nAlign : 3; // Line adjustment? No, above, middle, bottom
      60             :     virtual xub_StrLen GetCrsrOfst( const KSHORT nOfst ) const;
      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         164 :     inline const Point& GetRefPoint() const { return aRef; }
      74         580 :     inline SwFlyInCntFrm *GetFlyFrm() { return (SwFlyInCntFrm*)pContact; }
      75        1054 :     inline const SwFlyInCntFrm *GetFlyFrm() const
      76        1054 :         { return (SwFlyInCntFrm*)pContact; }
      77          50 :     inline SwDrawContact *GetDrawContact() { return (SwDrawContact*)pContact; }
      78             :     inline const SwDrawContact* GetDrawContact() const
      79             :         { return (SwDrawContact*)pContact; }
      80           0 :     inline sal_Bool IsDraw() const { return bDraw; }
      81        1056 :     inline sal_Bool IsMax() const { return bMax; }
      82         328 :     inline sal_uInt8 GetAlign() const { return nAlign; }
      83         605 :     inline void SetAlign( sal_uInt8 nNew ) { nAlign = nNew; }
      84           0 :     inline void SetMax( sal_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             :     xub_StrLen GetFlyCrsrOfst( const KSHORT nOfst, const Point &rPoint,
      91             :                         SwPosition *pPos, SwCrsrMoveState* pCMS ) const;
      92             :     virtual sal_Bool Format( SwTxtFormatInfo &rInf );
      93             :     virtual void Paint( const SwTxtPaintInfo &rInf ) const;
      94             :     OUTPUT_OPERATOR
      95             : };
      96             : 
      97             : CLASSIO( SwFlyPortion )
      98             : CLASSIO( SwFlyCntPortion )
      99             : 
     100             : 
     101             : #endif
     102             : 
     103             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10