1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
19 #ifndef INCLUDED_SW_INC_HINTS_HXX
20 #define INCLUDED_SW_INC_HINTS_HXX
22 #include <swatrset.hxx>
23 #include <vcl/vclptr.hxx>
37 // Base class for all Message-Hints:
38 // "Overhead" of SfxPoolItem is handled here
39 class SwMsgPoolItem
: public SfxPoolItem
42 SwMsgPoolItem( sal_uInt16 nWhich
);
44 // "Overhead" of SfxPoolItem
45 virtual bool operator==( const SfxPoolItem
& ) const SAL_OVERRIDE
;
46 virtual SfxPoolItem
* Clone( SfxItemPool
* pPool
= 0 ) const SAL_OVERRIDE
;
49 // SwPtrMsgPoolItem (old SwObjectDying!)
51 class SwPtrMsgPoolItem
: public SwMsgPoolItem
56 SwPtrMsgPoolItem( sal_uInt16 nId
, void * pObj
)
57 : SwMsgPoolItem( nId
), pObject( pObj
)
62 * SwFormatChg is sent when a format has changed to another format. 2 Hints are always sent
63 * the old and the new format
65 class SwFormatChg
: public SwMsgPoolItem
68 SwFormat
*pChangedFormat
;
69 SwFormatChg( SwFormat
*pFormat
);
72 class SwInsText
: public SwMsgPoolItem
78 SwInsText( sal_Int32 nP
, sal_Int32 nL
);
81 class SwDelChr
: public SwMsgPoolItem
86 SwDelChr( sal_Int32 nP
);
89 class SwDelText
: public SwMsgPoolItem
95 SwDelText( sal_Int32 nS
, sal_Int32 nL
);
98 class SwUpdateAttr
: public SwMsgPoolItem
103 sal_uInt16 nWhichAttr
;
104 std::vector
<sal_uInt16
> aWhichFormatAttr
; // attributes changed inside RES_TXTATR_AUTOFMT
107 SwUpdateAttr( sal_Int32 nS
, sal_Int32 nE
, sal_uInt16 nW
);
109 sal_Int32
getStart() const
114 sal_Int32
getEnd() const
119 sal_uInt16
getWhichAttr() const
124 const std::vector
<sal_uInt16
>& getFormatAttr() const
126 return aWhichFormatAttr
;
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 class SwRefMarkFieldUpdate
: public SwMsgPoolItem
136 VclPtr
<OutputDevice
> pOut
; ///< pointer to the current output device
137 /** Is sent if reference marks should be updated.
139 To get the page/chapter number, the frame has to be asked. For that we need
140 the current OutputDevice.
142 SwRefMarkFieldUpdate( OutputDevice
* );
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 class SwDocPosUpdate
: public SwMsgPoolItem
151 SwDocPosUpdate( const long nDocPos
);
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,
162 class SwTableFormulaUpdate
: public SwMsgPoolItem
165 const SwTable
* pTable
; ///< Pointer to the current table
167 const SwTable
* pDelTable
; ///< Merge: Pointer to the table to be removed
168 const OUString
* pNewTableNm
; ///< Split: the name of the new table
171 sal_uInt16 nSplitLine
; ///< Split: from this BaseLine on will be splitted
172 TableFormulaUpdateFlags eFlags
;
174 bool bBehindSplitLine
: 1;
176 /** Is sent if a table should be recalculated */
177 SwTableFormulaUpdate( const SwTable
* );
180 class SwAutoFormatGetDocNode
: public SwMsgPoolItem
183 const SwContentNode
* pContentNode
;
184 const SwNodes
* pNodes
;
186 SwAutoFormatGetDocNode( const SwNodes
* pNds
);
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.
193 class SwAttrSetChg
: public SwMsgPoolItem
196 SwAttrSet
* pChgSet
; ///< what has changed
197 const SwAttrSet
* pTheChgdSet
; ///< is only used to compare
199 SwAttrSetChg( const SwAttrSet
& rTheSet
, SwAttrSet
& rSet
);
200 SwAttrSetChg( const SwAttrSetChg
& );
201 virtual ~SwAttrSetChg();
204 const SwAttrSet
* GetChgSet() const { return pChgSet
; }
205 SwAttrSet
* GetChgSet() { return pChgSet
; }
207 /// Where it has changed
208 const SwAttrSet
* GetTheChgdSet() const { return pTheChgdSet
; }
210 sal_uInt16
Count() const { return pChgSet
->Count(); }
211 void ClearItem( sal_uInt16 nWhichL
= 0 )
215 { pChgSet
->ClearItem( nWhichL
); }
219 class SwCondCollCondChg
: public SwMsgPoolItem
222 SwFormat
*pChangedFormat
;
223 SwCondCollCondChg( SwFormat
*pFormat
);
226 class SwVirtPageNumInfo
: public SwMsgPoolItem
228 const SwPageFrm
*pPage
;
229 const SwPageFrm
*pOrigPage
;
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 */
234 SwVirtPageNumInfo( const SwPageFrm
*pPg
);
236 const SwPageFrm
*GetPage() { return pPage
; }
237 const SwPageFrm
*GetOrigPage() { return pOrigPage
;}
238 const SwFrm
*GetFrm() { return pFrm
; }
239 void SetInfo( const SwPageFrm
*pPg
,
240 const SwFrm
*pF
) { pFrm
= pF
, pPage
= pPg
; }
243 class SwFindNearestNode
: public SwMsgPoolItem
245 const SwNode
*pNd
, *pFnd
;
247 SwFindNearestNode( const SwNode
& rNd
);
248 void CheckNode( const SwNode
& rNd
);
250 const SwNode
* GetFoundNode() const { return pFnd
; }
253 class SwStringMsgPoolItem
: public SwMsgPoolItem
258 OUString
GetString() const { return m_sStr
; }
260 SwStringMsgPoolItem( sal_uInt16 nId
, const OUString
& rStr
)
261 : SwMsgPoolItem( nId
), m_sStr( rStr
)
266 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */