LCOV - code coverage report
Current view: top level - libreoffice/sw/inc - fmthdft.hxx (source / functions) Hit Total Coverage
Test: libreoffice_filtered.info Lines: 14 14 100.0 %
Date: 2012-12-27 Functions: 10 10 100.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 _FMTHDFT_HXX
      20             : #define _FMTHDFT_HXX
      21             : 
      22             : #include <hintids.hxx>
      23             : #include <format.hxx>
      24             : #include <svl/poolitem.hxx>
      25             : #include <calbck.hxx>
      26             : 
      27             : class SwFrmFmt;
      28             : class IntlWrapper;
      29             : class SwFmt;
      30             : 
      31             :  /** Header, for PageFormats
      32             :  Client of FrmFmt discribing the header. */
      33             : 
      34             : class SW_DLLPUBLIC SwFmtHeader: public SfxPoolItem, public SwClient
      35             : {
      36             :     sal_Bool bActive;       ///< Only for controlling (creation of content).
      37             : 
      38             : public:
      39             :     SwFmtHeader( sal_Bool bOn = sal_False );
      40             :     SwFmtHeader( SwFrmFmt *pHeaderFmt );
      41             :     SwFmtHeader( const SwFmtHeader &rCpy );
      42             :     ~SwFmtHeader();
      43             :     SwFmtHeader& operator=( const SwFmtHeader &rCpy );
      44             : 
      45             :     TYPEINFO();
      46             : 
      47             :     /// "pure virtual methods" of SfxPoolItem
      48             :     virtual int             operator==( const SfxPoolItem& ) const;
      49             :     virtual SfxPoolItem*    Clone( SfxItemPool* pPool = 0 ) const;
      50             :     virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
      51             :                                     SfxMapUnit eCoreMetric,
      52             :                                     SfxMapUnit ePresMetric,
      53             :                                     String &rText,
      54             :                                     const IntlWrapper*    pIntl = 0 ) const;
      55             : 
      56         514 :     const SwFrmFmt *GetHeaderFmt() const { return (SwFrmFmt*)GetRegisteredIn(); }
      57        1692 :           SwFrmFmt *GetHeaderFmt()       { return (SwFrmFmt*)GetRegisteredIn(); }
      58             : 
      59             :     void RegisterToFormat( SwFmt& rFmt );
      60        5704 :     sal_Bool IsActive() const { return bActive; }
      61             :     void SetActive( sal_Bool bNew = sal_True ) { bActive = bNew; }
      62             : };
      63             : 
      64             :  /**Footer, for pageformats
      65             :  Client of FrmFmt describing the footer */
      66             : 
      67             : class SW_DLLPUBLIC SwFmtFooter: public SfxPoolItem, public SwClient
      68             : {
      69             :     sal_Bool bActive;       // Only for controlling (creation of content).
      70             : 
      71             : public:
      72             :     SwFmtFooter( sal_Bool bOn = sal_False );
      73             :     SwFmtFooter( SwFrmFmt *pFooterFmt );
      74             :     SwFmtFooter( const SwFmtFooter &rCpy );
      75             :     ~SwFmtFooter();
      76             :     SwFmtFooter& operator=( const SwFmtFooter &rCpy );
      77             : 
      78             :     TYPEINFO();
      79             : 
      80             :     /// "pure virtual methods" of SfxPoolItem
      81             :     virtual int             operator==( const SfxPoolItem& ) const;
      82             :     virtual SfxPoolItem*    Clone( SfxItemPool* pPool = 0 ) const;
      83             :     virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
      84             :                                     SfxMapUnit eCoreMetric,
      85             :                                     SfxMapUnit ePresMetric,
      86             :                                     String &rText,
      87             :                                     const IntlWrapper*    pIntl = 0 ) const;
      88             : 
      89         393 :     const SwFrmFmt *GetFooterFmt() const { return (SwFrmFmt*)GetRegisteredIn(); }
      90        1312 :           SwFrmFmt *GetFooterFmt()       { return (SwFrmFmt*)GetRegisteredIn(); }
      91             : 
      92             :     void RegisterToFormat( SwFmt& rFmt );
      93        5563 :     sal_Bool IsActive() const { return bActive; }
      94             :     void SetActive( sal_Bool bNew = sal_True ) { bActive = bNew; }
      95             : };
      96             : 
      97        4441 : inline const SwFmtHeader &SwAttrSet::GetHeader(sal_Bool bInP) const
      98        4441 :     { return (const SwFmtHeader&)Get( RES_HEADER,bInP); }
      99        4316 : inline const SwFmtFooter &SwAttrSet::GetFooter(sal_Bool bInP) const
     100        4316 :     { return (const SwFmtFooter&)Get( RES_FOOTER,bInP); }
     101             : 
     102        4441 : inline const SwFmtHeader &SwFmt::GetHeader(sal_Bool bInP) const
     103        4441 :     { return aSet.GetHeader(bInP); }
     104        4316 : inline const SwFmtFooter &SwFmt::GetFooter(sal_Bool bInP) const
     105        4316 :     { return aSet.GetFooter(bInP); }
     106             : 
     107             : #endif
     108             : 
     109             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10