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
143class CondCollCondChg final : public SfxHint
144{
145public:
147 CondCollCondChg(const SwTextFormatColl& rColl) : m_rColl(rColl) {};
148};
149
151{
152};
153
154class PreGraphicArrivedHint final : public SfxHint
155{
156};
157
158class PostGraphicArrivedHint final : public SfxHint
159{
160};
161
162class MoveTableLineHint final : public SfxHint
163{
164public:
167 MoveTableLineHint(const SwFrameFormat& rNewFormat, const SwTableLine& rTableLine): m_rNewFormat(rNewFormat), m_rTableLine(rTableLine) {};
168};
169
170class MoveTableBoxHint final : public SfxHint
171{
172public:
175 MoveTableBoxHint(const SwFrameFormat& rNewFormat, const SwTableBox& rTableBox): m_rNewFormat(rNewFormat), m_rTableBox(rTableBox) {};
176};
177
178class DocumentDyingHint final : public SfxHint
179{
180};
181
182class TableLineFormatChanged final : public SfxHint
183{
184public:
187 TableLineFormatChanged(const SwTableLineFormat& rNewFormat, const SwTableLine& rTabLine) : m_rNewFormat(rNewFormat), m_rTabLine(rTabLine) {};
188};
189class TableBoxFormatChanged final : public SfxHint
190{
191public:
194 TableBoxFormatChanged(const SwTableBoxFormat& rNewFormat, const SwTableBox& rTableBox) : m_rNewFormat(rNewFormat), m_rTableBox(rTableBox) {};
195};
196class NameChanged final : public SfxHint
197{
198public:
199 const OUString m_sOld;
200 const OUString m_sNew;
201 NameChanged(const OUString& rOld, const OUString& rNew) : SfxHint(SfxHintId::NameChanged), m_sOld(rOld), m_sNew(rNew) {};
202};
203class SectionHidden final: public SfxHint
204{
205public:
206 const bool m_isHidden;
207 SectionHidden(const bool isHidden = true) : SfxHint(SfxHintId::SwSectionHidden), m_isHidden(isHidden) {};
208};
209}
210
211class SwUpdateAttr final : public SwMsgPoolItem
212{
213private:
214 sal_Int32 m_nStart;
215 sal_Int32 m_nEnd;
216 sal_uInt16 m_nWhichAttr;
217 std::vector<sal_uInt16> m_aWhichFmtAttrs; // attributes changed inside RES_TXTATR_AUTOFMT
218
219public:
220 SwUpdateAttr( sal_Int32 nS, sal_Int32 nE, sal_uInt16 nW );
221 SwUpdateAttr( sal_Int32 nS, sal_Int32 nE, sal_uInt16 nW, std::vector<sal_uInt16> aW );
222
223 sal_Int32 getStart() const
224 {
225 return m_nStart;
226 }
227
228 sal_Int32 getEnd() const
229 {
230 return m_nEnd;
231 }
232
233 sal_uInt16 getWhichAttr() const
234 {
235 return m_nWhichAttr;
236 }
237
238 const std::vector<sal_uInt16>& getFmtAttrs() const
239 {
240 return m_aWhichFmtAttrs;
241 }
242};
243
248{
250public:
257};
258
261class SwDocPosUpdate final : public SwMsgPoolItem
262{
263public:
266};
267
275 };
277{
278public:
280 union {
282 const OUString* pNewTableNm;
285 sal_uInt16 m_nSplitLine;
287 bool m_bModified : 1;
289
292};
293
295{
296public:
298
299 SwAutoFormatGetDocNode( const SwNodes* pNds );
300};
301
302/*
303 * SwAttrSetChg is sent when something has changed in the SwAttrSet rTheChgdSet.
304 * 2 Hints are always sent, the old and the new items in the rTheChgdSet.
305 */
306class SwAttrSetChg final : public SwMsgPoolItem
307{
311public:
312 SwAttrSetChg( const SwAttrSet& rTheSet, SwAttrSet& rSet );
313 SwAttrSetChg( const SwAttrSetChg& );
314 virtual ~SwAttrSetChg() override;
315
317 const SwAttrSet* GetChgSet() const { return m_pChgSet; }
319
321 const SwAttrSet* GetTheChgdSet() const { return m_pTheChgdSet; }
322
323 sal_uInt16 Count() const { return m_pChgSet->Count(); }
324 void ClearItem( sal_uInt16 nWhichL )
325#ifdef DBG_UTIL
326 ;
327#else
328 { m_pChgSet->ClearItem( nWhichL ); }
329#endif
330};
331
333{
339public:
340 SwVirtPageNumInfo( const SwPageFrame *pPg );
341
342 const SwPageFrame *GetPage() const { return m_pPage; }
343 const SwPageFrame *GetOrigPage() const { return m_pOrigPage;}
344 const SwFrame *GetFrame() const { return m_pFrame; }
345 void SetInfo( const SwPageFrame *pPg,
346 const SwFrame *pF ) { m_pFrame = pF; m_pPage = pPg; }
347};
348
350{
352public:
353 SwFindNearestNode( const SwNode& rNd );
354 void CheckNode( const SwNode& rNd );
355
356 const SwNode* GetFoundNode() const { return m_pFound; }
357};
358
360{
361 OUString m_sStr;
362public:
363
364 const OUString& GetString() const { return m_sStr; }
365
366 SwStringMsgPoolItem( sal_uInt16 nId, OUString aStr )
367 : SwMsgPoolItem( nId ), m_sStr(std::move( aStr ))
368 {}
369};
370#endif
371
372/* 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:111
const SwAttrSet * m_pTheChgdSet
is only used to compare
Definition: hints.hxx:310
sal_uInt16 Count() const
Definition: hints.hxx:323
SwAttrSet * GetChgSet()
Definition: hints.hxx:318
const SwAttrSet * GetTheChgdSet() const
Where it has changed.
Definition: hints.hxx:321
SwAttrSet * m_pChgSet
what has changed
Definition: hints.hxx:309
void ClearItem(sal_uInt16 nWhichL)
Definition: hints.cxx:134
const SwAttrSet * GetChgSet() const
What has changed.
Definition: hints.hxx:317
bool m_bDelSet
Definition: hints.hxx:308
virtual ~SwAttrSetChg() override
Definition: hints.cxx:127
SwAutoFormatGetDocNode(const SwNodes *pNds)
Definition: hints.cxx:106
const SwNodes * pNodes
Definition: hints.hxx:297
SwDocPosUpdate is sent to signal that only the frames from or to a specified document-global position...
Definition: hints.hxx:262
const SwTwips nDocPos
Definition: hints.hxx:264
SwDocPosUpdate(const SwTwips nDocPos)
Definition: hints.cxx:91
const SwNode * m_pFound
Definition: hints.hxx:351
const SwNode * m_pNode
Definition: hints.hxx:351
void CheckNode(const SwNode &rNd)
Definition: hints.cxx:184
const SwNode * GetFoundNode() const
Definition: hints.hxx:356
SwFindNearestNode(const SwNode &rNd)
Definition: hints.cxx:179
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:146
virtual SwMsgPoolItem * Clone(SfxItemPool *pPool=nullptr) const override
Definition: hints.cxx:152
SwMsgPoolItem(sal_uInt16 nWhich)
Definition: hints.cxx:141
Base class of the Writer document model elements.
Definition: node.hxx:98
A page of the document layout.
Definition: pagefrm.hxx:58
SwPtrMsgPoolItem(sal_uInt16 nId, void *pObj)
Definition: hints.hxx:63
void * pObject
Definition: hints.hxx:61
SwRefMarkFieldUpdate is sent when the referencemarks should be updated.
Definition: hints.hxx:248
VclPtr< OutputDevice > pOut
pointer to the current output device
Definition: hints.hxx:249
SwRefMarkFieldUpdate(OutputDevice *)
Is sent if reference marks should be updated.
Definition: hints.cxx:84
SwStringMsgPoolItem(sal_uInt16 nId, OUString aStr)
Definition: hints.hxx:366
const OUString & GetString() const
Definition: hints.hxx:364
OUString m_sStr
Definition: hints.hxx:361
SwTableBox is one table cell in the document model.
Definition: swtable.hxx:426
sal_uInt16 m_nSplitLine
Split: from this BaseLine on will be split.
Definition: hints.hxx:285
TableFormulaUpdateFlags m_eFlags
Definition: hints.hxx:286
SwHistory * m_pHistory
Definition: hints.hxx:284
const OUString * pNewTableNm
Split: the name of the new table.
Definition: hints.hxx:282
const SwTable * m_pTable
Pointer to the current table.
Definition: hints.hxx:279
union SwTableFormulaUpdate::@26 m_aData
const SwTable * pDelTable
Merge: Pointer to the table to be removed.
Definition: hints.hxx:281
SwTableFormulaUpdate(const SwTable *)
Is sent if a table should be recalculated.
Definition: hints.cxx:96
SwTableLine is one table row in the document model.
Definition: swtable.hxx:364
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:111
const std::vector< sal_uInt16 > & getFmtAttrs() const
Definition: hints.hxx:238
sal_uInt16 getWhichAttr() const
Definition: hints.hxx:233
sal_Int32 getStart() const
Definition: hints.hxx:223
sal_uInt16 m_nWhichAttr
Definition: hints.hxx:216
sal_Int32 m_nEnd
Definition: hints.hxx:215
sal_Int32 getEnd() const
Definition: hints.hxx:228
std::vector< sal_uInt16 > m_aWhichFmtAttrs
Definition: hints.hxx:217
SwUpdateAttr(sal_Int32 nS, sal_Int32 nE, sal_uInt16 nW)
Definition: hints.cxx:74
sal_Int32 m_nStart
Definition: hints.hxx:214
const SwFrame * m_pFrame
Definition: hints.hxx:336
const SwPageFrame * m_pOrigPage
Definition: hints.hxx:335
const SwPageFrame * m_pPage
Definition: hints.hxx:334
void SetInfo(const SwPageFrame *pPg, const SwFrame *pF)
Definition: hints.hxx:345
const SwPageFrame * GetOrigPage() const
Definition: hints.hxx:343
SwVirtPageNumInfo(const SwPageFrame *pPg)
Multiple attributes can be attached to a single paragraph / table The frame, in the end,...
Definition: hints.cxx:174
const SwPageFrame * GetPage() const
Definition: hints.hxx:342
const SwFrame * GetFrame() const
Definition: hints.hxx:344
CondCollCondChg(const SwTextFormatColl &rColl)
Definition: hints.hxx:147
const SwTextFormatColl & m_rColl
Definition: hints.hxx:146
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
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:173
const SwTableBox & m_rTableBox
Definition: hints.hxx:174
MoveTableBoxHint(const SwFrameFormat &rNewFormat, const SwTableBox &rTableBox)
Definition: hints.hxx:175
const SwFrameFormat & m_rNewFormat
Definition: hints.hxx:165
const SwTableLine & m_rTableLine
Definition: hints.hxx:166
MoveTableLineHint(const SwFrameFormat &rNewFormat, const SwTableLine &rTableLine)
Definition: hints.hxx:167
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:201
const OUString m_sNew
Definition: hints.hxx:200
const OUString m_sOld
Definition: hints.hxx:199
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:207
const bool m_isHidden
Definition: hints.hxx:206
const SwTableBox & m_rTableBox
Definition: hints.hxx:193
const SwTableBoxFormat & m_rNewFormat
Definition: hints.hxx:192
TableBoxFormatChanged(const SwTableBoxFormat &rNewFormat, const SwTableBox &rTableBox)
Definition: hints.hxx:194
TableLineFormatChanged(const SwTableLineFormat &rNewFormat, const SwTableLine &rTabLine)
Definition: hints.hxx:187
const SwTableLine & m_rTabLine
Definition: hints.hxx:186
const SwTableLineFormat & m_rNewFormat
Definition: hints.hxx:185
SfxHintId
TableFormulaUpdateFlags
SwTableFormulaUpdate is sent when the table has to be newly calculated or when a table itself is merg...
Definition: hints.hxx:269
@ TBL_MERGETBL
Definition: hints.hxx:273
@ TBL_BOXPTR
Definition: hints.hxx:271
@ TBL_SPLITTBL
Definition: hints.hxx:274
@ TBL_CALC
Definition: hints.hxx:269
@ TBL_BOXNAME
Definition: hints.hxx:270
@ TBL_RELBOXNAME
Definition: hints.hxx:272
aStr
Dialog to specify the properties of date form field.
sal_Int16 nId
tools::Long SwTwips
Definition: swtypes.hxx:51