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