LCOV - code coverage report
Current view: top level - usr/local/src/libreoffice/sw/inc - fmtfld.hxx (source / functions) Hit Total Coverage
Test: libreoffice_filtered.info Lines: 14 15 93.3 %
Date: 2013-07-09 Functions: 10 12 83.3 %
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             : 
      20             : #ifndef SW_FMTFLD_HXX
      21             : #define SW_FMTFLD_HXX
      22             : 
      23             : #include <list>
      24             : 
      25             : #include <com/sun/star/text/XTextField.hpp>
      26             : 
      27             : #include <cppuhelper/weakref.hxx>
      28             : #include <svl/poolitem.hxx>
      29             : #include <svl/brdcst.hxx>
      30             : #include <svl/smplhint.hxx>
      31             : 
      32             : #include "swdllapi.h"
      33             : #include <calbck.hxx>
      34             : 
      35             : class SwField;
      36             : class SwTxtFld;
      37             : class SwView;
      38             : class SwFieldType;
      39             : 
      40             : // ATT_FLD
      41             : class SW_DLLPUBLIC SwFmtFld : public SfxPoolItem, public SwClient, public SfxBroadcaster
      42             : {
      43             :     friend class SwTxtFld;
      44             :     friend void _InitCore();
      45             : 
      46             :     ::com::sun::star::uno::WeakReference<
      47             :         ::com::sun::star::text::XTextField> m_wXTextField;
      48             : 
      49             :     SwField *pField;
      50             :     SwTxtFld* pTxtAttr;
      51             : 
      52             :     SwFmtFld(); ///< Default attibute.
      53             : 
      54             :     /* Protected CopyCtor.
      55             :      @@@ copy construction allowed, but copy assignment is not? @@@ */
      56             :     SwFmtFld& operator=(const SwFmtFld& rFld);
      57             : 
      58             : protected:
      59             :     virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew);
      60             :     virtual void SwClientNotify( const SwModify& rModify, const SfxHint& rHint );
      61             : 
      62             : public:
      63             :     TYPEINFO();
      64             : 
      65             :     /// Single argument constructors shall be explicit.
      66             :     explicit SwFmtFld( const SwField &rFld );
      67             : 
      68             :     /// @@@ copy construction allowed, but copy assignment is not? @@@
      69             :     SwFmtFld( const SwFmtFld& rAttr );
      70             : 
      71             :     virtual ~SwFmtFld();
      72             : 
      73             :     /// "Pure virtual methods" of SfxPoolItem.
      74             :     virtual int             operator==( const SfxPoolItem& ) const;
      75             :     virtual SfxPoolItem*    Clone( SfxItemPool* pPool = 0 ) const;
      76             : 
      77             :     virtual bool GetInfo( SfxPoolItem& rInfo ) const;
      78             : 
      79      132547 :     const SwField *GetFld() const   { return pField; }
      80        1016 :     SwField *GetFld()               { return pField; }
      81             : 
      82             :     /**
      83             :        Sets current field.
      84             : 
      85             :        @param pField          new field
      86             : 
      87             :        @attention The current field will be destroyed before setting the new field.
      88             :      */
      89             :     void SetFld(SwField * pField);
      90             : 
      91         402 :     const SwTxtFld *GetTxtFld() const   { return pTxtAttr; }
      92         268 :     SwTxtFld *GetTxtFld()               { return pTxtAttr; }
      93             : 
      94             :     void RegisterToFieldType( SwFieldType& );
      95             :     sal_Bool IsFldInDoc() const;
      96             :     sal_Bool IsProtect() const;
      97             : 
      98             :     SW_DLLPRIVATE ::com::sun::star::uno::WeakReference<
      99         124 :         ::com::sun::star::text::XTextField> const& GetXTextField() const
     100         124 :             { return m_wXTextField; }
     101         102 :     SW_DLLPRIVATE void SetXTextField(::com::sun::star::uno::Reference<
     102             :                     ::com::sun::star::text::XTextField> const& xTextField)
     103         102 :             { m_wXTextField = xTextField; }
     104             : };
     105             : 
     106        2354 : class SW_DLLPUBLIC SwFmtFldHint : public SfxHint
     107             : {
     108             : #define SWFMTFLD_INSERTED   1
     109             : #define SWFMTFLD_REMOVED    2
     110             : #define SWFMTFLD_FOCUS      3
     111             : #define SWFMTFLD_CHANGED    4
     112             : #define SWFMTFLD_LANGUAGE   5
     113             : 
     114             :     const SwFmtFld* pFld;
     115             :     sal_Int16 nWhich;
     116             :     const SwView* pView;
     117             : 
     118             : public:
     119        2354 :     SwFmtFldHint( const SwFmtFld* p, sal_Int16 n, const SwView* pV = 0)
     120             :         : pFld(p)
     121             :         , nWhich(n)
     122        2354 :         , pView(pV)
     123        2354 :     {}
     124             : 
     125             :     TYPEINFO();
     126           9 :     const SwFmtFld* GetField() const { return pFld; }
     127           9 :     sal_Int16 Which() const { return nWhich; }
     128           0 :     const SwView* GetView() const { return pView; }
     129             : };
     130             : 
     131             : #endif
     132             : 
     133             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10