LCOV - code coverage report
Current view: top level - libreoffice/sw/inc - hints.hxx (source / functions) Hit Total Coverage
Test: libreoffice_filtered.info Lines: 21 34 61.8 %
Date: 2012-12-27 Functions: 17 43 39.5 %
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 _HINTS_HXX
      20             : #define _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      151314 : class SwMsgPoolItem : public SfxPoolItem
      38             : {
      39             : public:
      40             :     SwMsgPoolItem( sal_uInt16 nWhich );
      41             : 
      42             :     // "Overhead" of SfxPoolItem
      43             :     virtual int             operator==( const SfxPoolItem& ) const;
      44             :     virtual SfxPoolItem*    Clone( SfxItemPool* pPool = 0 ) const;
      45             : };
      46             : 
      47             : 
      48             : // ---------------------------------------
      49             : // SwPtrMsgPoolItem (old SwObjectDying!)
      50             : // ---------------------------------------
      51             : 
      52        7101 : class SwPtrMsgPoolItem : public SwMsgPoolItem
      53             : {
      54             : public:
      55             :     void * pObject;
      56             : 
      57        7101 :     SwPtrMsgPoolItem( sal_uInt16 nId, void * pObj )
      58        7101 :         : SwMsgPoolItem( nId ), pObject( pObj )
      59        7101 :     {}
      60             : };
      61             : 
      62             : 
      63             : 
      64             : /*
      65             :  * SwFmtChg is sent when a format has changed to another format. 2 Hints are always sent
      66             :  * the old and the new format
      67             :  */
      68        7944 : class SwFmtChg: public SwMsgPoolItem
      69             : {
      70             : public:
      71             :     SwFmt *pChangedFmt;
      72             :     SwFmtChg( SwFmt *pFmt );
      73             : };
      74             : 
      75             : 
      76         765 : class SwInsTxt: public SwMsgPoolItem
      77             : {
      78             : public:
      79             :     xub_StrLen nPos;
      80             :     xub_StrLen nLen;
      81             : 
      82             :     SwInsTxt( xub_StrLen nP, xub_StrLen nL );
      83             : };
      84             : 
      85          28 : class SwDelChr: public SwMsgPoolItem
      86             : {
      87             : public:
      88             :     xub_StrLen nPos;
      89             : 
      90             :     SwDelChr( xub_StrLen nP );
      91             : };
      92             : 
      93         292 : class SwDelTxt: public SwMsgPoolItem
      94             : {
      95             : public:
      96             :     xub_StrLen nStart;
      97             :     xub_StrLen nLen;
      98             : 
      99             :     SwDelTxt( xub_StrLen nS, xub_StrLen nL );
     100             : };
     101             : 
     102       10038 : class SwUpdateAttr: public SwMsgPoolItem
     103             : {
     104             : public:
     105             :     xub_StrLen nStart;
     106             :     xub_StrLen nEnd;
     107             :     sal_uInt16 nWhichAttr;
     108             :     SwUpdateAttr( xub_StrLen nS, xub_StrLen nE, sal_uInt16 nW );
     109             : };
     110             : 
     111             : 
     112             : /** SwRefMarkFldUpdate is sent when the referencemarks should be updated.
     113             :      To determine Page- / chapternumbers the current frame has to be asked.
     114             :       For this we need the current outputdevice */
     115           0 : class SwRefMarkFldUpdate : public SwMsgPoolItem
     116             : {
     117             : public:
     118             :     const OutputDevice* pOut; ///< pointer to the current output device
     119             :     SwRefMarkFldUpdate( const OutputDevice* );
     120             : };
     121             : 
     122             : /** SwDocPosUpdate is sent to signal that only the frames from or to a specified document-global position
     123             :    have to be updated. At the moment this is only needed when updating pagenumber fields. */
     124         238 : class SwDocPosUpdate : public SwMsgPoolItem
     125             : {
     126             : public:
     127             :     const long nDocPos;
     128             :     SwDocPosUpdate( const long nDocPos );
     129             : };
     130             : 
     131             : /// SwTableFmlUpdate is sent when the table has to be newly calculated or when a table itself is merged or splitted
     132             : enum TableFmlUpdtFlags { TBL_CALC = 0,
     133             :                          TBL_BOXNAME,
     134             :                          TBL_BOXPTR,
     135             :                          TBL_RELBOXNAME,
     136             :                          TBL_MERGETBL,
     137             :                          TBL_SPLITTBL
     138             :                        };
     139          77 : class SwTableFmlUpdate : public SwMsgPoolItem
     140             : {
     141             : public:
     142             :     const SwTable* pTbl;         ///< Pointer to the current table
     143             :     union {
     144             :         const SwTable* pDelTbl;  ///< Merge: Pointer to the table to be removed
     145             :         const String* pNewTblNm; ///< Split: the name of the new table
     146             :     } DATA;
     147             :     SwHistory* pHistory;
     148             :     sal_uInt16 nSplitLine;       ///< Split: from this BaseLine on will be splitted
     149             :     TableFmlUpdtFlags eFlags;
     150             :     sal_Bool bModified : 1;
     151             :     sal_Bool bBehindSplitLine : 1;
     152             : 
     153             :     SwTableFmlUpdate( const SwTable* );
     154             : };
     155             : 
     156             : 
     157        4546 : class SwAutoFmtGetDocNode: public SwMsgPoolItem
     158             : {
     159             : public:
     160             :     const SwCntntNode* pCntntNode;
     161             :     const SwNodes* pNodes;
     162             : 
     163             :     SwAutoFmtGetDocNode( const SwNodes* pNds );
     164             : };
     165             : 
     166             : /*
     167             :  * SwAttrSetChg is sent when something has changed in the SwAttrSet rTheChgdSet.
     168             :  * 2 Hints are always sent, the old and the new items in the rTheChgdSet.
     169             :  */
     170             : class SwAttrSetChg: public SwMsgPoolItem
     171             : {
     172             :     sal_Bool bDelSet;
     173             :     SwAttrSet* pChgSet;           ///< what has changed
     174             :     const SwAttrSet* pTheChgdSet; ///< is only used to compare
     175             : public:
     176             :     SwAttrSetChg( const SwAttrSet& rTheSet, SwAttrSet& rSet );
     177             :     SwAttrSetChg( const SwAttrSetChg& );
     178             :     ~SwAttrSetChg();
     179             : 
     180             :     /// What has changed
     181       18010 :     const SwAttrSet* GetChgSet() const     { return pChgSet; }
     182      238553 :           SwAttrSet* GetChgSet()           { return pChgSet; }
     183             : 
     184             :     /// Where it has changed
     185       53477 :     const SwAttrSet* GetTheChgdSet() const { return pTheChgdSet; }
     186             : 
     187       28027 :     sal_uInt16 Count() const { return pChgSet->Count(); }
     188           0 :     void ClearItem( sal_uInt16 nWhichL = 0 )
     189             : #ifdef DBG_UTIL
     190             :         ;
     191             : #else
     192           0 :     { pChgSet->ClearItem( nWhichL ); }
     193             : #endif
     194             : };
     195             : 
     196           0 : class SwCondCollCondChg: public SwMsgPoolItem
     197             : {
     198             : public:
     199             :     SwFmt *pChangedFmt;
     200             :     SwCondCollCondChg( SwFmt *pFmt );
     201             : };
     202             : 
     203           0 : class SwVirtPageNumInfo: public SwMsgPoolItem
     204             : {
     205             :     const SwPageFrm *pPage;
     206             :     const SwPageFrm *pOrigPage;
     207             :     const SwFrm     *pFrm;
     208             :     /** Multiple attributes can be attached to a single paragraph / table
     209             :      The frame, in the end, has to decide which attribute takes effect and which physical page it involves */
     210             : public:
     211             :     SwVirtPageNumInfo( const SwPageFrm *pPg );
     212             : 
     213           0 :     const SwPageFrm *GetPage()          { return pPage;    }
     214           0 :     const SwPageFrm *GetOrigPage()      { return pOrigPage;}
     215           0 :     const SwFrm *GetFrm()               { return pFrm; }
     216           0 :     void  SetInfo( const SwPageFrm *pPg,
     217           0 :                    const SwFrm *pF )    { pFrm = pF, pPage = pPg; }
     218             : };
     219             : 
     220           0 : class SwFindNearestNode : public SwMsgPoolItem
     221             : {
     222             :     const SwNode *pNd, *pFnd;
     223             : public:
     224             :     SwFindNearestNode( const SwNode& rNd );
     225             :     void CheckNode( const SwNode& rNd );
     226             : 
     227           0 :     const SwNode* GetFoundNode() const { return pFnd; }
     228             : };
     229             : 
     230          82 : class SwStringMsgPoolItem : public SwMsgPoolItem
     231             : {
     232             :     String sStr;
     233             : public:
     234             : 
     235           0 :     const String& GetString() const { return sStr; }
     236             : 
     237          82 :     SwStringMsgPoolItem( sal_uInt16 nId, const String& rStr )
     238          82 :         : SwMsgPoolItem( nId ), sStr( rStr )
     239          82 :     {}
     240             : };
     241             : #endif
     242             : 
     243             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10