11d2dbeb0SAndrew Rist /**************************************************************
2cdf0e10cSrcweir *
31d2dbeb0SAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one
41d2dbeb0SAndrew Rist * or more contributor license agreements. See the NOTICE file
51d2dbeb0SAndrew Rist * distributed with this work for additional information
61d2dbeb0SAndrew Rist * regarding copyright ownership. The ASF licenses this file
71d2dbeb0SAndrew Rist * to you under the Apache License, Version 2.0 (the
81d2dbeb0SAndrew Rist * "License"); you may not use this file except in compliance
91d2dbeb0SAndrew Rist * with the License. You may obtain a copy of the License at
10cdf0e10cSrcweir *
111d2dbeb0SAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0
12cdf0e10cSrcweir *
131d2dbeb0SAndrew Rist * Unless required by applicable law or agreed to in writing,
141d2dbeb0SAndrew Rist * software distributed under the License is distributed on an
151d2dbeb0SAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
161d2dbeb0SAndrew Rist * KIND, either express or implied. See the License for the
171d2dbeb0SAndrew Rist * specific language governing permissions and limitations
181d2dbeb0SAndrew Rist * under the License.
19cdf0e10cSrcweir *
201d2dbeb0SAndrew Rist *************************************************************/
211d2dbeb0SAndrew Rist
221d2dbeb0SAndrew Rist
23cdf0e10cSrcweir #ifndef SW_FRAME_HXX
24cdf0e10cSrcweir #define SW_FRAME_HXX
25cdf0e10cSrcweir
26cdf0e10cSrcweir #include <svl/svarray.hxx>
27cdf0e10cSrcweir #include "swtypes.hxx" // fuer SwTwips
28cdf0e10cSrcweir #include "swrect.hxx"
29cdf0e10cSrcweir #include "calbck.hxx" // fuer SwClient
30cdf0e10cSrcweir #include <svl/brdcst.hxx>
31cdf0e10cSrcweir
32ca62e2c2SSteve Yin #include <com/sun/star/style/TabStop.hpp>
33ca62e2c2SSteve Yin #include <comphelper/stlunosequence.hxx>
34ca62e2c2SSteve Yin using namespace ::com::sun::star;
35cdf0e10cSrcweir class SwLayoutFrm;
36cdf0e10cSrcweir class SwRootFrm;
37cdf0e10cSrcweir class SwPageFrm;
38cdf0e10cSrcweir class SwFlyFrm;
39cdf0e10cSrcweir class SwSectionFrm;
40cdf0e10cSrcweir class SdrObject;
41cdf0e10cSrcweir class SwFtnFrm;
42cdf0e10cSrcweir class SwFtnBossFrm;
43cdf0e10cSrcweir class SwTabFrm;
44cdf0e10cSrcweir class SwRowFrm;
45cdf0e10cSrcweir class SwFlowFrm;
46cdf0e10cSrcweir class SwCntntFrm;
47cdf0e10cSrcweir class SfxPoolItem;
48cdf0e10cSrcweir class SwAttrSet;
49cdf0e10cSrcweir class ViewShell;
50cdf0e10cSrcweir class Color;
51cdf0e10cSrcweir class SwBorderAttrs;
52cdf0e10cSrcweir class SwCache;
53cdf0e10cSrcweir class SvxBrushItem;
54cdf0e10cSrcweir class SwSelectionList;
55cdf0e10cSrcweir struct SwPosition;
56cdf0e10cSrcweir struct SwCrsrMoveState;
57cdf0e10cSrcweir class SwFmt;
58cdf0e10cSrcweir class SwPrintData;
59cdf0e10cSrcweir class SwSortedObjs;
60cdf0e10cSrcweir class SwAnchoredObject;
61cdf0e10cSrcweir
62cdf0e10cSrcweir //Jeder FrmTyp findet sich hier in einem Bit wieder.
63cdf0e10cSrcweir //Die Bits muessen so gesetzt werden, dass mit einer Maskierung festgestellt
64cdf0e10cSrcweir //werden kann was fuer ein FrmTyp eine Instanz ist _und_ von welchen Klassen
65cdf0e10cSrcweir //sie abgeleitet ist.
66cdf0e10cSrcweir //Der Frm hat in der Basisklasse einen Member der von den CToren der
67cdf0e10cSrcweir //einzelnen Frms entsprechend gesetzt werden muss.
68cdf0e10cSrcweir #define FRM_ROOT 0x0001
69cdf0e10cSrcweir #define FRM_PAGE 0x0002
70cdf0e10cSrcweir #define FRM_COLUMN 0x0004
71cdf0e10cSrcweir #define FRM_HEADER 0x0008
72cdf0e10cSrcweir #define FRM_FOOTER 0x0010
73cdf0e10cSrcweir #define FRM_FTNCONT 0x0020
74cdf0e10cSrcweir #define FRM_FTN 0x0040
75cdf0e10cSrcweir #define FRM_BODY 0x0080
76cdf0e10cSrcweir #define FRM_FLY 0x0100
77cdf0e10cSrcweir #define FRM_SECTION 0x0200
78cdf0e10cSrcweir #define FRM_UNUSED 0x0400
79cdf0e10cSrcweir #define FRM_TAB 0x0800
80cdf0e10cSrcweir #define FRM_ROW 0x1000
81cdf0e10cSrcweir #define FRM_CELL 0x2000
82cdf0e10cSrcweir #define FRM_TXT 0x4000
83cdf0e10cSrcweir #define FRM_NOTXT 0x8000
84cdf0e10cSrcweir
85cdf0e10cSrcweir //Fuer den internen Gebrauch ein paar gebraeuchliche Verknuepfungen.
86cdf0e10cSrcweir #define FRM_LAYOUT 0x3FFF
87cdf0e10cSrcweir #define FRM_CNTNT 0xC000
88cdf0e10cSrcweir #define FRM_FTNBOSS 0x0006
89cdf0e10cSrcweir #define FRM_ACCESSIBLE (FRM_HEADER|FRM_FOOTER|FRM_FTN|FRM_TXT|FRM_ROOT|FRM_FLY|FRM_TAB|FRM_CELL|FRM_PAGE)
90cdf0e10cSrcweir
91cdf0e10cSrcweir //Weils so schon ist das ganze als Bitfeld....
92cdf0e10cSrcweir //0000 0000 0000 0001 ROOT
93cdf0e10cSrcweir //0000 0000 0000 0010 PAGE
94cdf0e10cSrcweir //0000 0000 0000 0100 COLUMN
95cdf0e10cSrcweir //0000 0000 0000 1000 HEADER
96cdf0e10cSrcweir //0000 0000 0001 0000 FOOTER
97cdf0e10cSrcweir //0000 0000 0010 0000 FTNCONT
98cdf0e10cSrcweir //0000 0000 0100 0000 FTN
99cdf0e10cSrcweir //0000 0000 1000 0000 BODY
100cdf0e10cSrcweir //0000 0001 0000 0000 FLY
101cdf0e10cSrcweir //0000 0010 0000 0000 SECTION
102cdf0e10cSrcweir //0000 0100 0000 0000 UNUSED
103cdf0e10cSrcweir //0000 1000 0000 0000 TAB
104cdf0e10cSrcweir //0001 0000 0000 0000 ROW
105cdf0e10cSrcweir //0010 0000 0000 0000 CELL
106cdf0e10cSrcweir //0100 0000 0000 0000 TXT
107cdf0e10cSrcweir //1000 0000 0000 0000 NOTXT
108cdf0e10cSrcweir
109cdf0e10cSrcweir // The type of the frame is internal represented by the 4-bit value nType,
110cdf0e10cSrcweir // which can expanded to the types above by shifting a bit (0x1 << nType)
111cdf0e10cSrcweir // Here are the corresponding defines for the compressed representation:
112cdf0e10cSrcweir
113cdf0e10cSrcweir #define FRMC_ROOT 0
114cdf0e10cSrcweir #define FRMC_PAGE 1
115cdf0e10cSrcweir #define FRMC_COLUMN 2
116cdf0e10cSrcweir #define FRMC_HEADER 3
117cdf0e10cSrcweir #define FRMC_FOOTER 4
118cdf0e10cSrcweir #define FRMC_FTNCONT 5
119cdf0e10cSrcweir #define FRMC_FTN 6
120cdf0e10cSrcweir #define FRMC_BODY 7
121cdf0e10cSrcweir #define FRMC_FLY 8
122cdf0e10cSrcweir #define FRMC_SECTION 9
123cdf0e10cSrcweir #define FRMC_UNUSED 10
124cdf0e10cSrcweir #define FRMC_TAB 11
125cdf0e10cSrcweir #define FRMC_ROW 12
126cdf0e10cSrcweir #define FRMC_CELL 13
127cdf0e10cSrcweir #define FRMC_TXT 14
128cdf0e10cSrcweir #define FRMC_NOTXT 15
129cdf0e10cSrcweir
130cdf0e10cSrcweir #define FRM_NEIGHBOUR 0x2004
131cdf0e10cSrcweir #define FRM_NOTE_VERT 0x7a60
132cdf0e10cSrcweir #define FRM_HEADFOOT 0x0018
133cdf0e10cSrcweir #define FRM_BODYFTNC 0x00a0
134cdf0e10cSrcweir
135cdf0e10cSrcweir class SwFrm;
136cdf0e10cSrcweir typedef long (SwFrm:: *SwFrmGet)() const;
137cdf0e10cSrcweir typedef sal_Bool (SwFrm:: *SwFrmMax)( long );
138cdf0e10cSrcweir typedef void (SwFrm:: *SwFrmMakePos)( const SwFrm*, const SwFrm*, sal_Bool );
139cdf0e10cSrcweir typedef long (*SwOperator)( long, long );
140cdf0e10cSrcweir typedef void (SwFrm:: *SwFrmSet)( long, long );
141cdf0e10cSrcweir
142*0af288bdSJuergen Schmidt SwFrm* SaveCntnt( SwLayoutFrm*, SwFrm* pStart = NULL );
143*0af288bdSJuergen Schmidt
144cdf0e10cSrcweir struct SwRectFnCollection
145cdf0e10cSrcweir {
146cdf0e10cSrcweir SwRectGet fnGetTop;
147cdf0e10cSrcweir SwRectGet fnGetBottom;
148cdf0e10cSrcweir SwRectGet fnGetLeft;
149cdf0e10cSrcweir SwRectGet fnGetRight;
150cdf0e10cSrcweir SwRectGet fnGetWidth;
151cdf0e10cSrcweir SwRectGet fnGetHeight;
152cdf0e10cSrcweir SwRectPoint fnGetPos;
153cdf0e10cSrcweir SwRectSize fnGetSize;
154cdf0e10cSrcweir
155cdf0e10cSrcweir SwRectSet fnSetTop;
156cdf0e10cSrcweir SwRectSet fnSetBottom;
157cdf0e10cSrcweir SwRectSet fnSetLeft;
158cdf0e10cSrcweir SwRectSet fnSetRight;
159cdf0e10cSrcweir SwRectSet fnSetWidth;
160cdf0e10cSrcweir SwRectSet fnSetHeight;
161cdf0e10cSrcweir
162cdf0e10cSrcweir SwRectSet fnSubTop;
163cdf0e10cSrcweir SwRectSet fnAddBottom;
164cdf0e10cSrcweir SwRectSet fnSubLeft;
165cdf0e10cSrcweir SwRectSet fnAddRight;
166cdf0e10cSrcweir SwRectSet fnAddWidth;
167cdf0e10cSrcweir SwRectSet fnAddHeight;
168cdf0e10cSrcweir
169cdf0e10cSrcweir SwRectSet fnSetPosX;
170cdf0e10cSrcweir SwRectSet fnSetPosY;
171cdf0e10cSrcweir
172cdf0e10cSrcweir SwFrmGet fnGetTopMargin;
173cdf0e10cSrcweir SwFrmGet fnGetBottomMargin;
174cdf0e10cSrcweir SwFrmGet fnGetLeftMargin;
175cdf0e10cSrcweir SwFrmGet fnGetRightMargin;
176cdf0e10cSrcweir SwFrmSet fnSetXMargins;
177cdf0e10cSrcweir SwFrmSet fnSetYMargins;
178cdf0e10cSrcweir SwFrmGet fnGetPrtTop;
179cdf0e10cSrcweir SwFrmGet fnGetPrtBottom;
180cdf0e10cSrcweir SwFrmGet fnGetPrtLeft;
181cdf0e10cSrcweir SwFrmGet fnGetPrtRight;
182cdf0e10cSrcweir SwRectDist fnTopDist;
183cdf0e10cSrcweir SwRectDist fnBottomDist;
184cdf0e10cSrcweir SwRectDist fnLeftDist;
185cdf0e10cSrcweir SwRectDist fnRightDist;
186cdf0e10cSrcweir SwFrmMax fnSetLimit;
187cdf0e10cSrcweir SwRectMax fnOverStep;
188cdf0e10cSrcweir
189cdf0e10cSrcweir SwRectSetPos fnSetPos;
190cdf0e10cSrcweir SwFrmMakePos fnMakePos;
191cdf0e10cSrcweir SwOperator fnXDiff;
192cdf0e10cSrcweir SwOperator fnYDiff;
193cdf0e10cSrcweir SwOperator fnXInc;
194cdf0e10cSrcweir SwOperator fnYInc;
195cdf0e10cSrcweir
196cdf0e10cSrcweir SwRectSetTwice fnSetLeftAndWidth;
197cdf0e10cSrcweir SwRectSetTwice fnSetTopAndHeight;
198cdf0e10cSrcweir };
199cdf0e10cSrcweir
200cdf0e10cSrcweir typedef SwRectFnCollection* SwRectFn;
201cdf0e10cSrcweir /*
202cdf0e10cSrcweir extern SwRectFn fnRectHori, fnRectVert, fnRectB2T, fnRectVL2R;
203cdf0e10cSrcweir #define SWRECTFN( pFrm ) sal_Bool bVert = pFrm->IsVertical(); \
204cdf0e10cSrcweir sal_Bool bRev = pFrm->IsReverse(); \
205cdf0e10cSrcweir SwRectFn fnRect = bVert ? \
206cdf0e10cSrcweir ( bRev ? fnRectVL2R : fnRectVert ): \
207cdf0e10cSrcweir ( bRev ? fnRectB2T : fnRectHori );
208cdf0e10cSrcweir #define SWRECTFNX( pFrm ) sal_Bool bVertX = pFrm->IsVertical(); \
209cdf0e10cSrcweir sal_Bool bRevX = pFrm->IsReverse(); \
210cdf0e10cSrcweir SwRectFn fnRectX = bVertX ? \
211cdf0e10cSrcweir ( bRevX ? fnRectVL2R : fnRectVert ): \
212cdf0e10cSrcweir ( bRevX ? fnRectB2T : fnRectHori );
213cdf0e10cSrcweir #define SWREFRESHFN( pFrm ) { if( bVert != pFrm->IsVertical() || \
214cdf0e10cSrcweir bRev != pFrm->IsReverse() ) \
215cdf0e10cSrcweir bVert = pFrm->IsVertical(); \
216cdf0e10cSrcweir bRev = pFrm->IsReverse(); \
217cdf0e10cSrcweir fnRect = bVert ? \
218cdf0e10cSrcweir ( bRev ? fnRectVL2R : fnRectVert ): \
219cdf0e10cSrcweir ( bRev ? fnRectB2T : fnRectHori ); }
220cdf0e10cSrcweir #define SWRECTFN2( pFrm ) sal_Bool bVert = pFrm->IsVertical(); \
221cdf0e10cSrcweir sal_Bool bNeighb = pFrm->IsNeighbourFrm(); \
222cdf0e10cSrcweir SwRectFn fnRect = bVert == bNeighb ? \
223cdf0e10cSrcweir fnRectHori : fnRectVert;
224cdf0e10cSrcweir */
225cdf0e10cSrcweir
226cdf0e10cSrcweir //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin
227cdf0e10cSrcweir extern SwRectFn fnRectHori, fnRectVert, fnRectB2T, fnRectVL2R, fnRectVertL2R;
228cdf0e10cSrcweir #define SWRECTFN( pFrm ) sal_Bool bVert = pFrm->IsVertical(); \
229cdf0e10cSrcweir sal_Bool bRev = pFrm->IsReverse(); \
230cdf0e10cSrcweir sal_Bool bVertL2R = pFrm->IsVertLR(); \
231cdf0e10cSrcweir SwRectFn fnRect = bVert ? \
232cdf0e10cSrcweir ( bRev ? fnRectVL2R : ( bVertL2R ? fnRectVertL2R : fnRectVert ) ): \
233cdf0e10cSrcweir ( bRev ? fnRectB2T : fnRectHori );
234cdf0e10cSrcweir #define SWRECTFNX( pFrm ) sal_Bool bVertX = pFrm->IsVertical(); \
235cdf0e10cSrcweir sal_Bool bRevX = pFrm->IsReverse(); \
236cdf0e10cSrcweir sal_Bool bVertL2RX = pFrm->IsVertLR(); \
237cdf0e10cSrcweir SwRectFn fnRectX = bVertX ? \
238cdf0e10cSrcweir ( bRevX ? fnRectVL2R : ( bVertL2RX ? fnRectVertL2R : fnRectVert ) ): \
239cdf0e10cSrcweir ( bRevX ? fnRectB2T : fnRectHori );
240cdf0e10cSrcweir #define SWREFRESHFN( pFrm ) { if( bVert != pFrm->IsVertical() || \
241cdf0e10cSrcweir bRev != pFrm->IsReverse() ) \
242cdf0e10cSrcweir bVert = pFrm->IsVertical(); \
243cdf0e10cSrcweir bRev = pFrm->IsReverse(); \
244cdf0e10cSrcweir bVertL2R = pFrm->IsVertLR(); \
245cdf0e10cSrcweir fnRect = bVert ? \
246cdf0e10cSrcweir ( bRev ? fnRectVL2R : ( bVertL2R ? fnRectVertL2R : fnRectVert ) ): \
247cdf0e10cSrcweir ( bRev ? fnRectB2T : fnRectHori ); }
248cdf0e10cSrcweir #define SWRECTFN2( pFrm ) sal_Bool bVert = pFrm->IsVertical(); \
249cdf0e10cSrcweir sal_Bool bVertL2R = pFrm->IsVertLR(); \
250cdf0e10cSrcweir sal_Bool bNeighb = pFrm->IsNeighbourFrm(); \
251cdf0e10cSrcweir SwRectFn fnRect = bVert == bNeighb ? \
252cdf0e10cSrcweir fnRectHori : ( bVertL2R ? fnRectVertL2R : fnRectVert );
253cdf0e10cSrcweir //End of SCMS
254cdf0e10cSrcweir #define POS_DIFF( aFrm1, aFrm2 ) \
255cdf0e10cSrcweir ( (aFrm1.*fnRect->fnGetTop)() != (aFrm2.*fnRect->fnGetTop)() || \
256cdf0e10cSrcweir (aFrm1.*fnRect->fnGetLeft)() != (aFrm2.*fnRect->fnGetLeft)() )
257cdf0e10cSrcweir
258cdf0e10cSrcweir
259cdf0e10cSrcweir //Fuer GetNextLeaf/GetPrevLeaf.
260cdf0e10cSrcweir enum MakePageType
261cdf0e10cSrcweir {
262cdf0e10cSrcweir MAKEPAGE_NONE, //Keine Seite bzw. Fussnote anlegen
263cdf0e10cSrcweir MAKEPAGE_APPEND, //Nur ggf. Seite anhaengen
264cdf0e10cSrcweir MAKEPAGE_INSERT, //Seite ggf. anhaengen oder einfuegen.
265cdf0e10cSrcweir MAKEPAGE_FTN, //Fussnote ggf. einfuegen.
266cdf0e10cSrcweir MAKEPAGE_NOSECTION // Don't create section frames
267cdf0e10cSrcweir };
268cdf0e10cSrcweir
269cdf0e10cSrcweir // OD 2004-05-06 #i28701# - replaced by new class <SwSortedObjs>
270cdf0e10cSrcweir //typedef SdrObject* SdrObjectPtr;
271cdf0e10cSrcweir //SV_DECL_PTRARR(SwDrawObjs,SdrObjectPtr,1,1);
272cdf0e10cSrcweir
273cdf0e10cSrcweir class SwFrm: public SwClient, public SfxBroadcaster
274cdf0e10cSrcweir {
275cdf0e10cSrcweir //Der verkappte Frm
276cdf0e10cSrcweir friend class SwFlowFrm;
277cdf0e10cSrcweir friend class SwLayoutFrm; // Sw3FrameIo: fuer pNext, pPrev
278cdf0e10cSrcweir friend class SwLooping; // LoopControlling (layouter.cxx)
279cdf0e10cSrcweir
280cdf0e10cSrcweir //Hebt die Lower waehrend eines Spaltenumbaus auf.
281*0af288bdSJuergen Schmidt friend SwFrm *SaveCntnt( SwLayoutFrm*, SwFrm* pStart );
282cdf0e10cSrcweir friend void RestoreCntnt( SwFrm *, SwLayoutFrm *, SwFrm *pSibling, bool bGrow );
283cdf0e10cSrcweir
284cdf0e10cSrcweir #if OSL_DEBUG_LEVEL > 1
285cdf0e10cSrcweir //entfernt leere SwSectionFrms aus einer Kette
286cdf0e10cSrcweir friend SwFrm* SwClearDummies( SwFrm* pFrm );
287cdf0e10cSrcweir #endif
288cdf0e10cSrcweir
289cdf0e10cSrcweir //Zum validieren eines unsinnig invalidierten in SwCntntFrm::MakeAll
290cdf0e10cSrcweir friend void ValidateSz( SwFrm *pFrm );
291cdf0e10cSrcweir // Implementiert in text/txtftn.cxx, verhindert Ftn-Oszillation
292cdf0e10cSrcweir friend void ValidateTxt( SwFrm *pFrm );
293cdf0e10cSrcweir
294cdf0e10cSrcweir // friend void CalcAnchorAndKeep( SwFlyFrm * );
295cdf0e10cSrcweir
296cdf0e10cSrcweir friend void MakeNxt( SwFrm *pFrm, SwFrm *pNxt );
297cdf0e10cSrcweir
298cdf0e10cSrcweir //Cache fuer (Umrandungs-)Attribute.
299cdf0e10cSrcweir static SwCache *pCache;
300ca62e2c2SSteve Yin //Solution:Member to identify if acc table should be disposed
301ca62e2c2SSteve Yin sal_Bool bIfAccTableShouldDisposing;
302cdf0e10cSrcweir
303cdf0e10cSrcweir // --> OD 2006-05-10 #i65250#
304cdf0e10cSrcweir // frame ID is now in general available - used for layout loop control
305cdf0e10cSrcweir static sal_uInt32 mnLastFrmId;
306cdf0e10cSrcweir const sal_uInt32 mnFrmId;
307cdf0e10cSrcweir // <--
308cdf0e10cSrcweir
309cdf0e10cSrcweir SwRootFrm *mpRoot;
310cdf0e10cSrcweir SwLayoutFrm *pUpper;
311cdf0e10cSrcweir SwFrm *pNext;
312cdf0e10cSrcweir SwFrm *pPrev;
313cdf0e10cSrcweir
314cdf0e10cSrcweir SwFrm *_FindNext();
315cdf0e10cSrcweir SwFrm *_FindPrev();
316cdf0e10cSrcweir
317cdf0e10cSrcweir /** method to determine next content frame in the same environment
318cdf0e10cSrcweir for a flow frame (content frame, table frame, section frame)
319cdf0e10cSrcweir
320cdf0e10cSrcweir OD 2005-11-30 #i27138# - adding documentation:
321cdf0e10cSrcweir Travelling downwards through the layout to determine the next content
322cdf0e10cSrcweir frame in the same environment. There are several environments in a
323cdf0e10cSrcweir document, which form a closed context regarding this function. These
324cdf0e10cSrcweir environments are:
325cdf0e10cSrcweir - Each page header
326cdf0e10cSrcweir - Each page footer
327cdf0e10cSrcweir - Each unlinked fly frame
328cdf0e10cSrcweir - Each group of linked fly frames
329cdf0e10cSrcweir - All footnotes
330cdf0e10cSrcweir - All document body frames
331cdf0e10cSrcweir OD 2005-11-30 #i27138# - adding parameter <_bInSameFtn>
332cdf0e10cSrcweir Its default value is <false>. If its value is <true>, the environment
333cdf0e10cSrcweir 'All footnotes' is no longer treated. Instead each footnote is treated
334cdf0e10cSrcweir as an own environment.
335cdf0e10cSrcweir
336cdf0e10cSrcweir @author OD
337cdf0e10cSrcweir
338cdf0e10cSrcweir @param _bInSameFtn
339cdf0e10cSrcweir input parameter - boolean indicating, that the found next content
340cdf0e10cSrcweir frame has to be in the same footnote frame. This parameter is only
341cdf0e10cSrcweir relevant for flow frames in footnotes.
342cdf0e10cSrcweir
343cdf0e10cSrcweir @return SwCntntFrm*
344cdf0e10cSrcweir pointer to the found next content frame. It's NULL, if none exists.
345cdf0e10cSrcweir */
346cdf0e10cSrcweir SwCntntFrm* _FindNextCnt( const bool _bInSameFtn = false );
347cdf0e10cSrcweir
348cdf0e10cSrcweir /** method to determine previous content frame in the same environment
349cdf0e10cSrcweir for a flow frame (content frame, table frame, section frame)
350cdf0e10cSrcweir
351cdf0e10cSrcweir OD 2005-11-30 #i27138#
352cdf0e10cSrcweir Travelling upwards through the layout to determine the previous content
353cdf0e10cSrcweir frame in the same environment. There are several environments in a
354cdf0e10cSrcweir document, which form a closed context regarding this function. These
355cdf0e10cSrcweir environments are:
356cdf0e10cSrcweir - Each page header
357cdf0e10cSrcweir - Each page footer
358cdf0e10cSrcweir - Each unlinked fly frame
359cdf0e10cSrcweir - Each group of linked fly frames
360cdf0e10cSrcweir - All footnotes
361cdf0e10cSrcweir - All document body frames
362cdf0e10cSrcweir OD 2005-11-30 #i27138# - adding parameter <_bInSameFtn>
363cdf0e10cSrcweir Its default value is <false>. If its value is <true>, the environment
364cdf0e10cSrcweir 'All footnotes' is no longer treated. Instead each footnote is treated
365cdf0e10cSrcweir as an own environment.
366cdf0e10cSrcweir
367cdf0e10cSrcweir @author OD
368cdf0e10cSrcweir
369cdf0e10cSrcweir @param _bInSameFtn
370cdf0e10cSrcweir input parameter - boolean indicating, that the found previous content
371cdf0e10cSrcweir frame has to be in the same footnote frame. This parameter is only
372cdf0e10cSrcweir relevant for flow frames in footnotes.
373cdf0e10cSrcweir
374cdf0e10cSrcweir @return SwCntntFrm*
375cdf0e10cSrcweir pointer to the found previous content frame. It's NULL, if none exists.
376cdf0e10cSrcweir */
377cdf0e10cSrcweir SwCntntFrm* _FindPrevCnt( const bool _bInSameFtn = false );
378cdf0e10cSrcweir
379cdf0e10cSrcweir
380cdf0e10cSrcweir void _UpdateAttrFrm( const SfxPoolItem*, const SfxPoolItem*, sal_uInt8 & );
381cdf0e10cSrcweir SwFrm* _GetIndNext();
382cdf0e10cSrcweir void SetDirFlags( sal_Bool bVert );
383cdf0e10cSrcweir
384cdf0e10cSrcweir SwFrm( SwFrm & ); //Kopieren ist nicht erlaubt.
385cdf0e10cSrcweir
386cdf0e10cSrcweir const SwLayoutFrm* ImplGetNextLayoutLeaf( bool bFwd ) const;
387cdf0e10cSrcweir
388cdf0e10cSrcweir protected:
389cdf0e10cSrcweir SwSortedObjs* pDrawObjs; //Hier haengen die DrawObjs, kann 0 sein
390cdf0e10cSrcweir
391cdf0e10cSrcweir SwRect aFrm; //Absolute Dokumentposition und groesse des Frm
392cdf0e10cSrcweir SwRect aPrt; //Position der PrtArea rel zum Frm und groesse der PrtArea
393cdf0e10cSrcweir
394cdf0e10cSrcweir sal_uInt16 bFlag01: 1;
395cdf0e10cSrcweir sal_uInt16 bFlag02: 1;
396cdf0e10cSrcweir sal_uInt16 bFlag03: 1;
397cdf0e10cSrcweir sal_uInt16 bFlag04: 1;
398cdf0e10cSrcweir sal_uInt16 bFlag05: 1;
399cdf0e10cSrcweir sal_uInt16 bReverse: 1; // Next line above/at the right side instead
400cdf0e10cSrcweir // under/at the left side of the previous line.
401cdf0e10cSrcweir sal_uInt16 bInvalidR2L: 1;
402cdf0e10cSrcweir sal_uInt16 bDerivedR2L: 1;
403cdf0e10cSrcweir sal_uInt16 bRightToLeft: 1;
404cdf0e10cSrcweir sal_uInt16 bInvalidVert: 1;
405cdf0e10cSrcweir sal_uInt16 bDerivedVert: 1;
406cdf0e10cSrcweir sal_uInt16 bVertical: 1;
407cdf0e10cSrcweir //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin
408cdf0e10cSrcweir sal_uInt16 bVertLR: 1;
409cdf0e10cSrcweir //End of SCMS
410cdf0e10cSrcweir sal_uInt16 nType: 4; //Who am I?
411cdf0e10cSrcweir
412cdf0e10cSrcweir sal_Bool bValidPos: 1;
413cdf0e10cSrcweir sal_Bool bValidPrtArea: 1;
414cdf0e10cSrcweir sal_Bool bValidSize: 1;
415cdf0e10cSrcweir sal_Bool bValidLineNum: 1;
416cdf0e10cSrcweir sal_Bool bFixSize: 1;
417cdf0e10cSrcweir sal_Bool bUnUsed1: 1;
418cdf0e10cSrcweir sal_Bool bCompletePaint: 1; //Frame wird ganz gepaintet wenn sal_True, auch
419cdf0e10cSrcweir //wenn der Inhalt nur teilw. veraendert ist;
420cdf0e10cSrcweir //Bei CntntFrms wird ausschliesslich wenn sal_True
421cdf0e10cSrcweir //der Border (von Action) gemalt.
422cdf0e10cSrcweir sal_Bool bRetouche: 1; //Der Frame ist fuer Retusche verantwortlich
423cdf0e10cSrcweir //wenn sal_True.
424cdf0e10cSrcweir public:
GetTabStopInfo(SwTwips)425ca62e2c2SSteve Yin virtual uno::Sequence< style::TabStop > GetTabStopInfo( SwTwips )
426ca62e2c2SSteve Yin {
427ca62e2c2SSteve Yin return uno::Sequence< style::TabStop >();
428ca62e2c2SSteve Yin }
429cdf0e10cSrcweir sal_Bool bUnUsed2: 1;
430cdf0e10cSrcweir protected:
431cdf0e10cSrcweir sal_Bool bInfInvalid: 1; //InfoFlags sind Invalid.
432cdf0e10cSrcweir sal_Bool bInfBody: 1; //Frm steht im DokumentBody.
433cdf0e10cSrcweir sal_Bool bInfTab: 1; //Frm steht in einer Tabelle.
434cdf0e10cSrcweir sal_Bool bInfFly: 1; //Frm steht in einem Fly.
435cdf0e10cSrcweir sal_Bool bInfFtn: 1; //Frm steht in einer Fussnote.
436cdf0e10cSrcweir sal_Bool bInfSct: 1; //Frm steht in einem Bereich.
437cdf0e10cSrcweir sal_Bool bColLocked: 1; //Grow/Shrink sperren bei spaltigen Section-
438cdf0e10cSrcweir //oder Fly-Frames, wird im Format gesetzt
439cdf0e10cSrcweir
ColLock()440cdf0e10cSrcweir void ColLock() { bColLocked = sal_True; }
ColUnlock()441cdf0e10cSrcweir void ColUnlock() { bColLocked = sal_False; }
442cdf0e10cSrcweir
443cdf0e10cSrcweir // Only used by SwRootFrm Ctor to get 'this' into mpRoot...
setRootFrm(SwRootFrm * pRoot)444cdf0e10cSrcweir void setRootFrm( SwRootFrm* pRoot ) { mpRoot = pRoot; }
445cdf0e10cSrcweir
446cdf0e10cSrcweir SwPageFrm *InsertPage( SwPageFrm *pSibling, sal_Bool bFtn );
447cdf0e10cSrcweir void PrepareMake();
448cdf0e10cSrcweir void OptPrepareMake();
449cdf0e10cSrcweir void MakePos();
450cdf0e10cSrcweir // --> OD 2005-09-28 #b6329202#
451cdf0e10cSrcweir // method formats next frame of table frame to assure keep attribute.
452cdf0e10cSrcweir // in case of nested tables method <SwFrm::MakeAll()> is called to
453cdf0e10cSrcweir // avoid format of superior table frame.
454cdf0e10cSrcweir friend SwFrm* lcl_FormatNextCntntForKeep( SwTabFrm* pTabFrm );
455cdf0e10cSrcweir // <--
456cdf0e10cSrcweir virtual void MakeAll() = 0;
457cdf0e10cSrcweir //Adjustierung der Frames einer Seite
458cdf0e10cSrcweir SwTwips AdjustNeighbourhood( SwTwips nDiff, sal_Bool bTst = sal_False );
459cdf0e10cSrcweir
460cdf0e10cSrcweir
461cdf0e10cSrcweir //Aendern nur die Framesize, nicht die PrtArea-SSize
462cdf0e10cSrcweir virtual SwTwips ShrinkFrm( SwTwips, sal_Bool bTst = sal_False, sal_Bool bInfo = sal_False ) = 0;
463cdf0e10cSrcweir virtual SwTwips GrowFrm ( SwTwips, sal_Bool bTst = sal_False, sal_Bool bInfo = sal_False ) = 0;
464cdf0e10cSrcweir
GetDep()465cdf0e10cSrcweir SwModify *GetDep() { return GetRegisteredInNonConst(); }
GetDep() const466cdf0e10cSrcweir const SwModify *GetDep() const { return GetRegisteredIn(); }
467cdf0e10cSrcweir
468cdf0e10cSrcweir SwFrm( SwModify*, SwFrm* );
469cdf0e10cSrcweir
470cdf0e10cSrcweir void CheckDir( sal_uInt16 nDir, sal_Bool bVert, sal_Bool bOnlyBiDi, sal_Bool bBrowse );
471cdf0e10cSrcweir
472cdf0e10cSrcweir /** enumeration for the different invalidations
473cdf0e10cSrcweir
474cdf0e10cSrcweir OD 2004-05-19 #i28701#
475cdf0e10cSrcweir
476cdf0e10cSrcweir @author OD
477cdf0e10cSrcweir */
478cdf0e10cSrcweir enum InvalidationType
479cdf0e10cSrcweir {
480cdf0e10cSrcweir INVALID_SIZE, INVALID_PRTAREA, INVALID_POS, INVALID_LINENUM, INVALID_ALL
481cdf0e10cSrcweir };
482cdf0e10cSrcweir
483cdf0e10cSrcweir /** method to determine, if an invalidation is allowed.
484cdf0e10cSrcweir
485cdf0e10cSrcweir OD 2004-05-19 #i28701
486cdf0e10cSrcweir
487cdf0e10cSrcweir @author OD
488cdf0e10cSrcweir */
489cdf0e10cSrcweir virtual bool _InvalidationAllowed( const InvalidationType _nInvalid ) const;
490cdf0e10cSrcweir
491cdf0e10cSrcweir /** method to perform additional actions on an invalidation
492cdf0e10cSrcweir
493cdf0e10cSrcweir OD 2004-05-19 #i28701#
494cdf0e10cSrcweir Method has *only* to contain actions, which has to be performed on
495cdf0e10cSrcweir *every* assignment of the corresponding flag to <sal_False>.
496cdf0e10cSrcweir
497cdf0e10cSrcweir @author OD
498cdf0e10cSrcweir */
499cdf0e10cSrcweir virtual void _ActionOnInvalidation( const InvalidationType _nInvalid );
500cdf0e10cSrcweir
501cdf0e10cSrcweir //Schatten und Umrandung painten
502cdf0e10cSrcweir void PaintShadow( const SwRect&, SwRect&, const SwBorderAttrs& ) const;
503cdf0e10cSrcweir virtual void Modify( const SfxPoolItem*, const SfxPoolItem* );
504cdf0e10cSrcweir
505cdf0e10cSrcweir public:
506cdf0e10cSrcweir TYPEINFO(); //Bereits in Basisklasse Client drin.
507cdf0e10cSrcweir
GetType() const508cdf0e10cSrcweir sal_uInt16 GetType() const { return 0x1 << nType; }
509cdf0e10cSrcweir
GetCache()510cdf0e10cSrcweir static SwCache &GetCache() { return *pCache; }
GetCachePtr()511cdf0e10cSrcweir static SwCache *GetCachePtr() { return pCache; }
SetCache(SwCache * pNew)512cdf0e10cSrcweir static void SetCache( SwCache *pNew ) { pCache = pNew; }
513cdf0e10cSrcweir
514cdf0e10cSrcweir //Aendern die PrtArea-SSize und die FrmSize.
515cdf0e10cSrcweir SwTwips Shrink( SwTwips, sal_Bool bTst = sal_False, sal_Bool bInfo = sal_False );
516cdf0e10cSrcweir SwTwips Grow ( SwTwips, sal_Bool bTst = sal_False, sal_Bool bInfo = sal_False );
517cdf0e10cSrcweir
518cdf0e10cSrcweir //Wir brauchen unterschiedliche Methoden (wg. Performance) fuer das
519cdf0e10cSrcweir //Einfuegenin den Layout Baum:
520cdf0e10cSrcweir
521cdf0e10cSrcweir //Einfuegen vor pBehind oder am Ende der Kette unter pUpper
522cdf0e10cSrcweir void InsertBefore( SwLayoutFrm* pParent, SwFrm* pBehind );
523cdf0e10cSrcweir //Einfuegen hinter pBefore oder am Anfang der Kette unter pUpper
524cdf0e10cSrcweir void InsertBehind( SwLayoutFrm *pParent, SwFrm *pBefore );
525cdf0e10cSrcweir //Einfuegen vor pBehind oder am Ende der Kette, unter Beruecksichtigung
526cdf0e10cSrcweir //der Geschwister von pSct
527cdf0e10cSrcweir void InsertGroupBefore( SwFrm* pParent, SwFrm* pWhere, SwFrm* pSct );
528cdf0e10cSrcweir void Remove();
529cdf0e10cSrcweir
530cdf0e10cSrcweir //For internal use only; wer es anders macht wird
531cdf0e10cSrcweir //in einen Sack gesteckt und muss zwei Tage drin hocken bleiben.
532cdf0e10cSrcweir //Fuert Spezialbehandlung fuer _Get[Next|Prev]Leaf() durch (Tabellen).
533cdf0e10cSrcweir SwLayoutFrm *GetLeaf( MakePageType eMakePage, sal_Bool bFwd );
534cdf0e10cSrcweir SwLayoutFrm *GetNextLeaf ( MakePageType eMakePage );
535cdf0e10cSrcweir SwLayoutFrm *GetNextFtnLeaf( MakePageType eMakePage );
536cdf0e10cSrcweir SwLayoutFrm *GetNextSctLeaf( MakePageType eMakePage );
537cdf0e10cSrcweir SwLayoutFrm *GetNextCellLeaf( MakePageType eMakePage );
538cdf0e10cSrcweir SwLayoutFrm *GetPrevLeaf ( MakePageType eMakeFtn = MAKEPAGE_FTN );
539cdf0e10cSrcweir SwLayoutFrm *GetPrevFtnLeaf( MakePageType eMakeFtn = MAKEPAGE_FTN );
540cdf0e10cSrcweir SwLayoutFrm *GetPrevSctLeaf( MakePageType eMakeFtn = MAKEPAGE_FTN );
541cdf0e10cSrcweir SwLayoutFrm *GetPrevCellLeaf( MakePageType eMakeFtn = MAKEPAGE_FTN );
542cdf0e10cSrcweir const SwLayoutFrm *GetLeaf ( MakePageType eMakePage, sal_Bool bFwd,
543cdf0e10cSrcweir const SwFrm *pAnch ) const;
544cdf0e10cSrcweir
545cdf0e10cSrcweir sal_Bool WrongPageDesc( SwPageFrm* pNew );
546cdf0e10cSrcweir
547cdf0e10cSrcweir // --> OD 2004-07-02 #i28701# - new methods to append/remove drawing objects
548cdf0e10cSrcweir void AppendDrawObj( SwAnchoredObject& _rNewObj );
549cdf0e10cSrcweir void RemoveDrawObj( SwAnchoredObject& _rToRemoveObj );
550cdf0e10cSrcweir // <--
551cdf0e10cSrcweir
552cdf0e10cSrcweir //Arbeiten mit der Kette der FlyFrms
553cdf0e10cSrcweir void AppendFly( SwFlyFrm *pNew );
554cdf0e10cSrcweir void RemoveFly( SwFlyFrm *pToRemove );
GetDrawObjs() const555cdf0e10cSrcweir const SwSortedObjs *GetDrawObjs() const { return pDrawObjs; }
GetDrawObjs()556cdf0e10cSrcweir SwSortedObjs *GetDrawObjs() { return pDrawObjs; }
557cdf0e10cSrcweir // --> OD 2004-07-01 #i28701# - change purpose of method and adjust its name
558cdf0e10cSrcweir void InvalidateObjs( const bool _bInvaPosOnly,
559cdf0e10cSrcweir const bool _bNoInvaOfAsCharAnchoredObjs = true );
560cdf0e10cSrcweir
561cdf0e10cSrcweir virtual void PaintBorder( const SwRect&, const SwPageFrm *pPage,
562cdf0e10cSrcweir const SwBorderAttrs & ) const;
563cdf0e10cSrcweir void PaintBaBo( const SwRect&, const SwPageFrm *pPage = 0,
564cdf0e10cSrcweir const sal_Bool bLowerBorder = sal_False ) const;
565cdf0e10cSrcweir void PaintBackground( const SwRect&, const SwPageFrm *pPage,
566cdf0e10cSrcweir const SwBorderAttrs &,
567cdf0e10cSrcweir const sal_Bool bLowerMode = sal_False,
568cdf0e10cSrcweir const sal_Bool bLowerBorder = sal_False ) const;
569cdf0e10cSrcweir void PaintBorderLine( const SwRect&, const SwRect&, const SwPageFrm*,
570cdf0e10cSrcweir const Color *pColor ) const;
571cdf0e10cSrcweir
572cdf0e10cSrcweir //Retouche, nicht im Bereich des uebergebenen Rect!
573cdf0e10cSrcweir void Retouche( const SwPageFrm *pPage, const SwRect &rRect ) const;
574cdf0e10cSrcweir
575cdf0e10cSrcweir sal_Bool GetBackgroundBrush( const SvxBrushItem*& rpBrush,
576cdf0e10cSrcweir const Color*& rpColor,
577cdf0e10cSrcweir SwRect &rOrigRect,
578cdf0e10cSrcweir sal_Bool bLowerMode ) const;
579cdf0e10cSrcweir
580cdf0e10cSrcweir inline void SetCompletePaint() const;
581cdf0e10cSrcweir inline void ResetCompletePaint() const;
IsCompletePaint() const582cdf0e10cSrcweir inline sal_Bool IsCompletePaint() const { return bCompletePaint; }
583cdf0e10cSrcweir
584cdf0e10cSrcweir inline void SetRetouche() const;
585cdf0e10cSrcweir inline void ResetRetouche() const;
IsRetouche() const586cdf0e10cSrcweir inline sal_Bool IsRetouche() const { return bRetouche; }
587cdf0e10cSrcweir
588cdf0e10cSrcweir void SetInfFlags(); //Setzen der InfoFlags
InvalidateInfFlags()589cdf0e10cSrcweir inline void InvalidateInfFlags() { bInfInvalid = sal_True; }
590cdf0e10cSrcweir inline sal_Bool IsInDocBody() const; //Benutzen die InfoFlags.
591cdf0e10cSrcweir inline sal_Bool IsInFtn() const; //ggf. werden die Flags ermittelt.
592cdf0e10cSrcweir inline sal_Bool IsInTab() const;
593cdf0e10cSrcweir inline sal_Bool IsInFly() const;
594cdf0e10cSrcweir inline sal_Bool IsInSct() const;
595cdf0e10cSrcweir
596cdf0e10cSrcweir // If frame is inside a split table row, this function returns
597cdf0e10cSrcweir // the corresponding row frame in the follow table.
598cdf0e10cSrcweir const SwRowFrm* IsInSplitTableRow() const;
599cdf0e10cSrcweir
600cdf0e10cSrcweir // If frame is inside a follow flow row, this function returns
601cdf0e10cSrcweir // the corresponding row frame master table
602cdf0e10cSrcweir const SwRowFrm* IsInFollowFlowRow() const;
603cdf0e10cSrcweir
604cdf0e10cSrcweir bool IsInBalancedSection() const;
605cdf0e10cSrcweir
IsReverse() const606cdf0e10cSrcweir inline sal_Bool IsReverse() const { return bReverse; }
SetReverse(sal_Bool bNew)607cdf0e10cSrcweir inline void SetReverse( sal_Bool bNew ){ bReverse = bNew ? 1 : 0; }
608cdf0e10cSrcweir inline sal_Bool IsVertical() const;
609cdf0e10cSrcweir //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin
610cdf0e10cSrcweir inline sal_Bool IsVertLR() const;
611cdf0e10cSrcweir //End of SCMS
612cdf0e10cSrcweir inline sal_Bool GetVerticalFlag() const;
SetVertical(sal_Bool bNew)613cdf0e10cSrcweir inline void SetVertical( sal_Bool bNew ){ bVertical = bNew ? 1 : 0; }
614cdf0e10cSrcweir //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin
SetbVertLR(sal_Bool bNew)615cdf0e10cSrcweir inline void SetbVertLR( sal_Bool bNew ) { bVertLR = bNew ? 1 : 0; }
616cdf0e10cSrcweir //End of SCMS
SetDerivedVert(sal_Bool bNew)617cdf0e10cSrcweir inline void SetDerivedVert( sal_Bool bNew ){ bDerivedVert = bNew ? 1 : 0; }
SetInvalidVert(sal_Bool bNew)618cdf0e10cSrcweir inline void SetInvalidVert( sal_Bool bNew) { bInvalidVert = bNew ? 1 : 0; }
619cdf0e10cSrcweir inline sal_Bool IsRightToLeft() const;
620cdf0e10cSrcweir inline sal_Bool GetRightToLeftFlag() const;
SetRightToLeft(sal_Bool bNew)621cdf0e10cSrcweir inline void SetRightToLeft( sal_Bool bNew ){ bRightToLeft = bNew ? 1 : 0; }
SetDerivedR2L(sal_Bool bNew)622cdf0e10cSrcweir inline void SetDerivedR2L( sal_Bool bNew ) { bDerivedR2L = bNew ? 1 : 0; }
SetInvalidR2L(sal_Bool bNew)623cdf0e10cSrcweir inline void SetInvalidR2L( sal_Bool bNew ) { bInvalidR2L = bNew ? 1 : 0; }
624cdf0e10cSrcweir
625cdf0e10cSrcweir void CheckDirChange();
626cdf0e10cSrcweir // returns upper left frame position for LTR and
627cdf0e10cSrcweir // upper right frame position for Asian / RTL frames
628cdf0e10cSrcweir Point GetFrmAnchorPos( sal_Bool bIgnoreFlysAnchoredAtThisFrame ) const;
629cdf0e10cSrcweir
630cdf0e10cSrcweir /** determine, if frame is moveable in given environment
631cdf0e10cSrcweir
632cdf0e10cSrcweir OD 08.08.2003 #110978#
633cdf0e10cSrcweir method replaced 'old' method <sal_Bool IsMoveable() const>.
634cdf0e10cSrcweir Determines, if frame is moveable in given environment. if no environment
635cdf0e10cSrcweir is given (parameter _pLayoutFrm == 0L), the movability in the actual
636cdf0e10cSrcweir environment (<this->GetUpper()) is checked.
637cdf0e10cSrcweir
638cdf0e10cSrcweir @author OD
639cdf0e10cSrcweir
640cdf0e10cSrcweir @param _pLayoutFrm
641cdf0e10cSrcweir input parameter - given environment (layout frame), in which the movability
642cdf0e10cSrcweir will be checked. If not set ( == 0L ), actual environment is taken.
643cdf0e10cSrcweir
644cdf0e10cSrcweir @return boolean, indicating, if frame is moveable in given environment
645cdf0e10cSrcweir */
646cdf0e10cSrcweir // sal_Bool IsMoveable() const;
647cdf0e10cSrcweir bool IsMoveable( const SwLayoutFrm* _pLayoutFrm = 0L ) const;
648cdf0e10cSrcweir
649cdf0e10cSrcweir //Ist es fuer den (Txt)Frm in der aktuellen Umgebung erlaubt eine
650cdf0e10cSrcweir //Fussnote einzufuegen (nicht z.B. in wiederholten TabellenHeadlines).
651cdf0e10cSrcweir sal_Bool IsFtnAllowed() const;
652cdf0e10cSrcweir
653cdf0e10cSrcweir virtual void Format( const SwBorderAttrs *pAttrs = 0 );
654cdf0e10cSrcweir
655cdf0e10cSrcweir virtual void CheckDirection( sal_Bool bVert );
656cdf0e10cSrcweir
657cdf0e10cSrcweir void ReinitializeFrmSizeAttrFlags();
658cdf0e10cSrcweir
659cdf0e10cSrcweir const SwAttrSet *GetAttrSet() const;
660cdf0e10cSrcweir
HasFixSize() const661cdf0e10cSrcweir inline sal_Bool HasFixSize() const { return bFixSize; }
SetFixSize(sal_Bool bNew)662cdf0e10cSrcweir inline void SetFixSize( sal_Bool bNew ) { bFixSize = bNew; }
663cdf0e10cSrcweir
664cdf0e10cSrcweir //Prueft alle Seiten ab der Uebergebenen und korrigiert ggf.
665cdf0e10cSrcweir static void CheckPageDescs( SwPageFrm *pStart, sal_Bool bNotifyFields = sal_True );
666cdf0e10cSrcweir
667cdf0e10cSrcweir //Koennen 0 liefern, einmal const einmal nicht
GetNext()668cdf0e10cSrcweir SwFrm *GetNext() { return pNext; }
GetPrev()669cdf0e10cSrcweir SwFrm *GetPrev() { return pPrev; }
GetUpper()670cdf0e10cSrcweir SwLayoutFrm *GetUpper() { return pUpper; }
getRootFrm()671cdf0e10cSrcweir SwRootFrm *getRootFrm(){ return mpRoot; }
672cdf0e10cSrcweir SwPageFrm *FindPageFrm();
673cdf0e10cSrcweir SwFrm *FindColFrm();
674cdf0e10cSrcweir SwFtnBossFrm *FindFtnBossFrm( sal_Bool bFootnotes = sal_False );
675cdf0e10cSrcweir SwTabFrm *ImplFindTabFrm();
676cdf0e10cSrcweir SwFtnFrm *ImplFindFtnFrm();
677cdf0e10cSrcweir SwFlyFrm *ImplFindFlyFrm();
678cdf0e10cSrcweir SwSectionFrm *ImplFindSctFrm();
679cdf0e10cSrcweir SwFrm *FindFooterOrHeader();
680cdf0e10cSrcweir SwFrm *GetLower();
GetNext() const681cdf0e10cSrcweir const SwFrm *GetNext() const { return pNext; }
GetPrev() const682cdf0e10cSrcweir const SwFrm *GetPrev() const { return pPrev; }
GetUpper() const683cdf0e10cSrcweir const SwLayoutFrm *GetUpper() const { return pUpper; }
getRootFrm() const684cdf0e10cSrcweir const SwRootFrm *getRootFrm() const { return mpRoot; }
685cdf0e10cSrcweir inline SwTabFrm *FindTabFrm();
686cdf0e10cSrcweir inline SwFtnFrm *FindFtnFrm();
687cdf0e10cSrcweir inline SwFlyFrm *FindFlyFrm();
688cdf0e10cSrcweir inline SwSectionFrm *FindSctFrm();
689cdf0e10cSrcweir inline SwFrm *FindNext();
690cdf0e10cSrcweir // --> OD 2005-12-01 #i27138# - add parameter <_bInSameFtn>
691cdf0e10cSrcweir inline SwCntntFrm* FindNextCnt( const bool _bInSameFtn = false );
692cdf0e10cSrcweir // <--
693cdf0e10cSrcweir inline SwFrm *FindPrev();
694cdf0e10cSrcweir inline const SwPageFrm *FindPageFrm() const;
695cdf0e10cSrcweir inline const SwFtnBossFrm *FindFtnBossFrm( sal_Bool bFtn = sal_False ) const;
696cdf0e10cSrcweir inline const SwFrm *FindColFrm() const;
697cdf0e10cSrcweir inline const SwFrm *FindFooterOrHeader() const;
698cdf0e10cSrcweir inline const SwTabFrm *FindTabFrm() const;
699cdf0e10cSrcweir inline const SwFtnFrm *FindFtnFrm() const;
700cdf0e10cSrcweir inline const SwFlyFrm *FindFlyFrm() const;
701cdf0e10cSrcweir inline const SwSectionFrm *FindSctFrm() const;
702cdf0e10cSrcweir inline const SwFrm *FindNext() const;
703cdf0e10cSrcweir // --> OD 2005-12-01 #i27138# - add parameter <_bInSameFtn>
704cdf0e10cSrcweir inline const SwCntntFrm* FindNextCnt( const bool _bInSameFtn = false ) const;
705cdf0e10cSrcweir // <--
706cdf0e10cSrcweir inline const SwFrm *FindPrev() const;
707cdf0e10cSrcweir const SwFrm *GetLower() const;
708cdf0e10cSrcweir
709cdf0e10cSrcweir /** inline wrapper method for <_FindPrevCnt(..)>
710cdf0e10cSrcweir
711cdf0e10cSrcweir OD 2005-11-30 #i27138#
712cdf0e10cSrcweir
713cdf0e10cSrcweir @author OD
714cdf0e10cSrcweir */
FindPrevCnt(const bool _bInSameFtn=false)715cdf0e10cSrcweir inline SwCntntFrm* FindPrevCnt( const bool _bInSameFtn = false )
716cdf0e10cSrcweir {
717cdf0e10cSrcweir if ( GetPrev() && GetPrev()->IsCntntFrm() )
718cdf0e10cSrcweir return (SwCntntFrm*)(GetPrev());
719cdf0e10cSrcweir else
720cdf0e10cSrcweir return _FindPrevCnt( _bInSameFtn );
721cdf0e10cSrcweir }
722cdf0e10cSrcweir
723cdf0e10cSrcweir /** inline const wrapper method for <_FindPrevCnt(..)>
724cdf0e10cSrcweir
725cdf0e10cSrcweir OD 2005-11-30 #i27138#
726cdf0e10cSrcweir
727cdf0e10cSrcweir @author OD
728cdf0e10cSrcweir */
FindPrevCnt(const bool _bInSameFtn=false) const729cdf0e10cSrcweir inline const SwCntntFrm* FindPrevCnt( const bool _bInSameFtn = false ) const
730cdf0e10cSrcweir {
731cdf0e10cSrcweir if ( GetPrev() && GetPrev()->IsCntntFrm() )
732cdf0e10cSrcweir return (const SwCntntFrm*)(GetPrev());
733cdf0e10cSrcweir else
734cdf0e10cSrcweir return const_cast<SwFrm*>(this)->_FindPrevCnt( _bInSameFtn );
735cdf0e10cSrcweir }
736cdf0e10cSrcweir
737cdf0e10cSrcweir // --> OD 2007-09-04 #i79774#, #b6596954#
738cdf0e10cSrcweir SwFrm* _GetIndPrev() const;
GetIndPrev() const739cdf0e10cSrcweir SwFrm* GetIndPrev() const
740cdf0e10cSrcweir { return ( pPrev || !IsInSct() ) ? pPrev : _GetIndPrev(); }
741cdf0e10cSrcweir // const SwFrm* GetIndPrev() const { return ((SwFrm*)this)->GetIndPrev(); }
742cdf0e10cSrcweir // <--
GetIndNext()743cdf0e10cSrcweir SwFrm* GetIndNext()
744cdf0e10cSrcweir { return ( pNext || !IsInSct() ) ? pNext : _GetIndNext(); }
GetIndNext() const745cdf0e10cSrcweir const SwFrm* GetIndNext() const { return ((SwFrm*)this)->GetIndNext(); }
746cdf0e10cSrcweir
747cdf0e10cSrcweir sal_uInt16 GetPhyPageNum() const; //Seitennummer ohne Offset
748cdf0e10cSrcweir sal_uInt16 GetVirtPageNum() const; //Seitenummer mit Offset
OnRightPage() const749cdf0e10cSrcweir sal_Bool OnRightPage() const { return 0 != GetPhyPageNum() % 2; };
750cdf0e10cSrcweir sal_Bool WannaRightPage() const;
751cdf0e10cSrcweir
752cdf0e10cSrcweir
753cdf0e10cSrcweir inline const SwLayoutFrm *GetPrevLayoutLeaf() const;
754cdf0e10cSrcweir inline const SwLayoutFrm *GetNextLayoutLeaf() const;
755cdf0e10cSrcweir inline SwLayoutFrm *GetPrevLayoutLeaf();
756cdf0e10cSrcweir inline SwLayoutFrm *GetNextLayoutLeaf();
757cdf0e10cSrcweir
758cdf0e10cSrcweir inline void Calc() const; //Hier wird ggf. 'Formatiert'
759cdf0e10cSrcweir inline void OptCalc() const; //Hier wird zur Optimierung davon ausgegangen,
760cdf0e10cSrcweir //das die Vorgaenger bereits formatiert sind.
761cdf0e10cSrcweir
762cdf0e10cSrcweir inline Point GetRelPos() const;
Frm() const763cdf0e10cSrcweir const SwRect &Frm() const { return aFrm; }
Prt() const764cdf0e10cSrcweir const SwRect &Prt() const { return aPrt; }
765cdf0e10cSrcweir
766cdf0e10cSrcweir // The PaintArea is the area, where content may be displayed.
767cdf0e10cSrcweir // The margin of the page or the space between columns belongs to her.
768cdf0e10cSrcweir const SwRect PaintArea() const;
769cdf0e10cSrcweir // The UnionFrm is the union of frm- and prt-area, normally identical
770cdf0e10cSrcweir // to the frm-area except the case of negative prt-margins.
771cdf0e10cSrcweir const SwRect UnionFrm( sal_Bool bBorder = sal_False ) const;
772cdf0e10cSrcweir
773cdf0e10cSrcweir //Der Zugriff auf die Member wird hier ausnahmsweiste gestattet,
774cdf0e10cSrcweir //dies soll aber nicht dazu dienen die Werte wahllos zu veraendern;
775cdf0e10cSrcweir //es ist nur die einzige Moeglichkeit die Compilerprobleme zu umgehen
776cdf0e10cSrcweir //(gleiche Methode mal public mal protected).
Frm()777cdf0e10cSrcweir SwRect &Frm() { return aFrm; }
Prt()778cdf0e10cSrcweir SwRect &Prt() { return aPrt; }
779cdf0e10cSrcweir
780cdf0e10cSrcweir virtual Size ChgSize( const Size& aNewSize );
781cdf0e10cSrcweir
782cdf0e10cSrcweir virtual void Cut() = 0;
783ca62e2c2SSteve Yin //Solution:Add a method to change the acc table dispose state.
SetAccTableDispose(sal_Bool bDispose)784ca62e2c2SSteve Yin void SetAccTableDispose( sal_Bool bDispose){ bIfAccTableShouldDisposing = bDispose;}
785cdf0e10cSrcweir virtual void Paste( SwFrm* pParent, SwFrm* pSibling = 0 ) = 0;
786cdf0e10cSrcweir
ValidateLineNum()787cdf0e10cSrcweir void ValidateLineNum() { bValidLineNum = sal_True; }
788cdf0e10cSrcweir
GetValidPosFlag() const789cdf0e10cSrcweir sal_Bool GetValidPosFlag() const { return bValidPos; }
GetValidPrtAreaFlag() const790cdf0e10cSrcweir sal_Bool GetValidPrtAreaFlag()const { return bValidPrtArea; }
GetValidSizeFlag() const791cdf0e10cSrcweir sal_Bool GetValidSizeFlag() const { return bValidSize; }
GetValidLineNumFlag() const792cdf0e10cSrcweir sal_Bool GetValidLineNumFlag()const { return bValidLineNum; }
IsValid() const793cdf0e10cSrcweir sal_Bool IsValid() const { return bValidPos && bValidSize && bValidPrtArea; }
794cdf0e10cSrcweir
795cdf0e10cSrcweir //Invalideren nur den Frm
796cdf0e10cSrcweir // OD 2004-05-19 #i28701# - add call to method <_ActionOnInvalidation(..)>
797cdf0e10cSrcweir // for all invalidation methods.
798cdf0e10cSrcweir // OD 2004-05-19 #i28701# - use method <_InvalidationAllowed(..)> to
799cdf0e10cSrcweir // decide, if invalidation will to be performed or not.
800cdf0e10cSrcweir // --> OD 2004-10-08 #i26945# - no additional invalidation, if it's already
801cdf0e10cSrcweir // invalidate.
_InvalidateSize()802cdf0e10cSrcweir void _InvalidateSize()
803cdf0e10cSrcweir {
804cdf0e10cSrcweir if ( bValidSize && _InvalidationAllowed( INVALID_SIZE ) )
805cdf0e10cSrcweir {
806cdf0e10cSrcweir bValidSize = sal_False;
807cdf0e10cSrcweir _ActionOnInvalidation( INVALID_SIZE );
808cdf0e10cSrcweir }
809cdf0e10cSrcweir }
_InvalidatePrt()810cdf0e10cSrcweir void _InvalidatePrt()
811cdf0e10cSrcweir {
812cdf0e10cSrcweir if ( bValidPrtArea && _InvalidationAllowed( INVALID_PRTAREA ) )
813cdf0e10cSrcweir {
814cdf0e10cSrcweir bValidPrtArea = sal_False;
815cdf0e10cSrcweir _ActionOnInvalidation( INVALID_PRTAREA );
816cdf0e10cSrcweir }
817cdf0e10cSrcweir }
_InvalidatePos()818cdf0e10cSrcweir void _InvalidatePos()
819cdf0e10cSrcweir {
820cdf0e10cSrcweir if ( bValidPos && _InvalidationAllowed( INVALID_POS ) )
821cdf0e10cSrcweir {
822cdf0e10cSrcweir bValidPos = sal_False;
823cdf0e10cSrcweir _ActionOnInvalidation( INVALID_POS );
824cdf0e10cSrcweir }
825cdf0e10cSrcweir }
_InvalidateLineNum()826cdf0e10cSrcweir void _InvalidateLineNum()
827cdf0e10cSrcweir {
828cdf0e10cSrcweir if ( bValidLineNum && _InvalidationAllowed( INVALID_LINENUM ) )
829cdf0e10cSrcweir {
830cdf0e10cSrcweir bValidLineNum = sal_False;
831cdf0e10cSrcweir _ActionOnInvalidation( INVALID_LINENUM );
832cdf0e10cSrcweir }
833cdf0e10cSrcweir }
_InvalidateAll()834cdf0e10cSrcweir void _InvalidateAll()
835cdf0e10cSrcweir {
836cdf0e10cSrcweir if ( ( bValidSize || bValidPrtArea || bValidPos ) &&
837cdf0e10cSrcweir _InvalidationAllowed( INVALID_ALL ) )
838cdf0e10cSrcweir {
839cdf0e10cSrcweir bValidSize = bValidPrtArea = bValidPos = sal_False;
840cdf0e10cSrcweir _ActionOnInvalidation( INVALID_ALL );
841cdf0e10cSrcweir }
842cdf0e10cSrcweir }
843cdf0e10cSrcweir // <--
844cdf0e10cSrcweir //Benachrichtigen gleich die Seite mit.
845cdf0e10cSrcweir inline void InvalidateSize();
846cdf0e10cSrcweir inline void InvalidatePrt();
847cdf0e10cSrcweir inline void InvalidatePos();
848cdf0e10cSrcweir inline void InvalidateLineNum();
849cdf0e10cSrcweir inline void InvalidateAll();
850cdf0e10cSrcweir void ImplInvalidateSize();
851cdf0e10cSrcweir void ImplInvalidatePrt();
852cdf0e10cSrcweir void ImplInvalidatePos();
853cdf0e10cSrcweir void ImplInvalidateLineNum();
854cdf0e10cSrcweir
855cdf0e10cSrcweir inline void InvalidateNextPos( sal_Bool bNoFtn = sal_False );
856cdf0e10cSrcweir void ImplInvalidateNextPos( sal_Bool bNoFtn = sal_False );
857cdf0e10cSrcweir
858cdf0e10cSrcweir /** method to invalidate printing area of next frame
859cdf0e10cSrcweir
860cdf0e10cSrcweir OD 09.01.2004 #i11859#
861cdf0e10cSrcweir
862cdf0e10cSrcweir @author OD
863cdf0e10cSrcweir */
864cdf0e10cSrcweir void InvalidateNextPrtArea();
865cdf0e10cSrcweir
866cdf0e10cSrcweir void InvalidatePage( const SwPageFrm *pPage = 0 ) const;
867cdf0e10cSrcweir
868cdf0e10cSrcweir virtual bool FillSelection( SwSelectionList& rList, const SwRect& rRect ) const;
869cdf0e10cSrcweir
870cdf0e10cSrcweir virtual sal_Bool GetCrsrOfst( SwPosition *, Point&,
871cdf0e10cSrcweir SwCrsrMoveState* = 0 ) const;
872cdf0e10cSrcweir virtual sal_Bool GetCharRect( SwRect &, const SwPosition&,
873cdf0e10cSrcweir SwCrsrMoveState* = 0 ) const;
874cdf0e10cSrcweir virtual void Paint( SwRect const&,
875cdf0e10cSrcweir SwPrintData const*const pPrintData = NULL ) const;
876cdf0e10cSrcweir
877cdf0e10cSrcweir // der "kurze Dienstweg" zwischen den Frames und der Formatierung.
878cdf0e10cSrcweir // Wer den void* falsch Casted ist selbst schuld!
879cdf0e10cSrcweir // Auf jedenfall muss der void* auf 0 geprueft werden.
880cdf0e10cSrcweir virtual void Prepare( const PrepareHint ePrep = PREP_CLEAR,
881cdf0e10cSrcweir const void *pVoid = 0, sal_Bool bNotify = sal_True );
882cdf0e10cSrcweir
883cdf0e10cSrcweir //sal_True wenn's die richtige Klasse ist, sal_False sonst
884cdf0e10cSrcweir inline sal_Bool IsLayoutFrm() const;
885cdf0e10cSrcweir inline sal_Bool IsRootFrm() const;
886cdf0e10cSrcweir inline sal_Bool IsPageFrm() const;
887cdf0e10cSrcweir inline sal_Bool IsColumnFrm() const;
888cdf0e10cSrcweir inline sal_Bool IsFtnBossFrm() const; // Fussnotenbosse sind PageFrms und ColumnFrms
889cdf0e10cSrcweir inline sal_Bool IsHeaderFrm() const;
890cdf0e10cSrcweir inline sal_Bool IsFooterFrm() const;
891cdf0e10cSrcweir inline sal_Bool IsFtnContFrm() const;
892cdf0e10cSrcweir inline sal_Bool IsFtnFrm() const;
893cdf0e10cSrcweir inline sal_Bool IsBodyFrm() const;
894cdf0e10cSrcweir inline sal_Bool IsColBodyFrm() const; // in layfrm.hxx implementiert, BodyFrm unterhalb ColumnFrm
895cdf0e10cSrcweir inline sal_Bool IsPageBodyFrm() const; // in layfrm.hxx implementiert, BodyFrm unterhalb PageFrm
896cdf0e10cSrcweir inline sal_Bool IsFlyFrm() const;
897cdf0e10cSrcweir inline sal_Bool IsSctFrm() const;
898cdf0e10cSrcweir inline sal_Bool IsTabFrm() const;
899cdf0e10cSrcweir inline sal_Bool IsRowFrm() const;
900cdf0e10cSrcweir inline sal_Bool IsCellFrm() const;
901cdf0e10cSrcweir inline sal_Bool IsCntntFrm() const;
902cdf0e10cSrcweir inline sal_Bool IsTxtFrm() const;
903cdf0e10cSrcweir inline sal_Bool IsNoTxtFrm() const;
904cdf0e10cSrcweir inline sal_Bool IsFlowFrm() const; //Frms deren PrtArea von den Nachbarn
905cdf0e10cSrcweir //abhaengen und die halt im Inhaltsfluss
906cdf0e10cSrcweir //stehen.
907cdf0e10cSrcweir inline sal_Bool IsRetoucheFrm() const; //Frms die Retouchefaehig sind bzw. die
908cdf0e10cSrcweir //u.U. hinter sich Retouchieren muessen.
909cdf0e10cSrcweir inline sal_Bool IsAccessibleFrm() const;
910cdf0e10cSrcweir
911cdf0e10cSrcweir void PrepareCrsr(); //Die CrsrShell darf.
912cdf0e10cSrcweir
913cdf0e10cSrcweir //Ist der Frm (bzw. die Section in der er steht) geschuetzt?
914cdf0e10cSrcweir //Auch Fly in Fly in ... und Fussnoten
915cdf0e10cSrcweir sal_Bool IsProtected() const;
916cdf0e10cSrcweir
IsColLocked() const917cdf0e10cSrcweir sal_Bool IsColLocked() const { return bColLocked; }
918cdf0e10cSrcweir
919cdf0e10cSrcweir virtual ~SwFrm();
920cdf0e10cSrcweir
921cdf0e10cSrcweir // No inline cause we need the function pointers
922cdf0e10cSrcweir long GetTopMargin() const;
923cdf0e10cSrcweir long GetBottomMargin() const;
924cdf0e10cSrcweir long GetLeftMargin() const;
925cdf0e10cSrcweir long GetRightMargin() const;
926cdf0e10cSrcweir void SetTopBottomMargins( long, long );
927cdf0e10cSrcweir void SetBottomTopMargins( long, long );
928cdf0e10cSrcweir void SetLeftRightMargins( long, long );
929cdf0e10cSrcweir void SetRightLeftMargins( long, long );
930cdf0e10cSrcweir void SetLeftAndWidth( long nLeft, long nWidth );
931cdf0e10cSrcweir void SetTopAndHeight( long nTop, long nHeight );
932cdf0e10cSrcweir void SetRightAndWidth( long nRight, long nWidth );
933cdf0e10cSrcweir void SetBottomAndHeight( long nBottom, long nHeight );
934cdf0e10cSrcweir long GetPrtLeft() const;
935cdf0e10cSrcweir long GetPrtBottom() const;
936cdf0e10cSrcweir long GetPrtRight() const;
937cdf0e10cSrcweir long GetPrtTop() const;
938cdf0e10cSrcweir sal_Bool SetMinLeft( long );
939cdf0e10cSrcweir sal_Bool SetMaxBottom( long );
940cdf0e10cSrcweir sal_Bool SetMaxRight( long );
941cdf0e10cSrcweir sal_Bool SetMinTop( long );
942cdf0e10cSrcweir void MakeBelowPos( const SwFrm*, const SwFrm*, sal_Bool );
943cdf0e10cSrcweir void MakeUpperPos( const SwFrm*, const SwFrm*, sal_Bool );
944cdf0e10cSrcweir void MakeLeftPos( const SwFrm*, const SwFrm*, sal_Bool );
945cdf0e10cSrcweir void MakeRightPos( const SwFrm*, const SwFrm*, sal_Bool );
IsNeighbourFrm() const946cdf0e10cSrcweir inline sal_Bool IsNeighbourFrm() const
947cdf0e10cSrcweir { return GetType() & FRM_NEIGHBOUR ? sal_True : sal_False; }
948cdf0e10cSrcweir
949cdf0e10cSrcweir // --> OD 2006-05-10 #i65250#
GetFrmId() const950cdf0e10cSrcweir inline sal_uInt32 GetFrmId() const { return mnFrmId; }
GetLastFrmId() const951cdf0e10cSrcweir inline sal_uInt32 GetLastFrmId() const { return mnLastFrmId; }
952cdf0e10cSrcweir // <--
953cdf0e10cSrcweir
954cdf0e10cSrcweir // NEW TABELS
955cdf0e10cSrcweir // Some functions for covered/covering table cells. This way unnessessary
956cdf0e10cSrcweir // includes can be avoided
957cdf0e10cSrcweir bool IsLeaveUpperAllowed() const;
958cdf0e10cSrcweir bool IsCoveredCell() const;
959cdf0e10cSrcweir bool IsInCoveredCell() const;
960cdf0e10cSrcweir
961cdf0e10cSrcweir // FME 2007-08-30 #i81146# new loop control
962cdf0e10cSrcweir bool KnowsFormat( const SwFmt& rFmt ) const;
963cdf0e10cSrcweir void RegisterToFormat( SwFmt& rFmt );
964cdf0e10cSrcweir void ValidateThisAndAllLowers( const sal_uInt16 nStage );
965cdf0e10cSrcweir };
966cdf0e10cSrcweir
IsInDocBody() const967cdf0e10cSrcweir inline sal_Bool SwFrm::IsInDocBody() const
968cdf0e10cSrcweir {
969cdf0e10cSrcweir if ( bInfInvalid )
970cdf0e10cSrcweir ((SwFrm*)this)->SetInfFlags();
971cdf0e10cSrcweir return bInfBody;
972cdf0e10cSrcweir }
IsInFtn() const973cdf0e10cSrcweir inline sal_Bool SwFrm::IsInFtn() const
974cdf0e10cSrcweir {
975cdf0e10cSrcweir if ( bInfInvalid )
976cdf0e10cSrcweir ((SwFrm*)this)->SetInfFlags();
977cdf0e10cSrcweir return bInfFtn;
978cdf0e10cSrcweir }
IsInTab() const979cdf0e10cSrcweir inline sal_Bool SwFrm::IsInTab() const
980cdf0e10cSrcweir {
981cdf0e10cSrcweir if ( bInfInvalid )
982cdf0e10cSrcweir ((SwFrm*)this)->SetInfFlags();
983cdf0e10cSrcweir return bInfTab;
984cdf0e10cSrcweir }
IsInFly() const985cdf0e10cSrcweir inline sal_Bool SwFrm::IsInFly() const
986cdf0e10cSrcweir {
987cdf0e10cSrcweir if ( bInfInvalid )
988cdf0e10cSrcweir ((SwFrm*)this)->SetInfFlags();
989cdf0e10cSrcweir return bInfFly;
990cdf0e10cSrcweir }
IsInSct() const991cdf0e10cSrcweir inline sal_Bool SwFrm::IsInSct() const
992cdf0e10cSrcweir {
993cdf0e10cSrcweir if ( bInfInvalid )
994cdf0e10cSrcweir ((SwFrm*)this)->SetInfFlags();
995cdf0e10cSrcweir return bInfSct;
996cdf0e10cSrcweir }
IsVertical() const997cdf0e10cSrcweir sal_Bool SwFrm::IsVertical() const
998cdf0e10cSrcweir {
999cdf0e10cSrcweir if( bInvalidVert )
1000cdf0e10cSrcweir ((SwFrm*)this)->SetDirFlags( sal_True );
1001cdf0e10cSrcweir return bVertical != 0;
1002cdf0e10cSrcweir }
1003cdf0e10cSrcweir //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin
IsVertLR() const1004cdf0e10cSrcweir inline sal_Bool SwFrm::IsVertLR() const
1005cdf0e10cSrcweir {
1006cdf0e10cSrcweir return bVertLR != 0;
1007cdf0e10cSrcweir }
1008cdf0e10cSrcweir //End of SCMS
GetVerticalFlag() const1009cdf0e10cSrcweir sal_Bool SwFrm::GetVerticalFlag() const
1010cdf0e10cSrcweir {
1011cdf0e10cSrcweir return bVertical != 0;
1012cdf0e10cSrcweir }
IsRightToLeft() const1013cdf0e10cSrcweir inline sal_Bool SwFrm::IsRightToLeft() const
1014cdf0e10cSrcweir {
1015cdf0e10cSrcweir if( bInvalidR2L )
1016cdf0e10cSrcweir ((SwFrm*)this)->SetDirFlags( sal_False );
1017cdf0e10cSrcweir return bRightToLeft != 0;
1018cdf0e10cSrcweir }
GetRightToLeftFlag() const1019cdf0e10cSrcweir sal_Bool SwFrm::GetRightToLeftFlag() const
1020cdf0e10cSrcweir {
1021cdf0e10cSrcweir return bRightToLeft != 0;
1022cdf0e10cSrcweir }
1023cdf0e10cSrcweir
SetCompletePaint() const1024cdf0e10cSrcweir inline void SwFrm::SetCompletePaint() const
1025cdf0e10cSrcweir {
1026cdf0e10cSrcweir ((SwFrm*)this)->bCompletePaint = sal_True;
1027cdf0e10cSrcweir }
ResetCompletePaint() const1028cdf0e10cSrcweir inline void SwFrm::ResetCompletePaint() const
1029cdf0e10cSrcweir {
1030cdf0e10cSrcweir ((SwFrm*)this)->bCompletePaint = sal_False;
1031cdf0e10cSrcweir }
1032cdf0e10cSrcweir
SetRetouche() const1033cdf0e10cSrcweir inline void SwFrm::SetRetouche() const
1034cdf0e10cSrcweir {
1035cdf0e10cSrcweir ((SwFrm*)this)->bRetouche = sal_True;
1036cdf0e10cSrcweir }
ResetRetouche() const1037cdf0e10cSrcweir inline void SwFrm::ResetRetouche() const
1038cdf0e10cSrcweir {
1039cdf0e10cSrcweir ((SwFrm*)this)->bRetouche = sal_False;
1040cdf0e10cSrcweir }
1041cdf0e10cSrcweir
GetNextLayoutLeaf()1042cdf0e10cSrcweir inline SwLayoutFrm *SwFrm::GetNextLayoutLeaf()
1043cdf0e10cSrcweir {
1044cdf0e10cSrcweir return (SwLayoutFrm*)((const SwFrm*)this)->GetNextLayoutLeaf();
1045cdf0e10cSrcweir }
1046cdf0e10cSrcweir
GetPrevLayoutLeaf()1047cdf0e10cSrcweir inline SwLayoutFrm *SwFrm::GetPrevLayoutLeaf()
1048cdf0e10cSrcweir {
1049cdf0e10cSrcweir return (SwLayoutFrm*)((const SwFrm*)this)->GetPrevLayoutLeaf();
1050cdf0e10cSrcweir }
1051cdf0e10cSrcweir
GetNextLayoutLeaf() const1052cdf0e10cSrcweir inline const SwLayoutFrm *SwFrm::GetNextLayoutLeaf() const
1053cdf0e10cSrcweir {
1054cdf0e10cSrcweir return ImplGetNextLayoutLeaf( true );
1055cdf0e10cSrcweir }
1056cdf0e10cSrcweir
GetPrevLayoutLeaf() const1057cdf0e10cSrcweir inline const SwLayoutFrm *SwFrm::GetPrevLayoutLeaf() const
1058cdf0e10cSrcweir {
1059cdf0e10cSrcweir return ImplGetNextLayoutLeaf( false );
1060cdf0e10cSrcweir }
1061cdf0e10cSrcweir
InvalidateSize()1062cdf0e10cSrcweir inline void SwFrm::InvalidateSize()
1063cdf0e10cSrcweir {
1064cdf0e10cSrcweir if ( bValidSize )
1065cdf0e10cSrcweir ImplInvalidateSize();
1066cdf0e10cSrcweir }
InvalidatePrt()1067cdf0e10cSrcweir inline void SwFrm::InvalidatePrt()
1068cdf0e10cSrcweir {
1069cdf0e10cSrcweir if ( bValidPrtArea )
1070cdf0e10cSrcweir ImplInvalidatePrt();
1071cdf0e10cSrcweir }
InvalidatePos()1072cdf0e10cSrcweir inline void SwFrm::InvalidatePos()
1073cdf0e10cSrcweir {
1074cdf0e10cSrcweir if ( bValidPos )
1075cdf0e10cSrcweir ImplInvalidatePos();
1076cdf0e10cSrcweir }
InvalidateLineNum()1077cdf0e10cSrcweir inline void SwFrm::InvalidateLineNum()
1078cdf0e10cSrcweir {
1079cdf0e10cSrcweir if ( bValidLineNum )
1080cdf0e10cSrcweir ImplInvalidateLineNum();
1081cdf0e10cSrcweir }
1082cdf0e10cSrcweir
InvalidateAll()1083cdf0e10cSrcweir inline void SwFrm::InvalidateAll()
1084cdf0e10cSrcweir {
1085cdf0e10cSrcweir if ( _InvalidationAllowed( INVALID_ALL ) )
1086cdf0e10cSrcweir {
1087cdf0e10cSrcweir if ( bValidPrtArea && bValidSize && bValidPos )
1088cdf0e10cSrcweir ImplInvalidatePos();
1089cdf0e10cSrcweir bValidPrtArea = bValidSize = bValidPos = sal_False;
1090cdf0e10cSrcweir
1091cdf0e10cSrcweir // OD 2004-05-19 #i28701#
1092cdf0e10cSrcweir _ActionOnInvalidation( INVALID_ALL );
1093cdf0e10cSrcweir }
1094cdf0e10cSrcweir }
1095cdf0e10cSrcweir
InvalidateNextPos(sal_Bool bNoFtn)1096cdf0e10cSrcweir inline void SwFrm::InvalidateNextPos( sal_Bool bNoFtn )
1097cdf0e10cSrcweir {
1098cdf0e10cSrcweir if ( pNext && !pNext->IsSctFrm() )
1099cdf0e10cSrcweir pNext->InvalidatePos();
1100cdf0e10cSrcweir #ifndef C30 // vielleicht geht es ja bei C40 ?
1101cdf0e10cSrcweir else
1102cdf0e10cSrcweir ImplInvalidateNextPos( bNoFtn );
1103cdf0e10cSrcweir #else
1104cdf0e10cSrcweir if ( !pNext )
1105cdf0e10cSrcweir ImplInvalidateNextPos( bNoFtn );
1106cdf0e10cSrcweir #endif
1107cdf0e10cSrcweir }
1108cdf0e10cSrcweir
Calc() const1109cdf0e10cSrcweir inline void SwFrm::Calc() const
1110cdf0e10cSrcweir {
1111cdf0e10cSrcweir if ( !bValidPos || !bValidPrtArea || !bValidSize )
1112cdf0e10cSrcweir ((SwFrm*)this)->PrepareMake();
1113cdf0e10cSrcweir }
OptCalc() const1114cdf0e10cSrcweir inline void SwFrm::OptCalc() const
1115cdf0e10cSrcweir {
1116cdf0e10cSrcweir if ( !bValidPos || !bValidPrtArea || !bValidSize )
1117cdf0e10cSrcweir ((SwFrm*)this)->OptPrepareMake();
1118cdf0e10cSrcweir }
1119cdf0e10cSrcweir
GetRelPos() const1120cdf0e10cSrcweir inline Point SwFrm::GetRelPos() const
1121cdf0e10cSrcweir {
1122cdf0e10cSrcweir Point aRet( aFrm.Pos() );
1123cdf0e10cSrcweir //hier wird gecasted, weil die Klasse SwLayoutFrm nur vorward-
1124cdf0e10cSrcweir //declariert ist.
1125cdf0e10cSrcweir aRet -= ((SwFrm*)GetUpper())->Prt().Pos();
1126cdf0e10cSrcweir aRet -= ((SwFrm*)GetUpper())->Frm().Pos();
1127cdf0e10cSrcweir return aRet;
1128cdf0e10cSrcweir }
1129cdf0e10cSrcweir
FindPageFrm() const1130cdf0e10cSrcweir inline const SwPageFrm *SwFrm::FindPageFrm() const
1131cdf0e10cSrcweir {
1132cdf0e10cSrcweir return ((SwFrm*)this)->FindPageFrm();
1133cdf0e10cSrcweir }
FindColFrm() const1134cdf0e10cSrcweir inline const SwFrm *SwFrm::FindColFrm() const
1135cdf0e10cSrcweir {
1136cdf0e10cSrcweir return ((SwFrm*)this)->FindColFrm();
1137cdf0e10cSrcweir }
FindFooterOrHeader() const1138cdf0e10cSrcweir inline const SwFrm *SwFrm::FindFooterOrHeader() const
1139cdf0e10cSrcweir {
1140cdf0e10cSrcweir return ((SwFrm*)this)->FindFooterOrHeader();
1141cdf0e10cSrcweir }
FindTabFrm()1142cdf0e10cSrcweir inline SwTabFrm *SwFrm::FindTabFrm()
1143cdf0e10cSrcweir {
1144cdf0e10cSrcweir return IsInTab() ? ImplFindTabFrm() : 0;
1145cdf0e10cSrcweir }
FindFtnBossFrm(sal_Bool bFtn) const1146cdf0e10cSrcweir inline const SwFtnBossFrm *SwFrm::FindFtnBossFrm( sal_Bool bFtn ) const
1147cdf0e10cSrcweir {
1148cdf0e10cSrcweir return ((SwFrm*)this)->FindFtnBossFrm( bFtn );
1149cdf0e10cSrcweir }
FindFtnFrm()1150cdf0e10cSrcweir inline SwFtnFrm *SwFrm::FindFtnFrm()
1151cdf0e10cSrcweir {
1152cdf0e10cSrcweir return IsInFtn() ? ImplFindFtnFrm() : 0;
1153cdf0e10cSrcweir }
FindFlyFrm()1154cdf0e10cSrcweir inline SwFlyFrm *SwFrm::FindFlyFrm()
1155cdf0e10cSrcweir {
1156cdf0e10cSrcweir return IsInFly() ? ImplFindFlyFrm() : 0;
1157cdf0e10cSrcweir }
FindSctFrm()1158cdf0e10cSrcweir inline SwSectionFrm *SwFrm::FindSctFrm()
1159cdf0e10cSrcweir {
1160cdf0e10cSrcweir return IsInSct() ? ImplFindSctFrm() : 0;
1161cdf0e10cSrcweir }
1162cdf0e10cSrcweir
FindTabFrm() const1163cdf0e10cSrcweir inline const SwTabFrm *SwFrm::FindTabFrm() const
1164cdf0e10cSrcweir {
1165cdf0e10cSrcweir return IsInTab() ? ((SwFrm*)this)->ImplFindTabFrm() : 0;
1166cdf0e10cSrcweir }
FindFtnFrm() const1167cdf0e10cSrcweir inline const SwFtnFrm *SwFrm::FindFtnFrm() const
1168cdf0e10cSrcweir {
1169cdf0e10cSrcweir return IsInFtn() ? ((SwFrm*)this)->ImplFindFtnFrm() : 0;
1170cdf0e10cSrcweir }
FindFlyFrm() const1171cdf0e10cSrcweir inline const SwFlyFrm *SwFrm::FindFlyFrm() const
1172cdf0e10cSrcweir {
1173cdf0e10cSrcweir return IsInFly() ? ((SwFrm*)this)->ImplFindFlyFrm() : 0;
1174cdf0e10cSrcweir }
FindSctFrm() const1175cdf0e10cSrcweir inline const SwSectionFrm *SwFrm::FindSctFrm() const
1176cdf0e10cSrcweir {
1177cdf0e10cSrcweir return IsInSct() ? ((SwFrm*)this)->ImplFindSctFrm() : 0;
1178cdf0e10cSrcweir }
FindNext()1179cdf0e10cSrcweir inline SwFrm *SwFrm::FindNext()
1180cdf0e10cSrcweir {
1181cdf0e10cSrcweir if ( pNext )
1182cdf0e10cSrcweir return pNext;
1183cdf0e10cSrcweir else
1184cdf0e10cSrcweir return _FindNext();
1185cdf0e10cSrcweir }
FindNext() const1186cdf0e10cSrcweir inline const SwFrm *SwFrm::FindNext() const
1187cdf0e10cSrcweir {
1188cdf0e10cSrcweir if ( pNext )
1189cdf0e10cSrcweir return pNext;
1190cdf0e10cSrcweir else
1191cdf0e10cSrcweir return ((SwFrm*)this)->_FindNext();
1192cdf0e10cSrcweir }
1193cdf0e10cSrcweir // --> OD 2005-12-01 #i27138# - add parameter <_bInSameFtn>
FindNextCnt(const bool _bInSameFtn)1194cdf0e10cSrcweir inline SwCntntFrm *SwFrm::FindNextCnt( const bool _bInSameFtn )
1195cdf0e10cSrcweir {
1196cdf0e10cSrcweir if ( pNext && pNext->IsCntntFrm() )
1197cdf0e10cSrcweir return (SwCntntFrm*)pNext;
1198cdf0e10cSrcweir else
1199cdf0e10cSrcweir return _FindNextCnt( _bInSameFtn );
1200cdf0e10cSrcweir }
1201cdf0e10cSrcweir // <--
1202cdf0e10cSrcweir // --> OD 2005-12-01 #i27138# - add parameter <_bInSameFtn>
FindNextCnt(const bool _bInSameFtn) const1203cdf0e10cSrcweir inline const SwCntntFrm *SwFrm::FindNextCnt( const bool _bInSameFtn ) const
1204cdf0e10cSrcweir {
1205cdf0e10cSrcweir if ( pNext && pNext->IsCntntFrm() )
1206cdf0e10cSrcweir return (SwCntntFrm*)pNext;
1207cdf0e10cSrcweir else
1208cdf0e10cSrcweir return ((SwFrm*)this)->_FindNextCnt( _bInSameFtn );
1209cdf0e10cSrcweir }
1210cdf0e10cSrcweir // <--
FindPrev()1211cdf0e10cSrcweir inline SwFrm *SwFrm::FindPrev()
1212cdf0e10cSrcweir {
1213cdf0e10cSrcweir if ( pPrev && !pPrev->IsSctFrm() )
1214cdf0e10cSrcweir return pPrev;
1215cdf0e10cSrcweir else
1216cdf0e10cSrcweir return _FindPrev();
1217cdf0e10cSrcweir }
FindPrev() const1218cdf0e10cSrcweir inline const SwFrm *SwFrm::FindPrev() const
1219cdf0e10cSrcweir {
1220cdf0e10cSrcweir if ( pPrev && !pPrev->IsSctFrm() )
1221cdf0e10cSrcweir return pPrev;
1222cdf0e10cSrcweir else
1223cdf0e10cSrcweir return ((SwFrm*)this)->_FindPrev();
1224cdf0e10cSrcweir }
1225cdf0e10cSrcweir
1226cdf0e10cSrcweir
IsLayoutFrm() const1227cdf0e10cSrcweir inline sal_Bool SwFrm::IsLayoutFrm() const
1228cdf0e10cSrcweir {
1229cdf0e10cSrcweir return GetType() & FRM_LAYOUT ? sal_True : sal_False;
1230cdf0e10cSrcweir }
IsRootFrm() const1231cdf0e10cSrcweir inline sal_Bool SwFrm::IsRootFrm() const
1232cdf0e10cSrcweir {
1233cdf0e10cSrcweir return nType == FRMC_ROOT;
1234cdf0e10cSrcweir }
IsPageFrm() const1235cdf0e10cSrcweir inline sal_Bool SwFrm::IsPageFrm() const
1236cdf0e10cSrcweir {
1237cdf0e10cSrcweir return nType == FRMC_PAGE;
1238cdf0e10cSrcweir }
IsColumnFrm() const1239cdf0e10cSrcweir inline sal_Bool SwFrm::IsColumnFrm() const
1240cdf0e10cSrcweir {
1241cdf0e10cSrcweir return nType == FRMC_COLUMN;
1242cdf0e10cSrcweir }
IsFtnBossFrm() const1243cdf0e10cSrcweir inline sal_Bool SwFrm::IsFtnBossFrm() const
1244cdf0e10cSrcweir {
1245cdf0e10cSrcweir return GetType() & FRM_FTNBOSS ? sal_True : sal_False;
1246cdf0e10cSrcweir }
IsHeaderFrm() const1247cdf0e10cSrcweir inline sal_Bool SwFrm::IsHeaderFrm() const
1248cdf0e10cSrcweir {
1249cdf0e10cSrcweir return nType == FRMC_HEADER;
1250cdf0e10cSrcweir }
IsFooterFrm() const1251cdf0e10cSrcweir inline sal_Bool SwFrm::IsFooterFrm() const
1252cdf0e10cSrcweir {
1253cdf0e10cSrcweir return nType == FRMC_FOOTER;
1254cdf0e10cSrcweir }
IsFtnContFrm() const1255cdf0e10cSrcweir inline sal_Bool SwFrm::IsFtnContFrm() const
1256cdf0e10cSrcweir {
1257cdf0e10cSrcweir return nType == FRMC_FTNCONT;
1258cdf0e10cSrcweir }
IsFtnFrm() const1259cdf0e10cSrcweir inline sal_Bool SwFrm::IsFtnFrm() const
1260cdf0e10cSrcweir {
1261cdf0e10cSrcweir return nType == FRMC_FTN;
1262cdf0e10cSrcweir }
IsBodyFrm() const1263cdf0e10cSrcweir inline sal_Bool SwFrm::IsBodyFrm() const
1264cdf0e10cSrcweir {
1265cdf0e10cSrcweir return nType == FRMC_BODY;
1266cdf0e10cSrcweir }
IsFlyFrm() const1267cdf0e10cSrcweir inline sal_Bool SwFrm::IsFlyFrm() const
1268cdf0e10cSrcweir {
1269cdf0e10cSrcweir return nType == FRMC_FLY;
1270cdf0e10cSrcweir }
IsSctFrm() const1271cdf0e10cSrcweir inline sal_Bool SwFrm::IsSctFrm() const
1272cdf0e10cSrcweir {
1273cdf0e10cSrcweir return nType == FRMC_SECTION;
1274cdf0e10cSrcweir }
IsTabFrm() const1275cdf0e10cSrcweir inline sal_Bool SwFrm::IsTabFrm() const
1276cdf0e10cSrcweir {
1277cdf0e10cSrcweir return nType == FRMC_TAB;
1278cdf0e10cSrcweir }
IsRowFrm() const1279cdf0e10cSrcweir inline sal_Bool SwFrm::IsRowFrm() const
1280cdf0e10cSrcweir {
1281cdf0e10cSrcweir return nType == FRMC_ROW;
1282cdf0e10cSrcweir }
IsCellFrm() const1283cdf0e10cSrcweir inline sal_Bool SwFrm::IsCellFrm() const
1284cdf0e10cSrcweir {
1285cdf0e10cSrcweir return nType == FRMC_CELL;
1286cdf0e10cSrcweir }
IsCntntFrm() const1287cdf0e10cSrcweir inline sal_Bool SwFrm::IsCntntFrm() const
1288cdf0e10cSrcweir {
1289cdf0e10cSrcweir return GetType() & FRM_CNTNT ? sal_True : sal_False;
1290cdf0e10cSrcweir }
IsTxtFrm() const1291cdf0e10cSrcweir inline sal_Bool SwFrm::IsTxtFrm() const
1292cdf0e10cSrcweir {
1293cdf0e10cSrcweir return nType == FRMC_TXT;
1294cdf0e10cSrcweir }
IsNoTxtFrm() const1295cdf0e10cSrcweir inline sal_Bool SwFrm::IsNoTxtFrm() const
1296cdf0e10cSrcweir {
1297cdf0e10cSrcweir return nType == FRMC_NOTXT;
1298cdf0e10cSrcweir }
IsFlowFrm() const1299cdf0e10cSrcweir inline sal_Bool SwFrm::IsFlowFrm() const
1300cdf0e10cSrcweir {
1301cdf0e10cSrcweir return GetType() & 0xCA00 ? sal_True : sal_False; //TabFrm, CntntFrm, SectionFrm
1302cdf0e10cSrcweir }
IsRetoucheFrm() const1303cdf0e10cSrcweir inline sal_Bool SwFrm::IsRetoucheFrm() const
1304cdf0e10cSrcweir {
1305cdf0e10cSrcweir return GetType() & 0xCA40 ? sal_True : sal_False; //TabFrm, CntntFrm, SectionFrm, Ftnfrm
1306cdf0e10cSrcweir }
IsAccessibleFrm() const1307cdf0e10cSrcweir inline sal_Bool SwFrm::IsAccessibleFrm() const
1308cdf0e10cSrcweir {
1309cdf0e10cSrcweir return GetType() & FRM_ACCESSIBLE ? sal_True : sal_False;
1310cdf0e10cSrcweir }
1311cdf0e10cSrcweir #endif
1312