LCOV - code coverage report
Current view: top level - sw/source/core/text - porhyph.hxx (source / functions) Hit Total Coverage
Test: commit 10e77ab3ff6f4314137acd6e2702a6e5c1ce1fae Lines: 8 14 57.1 %
Date: 2014-11-03 Functions: 6 13 46.2 %
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 INCLUDED_SW_SOURCE_CORE_TEXT_PORHYPH_HXX
      20             : #define INCLUDED_SW_SOURCE_CORE_TEXT_PORHYPH_HXX
      21             : 
      22             : #include "porexp.hxx"
      23             : 
      24          74 : class SwHyphPortion : public SwExpandPortion
      25             : {
      26             : public:
      27          74 :     SwHyphPortion()
      28          74 :     {
      29          74 :         SetWhichPor( POR_HYPH );
      30          74 :     }
      31             :     virtual bool GetExpTxt( const SwTxtSizeInfo &rInf, OUString &rTxt ) const SAL_OVERRIDE;
      32             :     virtual bool Format( SwTxtFormatInfo &rInf ) SAL_OVERRIDE;
      33             : 
      34             :     // Accessibility: pass information about this portion to the PortionHandler
      35             :     virtual void HandlePortion( SwPortionHandler& rPH ) const SAL_OVERRIDE;
      36             : 
      37             :     OUTPUT_OPERATOR_OVERRIDE
      38             : };
      39             : 
      40           0 : class SwHyphStrPortion : public SwHyphPortion
      41             : {
      42             :     OUString aExpand;
      43             : public:
      44           0 :     SwHyphStrPortion(const OUString &rStr)
      45           0 :         : aExpand(rStr + "-")
      46             :     {
      47           0 :         SetWhichPor( POR_HYPHSTR );
      48           0 :     }
      49             : 
      50             :     virtual bool GetExpTxt( const SwTxtSizeInfo &rInf, OUString &rTxt ) const SAL_OVERRIDE;
      51             : 
      52             :     // Accessibility: pass information about this portion to the PortionHandler
      53             :     virtual void HandlePortion( SwPortionHandler& rPH ) const SAL_OVERRIDE;
      54             : 
      55             :     OUTPUT_OPERATOR_OVERRIDE
      56             : };
      57             : 
      58         148 : class SwSoftHyphPortion : public SwHyphPortion
      59             : {
      60             :     bool    bExpand;
      61             :     sal_uInt16  nViewWidth;
      62             :     sal_uInt16  nHyphWidth;
      63             : 
      64             : public:
      65             :     SwSoftHyphPortion();
      66             :     virtual bool GetExpTxt( const SwTxtSizeInfo &rInf, OUString &rTxt ) const SAL_OVERRIDE;
      67             :     virtual SwLinePortion *Compress() SAL_OVERRIDE;
      68             :     virtual void Paint( const SwTxtPaintInfo &rInf ) const SAL_OVERRIDE;
      69             :     virtual bool Format( SwTxtFormatInfo &rInf ) SAL_OVERRIDE;
      70             :     virtual void FormatEOL( SwTxtFormatInfo &rInf ) SAL_OVERRIDE;
      71         148 :     inline void SetExpand( const bool bNew ) { bExpand = bNew; }
      72          74 :     bool IsExpand() const { return bExpand; }
      73             : 
      74             :     virtual sal_uInt16 GetViewWidth( const SwTxtSizeInfo &rInf ) const SAL_OVERRIDE;
      75             : 
      76             :     // Accessibility: pass information about this portion to the PortionHandler
      77             :     virtual void HandlePortion( SwPortionHandler& rPH ) const SAL_OVERRIDE;
      78             : 
      79             :     OUTPUT_OPERATOR_OVERRIDE
      80             : };
      81             : 
      82           0 : class SwSoftHyphStrPortion : public SwHyphStrPortion
      83             : {
      84             : public:
      85             :     SwSoftHyphStrPortion( const OUString &rStr );
      86             :     virtual void Paint( const SwTxtPaintInfo &rInf ) const SAL_OVERRIDE;
      87             :     OUTPUT_OPERATOR_OVERRIDE
      88             : };
      89             : 
      90             : #endif
      91             : 
      92             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10