LibreOffice Module sw (master) 1
hints.hxx
Go to the documentation of this file.
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 "swtypes.hxx"
24#include <vcl/vclptr.hxx>
25
26class SwFormat;
27class OutputDevice;
28class SwTable;
29class SwNode;
30class SwNodes;
31class SwPageFrame;
32class SwFrame;
33class SwHistory;
34class SwTextNode;
36class SwFrameFormat;
37class SwTableBox;
39class SwTableLine;
41class SwTableBox;
42
43// Base class for all Message-Hints:
44// "Overhead" of SfxPoolItem is handled here
46{
47public:
48 SwMsgPoolItem( sal_uInt16 nWhich );
49
50 // "Overhead" of SfxPoolItem
51 virtual bool operator==( const SfxPoolItem& ) const override;
52 virtual SwMsgPoolItem* Clone( SfxItemPool* pPool = nullptr ) const override;
53};
54
55// SwPtrMsgPoolItem (old SwObjectDying!)
56
57class SwPtrMsgPoolItem final : public SwMsgPoolItem
58{
59public:
60 void * pObject;
61
62 SwPtrMsgPoolItem( sal_uInt16 nId, void * pObj )
63 : SwMsgPoolItem( nId ), pObject( pObj )
64 {}
65};
66
67/*
68 * SwFormatChg is sent when a format has changed to another format. 2 Hints are always sent
69 * the old and the new format
70 */
71class SwFormatChg final : public SwMsgPoolItem
72{
73public:
75 SwFormatChg( SwFormat *pFormat );
76};
77
78class SwInsText final : public SwMsgPoolItem
79{
80public:
81 sal_Int32 nPos;
82 sal_Int32 nLen;
85
86 SwInsText(sal_Int32 nP, sal_Int32 nL, bool isInFMCommand, bool isInFMResult);
87};
88
89class SwDelChr final : public SwMsgPoolItem
90{
91public:
92 sal_Int32 nPos;
93
94 SwDelChr( sal_Int32 nP );
95};
96
97class SwDelText final : public SwMsgPoolItem
98{
99public:
100 sal_Int32 nStart;
101 sal_Int32 nLen;
102
103 SwDelText( sal_Int32 nS, sal_Int32 nL );
104};
105
106namespace sw {
107
109class MoveText final : public SfxHint
110{
111public:
113 sal_Int32 nDestStart;
114 sal_Int32 nSourceStart;
115 sal_Int32 nLen;
116
117 MoveText(SwTextNode *pD, sal_Int32 nD, sal_Int32 nS, sal_Int32 nL);
118};
119
121class RedlineDelText final : public SfxHint
122{
123public:
124 sal_Int32 nStart;
125 sal_Int32 nLen;
126
127 RedlineDelText(sal_Int32 nS, sal_Int32 nL);
128};
129
131class RedlineUnDelText final : public SfxHint
132{
133public:
134 sal_Int32 nStart;
135 sal_Int32 nLen;
136
137 RedlineUnDelText(sal_Int32 nS, sal_Int32 nL);
138};
139
140class CondCollCondChg final : public SfxHint
141{
142public:
144 CondCollCondChg(const SwTextFormatColl& rColl) : m_rColl(rColl) {};
145};
146
148{
149};
150
151class PreGraphicArrivedHint final : public SfxHint
152{
153};
154
155class PostGraphicArrivedHint final : public SfxHint
156{
157};
158
159class MoveTableLineHint final : public SfxHint
160{
161public:
164 MoveTableLineHint(const SwFrameFormat& rNewFormat, const SwTableLine& rTableLine): m_rNewFormat(rNewFormat), m_rTableLine(rTableLine) {};
165};
166
167class MoveTableBoxHint final : public SfxHint
168{
169public:
172 MoveTableBoxHint(const SwFrameFormat& rNewFormat, const SwTableBox& rTableBox): m_rNewFormat(rNewFormat), m_rTableBox(rTableBox) {};
173};
174
175class DocumentDyingHint final : public SfxHint
176{
177};
178
179class TableLineFormatChanged final : public SfxHint
180{
181public:
184 TableLineFormatChanged(const SwTableLineFormat& rNewFormat, const SwTableLine& rTabLine) : m_rNewFormat(rNewFormat), m_rTabLine(rTabLine) {};
185};
186class TableBoxFormatChanged final : public SfxHint
187{
188public:
191 TableBoxFormatChanged(const SwTableBoxFormat& rNewFormat, const SwTableBox& rTableBox) : m_rNewFormat(rNewFormat), m_rTableBox(rTableBox) {};
192};
193}
194
195class SwUpdateAttr final : public SwMsgPoolItem
196{
197private:
198 sal_Int32 m_nStart;
199 sal_Int32 m_nEnd;
200 sal_uInt16 m_nWhichAttr;
201 std::vector<sal_uInt16> m_aWhichFmtAttrs; // attributes changed inside RES_TXTATR_AUTOFMT
202
203public:
204 SwUpdateAttr( sal_Int32 nS, sal_Int32 nE, sal_uInt16 nW );
205 SwUpdateAttr( sal_Int32 nS, sal_Int32 nE, sal_uInt16 nW, std::vector<sal_uInt16> aW );
206
207 sal_Int32 getStart() const
208 {
209 return m_nStart;
210 }
211
212 sal_Int32 getEnd() const
213 {
214 return m_nEnd;
215 }
216
217 sal_uInt16 getWhichAttr() const
218 {
219 return m_nWhichAttr;
220 }
221
222 const std::vector<sal_uInt16>& getFmtAttrs() const
223 {
224 return m_aWhichFmtAttrs;
225 }
226};
227
232{
234public:
241};
242
245class SwDocPosUpdate final : public SwMsgPoolItem
246{
247public:
250};
251
259 };
261{
262public:
264 union {
266 const OUString* pNewTableNm;
269 sal_uInt16 m_nSplitLine;
271 bool m_bModified : 1;
273
276};
277
279{
280public:
282
283 SwAutoFormatGetDocNode( const SwNodes* pNds );
284};
285
286/*
287 * SwAttrSetChg is sent when something has changed in the SwAttrSet rTheChgdSet.
288 * 2 Hints are always sent, the old and the new items in the rTheChgdSet.
289 */
290class SwAttrSetChg final : public SwMsgPoolItem
291{
295public:
296 SwAttrSetChg( const SwAttrSet& rTheSet, SwAttrSet& rSet );
297 SwAttrSetChg( const SwAttrSetChg& );
298 virtual ~SwAttrSetChg() override;
299
301 const SwAttrSet* GetChgSet() const { return m_pChgSet; }
303
305 const SwAttrSet* GetTheChgdSet() const { return m_pTheChgdSet; }
306
307 sal_uInt16 Count() const { return m_pChgSet->Count(); }
308 void ClearItem( sal_uInt16 nWhichL )
309#ifdef DBG_UTIL
310 ;
311#else
312 { m_pChgSet->ClearItem( nWhichL ); }
313#endif
314};
315
317{
323public:
324 SwVirtPageNumInfo( const SwPageFrame *pPg );
325
326 const SwPageFrame *GetPage() const { return m_pPage; }
327 const SwPageFrame *GetOrigPage() const { return m_pOrigPage;}
328 const SwFrame *GetFrame() const { return m_pFrame; }
329 void SetInfo( const SwPageFrame *pPg,
330 const SwFrame *pF ) { m_pFrame = pF; m_pPage = pPg; }
331};
332
334{
336public:
337 SwFindNearestNode( const SwNode& rNd );
338 void CheckNode( const SwNode& rNd );
339
340 const SwNode* GetFoundNode() const { return m_pFound; }
341};
342
344{
345 OUString m_sStr;
346public:
347
348 const OUString& GetString() const { return m_sStr; }
349
350 SwStringMsgPoolItem( sal_uInt16 nId, const OUString& rStr )
351 : SwMsgPoolItem( nId ), m_sStr( rStr )
352 {}
353};
354#endif
355
356/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
sal_uInt16 Count() const
sal_uInt16 ClearItem(sal_uInt16 nWhich=0)
SwAttrSetChg(const SwAttrSet &rTheSet, SwAttrSet &rSet)
Definition: hints.cxx:108
const SwAttrSet * m_pTheChgdSet
is only used to compare
Definition: hints.hxx:294
sal_uInt16 Count() const
Definition: hints.hxx:307
SwAttrSet * GetChgSet()
Definition: hints.hxx:302
const SwAttrSet * GetTheChgdSet() const
Where it has changed.
Definition: hints.hxx:305
SwAttrSet * m_pChgSet
what has changed
Definition: hints.hxx:293
void ClearItem(sal_uInt16 nWhichL)
Definition: hints.cxx:131
const SwAttrSet * GetChgSet() const
What has changed.
Definition: hints.hxx:301
bool m_bDelSet
Definition: hints.hxx:292
virtual ~SwAttrSetChg() override
Definition: hints.cxx:124
SwAutoFormatGetDocNode(const SwNodes *pNds)
Definition: hints.cxx:103
const SwNodes * pNodes
Definition: hints.hxx:281
SwDelChr(sal_Int32 nP)
Definition: hints.cxx:42
sal_Int32 nPos
Definition: hints.hxx:92
sal_Int32 nStart
Definition: hints.hxx:100
sal_Int32 nLen
Definition: hints.hxx:101
SwDelText(sal_Int32 nS, sal_Int32 nL)
Definition: hints.cxx:47
SwDocPosUpdate is sent to signal that only the frames from or to a specified document-global position...
Definition: hints.hxx:246
const SwTwips nDocPos
Definition: hints.hxx:248
SwDocPosUpdate(const SwTwips nDocPos)
Definition: hints.cxx:88
const SwNode * m_pFound
Definition: hints.hxx:335
const SwNode * m_pNode
Definition: hints.hxx:335
void CheckNode(const SwNode &rNd)
Definition: hints.cxx:181
const SwNode * GetFoundNode() const
Definition: hints.hxx:340
SwFindNearestNode(const SwNode &rNd)
Definition: hints.cxx:176
SwFormatChg(SwFormat *pFormat)
Definition: hints.cxx:29
SwFormat * pChangedFormat
Definition: hints.hxx:74
Base class for various Writer styles.
Definition: format.hxx:47
Style of a layout element.
Definition: frmfmt.hxx:61
Base class of the Writer layout elements.
Definition: frame.hxx:315
sal_Int32 nPos
Definition: hints.hxx:81
bool isInsideFieldmarkCommand
Definition: hints.hxx:83
sal_Int32 nLen
Definition: hints.hxx:82
SwInsText(sal_Int32 nP, sal_Int32 nL, bool isInFMCommand, bool isInFMResult)
Definition: hints.cxx:34
bool isInsideFieldmarkResult
Definition: hints.hxx:84
virtual bool operator==(const SfxPoolItem &) const override
Definition: hints.cxx:143
virtual SwMsgPoolItem * Clone(SfxItemPool *pPool=nullptr) const override
Definition: hints.cxx:149
SwMsgPoolItem(sal_uInt16 nWhich)
Definition: hints.cxx:138
Base class of the Writer document model elements.
Definition: node.hxx:83
A page of the document layout.
Definition: pagefrm.hxx:58
SwPtrMsgPoolItem(sal_uInt16 nId, void *pObj)
Definition: hints.hxx:62
void * pObject
Definition: hints.hxx:60
SwRefMarkFieldUpdate is sent when the referencemarks should be updated.
Definition: hints.hxx:232
VclPtr< OutputDevice > pOut
pointer to the current output device
Definition: hints.hxx:233
SwRefMarkFieldUpdate(OutputDevice *)
Is sent if reference marks should be updated.
Definition: hints.cxx:81
const OUString & GetString() const
Definition: hints.hxx:348
OUString m_sStr
Definition: hints.hxx:345
SwStringMsgPoolItem(sal_uInt16 nId, const OUString &rStr)
Definition: hints.hxx:350
SwTableBox is one table cell in the document model.
Definition: swtable.hxx:419
sal_uInt16 m_nSplitLine
Split: from this BaseLine on will be split.
Definition: hints.hxx:269
TableFormulaUpdateFlags m_eFlags
Definition: hints.hxx:270
SwHistory * m_pHistory
Definition: hints.hxx:268
const OUString * pNewTableNm
Split: the name of the new table.
Definition: hints.hxx:266
const SwTable * m_pTable
Pointer to the current table.
Definition: hints.hxx:263
union SwTableFormulaUpdate::@26 m_aData
const SwTable * pDelTable
Merge: Pointer to the table to be removed.
Definition: hints.hxx:265
SwTableFormulaUpdate(const SwTable *)
Is sent if a table should be recalculated.
Definition: hints.cxx:93
SwTableLine is one table row in the document model.
Definition: swtable.hxx:358
SwTable is one table in the document model, containing rows (which contain cells).
Definition: swtable.hxx:113
Represents the style of a paragraph.
Definition: fmtcol.hxx:59
SwTextNode is a paragraph in the document model.
Definition: ndtxt.hxx:84
const std::vector< sal_uInt16 > & getFmtAttrs() const
Definition: hints.hxx:222
sal_uInt16 getWhichAttr() const
Definition: hints.hxx:217
sal_Int32 getStart() const
Definition: hints.hxx:207
sal_uInt16 m_nWhichAttr
Definition: hints.hxx:200
sal_Int32 m_nEnd
Definition: hints.hxx:199
sal_Int32 getEnd() const
Definition: hints.hxx:212
std::vector< sal_uInt16 > m_aWhichFmtAttrs
Definition: hints.hxx:201
SwUpdateAttr(sal_Int32 nS, sal_Int32 nE, sal_uInt16 nW)
Definition: hints.cxx:71
sal_Int32 m_nStart
Definition: hints.hxx:198
const SwFrame * m_pFrame
Definition: hints.hxx:320
const SwPageFrame * m_pOrigPage
Definition: hints.hxx:319
const SwPageFrame * m_pPage
Definition: hints.hxx:318
void SetInfo(const SwPageFrame *pPg, const SwFrame *pF)
Definition: hints.hxx:329
const SwPageFrame * GetOrigPage() const
Definition: hints.hxx:327
SwVirtPageNumInfo(const SwPageFrame *pPg)
Multiple attributes can be attached to a single paragraph / table The frame, in the end,...
Definition: hints.cxx:171
const SwPageFrame * GetPage() const
Definition: hints.hxx:326
const SwFrame * GetFrame() const
Definition: hints.hxx:328
CondCollCondChg(const SwTextFormatColl &rColl)
Definition: hints.hxx:144
const SwTextFormatColl & m_rColl
Definition: hints.hxx:143
const SwFrameFormat & m_rNewFormat
Definition: hints.hxx:170
const SwTableBox & m_rTableBox
Definition: hints.hxx:171
MoveTableBoxHint(const SwFrameFormat &rNewFormat, const SwTableBox &rTableBox)
Definition: hints.hxx:172
const SwFrameFormat & m_rNewFormat
Definition: hints.hxx:162
const SwTableLine & m_rTableLine
Definition: hints.hxx:163
MoveTableLineHint(const SwFrameFormat &rNewFormat, const SwTableLine &rTableLine)
Definition: hints.hxx:164
text is moved into pDestNode
Definition: hints.hxx:110
sal_Int32 nDestStart
Definition: hints.hxx:113
SwTextNode * pDestNode
Definition: hints.hxx:112
sal_Int32 nSourceStart
Definition: hints.hxx:114
sal_Int32 nLen
Definition: hints.hxx:115
MoveText(SwTextNode *pD, sal_Int32 nD, sal_Int32 nS, sal_Int32 nL)
Definition: hints.cxx:54
new delete redline is created
Definition: hints.hxx:122
RedlineDelText(sal_Int32 nS, sal_Int32 nL)
Definition: hints.cxx:59
sal_Int32 nStart
Definition: hints.hxx:124
sal_Int32 nLen
Definition: hints.hxx:125
delete redline is removed
Definition: hints.hxx:132
sal_Int32 nLen
Definition: hints.hxx:135
sal_Int32 nStart
Definition: hints.hxx:134
RedlineUnDelText(sal_Int32 nS, sal_Int32 nL)
Definition: hints.cxx:64
const SwTableBox & m_rTableBox
Definition: hints.hxx:190
const SwTableBoxFormat & m_rNewFormat
Definition: hints.hxx:189
TableBoxFormatChanged(const SwTableBoxFormat &rNewFormat, const SwTableBox &rTableBox)
Definition: hints.hxx:191
TableLineFormatChanged(const SwTableLineFormat &rNewFormat, const SwTableLine &rTabLine)
Definition: hints.hxx:184
const SwTableLine & m_rTabLine
Definition: hints.hxx:183
const SwTableLineFormat & m_rNewFormat
Definition: hints.hxx:182
TableFormulaUpdateFlags
SwTableFormulaUpdate is sent when the table has to be newly calculated or when a table itself is merg...
Definition: hints.hxx:253
@ TBL_MERGETBL
Definition: hints.hxx:257
@ TBL_BOXPTR
Definition: hints.hxx:255
@ TBL_SPLITTBL
Definition: hints.hxx:258
@ TBL_CALC
Definition: hints.hxx:253
@ TBL_BOXNAME
Definition: hints.hxx:254
@ TBL_RELBOXNAME
Definition: hints.hxx:256
Dialog to specify the properties of date form field.
sal_Int16 nId
tools::Long SwTwips
Definition: swtypes.hxx:51