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 SwTableBox;
38 class SwTableBoxFormat;
39 class SwTableLine;
40 class SwTableLineFormat;
41 class SwTableBox;
42 
43 // Base class for all Message-Hints:
44 // "Overhead" of SfxPoolItem is handled here
45 class SwMsgPoolItem : public SfxPoolItem
46 {
47 public:
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 
57 class SwPtrMsgPoolItem final : public SwMsgPoolItem
58 {
59 public:
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  */
71 class SwFormatChg final : public SwMsgPoolItem
72 {
73 public:
75  SwFormatChg( SwFormat *pFormat );
76 };
77 
78 class SwInsText final : public SwMsgPoolItem
79 {
80 public:
81  sal_Int32 nPos;
82  sal_Int32 nLen;
83 
84  SwInsText( sal_Int32 nP, sal_Int32 nL );
85 };
86 
87 class SwDelChr final : public SwMsgPoolItem
88 {
89 public:
90  sal_Int32 nPos;
91 
92  SwDelChr( sal_Int32 nP );
93 };
94 
95 class SwDelText final : public SwMsgPoolItem
96 {
97 public:
98  sal_Int32 nStart;
99  sal_Int32 nLen;
100 
101  SwDelText( sal_Int32 nS, sal_Int32 nL );
102 };
103 
104 namespace sw {
105 
107 class MoveText final : public SfxHint
108 {
109 public:
111  sal_Int32 nDestStart;
112  sal_Int32 nSourceStart;
113  sal_Int32 nLen;
114 
115  MoveText(SwTextNode *pD, sal_Int32 nD, sal_Int32 nS, sal_Int32 nL);
116 };
117 
119 class RedlineDelText final : public SfxHint
120 {
121 public:
122  sal_Int32 nStart;
123  sal_Int32 nLen;
124 
125  RedlineDelText(sal_Int32 nS, sal_Int32 nL);
126 };
127 
129 class RedlineUnDelText final : public SfxHint
130 {
131 public:
132  sal_Int32 nStart;
133  sal_Int32 nLen;
134 
135  RedlineUnDelText(sal_Int32 nS, sal_Int32 nL);
136 };
137 
138 class CondCollCondChg final : public SfxHint
139 {
140 public:
142  CondCollCondChg(const SwTextFormatColl& rColl) : m_rColl(rColl) {};
143 };
144 
145 class GrfRereadAndInCacheHint final : public SfxHint
146 {
147 };
148 
149 class PreGraphicArrivedHint final : public SfxHint
150 {
151 };
152 
153 class PostGraphicArrivedHint final : public SfxHint
154 {
155 };
156 
157 class MoveTableLineHint final : public SfxHint
158 {
159 public:
162  MoveTableLineHint(const SwFrameFormat& rNewFormat, const SwTableLine& rTableLine): m_rNewFormat(rNewFormat), m_rTableLine(rTableLine) {};
163 };
164 
165 class MoveTableBoxHint final : public SfxHint
166 {
167 public:
170  MoveTableBoxHint(const SwFrameFormat& rNewFormat, const SwTableBox& rTableBox): m_rNewFormat(rNewFormat), m_rTableBox(rTableBox) {};
171 };
172 
173 class DocumentDyingHint final : public SfxHint
174 {
175 };
176 
177 class TableLineFormatChanged final : public SfxHint
178 {
179 public:
182  TableLineFormatChanged(const SwTableLineFormat& rNewFormat, const SwTableLine& rTabLine) : m_rNewFormat(rNewFormat), m_rTabLine(rTabLine) {};
183 };
184 class TableBoxFormatChanged final : public SfxHint
185 {
186 public:
189  TableBoxFormatChanged(const SwTableBoxFormat& rNewFormat, const SwTableBox& rTableBox) : m_rNewFormat(rNewFormat), m_rTableBox(rTableBox) {};
190 };
191 }
192 
193 class SwUpdateAttr final : public SwMsgPoolItem
194 {
195 private:
196  sal_Int32 m_nStart;
197  sal_Int32 m_nEnd;
198  sal_uInt16 m_nWhichAttr;
199  std::vector<sal_uInt16> m_aWhichFmtAttrs; // attributes changed inside RES_TXTATR_AUTOFMT
200 
201 public:
202  SwUpdateAttr( sal_Int32 nS, sal_Int32 nE, sal_uInt16 nW );
203  SwUpdateAttr( sal_Int32 nS, sal_Int32 nE, sal_uInt16 nW, std::vector<sal_uInt16> aW );
204 
205  sal_Int32 getStart() const
206  {
207  return m_nStart;
208  }
209 
210  sal_Int32 getEnd() const
211  {
212  return m_nEnd;
213  }
214 
215  sal_uInt16 getWhichAttr() const
216  {
217  return m_nWhichAttr;
218  }
219 
220  const std::vector<sal_uInt16>& getFmtAttrs() const
221  {
222  return m_aWhichFmtAttrs;
223  }
224 };
225 
230 {
232 public:
239 };
240 
243 class SwDocPosUpdate final : public SwMsgPoolItem
244 {
245 public:
247  SwDocPosUpdate( const SwTwips nDocPos );
248 };
249 
257  };
259 {
260 public:
261  const SwTable* m_pTable;
262  union {
264  const OUString* pNewTableNm;
265  } m_aData;
267  sal_uInt16 m_nSplitLine;
269  bool m_bModified : 1;
271 
273  SwTableFormulaUpdate( const SwTable* );
274 };
275 
277 {
278 public:
279  const SwNodes* pNodes;
280 
281  SwAutoFormatGetDocNode( const SwNodes* pNds );
282 };
283 
284 /*
285  * SwAttrSetChg is sent when something has changed in the SwAttrSet rTheChgdSet.
286  * 2 Hints are always sent, the old and the new items in the rTheChgdSet.
287  */
288 class SwAttrSetChg final : public SwMsgPoolItem
289 {
290  bool m_bDelSet;
293 public:
294  SwAttrSetChg( const SwAttrSet& rTheSet, SwAttrSet& rSet );
295  SwAttrSetChg( const SwAttrSetChg& );
296  virtual ~SwAttrSetChg() override;
297 
299  const SwAttrSet* GetChgSet() const { return m_pChgSet; }
301 
303  const SwAttrSet* GetTheChgdSet() const { return m_pTheChgdSet; }
304 
305  sal_uInt16 Count() const { return m_pChgSet->Count(); }
306  void ClearItem( sal_uInt16 nWhichL )
307 #ifdef DBG_UTIL
308  ;
309 #else
310  { m_pChgSet->ClearItem( nWhichL ); }
311 #endif
312 };
313 
314 class SwVirtPageNumInfo final : public SwMsgPoolItem
315 {
321 public:
322  SwVirtPageNumInfo( const SwPageFrame *pPg );
323 
324  const SwPageFrame *GetPage() const { return m_pPage; }
325  const SwPageFrame *GetOrigPage() const { return m_pOrigPage;}
326  const SwFrame *GetFrame() const { return m_pFrame; }
327  void SetInfo( const SwPageFrame *pPg,
328  const SwFrame *pF ) { m_pFrame = pF; m_pPage = pPg; }
329 };
330 
331 class SwFindNearestNode final : public SwMsgPoolItem
332 {
334 public:
335  SwFindNearestNode( const SwNode& rNd );
336  void CheckNode( const SwNode& rNd );
337 
338  const SwNode* GetFoundNode() const { return m_pFound; }
339 };
340 
341 class SwStringMsgPoolItem final : public SwMsgPoolItem
342 {
343  OUString m_sStr;
344 public:
345 
346  const OUString& GetString() const { return m_sStr; }
347 
348  SwStringMsgPoolItem( sal_uInt16 nId, const OUString& rStr )
349  : SwMsgPoolItem( nId ), m_sStr( rStr )
350  {}
351 };
352 #endif
353 
354 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
SwRefMarkFieldUpdate is sent when the referencemarks should be updated.
Definition: hints.hxx:229
const SwAttrSet * GetChgSet() const
What has changed.
Definition: hints.hxx:299
Base class of the Writer layout elements.
Definition: frame.hxx:313
CondCollCondChg(const SwTextFormatColl &rColl)
Definition: hints.hxx:142
Represents the style of a paragraph.
Definition: fmtcol.hxx:56
VclPtr< OutputDevice > pOut
pointer to the current output device
Definition: hints.hxx:231
const SwPageFrame * GetOrigPage() const
Definition: hints.hxx:325
sal_Int32 nSourceStart
Definition: hints.hxx:112
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:266
const SwNode * GetFoundNode() const
Definition: hints.hxx:338
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:132
SwUpdateAttr(sal_Int32 nS, sal_Int32 nE, sal_uInt16 nW)
Definition: hints.cxx:68
const SwTableLineFormat & m_rNewFormat
Definition: hints.hxx:180
Dialog to specify the properties of date form field.
const SwTextFormatColl & m_rColl
Definition: hints.hxx:141
const SwTableBox & m_rTableBox
Definition: hints.hxx:188
SwRefMarkFieldUpdate(OutputDevice *)
Is sent if reference marks should be updated.
Definition: hints.cxx:78
const SwTwips nDocPos
Definition: hints.hxx:246
SwPtrMsgPoolItem(sal_uInt16 nId, void *pObj)
Definition: hints.hxx:62
sal_Int32 nDestStart
Definition: hints.hxx:111
sal_Int32 getEnd() const
Definition: hints.hxx:210
const SwPageFrame * GetPage() const
Definition: hints.hxx:324
new delete redline is created
Definition: hints.hxx:119
SwAutoFormatGetDocNode(const SwNodes *pNds)
Definition: hints.cxx:100
void SetInfo(const SwPageFrame *pPg, const SwFrame *pF)
Definition: hints.hxx:327
const SwTable * m_pTable
Pointer to the current table.
Definition: hints.hxx:261
const SwFrameFormat & m_rNewFormat
Definition: hints.hxx:168
SwAttrSet * GetChgSet()
Definition: hints.hxx:300
RedlineUnDelText(sal_Int32 nS, sal_Int32 nL)
Definition: hints.cxx:61
sal_Int32 getStart() const
Definition: hints.hxx:205
const OUString & GetString() const
Definition: hints.hxx:346
std::vector< sal_uInt16 > m_aWhichFmtAttrs
Definition: hints.hxx:199
sal_Int32 nPos
Definition: hints.hxx:90
Base class for various Writer styles.
Definition: format.hxx:46
sal_uInt16 m_nWhichAttr
Definition: hints.hxx:198
const SwNode * m_pFound
Definition: hints.hxx:333
const SwTableBox & m_rTableBox
Definition: hints.hxx:169
delete redline is removed
Definition: hints.hxx:129
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
TableBoxFormatChanged(const SwTableBoxFormat &rNewFormat, const SwTableBox &rTableBox)
Definition: hints.hxx:189
const SwPageFrame * m_pPage
Definition: hints.hxx:316
sal_uInt16 Count() const
const SwTableLine & m_rTabLine
Definition: hints.hxx:181
SwFindNearestNode(const SwNode &rNd)
Definition: hints.cxx:173
void CheckNode(const SwNode &rNd)
Definition: hints.cxx:178
sal_Int32 nLen
Definition: hints.hxx:113
text is moved into pDestNode
Definition: hints.hxx:107
const SwAttrSet * GetTheChgdSet() const
Where it has changed.
Definition: hints.hxx:303
SwTextNode * pDestNode
Definition: hints.hxx:110
const SwFrameFormat & m_rNewFormat
Definition: hints.hxx:160
A page of the document layout.
Definition: pagefrm.hxx:57
TableLineFormatChanged(const SwTableLineFormat &rNewFormat, const SwTableLine &rTabLine)
Definition: hints.hxx:182
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:122
const SwFrame * GetFrame() const
Definition: hints.hxx:326
SwFormat * pChangedFormat
Definition: hints.hxx:74
const SwTableLine & m_rTableLine
Definition: hints.hxx:161
sal_uInt16 Count() const
Definition: hints.hxx:305
sal_Int32 nLen
Definition: hints.hxx:82
SwTextNode is a paragraph in the document model.
Definition: ndtxt.hxx:79
sal_Int32 nPos
Definition: hints.hxx:81
sal_Int32 nStart
Definition: hints.hxx:98
const SwTableBoxFormat & m_rNewFormat
Definition: hints.hxx:187
MoveTableBoxHint(const SwFrameFormat &rNewFormat, const SwTableBox &rTableBox)
Definition: hints.hxx:170
sal_Int32 m_nStart
Definition: hints.hxx:196
const SwNode * m_pNode
Definition: hints.hxx:333
SwTableBox is one table cell in the document model.
Definition: swtable.hxx:395
sal_Int32 nLen
Definition: hints.hxx:123
bool m_bDelSet
Definition: hints.hxx:290
const std::vector< sal_uInt16 > & getFmtAttrs() const
Definition: hints.hxx:220
sal_Int32 nLen
Definition: hints.hxx:133
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:243
void ClearItem(sal_uInt16 nWhichL)
Definition: hints.cxx:128
void * pObject
Definition: hints.hxx:60
TableFormulaUpdateFlags
SwTableFormulaUpdate is sent when the table has to be newly calculated or when a table itself is merg...
Definition: hints.hxx:251
sal_Int32 nLen
Definition: hints.hxx:99
const SwTable * pDelTable
Merge: Pointer to the table to be removed.
Definition: hints.hxx:263
SwInsText(sal_Int32 nP, sal_Int32 nL)
Definition: hints.cxx:34
sal_uInt16 getWhichAttr() const
Definition: hints.hxx:215
SwDelChr(sal_Int32 nP)
Definition: hints.cxx:39
TableFormulaUpdateFlags m_eFlags
Definition: hints.hxx:268
const OUString * pNewTableNm
Split: the name of the new table.
Definition: hints.hxx:264
const SwAttrSet * m_pTheChgdSet
is only used to compare
Definition: hints.hxx:292
const SwNodes * pNodes
Definition: hints.hxx:279
const SwFrame * m_pFrame
Definition: hints.hxx:318
SwFormatChg(SwFormat *pFormat)
Definition: hints.cxx:29
SwAttrSet * m_pChgSet
what has changed
Definition: hints.hxx:291
SwStringMsgPoolItem(sal_uInt16 nId, const OUString &rStr)
Definition: hints.hxx:348
sal_Int32 m_nEnd
Definition: hints.hxx:197
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:267
OUString m_sStr
Definition: hints.hxx:343
const SwPageFrame * m_pOrigPage
Definition: hints.hxx:317
Base class of the Writer document model elements.
Definition: node.hxx:80
MoveTableLineHint(const SwFrameFormat &rNewFormat, const SwTableLine &rTableLine)
Definition: hints.hxx:162