LCOV - code coverage report
Current view: top level - sw/inc - fmtftn.hxx (source / functions) Hit Total Coverage
Test: commit 10e77ab3ff6f4314137acd6e2702a6e5c1ce1fae Lines: 10 14 71.4 %
Date: 2014-11-03 Functions: 8 9 88.9 %
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_INC_FMTFTN_HXX
      20             : #define INCLUDED_SW_INC_FMTFTN_HXX
      21             : 
      22             : #include <rtl/ustring.hxx>
      23             : #include <cppuhelper/weakref.hxx>
      24             : #include <svl/poolitem.hxx>
      25             : 
      26             : #include "swdllapi.h"
      27             : #include <calbck.hxx>
      28             : 
      29             : namespace com { namespace sun { namespace star {
      30             :     namespace text { class XFootnote; }
      31             : } } }
      32             : 
      33             : class SwDoc;
      34             : class SwTxtFtn;
      35             : 
      36             : // ATT_FTN
      37             : 
      38             : class SW_DLLPUBLIC SwFmtFtn
      39             :     : public SfxPoolItem
      40             :     , public SwModify
      41             : {
      42             :     friend class SwTxtFtn;
      43             :     SwTxtFtn* m_pTxtAttr;   ///< My TextAttribute.
      44             :     OUString m_aNumber;     ///< User-defined 'Number'.
      45             :     sal_uInt16 m_nNumber;   ///< Automatische Nummerierung
      46             :     bool    m_bEndNote;     ///< Is it an End note?
      47             : 
      48             :     css::uno::WeakReference<css::text::XFootnote> m_wXFootnote;
      49             : 
      50             :     /// Protected CopyCtor.
      51             :     SwFmtFtn& operator=(const SwFmtFtn& rFtn);
      52             :     SwFmtFtn( const SwFmtFtn& );
      53             : 
      54             : public:
      55             :     SwFmtFtn( bool bEndNote = false );
      56             :     virtual ~SwFmtFtn();
      57             : 
      58             :     /// "Pure virtual methods" of SfxPoolItem.
      59             :     virtual bool            operator==( const SfxPoolItem& ) const SAL_OVERRIDE;
      60             :     virtual SfxPoolItem*    Clone( SfxItemPool* pPool = 0 ) const SAL_OVERRIDE;
      61             : 
      62             :     // SwClient
      63             :     virtual void Modify(SfxPoolItem const* pOld, SfxPoolItem const* pNew)
      64             :         SAL_OVERRIDE;
      65             : 
      66             :     void InvalidateFootnote();
      67             : 
      68        1842 :     OUString   GetNumStr() const { return m_aNumber; }
      69         876 :     sal_uInt16 GetNumber() const { return m_nNumber; }
      70        7368 :     bool       IsEndNote() const { return m_bEndNote;}
      71             : 
      72          70 :     void SetNumStr( const OUString& rStr ) { m_aNumber = rStr; }
      73             :     void SetNumber( sal_uInt16 nNo )       { m_nNumber = nNo; }
      74             :     void SetEndNote( bool b );
      75             : 
      76           0 :     void SetNumber( const SwFmtFtn& rFtn )
      77             :     {
      78           0 :         m_nNumber = rFtn.m_nNumber;
      79           0 :         m_aNumber = rFtn.m_aNumber;
      80           0 :     }
      81             : 
      82        1520 :     const SwTxtFtn *GetTxtFtn() const   { return m_pTxtAttr; }
      83         600 :           SwTxtFtn *GetTxtFtn()         { return m_pTxtAttr; }
      84             : 
      85             :     void GetFtnText( OUString& rStr ) const;
      86             : 
      87             :     /// Returns string to be displayed of footnote / endnote.
      88             :     OUString GetViewNumStr( const SwDoc& rDoc, bool bInclStrs = false ) const;
      89             : 
      90          70 :     css::uno::WeakReference<css::text::XFootnote> const& GetXFootnote() const
      91          70 :         { return m_wXFootnote; }
      92          66 :     void SetXFootnote(css::uno::Reference<css::text::XFootnote> const& xNote)
      93          66 :         { m_wXFootnote = xNote; }
      94             : };
      95             : 
      96             : #endif
      97             : 
      98             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10