xref: /aoo4110/main/sw/inc/hints.hxx (revision b1cdbd2c)
1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 #ifndef _HINTS_HXX
24 #define _HINTS_HXX
25 
26 #ifndef _TABLE_HXX //autogen
27 #include <tools/table.hxx>
28 #endif
29 #include <swatrset.hxx>
30 
31 class SwFmt;
32 class OutputDevice;
33 class SwTable;
34 class SwNode;
35 class SwNodes;
36 class SwCntntNode;
37 class SwPageFrm;
38 class SwFrm;
39 class SwTxtNode;
40 class SwHistory;
41 
42 // Basis-Klasse fuer alle Message-Hints:
43 //	"Overhead" vom SfxPoolItem wird hier behandelt
44 class SwMsgPoolItem : public SfxPoolItem
45 {
46 public:
47 	SwMsgPoolItem( sal_uInt16 nWhich );
48 
49 	// "Overhead" vom SfxPoolItem
50 	virtual int             operator==( const SfxPoolItem& ) const;
51 	virtual SfxPoolItem*	Clone( SfxItemPool* pPool = 0 ) const;
52 };
53 
54 
55 // ---------------------------------------
56 // SwPtrMsgPoolItem (altes SwObjectDying!)
57 // ---------------------------------------
58 
59 class SwPtrMsgPoolItem : public SwMsgPoolItem
60 {
61 public:
62 	void * pObject;
63 
SwPtrMsgPoolItem(sal_uInt16 nId,void * pObj)64 	SwPtrMsgPoolItem( sal_uInt16 nId, void * pObj )
65 		: SwMsgPoolItem( nId ), pObject( pObj )
66 	{}
67 };
68 
69 
70 
71 /*
72  * SwFmtChg wird verschickt, wenn ein Format gegen ein anderes
73  * Format ausgewechselt worden ist. Es werden immer 2. Hints verschickt,
74  * das alte und neue Format.
75  */
76 class SwFmtChg: public SwMsgPoolItem
77 {
78 public:
79 	SwFmt *pChangedFmt;
80 	SwFmtChg( SwFmt *pFmt );
81 };
82 
83 
84 class SwInsTxt: public SwMsgPoolItem
85 {
86 public:
87 	xub_StrLen nPos;
88 	xub_StrLen nLen;
89 
90 	SwInsTxt( xub_StrLen nP, xub_StrLen nL );
91 };
92 
93 class SwDelChr: public SwMsgPoolItem
94 {
95 public:
96 	xub_StrLen nPos;
97 
98 	SwDelChr( xub_StrLen nP );
99 };
100 
101 class SwDelTxt: public SwMsgPoolItem
102 {
103 public:
104 	xub_StrLen nStart;
105 	xub_StrLen nLen;
106 
107 	SwDelTxt( xub_StrLen nS, xub_StrLen nL );
108 };
109 
110 class SwUpdateAttr: public SwMsgPoolItem
111 {
112 public:
113 	xub_StrLen nStart;
114 	xub_StrLen nEnd;
115 	sal_uInt16 nWhichAttr;
116 	SwUpdateAttr( xub_StrLen nS, xub_StrLen nE, sal_uInt16 nW );
117 };
118 
119 
120 // SwRefMarkFldUpdate wird verschickt, wenn sich die ReferenzMarkierungen
121 // Updaten sollen. Um Seiten-/KapitelNummer feststellen zu koennen, muss
122 // der akt. Frame befragt werden. Dafuer wird das akt. OutputDevice benoetigt.
123 class SwRefMarkFldUpdate : public SwMsgPoolItem
124 {
125 public:
126 	const OutputDevice* pOut;		// Pointer auf das aktuelle Output-Device
127 	SwRefMarkFldUpdate( const OutputDevice* );
128 };
129 
130 // SwDocPosUpdate wird verschickt, um zu signalisieren, dass nur die
131 // Frames ab oder bis zu einer bestimmten dokument-globalen Position
132 // geupdated werden brauchen. Zur Zeit wird dies nur beim Updaten
133 // von Seitennummernfeldern benoetigt.
134 
135 class SwDocPosUpdate : public SwMsgPoolItem
136 {
137 public:
138 	const long nDocPos;
139 	SwDocPosUpdate( const long nDocPos );
140 };
141 
142 // SwTableFmlUpdate wird verschickt, wenn sich die Tabelle neu berechnen soll
143 // JP 16.02.99: oder wenn die Tabelle selbst gemergt oder gesplittet wird
144 enum TableFmlUpdtFlags { TBL_CALC = 0,
145 						 TBL_BOXNAME,
146 						 TBL_BOXPTR,
147 						 TBL_RELBOXNAME,
148 						 TBL_MERGETBL,
149 						 TBL_SPLITTBL
150 					   };
151 class SwTableFmlUpdate : public SwMsgPoolItem
152 {
153 public:
154 	const SwTable* pTbl;		// Pointer auf die zu aktuelle Tabelle
155 	union {
156 		const SwTable* pDelTbl;		// Merge: Ptr auf die zu loeschende Tabelle
157 		const String* pNewTblNm;	// Split: der Name der neuen Tabelle
158 	} DATA;
159 	SwHistory* pHistory;
160 	sal_uInt16 nSplitLine;			// Split: ab dieser BaseLine wird gespl.
161 	TableFmlUpdtFlags eFlags;
162 	sal_Bool bModified : 1;
163 	sal_Bool bBehindSplitLine : 1;
164 
165 	SwTableFmlUpdate( const SwTable* );
166 };
167 
168 
169 class SwAutoFmtGetDocNode: public SwMsgPoolItem
170 {
171 public:
172 	const SwCntntNode* pCntntNode;
173 	const SwNodes* pNodes;
174 
175 	SwAutoFmtGetDocNode( const SwNodes* pNds );
176 };
177 
178 /*
179  * SwAttrSetChg wird verschicht, wenn sich in dem SwAttrSet rTheChgdSet
180  * etwas veraendert hat. Es werden immer 2. Hints
181  * verschickt, die alten und neuen Items in dem rTheChgdSet.
182  */
183 class SwAttrSetChg: public SwMsgPoolItem
184 {
185 	sal_Bool bDelSet;
186 	SwAttrSet* pChgSet;				// was sich veraendert hat
187 	const SwAttrSet* pTheChgdSet;	// wird nur zum Vergleichen gebraucht !!
188 public:
189 	SwAttrSetChg( const SwAttrSet& rTheSet, SwAttrSet& rSet );
190 	SwAttrSetChg( const SwAttrSetChg& );
191 	~SwAttrSetChg();
192 
193 	// was sich veraendert hat
GetChgSet() const194 	const SwAttrSet* GetChgSet() const	{ return pChgSet; }
GetChgSet()195 		  SwAttrSet* GetChgSet() 		{ return pChgSet; }
196 
197 	// wo es sich geaendert hat
GetTheChgdSet() const198 	const SwAttrSet* GetTheChgdSet() const	{ return pTheChgdSet; }
199 
Count() const200     sal_uInt16 Count() const { return pChgSet->Count(); }
ClearItem(sal_uInt16 nWhichL=0)201     void ClearItem( sal_uInt16 nWhichL = 0 )
202 #ifndef DBG_UTIL
203     { pChgSet->ClearItem( nWhichL ); }
204 #else
205 		;
206 #endif
207 };
208 
209 class SwCondCollCondChg: public SwMsgPoolItem
210 {
211 public:
212 	SwFmt *pChangedFmt;
213 	SwCondCollCondChg( SwFmt *pFmt );
214 };
215 
216 class SwVirtPageNumInfo: public SwMsgPoolItem
217 {
218 	const SwPageFrm *pPage;
219 	const SwPageFrm *pOrigPage;
220 	const SwFrm 	*pFrm;		//An einem Absatz/Tabelle koennen mehrere
221 								//Attribute sitzen. Der Frame muss dann
222 								//muss dann letztlich bei bestimmen
223 								//welches Attribut gilt und um welche physikalische
224 								//Seite es sich handelt.
225 public:
226 	SwVirtPageNumInfo( const SwPageFrm *pPg );
227 
GetPage()228 	const SwPageFrm *GetPage()			{ return pPage;    }
GetOrigPage()229 	const SwPageFrm *GetOrigPage()		{ return pOrigPage;}
GetFrm()230 	const SwFrm *GetFrm()				{ return pFrm; }
SetInfo(const SwPageFrm * pPg,const SwFrm * pF)231 	void  SetInfo( const SwPageFrm *pPg,
232 				   const SwFrm *pF	) 	{ pFrm = pF, pPage = pPg; }
233 };
234 
235 
236 // --> OD 2008-02-19 #refactorlists#
237 //DECLARE_TABLE( SwTxtNodeTable, SwTxtNode* )
238 
239 //class SwNumRuleInfo : public SwMsgPoolItem
240 //{
241 //    SwTxtNodeTable aList;
242 //    const String& rName;
243 //public:
244 //  SwNumRuleInfo( const String& rRuleName );
245 
246 //  const String& GetName() const { return rName; }
247 //  void AddNode( SwTxtNode& rNd );
248 
249 //  // erzeuge die Liste aller Nodes der NumRule in dem angegebenem Doc
250 //  // Der Code steht im docnum.cxx
251 //    // #111955#
252 //  void MakeList( SwDoc& rDoc, sal_Bool bOutline = sal_False );
253 
254 //    const SwTxtNodeTable& GetTxtNodeList() const { return aList; }
255 //};
256 // <--
257 
258 class SwFindNearestNode : public SwMsgPoolItem
259 {
260 	const SwNode *pNd, *pFnd;
261 public:
262 	SwFindNearestNode( const SwNode& rNd );
263 	void CheckNode( const SwNode& rNd );
264 
GetFoundNode() const265 	const SwNode* GetFoundNode() const 		{ return pFnd; }
266 };
267 
268 class SwStringMsgPoolItem : public SwMsgPoolItem
269 {
270 	String sStr;
271 public:
272 
GetString() const273 	const String& GetString() const { return sStr; }
274 
SwStringMsgPoolItem(sal_uInt16 nId,const String & rStr)275 	SwStringMsgPoolItem( sal_uInt16 nId, const String& rStr )
276 		: SwMsgPoolItem( nId ), sStr( rStr )
277 	{}
278 };
279 
280 #endif
281