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

Generated by: LCOV version 1.11