LCOV - code coverage report
Current view: top level - libreoffice/sw/source/core/text - porrst.hxx (source / functions) Hit Total Coverage
Test: libreoffice_filtered.info Lines: 2 18 11.1 %
Date: 2012-12-27 Functions: 4 20 20.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 _PORRST_HXX
      20             : #define _PORRST_HXX
      21             : #include "porlay.hxx"
      22             : #include "porexp.hxx"
      23             : 
      24             : #define LINE_BREAK_WIDTH        150
      25             : #define SPECIAL_FONT_HEIGHT     200
      26             : 
      27             : class SwTxtFormatInfo;
      28             : 
      29             : /*************************************************************************
      30             :  *                      class SwTmpEndPortion
      31             :  *************************************************************************/
      32             : 
      33           0 : class SwTmpEndPortion : public SwLinePortion
      34             : {
      35             : public:
      36             :             SwTmpEndPortion( const SwLinePortion &rPortion );
      37             :     virtual void Paint( const SwTxtPaintInfo &rInf ) const;
      38             :     OUTPUT_OPERATOR
      39             : };
      40             : 
      41             : /*************************************************************************
      42             :  *                      class SwBreakPortion
      43             :  *************************************************************************/
      44             : 
      45           2 : class SwBreakPortion : public SwLinePortion
      46             : {
      47             : public:
      48             :             SwBreakPortion( const SwLinePortion &rPortion );
      49             :     // Returns 0 if we have no usable data
      50             :     virtual SwLinePortion *Compress();
      51             :     virtual void Paint( const SwTxtPaintInfo &rInf ) const;
      52             :     virtual sal_Bool Format( SwTxtFormatInfo &rInf );
      53             :     virtual KSHORT GetViewWidth( const SwTxtSizeInfo &rInf ) const;
      54             :     virtual xub_StrLen GetCrsrOfst( const MSHORT nOfst ) const;
      55             : 
      56             :     // Accessibility: pass information about this portion to the PortionHandler
      57             :     virtual void HandlePortion( SwPortionHandler& rPH ) const;
      58             : 
      59             :     OUTPUT_OPERATOR
      60             : };
      61             : 
      62             : /*************************************************************************
      63             :  *                      class SwKernPortion
      64             :  *************************************************************************/
      65             : 
      66           2 : class SwKernPortion : public SwLinePortion
      67             : {
      68             :     short nKern;
      69             :     bool bBackground;
      70             :     bool bGridKern;
      71             : 
      72             : public:
      73             : 
      74             :     // This constructor automatically appends the portion to rPortion
      75             :     // bBG indicates, that the background of the kerning portion has to
      76             :     // be painted, e.g., if the portion if positioned between to fields.
      77             :     // bGridKern indicates, that the kerning portion is used to provide
      78             :     // additional space in grid mode.
      79             :     SwKernPortion( SwLinePortion &rPortion, short nKrn,
      80             :                    bool bBG = false, bool bGridKern = false );
      81             : 
      82             :     // This constructor only sets the height and ascent to the values
      83             :     // of rPortion. It is only used for kerning portions for grid mode
      84             :     SwKernPortion( const SwLinePortion &rPortion );
      85             : 
      86             :     virtual void FormatEOL( SwTxtFormatInfo &rInf );
      87             :     virtual void Paint( const SwTxtPaintInfo &rInf ) const;
      88             : 
      89             :     OUTPUT_OPERATOR
      90             : };
      91             : 
      92             : /*************************************************************************
      93             :  *                      class SwArrowPortion
      94             :  *************************************************************************/
      95             : 
      96           0 : class SwArrowPortion : public SwLinePortion
      97             : {
      98             :     Point aPos;
      99             :     bool bLeft;
     100             : public:
     101             :             SwArrowPortion( const SwLinePortion &rPortion );
     102             :             SwArrowPortion( const SwTxtPaintInfo &rInf );
     103             :     virtual void Paint( const SwTxtPaintInfo &rInf ) const;
     104             :     virtual SwLinePortion *Compress();
     105           0 :     inline bool IsLeft() const { return bLeft; }
     106           0 :     inline const Point& GetPos() const { return aPos; }
     107             :     OUTPUT_OPERATOR
     108             : };
     109             : 
     110             : /*************************************************************************
     111             :  *                      class SwHangingPortion
     112             :  * The characters which are forbidden at the start of a line like the dot and
     113             :  * other punctuation marks are allowed to display in the margin of the page
     114             :  * by a user option.
     115             :  * The SwHangingPortion is the corresponding textportion to do that.
     116             :  *************************************************************************/
     117             : 
     118           0 : class SwHangingPortion : public SwTxtPortion
     119             : {
     120             :     KSHORT nInnerWidth;
     121             : public:
     122           0 :     inline SwHangingPortion( SwPosSize aSize ) : nInnerWidth( aSize.Width() )
     123           0 :         { SetWhichPor( POR_HNG );  SetLen( 1 ); Height( aSize.Height() ); }
     124             : 
     125           0 :     inline KSHORT GetInnerWidth() const { return nInnerWidth; }
     126             : };
     127             : 
     128             : /*************************************************************************
     129             :  *                      class SwHiddenTextPortion
     130             :  * Is used to hide text
     131             :  *************************************************************************/
     132             : 
     133           0 : class SwHiddenTextPortion : public SwLinePortion
     134             : {
     135             : public:
     136           0 :     inline SwHiddenTextPortion( xub_StrLen nLen )
     137           0 :         { SetWhichPor( POR_HIDDEN_TXT );  SetLen( nLen ); }
     138             : 
     139             :     virtual void Paint( const SwTxtPaintInfo &rInf ) const;
     140             :     virtual sal_Bool Format( SwTxtFormatInfo &rInf );
     141             : };
     142             : 
     143             : /*************************************************************************
     144             :  *                      class SwControlCharPortion
     145             :  *************************************************************************/
     146             : 
     147           0 : class SwControlCharPortion : public SwLinePortion
     148             : {
     149             : 
     150             : private:
     151             :     mutable sal_uInt16 mnViewWidth;            // used to cache a calculated value
     152             :     mutable sal_uInt16 mnHalfCharWidth;        // used to cache a calculated value
     153             :     sal_Unicode mcChar;
     154             : 
     155             : public:
     156             : 
     157           0 :     inline SwControlCharPortion( sal_Unicode cChar )
     158           0 :         : mnViewWidth( 0 ), mnHalfCharWidth( 0 ), mcChar( cChar )
     159             :     {
     160           0 :         SetWhichPor( POR_CONTROLCHAR ); SetLen( 1 );
     161           0 :     }
     162             : 
     163             :     virtual void Paint( const SwTxtPaintInfo &rInf ) const;
     164             :     virtual sal_Bool Format( SwTxtFormatInfo &rInf );
     165             :     virtual KSHORT GetViewWidth( const SwTxtSizeInfo& rInf ) const;
     166             : };
     167             : 
     168             : 
     169             : 
     170             : /*************************************************************************
     171             :  *                  inline - Implementations
     172             :  *************************************************************************/
     173             : 
     174             : CLASSIO( SwBreakPortion )
     175             : CLASSIO( SwEndPortion )
     176             : CLASSIO( SwKernPortion )
     177             : CLASSIO( SwArrowPortion )
     178             : 
     179             : #endif
     180             : 
     181             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10