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