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::SwNameChanged), 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};
259class TableHeadingChange final: public SfxHint
260{
261public:
263};
264}
265
266class SwUpdateAttr final : public SwMsgPoolItem
267{
268private:
269 sal_Int32 m_nStart;
270 sal_Int32 m_nEnd;
271 sal_uInt16 m_nWhichAttr;
272 std::vector<sal_uInt16> m_aWhichFmtAttrs; // attributes changed inside RES_TXTATR_AUTOFMT
273
274public:
275 SwUpdateAttr( sal_Int32 nS, sal_Int32 nE, sal_uInt16 nW );
276 SwUpdateAttr( sal_Int32 nS, sal_Int32 nE, sal_uInt16 nW, std::vector<sal_uInt16> aW );
277
278 sal_Int32 getStart() const
279 {
280 return m_nStart;
281 }
282
283 sal_Int32 getEnd() const
284 {
285 return m_nEnd;
286 }
287
288 sal_uInt16 getWhichAttr() const
289 {
290 return m_nWhichAttr;
291 }
292
293 const std::vector<sal_uInt16>& getFmtAttrs() const
294 {
295 return m_aWhichFmtAttrs;
296 }
297};
298
306 };
308{
309public:
311 union {
313 const OUString* pNewTableNm;
315 sal_uInt16 m_nSplitLine;
317 bool m_bModified : 1;
319
322};
323
325{
326public:
328
329 SwAutoFormatGetDocNode( const SwNodes* pNds );
330};
331
332/*
333 * SwAttrSetChg is sent when something has changed in the SwAttrSet rTheChgdSet.
334 * 2 Hints are always sent, the old and the new items in the rTheChgdSet.
335 */
336class SwAttrSetChg final : public SwMsgPoolItem
337{
341public:
342 SwAttrSetChg( const SwAttrSet& rTheSet, SwAttrSet& rSet );
343 SwAttrSetChg( const SwAttrSetChg& );
344 virtual ~SwAttrSetChg() override;
345
347 const SwAttrSet* GetChgSet() const { return m_pChgSet; }
349
351 const SwAttrSet* GetTheChgdSet() const { return m_pTheChgdSet; }
352
353 sal_uInt16 Count() const { return m_pChgSet->Count(); }
354 void ClearItem( sal_uInt16 nWhichL )
355#ifdef DBG_UTIL
356 ;
357#else
358 { m_pChgSet->ClearItem( nWhichL ); }
359#endif
360};
361
363{
369public:
370 SwVirtPageNumInfo( const SwPageFrame *pPg );
371
372 const SwPageFrame *GetPage() const { return m_pPage; }
373 const SwPageFrame *GetOrigPage() const { return m_pOrigPage;}
374 const SwFrame *GetFrame() const { return m_pFrame; }
375 void SetInfo( const SwPageFrame *pPg,
376 const SwFrame *pF ) { m_pFrame = pF; m_pPage = pPg; }
377};
378
380{
382public:
383 SwFindNearestNode( const SwNode& rNd );
384 void CheckNode( const SwNode& rNd );
385
386 const SwNode* GetFoundNode() const { return m_pFound; }
387};
388
389#endif
390
391/* 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:99
const SwAttrSet * m_pTheChgdSet
is only used to compare
Definition: hints.hxx:340
sal_uInt16 Count() const
Definition: hints.hxx:353
SwAttrSet * GetChgSet()
Definition: hints.hxx:348
const SwAttrSet * GetTheChgdSet() const
Where it has changed.
Definition: hints.hxx:351
SwAttrSet * m_pChgSet
what has changed
Definition: hints.hxx:339
void ClearItem(sal_uInt16 nWhichL)
Definition: hints.cxx:122
const SwAttrSet * GetChgSet() const
What has changed.
Definition: hints.hxx:347
bool m_bDelSet
Definition: hints.hxx:338
virtual ~SwAttrSetChg() override
Definition: hints.cxx:115
SwAutoFormatGetDocNode(const SwNodes *pNds)
Definition: hints.cxx:94
const SwNodes * pNodes
Definition: hints.hxx:327
const SwNode * m_pFound
Definition: hints.hxx:381
const SwNode * m_pNode
Definition: hints.hxx:381
void CheckNode(const SwNode &rNd)
Definition: hints.cxx:172
const SwNode * GetFoundNode() const
Definition: hints.hxx:386
SwFindNearestNode(const SwNode &rNd)
Definition: hints.cxx:167
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:72
Base class of the Writer layout elements.
Definition: frame.hxx:315
virtual bool operator==(const SfxPoolItem &) const override
Definition: hints.cxx:134
virtual SwMsgPoolItem * Clone(SfxItemPool *pPool=nullptr) const override
Definition: hints.cxx:140
SwMsgPoolItem(sal_uInt16 nWhich)
Definition: hints.cxx:129
Base class of the Writer document model elements.
Definition: node.hxx:98
A page of the document layout.
Definition: pagefrm.hxx:60
SwPtrMsgPoolItem(sal_uInt16 nId, void *pObj)
Definition: hints.hxx:63
void * pObject
Definition: hints.hxx:61
SwTableBox is one table cell in the document model.
Definition: swtable.hxx:443
sal_uInt16 m_nSplitLine
Split: from this BaseLine on will be split.
Definition: hints.hxx:315
TableFormulaUpdateFlags m_eFlags
Definition: hints.hxx:316
union SwTableFormulaUpdate::@23 m_aData
const OUString * pNewTableNm
Split: the name of the new table.
Definition: hints.hxx:313
const SwTable * m_pTable
Pointer to the current table.
Definition: hints.hxx:310
const SwTable * pDelTable
Merge: Pointer to the table to be removed.
Definition: hints.hxx:312
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:293
sal_uInt16 getWhichAttr() const
Definition: hints.hxx:288
sal_Int32 getStart() const
Definition: hints.hxx:278
sal_uInt16 m_nWhichAttr
Definition: hints.hxx:271
sal_Int32 m_nEnd
Definition: hints.hxx:270
sal_Int32 getEnd() const
Definition: hints.hxx:283
std::vector< sal_uInt16 > m_aWhichFmtAttrs
Definition: hints.hxx:272
SwUpdateAttr(sal_Int32 nS, sal_Int32 nE, sal_uInt16 nW)
Definition: hints.cxx:74
sal_Int32 m_nStart
Definition: hints.hxx:269
const SwFrame * m_pFrame
Definition: hints.hxx:366
const SwPageFrame * m_pOrigPage
Definition: hints.hxx:365
const SwPageFrame * m_pPage
Definition: hints.hxx:364
void SetInfo(const SwPageFrame *pPg, const SwFrame *pF)
Definition: hints.hxx:375
const SwPageFrame * GetOrigPage() const
Definition: hints.hxx:373
SwVirtPageNumInfo(const SwPageFrame *pPg)
Multiple attributes can be attached to a single paragraph / table The frame, in the end,...
Definition: hints.cxx:162
const SwPageFrame * GetPage() const
Definition: hints.hxx:372
const SwFrame * GetFrame() const
Definition: hints.hxx:374
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
@ SwTableHeadingChange
@ 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:300
@ TBL_MERGETBL
Definition: hints.hxx:304
@ TBL_BOXPTR
Definition: hints.hxx:302
@ TBL_SPLITTBL
Definition: hints.hxx:305
@ TBL_CALC
Definition: hints.hxx:300
@ TBL_BOXNAME
Definition: hints.hxx:301
@ TBL_RELBOXNAME
Definition: hints.hxx:303
sal_Int32 nIndex
Dialog to specify the properties of date form field.
sal_Int16 nId
tools::Long SwTwips
Definition: swtypes.hxx:51