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 <utility>
25#include <vcl/vclptr.hxx>
26
27class SwFormat;
28class OutputDevice;
29class SwTable;
30class SwNode;
31class SwNodes;
32class SwPageFrame;
33class SwFrame;
34class SwHistory;
35class SwTextNode;
37class SwFrameFormat;
38class SwTableBox;
40class SwTableLine;
42class SwTableBox;
43
44// Base class for all Message-Hints:
45// "Overhead" of SfxPoolItem is handled here
47{
48public:
49 SwMsgPoolItem( sal_uInt16 nWhich );
50
51 // "Overhead" of SfxPoolItem
52 virtual bool operator==( const SfxPoolItem& ) const override;
53 virtual SwMsgPoolItem* Clone( SfxItemPool* pPool = nullptr ) const override;
54};
55
56// SwPtrMsgPoolItem (old SwObjectDying!)
57
58class SwPtrMsgPoolItem final : public SwMsgPoolItem
59{
60public:
61 void * pObject;
62
63 SwPtrMsgPoolItem( sal_uInt16 nId, void * pObj )
64 : SwMsgPoolItem( nId ), pObject( pObj )
65 {}
66};
67
68/*
69 * SwFormatChg is sent when a format has changed to another format. 2 Hints are always sent
70 * the old and the new format
71 */
72class SwFormatChg final : public SwMsgPoolItem
73{
74public:
76 SwFormatChg( SwFormat *pFormat );
77};
78
79
80
81namespace sw {
82
84class MoveText final : public SfxHint
85{
86public:
88 sal_Int32 nDestStart;
89 sal_Int32 nSourceStart;
90 sal_Int32 nLen;
91
92 MoveText(SwTextNode *pD, sal_Int32 nD, sal_Int32 nS, sal_Int32 nL);
93};
94
95class InsertText final : public SfxHint
96{
97public:
98 const sal_Int32 nPos;
99 const sal_Int32 nLen;
102
103 InsertText(sal_Int32 nP, sal_Int32 nL, bool isInFMCommand, bool isInFMResult);
104};
105
106class DeleteText final : public SfxHint
107{
108public:
109 const sal_Int32 nStart;
110 const sal_Int32 nLen;
111
112 DeleteText( sal_Int32 nS, sal_Int32 nL );
113};
114
115class DeleteChar final : public SfxHint
116{
117public:
118 const sal_Int32 m_nPos;
119
120 DeleteChar( const sal_Int32 nPos );
121};
122
124class RedlineDelText final : public SfxHint
125{
126public:
127 sal_Int32 nStart;
128 sal_Int32 nLen;
129
130 RedlineDelText(sal_Int32 nS, sal_Int32 nL);
131};
132
134class RedlineUnDelText final : public SfxHint
135{
136public:
137 sal_Int32 nStart;
138 sal_Int32 nLen;
139
140 RedlineUnDelText(sal_Int32 nS, sal_Int32 nL);
141};
142
145class DocPosUpdate final : public SfxHint
146{
147public:
149 DocPosUpdate(const SwTwips nDocPos)
151 , m_nDocPos(nDocPos)
152 {};
153};
154class DocPosUpdateAtIndex final : public SfxHint
155{
156public:
159 const sal_uInt32 m_nIndex;
160 DocPosUpdateAtIndex(const SwTwips nDocPos, const SwTextNode& rNode, sal_uInt32 nIndex)
162 , m_nDocPos(nDocPos)
163 , m_rNode(rNode)
165 {};
166};
167class CondCollCondChg final : public SfxHint
168{
169public:
171 CondCollCondChg(const SwTextFormatColl& rColl) : m_rColl(rColl) {};
172};
173
175{
176};
177
178class PreGraphicArrivedHint final : public SfxHint
179{
180public:
182};
183
184class PostGraphicArrivedHint final : public SfxHint
185{
186};
187
189{
190public:
192};
193
195{
196public:
198};
199
200class MoveTableLineHint final : public SfxHint
201{
202public:
205 MoveTableLineHint(const SwFrameFormat& rNewFormat, const SwTableLine& rTableLine): m_rNewFormat(rNewFormat), m_rTableLine(rTableLine) {};
206};
207
208class MoveTableBoxHint final : public SfxHint
209{
210public:
213 MoveTableBoxHint(const SwFrameFormat& rNewFormat, const SwTableBox& rTableBox): m_rNewFormat(rNewFormat), m_rTableBox(rTableBox) {};
214};
215
216class DocumentDyingHint final : public SfxHint
217{
218};
219
220class TableLineFormatChanged final : public SfxHint
221{
222public:
225 TableLineFormatChanged(const SwTableLineFormat& rNewFormat, const SwTableLine& rTabLine) : m_rNewFormat(rNewFormat), m_rTabLine(rTabLine) {};
226};
227class TableBoxFormatChanged final : public SfxHint
228{
229public:
232 TableBoxFormatChanged(const SwTableBoxFormat& rNewFormat, const SwTableBox& rTableBox) : m_rNewFormat(rNewFormat), m_rTableBox(rTableBox) {};
233};
234class NameChanged final : public SfxHint
235{
236public:
237 const OUString m_sOld;
238 const OUString m_sNew;
239 NameChanged(const OUString& rOld, const OUString& rNew) : SfxHint(SfxHintId::NameChanged), m_sOld(rOld), m_sNew(rNew) {};
240};
241class TitleChanged final : public SfxHint
242{
243public:
244 const OUString m_sOld;
245 const OUString m_sNew;
246 TitleChanged(const OUString& rOld, const OUString& rNew) : SfxHint(SfxHintId::SwTitleChanged), m_sOld(rOld), m_sNew(rNew) {};
247};
248class DescriptionChanged final : public SfxHint
249{
250public:
252};
253class SectionHidden final: public SfxHint
254{
255public:
256 const bool m_isHidden;
257 SectionHidden(const bool isHidden = true) : SfxHint(SfxHintId::SwSectionHidden), m_isHidden(isHidden) {};
258};
259}
260
261class SwUpdateAttr final : public SwMsgPoolItem
262{
263private:
264 sal_Int32 m_nStart;
265 sal_Int32 m_nEnd;
266 sal_uInt16 m_nWhichAttr;
267 std::vector<sal_uInt16> m_aWhichFmtAttrs; // attributes changed inside RES_TXTATR_AUTOFMT
268
269public:
270 SwUpdateAttr( sal_Int32 nS, sal_Int32 nE, sal_uInt16 nW );
271 SwUpdateAttr( sal_Int32 nS, sal_Int32 nE, sal_uInt16 nW, std::vector<sal_uInt16> aW );
272
273 sal_Int32 getStart() const
274 {
275 return m_nStart;
276 }
277
278 sal_Int32 getEnd() const
279 {
280 return m_nEnd;
281 }
282
283 sal_uInt16 getWhichAttr() const
284 {
285 return m_nWhichAttr;
286 }
287
288 const std::vector<sal_uInt16>& getFmtAttrs() const
289 {
290 return m_aWhichFmtAttrs;
291 }
292};
293
301 };
303{
304public:
306 union {
308 const OUString* pNewTableNm;
311 sal_uInt16 m_nSplitLine;
313 bool m_bModified : 1;
315
318};
319
321{
322public:
324
325 SwAutoFormatGetDocNode( const SwNodes* pNds );
326};
327
328/*
329 * SwAttrSetChg is sent when something has changed in the SwAttrSet rTheChgdSet.
330 * 2 Hints are always sent, the old and the new items in the rTheChgdSet.
331 */
332class SwAttrSetChg final : public SwMsgPoolItem
333{
337public:
338 SwAttrSetChg( const SwAttrSet& rTheSet, SwAttrSet& rSet );
339 SwAttrSetChg( const SwAttrSetChg& );
340 virtual ~SwAttrSetChg() override;
341
343 const SwAttrSet* GetChgSet() const { return m_pChgSet; }
345
347 const SwAttrSet* GetTheChgdSet() const { return m_pTheChgdSet; }
348
349 sal_uInt16 Count() const { return m_pChgSet->Count(); }
350 void ClearItem( sal_uInt16 nWhichL )
351#ifdef DBG_UTIL
352 ;
353#else
354 { m_pChgSet->ClearItem( nWhichL ); }
355#endif
356};
357
359{
365public:
366 SwVirtPageNumInfo( const SwPageFrame *pPg );
367
368 const SwPageFrame *GetPage() const { return m_pPage; }
369 const SwPageFrame *GetOrigPage() const { return m_pOrigPage;}
370 const SwFrame *GetFrame() const { return m_pFrame; }
371 void SetInfo( const SwPageFrame *pPg,
372 const SwFrame *pF ) { m_pFrame = pF; m_pPage = pPg; }
373};
374
376{
378public:
379 SwFindNearestNode( const SwNode& rNd );
380 void CheckNode( const SwNode& rNd );
381
382 const SwNode* GetFoundNode() const { return m_pFound; }
383};
384
386{
387 OUString m_sStr;
388public:
389
390 const OUString& GetString() const { return m_sStr; }
391
392 SwStringMsgPoolItem( sal_uInt16 nId, OUString aStr )
393 : SwMsgPoolItem( nId ), m_sStr(std::move( aStr ))
394 {}
395};
396#endif
397
398/* 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:100
const SwAttrSet * m_pTheChgdSet
is only used to compare
Definition: hints.hxx:336
sal_uInt16 Count() const
Definition: hints.hxx:349
SwAttrSet * GetChgSet()
Definition: hints.hxx:344
const SwAttrSet * GetTheChgdSet() const
Where it has changed.
Definition: hints.hxx:347
SwAttrSet * m_pChgSet
what has changed
Definition: hints.hxx:335
void ClearItem(sal_uInt16 nWhichL)
Definition: hints.cxx:123
const SwAttrSet * GetChgSet() const
What has changed.
Definition: hints.hxx:343
bool m_bDelSet
Definition: hints.hxx:334
virtual ~SwAttrSetChg() override
Definition: hints.cxx:116
SwAutoFormatGetDocNode(const SwNodes *pNds)
Definition: hints.cxx:95
const SwNodes * pNodes
Definition: hints.hxx:323
const SwNode * m_pFound
Definition: hints.hxx:377
const SwNode * m_pNode
Definition: hints.hxx:377
void CheckNode(const SwNode &rNd)
Definition: hints.cxx:173
const SwNode * GetFoundNode() const
Definition: hints.hxx:382
SwFindNearestNode(const SwNode &rNd)
Definition: hints.cxx:168
SwFormatChg(SwFormat *pFormat)
Definition: hints.cxx:30
SwFormat * pChangedFormat
Definition: hints.hxx:75
Base class for various Writer styles.
Definition: format.hxx:47
Style of a layout element.
Definition: frmfmt.hxx:62
Base class of the Writer layout elements.
Definition: frame.hxx:315
virtual bool operator==(const SfxPoolItem &) const override
Definition: hints.cxx:135
virtual SwMsgPoolItem * Clone(SfxItemPool *pPool=nullptr) const override
Definition: hints.cxx:141
SwMsgPoolItem(sal_uInt16 nWhich)
Definition: hints.cxx:130
Base class of the Writer document model elements.
Definition: node.hxx:98
A page of the document layout.
Definition: pagefrm.hxx:59
SwPtrMsgPoolItem(sal_uInt16 nId, void *pObj)
Definition: hints.hxx:63
void * pObject
Definition: hints.hxx:61
SwStringMsgPoolItem(sal_uInt16 nId, OUString aStr)
Definition: hints.hxx:392
const OUString & GetString() const
Definition: hints.hxx:390
OUString m_sStr
Definition: hints.hxx:387
SwTableBox is one table cell in the document model.
Definition: swtable.hxx:438
sal_uInt16 m_nSplitLine
Split: from this BaseLine on will be split.
Definition: hints.hxx:311
TableFormulaUpdateFlags m_eFlags
Definition: hints.hxx:312
SwHistory * m_pHistory
Definition: hints.hxx:310
const OUString * pNewTableNm
Split: the name of the new table.
Definition: hints.hxx:308
const SwTable * m_pTable
Pointer to the current table.
Definition: hints.hxx:305
union SwTableFormulaUpdate::@26 m_aData
const SwTable * pDelTable
Merge: Pointer to the table to be removed.
Definition: hints.hxx:307
SwTableFormulaUpdate(const SwTable *)
Is sent if a table should be recalculated.
Definition: hints.cxx:84
SwTableLine is one table row in the document model.
Definition: swtable.hxx:376
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:61
SwTextNode is a paragraph in the document model.
Definition: ndtxt.hxx:112
const std::vector< sal_uInt16 > & getFmtAttrs() const
Definition: hints.hxx:288
sal_uInt16 getWhichAttr() const
Definition: hints.hxx:283
sal_Int32 getStart() const
Definition: hints.hxx:273
sal_uInt16 m_nWhichAttr
Definition: hints.hxx:266
sal_Int32 m_nEnd
Definition: hints.hxx:265
sal_Int32 getEnd() const
Definition: hints.hxx:278
std::vector< sal_uInt16 > m_aWhichFmtAttrs
Definition: hints.hxx:267
SwUpdateAttr(sal_Int32 nS, sal_Int32 nE, sal_uInt16 nW)
Definition: hints.cxx:74
sal_Int32 m_nStart
Definition: hints.hxx:264
const SwFrame * m_pFrame
Definition: hints.hxx:362
const SwPageFrame * m_pOrigPage
Definition: hints.hxx:361
const SwPageFrame * m_pPage
Definition: hints.hxx:360
void SetInfo(const SwPageFrame *pPg, const SwFrame *pF)
Definition: hints.hxx:371
const SwPageFrame * GetOrigPage() const
Definition: hints.hxx:369
SwVirtPageNumInfo(const SwPageFrame *pPg)
Multiple attributes can be attached to a single paragraph / table The frame, in the end,...
Definition: hints.cxx:163
const SwPageFrame * GetPage() const
Definition: hints.hxx:368
const SwFrame * GetFrame() const
Definition: hints.hxx:370
CondCollCondChg(const SwTextFormatColl &rColl)
Definition: hints.hxx:171
const SwTextFormatColl & m_rColl
Definition: hints.hxx:170
DeleteChar(const sal_Int32 nPos)
Definition: hints.cxx:57
const sal_Int32 m_nPos
Definition: hints.hxx:118
const sal_Int32 nStart
Definition: hints.hxx:109
DeleteText(sal_Int32 nS, sal_Int32 nL)
Definition: hints.cxx:52
const sal_Int32 nLen
Definition: hints.hxx:110
DocPosUpdateAtIndex(const SwTwips nDocPos, const SwTextNode &rNode, sal_uInt32 nIndex)
Definition: hints.hxx:160
const SwTwips m_nDocPos
Definition: hints.hxx:157
const sal_uInt32 m_nIndex
Definition: hints.hxx:159
const SwTextNode & m_rNode
Definition: hints.hxx:158
DocPosUpdate is sent to signal that only the frames from or to a specified document-global position h...
Definition: hints.hxx:146
const SwTwips m_nDocPos
Definition: hints.hxx:148
DocPosUpdate(const SwTwips nDocPos)
Definition: hints.hxx:149
InsertText(sal_Int32 nP, sal_Int32 nL, bool isInFMCommand, bool isInFMResult)
Definition: hints.cxx:44
const bool isInsideFieldmarkResult
Definition: hints.hxx:101
const sal_Int32 nLen
Definition: hints.hxx:99
const bool isInsideFieldmarkCommand
Definition: hints.hxx:100
const sal_Int32 nPos
Definition: hints.hxx:98
const SwFrameFormat & m_rNewFormat
Definition: hints.hxx:211
const SwTableBox & m_rTableBox
Definition: hints.hxx:212
MoveTableBoxHint(const SwFrameFormat &rNewFormat, const SwTableBox &rTableBox)
Definition: hints.hxx:213
const SwFrameFormat & m_rNewFormat
Definition: hints.hxx:203
const SwTableLine & m_rTableLine
Definition: hints.hxx:204
MoveTableLineHint(const SwFrameFormat &rNewFormat, const SwTableLine &rTableLine)
Definition: hints.hxx:205
text is moved into pDestNode
Definition: hints.hxx:85
sal_Int32 nDestStart
Definition: hints.hxx:88
SwTextNode * pDestNode
Definition: hints.hxx:87
sal_Int32 nSourceStart
Definition: hints.hxx:89
sal_Int32 nLen
Definition: hints.hxx:90
MoveText(SwTextNode *pD, sal_Int32 nD, sal_Int32 nS, sal_Int32 nL)
Definition: hints.cxx:39
NameChanged(const OUString &rOld, const OUString &rNew)
Definition: hints.hxx:239
const OUString m_sNew
Definition: hints.hxx:238
const OUString m_sOld
Definition: hints.hxx:237
new delete redline is created
Definition: hints.hxx:125
RedlineDelText(sal_Int32 nS, sal_Int32 nL)
Definition: hints.cxx:62
sal_Int32 nStart
Definition: hints.hxx:127
sal_Int32 nLen
Definition: hints.hxx:128
delete redline is removed
Definition: hints.hxx:135
sal_Int32 nLen
Definition: hints.hxx:138
sal_Int32 nStart
Definition: hints.hxx:137
RedlineUnDelText(sal_Int32 nS, sal_Int32 nL)
Definition: hints.cxx:67
SectionHidden(const bool isHidden=true)
Definition: hints.hxx:257
const bool m_isHidden
Definition: hints.hxx:256
const SwTableBox & m_rTableBox
Definition: hints.hxx:231
const SwTableBoxFormat & m_rNewFormat
Definition: hints.hxx:230
TableBoxFormatChanged(const SwTableBoxFormat &rNewFormat, const SwTableBox &rTableBox)
Definition: hints.hxx:232
TableLineFormatChanged(const SwTableLineFormat &rNewFormat, const SwTableLine &rTabLine)
Definition: hints.hxx:225
const SwTableLine & m_rTabLine
Definition: hints.hxx:224
const SwTableLineFormat & m_rNewFormat
Definition: hints.hxx:223
const OUString m_sNew
Definition: hints.hxx:245
TitleChanged(const OUString &rOld, const OUString &rNew)
Definition: hints.hxx:246
const OUString m_sOld
Definition: hints.hxx:244
SfxHintId
@ SwPreGraphicArrived
@ SwDescriptionChanged
@ SwGraphicPieceArrived
@ SwLinkedGraphicStreamArrived
@ SwDocPosUpdateAtIndex
TableFormulaUpdateFlags
SwTableFormulaUpdate is sent when the table has to be newly calculated or when a table itself is merg...
Definition: hints.hxx:295
@ TBL_MERGETBL
Definition: hints.hxx:299
@ TBL_BOXPTR
Definition: hints.hxx:297
@ TBL_SPLITTBL
Definition: hints.hxx:300
@ TBL_CALC
Definition: hints.hxx:295
@ TBL_BOXNAME
Definition: hints.hxx:296
@ TBL_RELBOXNAME
Definition: hints.hxx:298
sal_Int32 nIndex
aStr
Dialog to specify the properties of date form field.
sal_Int16 nId
tools::Long SwTwips
Definition: swtypes.hxx:51