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 
36 // Base class for all Message-Hints:
37 // "Overhead" of SfxPoolItem is handled here
38 class SwMsgPoolItem : public SfxPoolItem
39 {
40 public:
41  SwMsgPoolItem( sal_uInt16 nWhich );
42 
43  // "Overhead" of SfxPoolItem
44  virtual bool operator==( const SfxPoolItem& ) const override;
45  virtual SfxPoolItem* Clone( SfxItemPool* pPool = nullptr ) const override;
46 };
47 
48 // SwPtrMsgPoolItem (old SwObjectDying!)
49 
51 {
52 public:
53  void * pObject;
54 
55  SwPtrMsgPoolItem( sal_uInt16 nId, void * pObj )
56  : SwMsgPoolItem( nId ), pObject( pObj )
57  {}
58 };
59 
60 /*
61  * SwFormatChg is sent when a format has changed to another format. 2 Hints are always sent
62  * the old and the new format
63  */
65 {
66 public:
68  SwFormatChg( SwFormat *pFormat );
69 };
70 
71 class SwInsText: public SwMsgPoolItem
72 {
73 public:
74  sal_Int32 const nPos;
75  sal_Int32 const nLen;
76 
77  SwInsText( sal_Int32 nP, sal_Int32 nL );
78 };
79 
80 class SwDelChr: public SwMsgPoolItem
81 {
82 public:
83  sal_Int32 const nPos;
84 
85  SwDelChr( sal_Int32 nP );
86 };
87 
88 class SwDelText: public SwMsgPoolItem
89 {
90 public:
91  sal_Int32 const nStart;
92  sal_Int32 const nLen;
93 
94  SwDelText( sal_Int32 nS, sal_Int32 nL );
95 };
96 
97 namespace sw {
98 
100 class MoveText : public SfxHint
101 {
102 public:
104  sal_Int32 nDestStart;
105  sal_Int32 nSourceStart;
106  sal_Int32 nLen;
107 
108  MoveText(SwTextNode *pD, sal_Int32 nD, sal_Int32 nS, sal_Int32 nL);
109 };
110 
112 class RedlineDelText : public SfxHint
113 {
114 public:
115  sal_Int32 const nStart;
116  sal_Int32 const nLen;
117 
118  RedlineDelText(sal_Int32 nS, sal_Int32 nL);
119 };
120 
122 class RedlineUnDelText : public SfxHint
123 {
124 public:
125  sal_Int32 nStart;
126  sal_Int32 nLen;
127 
128  RedlineUnDelText(sal_Int32 nS, sal_Int32 nL);
129 };
130 
131 }
132 
134 {
135 private:
136  sal_Int32 const m_nStart;
137  sal_Int32 const m_nEnd;
138  sal_uInt16 const m_nWhichAttr;
139  std::vector<sal_uInt16> m_aWhichFmtAttrs; // attributes changed inside RES_TXTATR_AUTOFMT
140 
141 public:
142  SwUpdateAttr( sal_Int32 nS, sal_Int32 nE, sal_uInt16 nW );
143  SwUpdateAttr( sal_Int32 nS, sal_Int32 nE, sal_uInt16 nW, std::vector<sal_uInt16> aW );
144 
145  sal_Int32 getStart() const
146  {
147  return m_nStart;
148  }
149 
150  sal_Int32 getEnd() const
151  {
152  return m_nEnd;
153  }
154 
155  sal_uInt16 getWhichAttr() const
156  {
157  return m_nWhichAttr;
158  }
159 
160  const std::vector<sal_uInt16>& getFmtAttrs() const
161  {
162  return m_aWhichFmtAttrs;
163  }
164 };
165 
170 {
172 public:
179 };
180 
184 {
185 public:
187  SwDocPosUpdate( const SwTwips nDocPos );
188 };
189 
197  };
199 {
200 public:
201  const SwTable* m_pTable;
202  union {
204  const OUString* pNewTableNm;
205  } m_aData;
207  sal_uInt16 m_nSplitLine;
209  bool m_bModified : 1;
211 
213  SwTableFormulaUpdate( const SwTable* );
214 };
215 
217 {
218 public:
219  const SwNodes* pNodes;
220 
221  SwAutoFormatGetDocNode( const SwNodes* pNds );
222 };
223 
224 /*
225  * SwAttrSetChg is sent when something has changed in the SwAttrSet rTheChgdSet.
226  * 2 Hints are always sent, the old and the new items in the rTheChgdSet.
227  */
229 {
230  bool const m_bDelSet;
233 public:
234  SwAttrSetChg( const SwAttrSet& rTheSet, SwAttrSet& rSet );
235  SwAttrSetChg( const SwAttrSetChg& );
236  virtual ~SwAttrSetChg() override;
237 
239  const SwAttrSet* GetChgSet() const { return m_pChgSet; }
241 
243  const SwAttrSet* GetTheChgdSet() const { return m_pTheChgdSet; }
244 
245  sal_uInt16 Count() const { return m_pChgSet->Count(); }
246  void ClearItem( sal_uInt16 nWhichL )
247 #ifdef DBG_UTIL
248  ;
249 #else
250  { m_pChgSet->ClearItem( nWhichL ); }
251 #endif
252 };
253 
255 {
256 public:
258  SwCondCollCondChg( SwFormat *pFormat );
259 };
260 
262 {
268 public:
269  SwVirtPageNumInfo( const SwPageFrame *pPg );
270 
271  const SwPageFrame *GetPage() { return m_pPage; }
272  const SwPageFrame *GetOrigPage() { return m_pOrigPage;}
273  const SwFrame *GetFrame() { return m_pFrame; }
274  void SetInfo( const SwPageFrame *pPg,
275  const SwFrame *pF ) { m_pFrame = pF; m_pPage = pPg; }
276 };
277 
279 {
281 public:
282  SwFindNearestNode( const SwNode& rNd );
283  void CheckNode( const SwNode& rNd );
284 
285  const SwNode* GetFoundNode() const { return m_pFound; }
286 };
287 
289 {
290  OUString const m_sStr;
291 public:
292 
293  const OUString& GetString() const { return m_sStr; }
294 
295  SwStringMsgPoolItem( sal_uInt16 nId, const OUString& rStr )
296  : SwMsgPoolItem( nId ), m_sStr( rStr )
297  {}
298 };
299 #endif
300 
301 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
SwRefMarkFieldUpdate is sent when the referencemarks should be updated.
Definition: hints.hxx:169
const SwAttrSet * GetChgSet() const
What has changed.
Definition: hints.hxx:239
Base class of the Writer layout elements.
Definition: frame.hxx:295
sal_Int32 const nStart
Definition: hints.hxx:115
VclPtr< OutputDevice > pOut
pointer to the current output device
Definition: hints.hxx:171
sal_Int32 nSourceStart
Definition: hints.hxx:105
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:206
const SwNode * GetFoundNode() const
Definition: hints.hxx:285
sal_Int32 const nStart
Definition: hints.hxx:91
RedlineDelText(sal_Int32 nS, sal_Int32 nL)
Definition: hints.cxx:56
long SwTwips
Definition: swtypes.hxx:49
sal_Int32 nStart
Definition: hints.hxx:125
SwUpdateAttr(sal_Int32 nS, sal_Int32 nE, sal_uInt16 nW)
Definition: hints.cxx:68
Dialog to specify the properties of date form field.
Definition: accfrmobj.cxx:38
SwRefMarkFieldUpdate(OutputDevice *)
Is sent if reference marks should be updated.
Definition: hints.cxx:78
const SwPageFrame * GetPage()
Definition: hints.hxx:271
const SwTwips nDocPos
Definition: hints.hxx:186
SwPtrMsgPoolItem(sal_uInt16 nId, void *pObj)
Definition: hints.hxx:55
sal_Int32 nDestStart
Definition: hints.hxx:104
sal_Int32 getEnd() const
Definition: hints.hxx:150
sal_Int32 const m_nEnd
Definition: hints.hxx:137
new delete redline is created
Definition: hints.hxx:112
SwAutoFormatGetDocNode(const SwNodes *pNds)
Definition: hints.cxx:100
void SetInfo(const SwPageFrame *pPg, const SwFrame *pF)
Definition: hints.hxx:274
const SwTable * m_pTable
Pointer to the current table.
Definition: hints.hxx:201
SwAttrSet * GetChgSet()
Definition: hints.hxx:240
RedlineUnDelText(sal_Int32 nS, sal_Int32 nL)
Definition: hints.cxx:61
sal_Int32 const nLen
Definition: hints.hxx:92
sal_Int32 getStart() const
Definition: hints.hxx:145
const OUString & GetString() const
Definition: hints.hxx:293
std::vector< sal_uInt16 > m_aWhichFmtAttrs
Definition: hints.hxx:139
Base class for various Writer styles.
Definition: format.hxx:43
const SwNode * m_pFound
Definition: hints.hxx:280
delete redline is removed
Definition: hints.hxx:122
const SwPageFrame * GetOrigPage()
Definition: hints.hxx:272
sal_uInt16 ClearItem(sal_uInt16 nWhich=0)
virtual SfxPoolItem * Clone(SfxItemPool *pPool=nullptr) const override
Definition: hints.cxx:146
SwDocPosUpdate(const SwTwips nDocPos)
Definition: hints.cxx:85
SwDelText(sal_Int32 nS, sal_Int32 nL)
Definition: hints.cxx:44
SwFormat *const pChangedFormat
Definition: hints.hxx:257
const SwPageFrame * m_pPage
Definition: hints.hxx:263
SwFormat *const pChangedFormat
Definition: hints.hxx:67
sal_uInt16 Count() const
bool const m_bDelSet
Definition: hints.hxx:230
SwFindNearestNode(const SwNode &rNd)
Definition: hints.cxx:178
void CheckNode(const SwNode &rNd)
Definition: hints.cxx:183
sal_Int32 nLen
Definition: hints.hxx:106
text is moved into pDestNode
Definition: hints.hxx:100
const SwAttrSet * GetTheChgdSet() const
Where it has changed.
Definition: hints.hxx:243
sal_uInt16 const m_nWhichAttr
Definition: hints.hxx:138
SwTextNode * pDestNode
Definition: hints.hxx:103
A page of the document layout.
Definition: pagefrm.hxx:40
SwTable is one table in the document model, containing rows (which contain cells).
Definition: swtable.hxx:110
SwMsgPoolItem(sal_uInt16 nWhich)
Definition: hints.cxx:135
const SwFrame * GetFrame()
Definition: hints.hxx:273
sal_uInt16 Count() const
Definition: hints.hxx:245
SwTextNode is a paragraph in the document model.
Definition: ndtxt.hxx:79
sal_Int32 const nPos
Definition: hints.hxx:74
sal_Int32 const nLen
Definition: hints.hxx:116
sal_Int32 const nLen
Definition: hints.hxx:75
const SwNode * m_pNode
Definition: hints.hxx:280
OUString const m_sStr
Definition: hints.hxx:290
sal_Int32 const m_nStart
Definition: hints.hxx:136
const std::vector< sal_uInt16 > & getFmtAttrs() const
Definition: hints.hxx:160
sal_Int32 nLen
Definition: hints.hxx:126
SwCondCollCondChg(SwFormat *pFormat)
Definition: hints.cxx:168
SwTableFormulaUpdate(const SwTable *)
Is sent if a table should be recalculated.
Definition: hints.cxx:90
sal_Int32 const nPos
Definition: hints.hxx:83
SwVirtPageNumInfo(const SwPageFrame *pPg)
Multiple attributes can be attached to a single paragraph / table The frame, in the end...
Definition: hints.cxx:173
SwDocPosUpdate is sent to signal that only the frames from or to a specified document-global position...
Definition: hints.hxx:183
void ClearItem(sal_uInt16 nWhichL)
Definition: hints.cxx:128
void * pObject
Definition: hints.hxx:53
TableFormulaUpdateFlags
SwTableFormulaUpdate is sent when the table has to be newly calculated or when a table itself is merg...
Definition: hints.hxx:191
const SwTable * pDelTable
Merge: Pointer to the table to be removed.
Definition: hints.hxx:203
SwInsText(sal_Int32 nP, sal_Int32 nL)
Definition: hints.cxx:34
sal_uInt16 getWhichAttr() const
Definition: hints.hxx:155
SwDelChr(sal_Int32 nP)
Definition: hints.cxx:39
TableFormulaUpdateFlags m_eFlags
Definition: hints.hxx:208
union SwTableFormulaUpdate::@27 m_aData
const OUString * pNewTableNm
Split: the name of the new table.
Definition: hints.hxx:204
const SwAttrSet * m_pTheChgdSet
is only used to compare
Definition: hints.hxx:232
const SwNodes * pNodes
Definition: hints.hxx:219
const SwFrame * m_pFrame
Definition: hints.hxx:265
SwFormatChg(SwFormat *pFormat)
Definition: hints.cxx:29
SwAttrSet * m_pChgSet
what has changed
Definition: hints.hxx:231
SwStringMsgPoolItem(sal_uInt16 nId, const OUString &rStr)
Definition: hints.hxx:295
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:207
const SwPageFrame * m_pOrigPage
Definition: hints.hxx:264
Base class of the Writer document model elements.
Definition: node.hxx:79