LCOV - code coverage report
Current view: top level - sw/inc - hints.hxx (source / functions) Hit Total Coverage
Test: commit 10e77ab3ff6f4314137acd6e2702a6e5c1ce1fae Lines: 39 42 92.9 %
Date: 2014-11-03 Functions: 29 47 61.7 %
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_HINTS_HXX
      20             : #define INCLUDED_SW_INC_HINTS_HXX
      21             : 
      22             : #include <swatrset.hxx>
      23             : 
      24             : class SwFmt;
      25             : class OutputDevice;
      26             : class SwTable;
      27             : class SwNode;
      28             : class SwNodes;
      29             : class SwCntntNode;
      30             : class SwPageFrm;
      31             : class SwFrm;
      32             : class SwTxtNode;
      33             : class SwHistory;
      34             : 
      35             : // Base class for all Message-Hints:
      36             : // "Overhead" of SfxPoolItem is handled here
      37     4881494 : class SwMsgPoolItem : public SfxPoolItem
      38             : {
      39             : public:
      40             :     SwMsgPoolItem( sal_uInt16 nWhich );
      41             : 
      42             :     // "Overhead" of SfxPoolItem
      43             :     virtual bool            operator==( const SfxPoolItem& ) const SAL_OVERRIDE;
      44             :     virtual SfxPoolItem*    Clone( SfxItemPool* pPool = 0 ) const SAL_OVERRIDE;
      45             : };
      46             : 
      47             : // SwPtrMsgPoolItem (old SwObjectDying!)
      48             : 
      49      563977 : class SwPtrMsgPoolItem : public SwMsgPoolItem
      50             : {
      51             : public:
      52             :     void * pObject;
      53             : 
      54      563977 :     SwPtrMsgPoolItem( sal_uInt16 nId, void * pObj )
      55      563977 :         : SwMsgPoolItem( nId ), pObject( pObj )
      56      563977 :     {}
      57             : };
      58             : 
      59             : /*
      60             :  * SwFmtChg is sent when a format has changed to another format. 2 Hints are always sent
      61             :  * the old and the new format
      62             :  */
      63      290808 : class SwFmtChg: public SwMsgPoolItem
      64             : {
      65             : public:
      66             :     SwFmt *pChangedFmt;
      67             :     SwFmtChg( SwFmt *pFmt );
      68             : };
      69             : 
      70       21460 : class SwInsTxt: public SwMsgPoolItem
      71             : {
      72             : public:
      73             :     sal_Int32 nPos;
      74             :     sal_Int32 nLen;
      75             : 
      76             :     SwInsTxt( sal_Int32 nP, sal_Int32 nL );
      77             : };
      78             : 
      79        6888 : class SwDelChr: public SwMsgPoolItem
      80             : {
      81             : public:
      82             :     sal_Int32 nPos;
      83             : 
      84             :     SwDelChr( sal_Int32 nP );
      85             : };
      86             : 
      87        2232 : class SwDelTxt: public SwMsgPoolItem
      88             : {
      89             : public:
      90             :     sal_Int32 nStart;
      91             :     sal_Int32 nLen;
      92             : 
      93             :     SwDelTxt( sal_Int32 nS, sal_Int32 nL );
      94             : };
      95             : 
      96      148319 : class SwUpdateAttr : public SwMsgPoolItem
      97             : {
      98             : private:
      99             :     sal_Int32 nStart;
     100             :     sal_Int32 nEnd;
     101             :     sal_uInt16 nWhichAttr;
     102             :     std::vector<sal_uInt16> aWhichFmtAttr; // attributes changed inside RES_TXTATR_AUTOFMT
     103             : 
     104             : public:
     105             :     SwUpdateAttr( sal_Int32 nS, sal_Int32 nE, sal_uInt16 nW );
     106             : 
     107        5782 :     sal_Int32 getStart() const
     108             :     {
     109        5782 :         return nStart;
     110             :     }
     111             : 
     112        5782 :     sal_Int32 getEnd() const
     113             :     {
     114        5782 :         return nEnd;
     115             :     }
     116             : 
     117      155829 :     sal_uInt16 getWhichAttr() const
     118             :     {
     119      155829 :         return nWhichAttr;
     120             :     }
     121             : 
     122        5782 :     const std::vector<sal_uInt16>& getFmtAttr() const
     123             :     {
     124        5782 :         return aWhichFmtAttr;
     125             :     }
     126             : };
     127             : 
     128             : /** SwRefMarkFldUpdate is sent when the referencemarks should be updated.
     129             :      To determine Page- / chapternumbers the current frame has to be asked.
     130             :       For this we need the current outputdevice */
     131           0 : class SwRefMarkFldUpdate : public SwMsgPoolItem
     132             : {
     133             : public:
     134             :     const OutputDevice* pOut; ///< pointer to the current output device
     135             :     /** Is sent if reference marks should be updated.
     136             : 
     137             :         To get the page/chapter number, the frame has to be asked. For that we need
     138             :         the current OutputDevice.
     139             :     */
     140             :     SwRefMarkFldUpdate( const OutputDevice* );
     141             : };
     142             : 
     143             : /** SwDocPosUpdate is sent to signal that only the frames from or to a specified document-global position
     144             :    have to be updated. At the moment this is only needed when updating pagenumber fields. */
     145        6956 : class SwDocPosUpdate : public SwMsgPoolItem
     146             : {
     147             : public:
     148             :     const long nDocPos;
     149             :     SwDocPosUpdate( const long nDocPos );
     150             : };
     151             : 
     152             : /// SwTableFmlUpdate is sent when the table has to be newly calculated or when a table itself is merged or splitted
     153             : enum TableFmlUpdtFlags { TBL_CALC = 0,
     154             :                          TBL_BOXNAME,
     155             :                          TBL_BOXPTR,
     156             :                          TBL_RELBOXNAME,
     157             :                          TBL_MERGETBL,
     158             :                          TBL_SPLITTBL
     159             :                        };
     160        1738 : class SwTableFmlUpdate : public SwMsgPoolItem
     161             : {
     162             : public:
     163             :     const SwTable* pTbl;         ///< Pointer to the current table
     164             :     union {
     165             :         const SwTable* pDelTbl;  ///< Merge: Pointer to the table to be removed
     166             :         const OUString* pNewTblNm; ///< Split: the name of the new table
     167             :     } DATA;
     168             :     SwHistory* pHistory;
     169             :     sal_uInt16 nSplitLine;       ///< Split: from this BaseLine on will be splitted
     170             :     TableFmlUpdtFlags eFlags;
     171             :     bool bModified : 1;
     172             :     bool bBehindSplitLine : 1;
     173             : 
     174             :     /** Is sent if a table should be recalculated */
     175             :     SwTableFmlUpdate( const SwTable* );
     176             : };
     177             : 
     178      172072 : class SwAutoFmtGetDocNode: public SwMsgPoolItem
     179             : {
     180             : public:
     181             :     const SwCntntNode* pCntntNode;
     182             :     const SwNodes* pNodes;
     183             : 
     184             :     SwAutoFmtGetDocNode( const SwNodes* pNds );
     185             : };
     186             : 
     187             : /*
     188             :  * SwAttrSetChg is sent when something has changed in the SwAttrSet rTheChgdSet.
     189             :  * 2 Hints are always sent, the old and the new items in the rTheChgdSet.
     190             :  */
     191             : class SwAttrSetChg: public SwMsgPoolItem
     192             : {
     193             :     bool bDelSet;
     194             :     SwAttrSet* pChgSet;           ///< what has changed
     195             :     const SwAttrSet* pTheChgdSet; ///< is only used to compare
     196             : public:
     197             :     SwAttrSetChg( const SwAttrSet& rTheSet, SwAttrSet& rSet );
     198             :     SwAttrSetChg( const SwAttrSetChg& );
     199             :     virtual ~SwAttrSetChg();
     200             : 
     201             :     /// What has changed
     202      421700 :     const SwAttrSet* GetChgSet() const     { return pChgSet; }
     203     7194013 :           SwAttrSet* GetChgSet()           { return pChgSet; }
     204             : 
     205             :     /// Where it has changed
     206     1661113 :     const SwAttrSet* GetTheChgdSet() const { return pTheChgdSet; }
     207             : 
     208      821085 :     sal_uInt16 Count() const { return pChgSet->Count(); }
     209       14308 :     void ClearItem( sal_uInt16 nWhichL = 0 )
     210             : #ifdef DBG_UTIL
     211             :         ;
     212             : #else
     213       14308 :     { pChgSet->ClearItem( nWhichL ); }
     214             : #endif
     215             : };
     216             : 
     217           0 : class SwCondCollCondChg: public SwMsgPoolItem
     218             : {
     219             : public:
     220             :     SwFmt *pChangedFmt;
     221             :     SwCondCollCondChg( SwFmt *pFmt );
     222             : };
     223             : 
     224         626 : class SwVirtPageNumInfo: public SwMsgPoolItem
     225             : {
     226             :     const SwPageFrm *pPage;
     227             :     const SwPageFrm *pOrigPage;
     228             :     const SwFrm     *pFrm;
     229             :     /** Multiple attributes can be attached to a single paragraph / table
     230             :      The frame, in the end, has to decide which attribute takes effect and which physical page it involves */
     231             : public:
     232             :     SwVirtPageNumInfo( const SwPageFrm *pPg );
     233             : 
     234        1152 :     const SwPageFrm *GetPage()          { return pPage;    }
     235         724 :     const SwPageFrm *GetOrigPage()      { return pOrigPage;}
     236         326 :     const SwFrm *GetFrm()               { return pFrm; }
     237         328 :     void  SetInfo( const SwPageFrm *pPg,
     238         328 :                    const SwFrm *pF )    { pFrm = pF, pPage = pPg; }
     239             : };
     240             : 
     241        4734 : class SwFindNearestNode : public SwMsgPoolItem
     242             : {
     243             :     const SwNode *pNd, *pFnd;
     244             : public:
     245             :     SwFindNearestNode( const SwNode& rNd );
     246             :     void CheckNode( const SwNode& rNd );
     247             : 
     248        4734 :     const SwNode* GetFoundNode() const { return pFnd; }
     249             : };
     250             : 
     251        4184 : class SwStringMsgPoolItem : public SwMsgPoolItem
     252             : {
     253             :     OUString m_sStr;
     254             : public:
     255             : 
     256           0 :     OUString GetString() const { return m_sStr; }
     257             : 
     258        4184 :     SwStringMsgPoolItem( sal_uInt16 nId, const OUString& rStr )
     259        4184 :         : SwMsgPoolItem( nId ), m_sStr( rStr )
     260        4184 :     {}
     261             : };
     262             : #endif
     263             : 
     264             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10