xref: /aoo42x/main/sw/source/core/inc/pagefrm.hxx (revision a4b2faf0)
11d2dbeb0SAndrew Rist /**************************************************************
260d78278Smseidel  *
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
1060d78278Smseidel  *
111d2dbeb0SAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
1260d78278Smseidel  *
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.
1960d78278Smseidel  *
201d2dbeb0SAndrew Rist  *************************************************************/
211d2dbeb0SAndrew Rist 
221d2dbeb0SAndrew Rist 
2360d78278Smseidel 
24cdf0e10cSrcweir #ifndef _PAGEFRM_HXX
25cdf0e10cSrcweir #define _PAGEFRM_HXX
26cdf0e10cSrcweir 
27cdf0e10cSrcweir 
28cdf0e10cSrcweir #include <svl/svarray.hxx>
29cdf0e10cSrcweir 
30cdf0e10cSrcweir #include "ftnboss.hxx"
31cdf0e10cSrcweir #include <tools/mempool.hxx>
32cdf0e10cSrcweir 
33cdf0e10cSrcweir #include <SidebarWindowsTypes.hxx>
34cdf0e10cSrcweir 
35cdf0e10cSrcweir class SwFlyFrm;
36cdf0e10cSrcweir class SwFlyFrmFmt;
37cdf0e10cSrcweir class SwPageDesc;
38cdf0e10cSrcweir class SwCntntFrm;
39cdf0e10cSrcweir struct SwPosition;
40cdf0e10cSrcweir struct SwCrsrMoveState;
41cdf0e10cSrcweir class SdrObject;
42cdf0e10cSrcweir class SwAttrSetChg;
43cdf0e10cSrcweir class Font;
44cdf0e10cSrcweir 
45cdf0e10cSrcweir // OD 2004-05-07 #i28701# - replaced by class <SwSortedObjs>
46cdf0e10cSrcweir //SV_DECL_PTRARR_SORT(SwSortDrawObjs,SdrObjectPtr,1,2);
47cdf0e10cSrcweir class SwSortedObjs;
48cdf0e10cSrcweir // --> OD 2004-07-02 #i28701#
49cdf0e10cSrcweir class SwAnchoredObject;
50cdf0e10cSrcweir // <--
51cdf0e10cSrcweir 
52cdf0e10cSrcweir enum SwPageChg
53cdf0e10cSrcweir {
54cdf0e10cSrcweir 	CHG_NEWPAGE,
55cdf0e10cSrcweir 	CHG_CUTPAGE,
56cdf0e10cSrcweir 	CHG_CHGPAGE
57cdf0e10cSrcweir };
58cdf0e10cSrcweir 
59cdf0e10cSrcweir class SwPageFrm: public SwFtnBossFrm
60cdf0e10cSrcweir {
61cdf0e10cSrcweir 	friend class SwFrm;
62cdf0e10cSrcweir 
63cdf0e10cSrcweir     // OD 2004-05-07 #i28701# - use <SwSortedObjs>
64cdf0e10cSrcweir     SwSortedObjs *pSortedObjs;
65cdf0e10cSrcweir 
66cdf0e10cSrcweir 	SwPageDesc *pDesc;		//PageDesc der die Seite beschreibt.
67cdf0e10cSrcweir 
68cdf0e10cSrcweir 	sal_uInt16	nPhyPageNum;		//Physikalische Seitennummer.
69cdf0e10cSrcweir 
7060d78278Smseidel 	sal_Bool bInvalidCntnt			:1;
7160d78278Smseidel 	sal_Bool bInvalidLayout			:1;
7260d78278Smseidel 	sal_Bool bInvalidFlyCntnt		:1;
7360d78278Smseidel 	sal_Bool bInvalidFlyLayout		:1;
7460d78278Smseidel 	sal_Bool bInvalidFlyInCnt		:1;
7560d78278Smseidel 	sal_Bool bFtnPage				:1;	//Diese Seite ist fuer Dokumentende-Fussnoten.
7660d78278Smseidel 	sal_Bool bEmptyPage				:1; //Dies ist eine explizite Leerseite
7760d78278Smseidel 	sal_Bool bEndNotePage			:1; //'Fussnotenseite' fuer Endnoten
7860d78278Smseidel 	sal_Bool bInvalidSpelling		:1; //Das Online-Spelling ist gefordert
7960d78278Smseidel 	sal_Bool bInvalidSmartTags		:1; //checking for smarttags is needed // SMARTTAGS
8060d78278Smseidel 	sal_Bool bInvalidAutoCmplWrds	:1; //Auto-Complete Wordliste aktualisieren
8160d78278Smseidel 	sal_Bool bInvalidWordCount		:1;
8260d78278Smseidel 	sal_Bool bHasGrid				:1; // Grid for Asian layout
83cdf0e10cSrcweir 
84cdf0e10cSrcweir     // OD 2004-05-17 #i28701# - boolean, indicating that layout of page frame
85cdf0e10cSrcweir     // is in progress.
86cdf0e10cSrcweir     bool mbLayoutInProgress;
87cdf0e10cSrcweir 
88cdf0e10cSrcweir     // OD 12.02.2003 #i9719#, #105645#
89cdf0e10cSrcweir     static const sal_Int8 mnBorderPxWidth;
90cdf0e10cSrcweir 
91cdf0e10cSrcweir 	void _UpdateAttr( const SfxPoolItem*, const SfxPoolItem*, sal_uInt8 &,
92cdf0e10cSrcweir 					  SwAttrSetChg *pa = 0, SwAttrSetChg *pb = 0 );
93cdf0e10cSrcweir 
94cdf0e10cSrcweir 	// Anpassen der max. Fussnotenhoehen in den einzelnen Spalten
95cdf0e10cSrcweir 	void SetColMaxFtnHeight();
96cdf0e10cSrcweir 
97cdf0e10cSrcweir     /** determine rectangle for page border
98cdf0e10cSrcweir 
99cdf0e10cSrcweir         OD 12.02.2003 for #i9719# and #105645#
100cdf0e10cSrcweir 
101cdf0e10cSrcweir         @author OD
102cdf0e10cSrcweir 
103cdf0e10cSrcweir         @param _rPageRect
104cdf0e10cSrcweir         input parameter - constant instance reference of the page rectangle.
105cdf0e10cSrcweir         Generally, it's the frame area of the page, but for empty pages in print
106cdf0e10cSrcweir         preview, this parameter is useful.
107cdf0e10cSrcweir 
108cdf0e10cSrcweir         @param _pViewShell
109cdf0e10cSrcweir         input parameter - instance of the view shell, for which the rectangle
110cdf0e10cSrcweir         has to be generated.
111cdf0e10cSrcweir 
112cdf0e10cSrcweir         @param _orBorderRect
113cdf0e10cSrcweir         output parameter - instance reference of the border rectangle for
114cdf0e10cSrcweir         the given page rectangle
115cdf0e10cSrcweir     */
116cdf0e10cSrcweir     static void GetBorderRect( const SwRect& _rPageRect,
117cdf0e10cSrcweir                                ViewShell*    _pViewShell,
118cdf0e10cSrcweir                                SwRect& _orBorderRect,
119cdf0e10cSrcweir                                bool bRightSidebar );
120cdf0e10cSrcweir 
121cdf0e10cSrcweir     /** determine rectangle for right page shadow
122cdf0e10cSrcweir 
123cdf0e10cSrcweir         OD 12.02.2003 for #i9719# and #105645#
124cdf0e10cSrcweir 
125cdf0e10cSrcweir         @author OD
126cdf0e10cSrcweir 
127cdf0e10cSrcweir         @param _rPageRect
128cdf0e10cSrcweir         input parameter - constant instance reference of the page rectangle.
129cdf0e10cSrcweir         Generally, it's the frame area of the page, but for empty pages in print
130cdf0e10cSrcweir         preview, this parameter is useful.
131cdf0e10cSrcweir 
132cdf0e10cSrcweir         @param _pViewShell
133cdf0e10cSrcweir         input parameter - instance of the view shell, for which the rectangle
134cdf0e10cSrcweir         has to be generated.
135cdf0e10cSrcweir 
136cdf0e10cSrcweir         @param _orRightShadowRect
137cdf0e10cSrcweir         output parameter - instance reference of the right shadow rectangle for
138cdf0e10cSrcweir         the given page rectangle
139cdf0e10cSrcweir     */
140cdf0e10cSrcweir     static void GetRightShadowRect( const SwRect& _rPageRect,
141cdf0e10cSrcweir                                     ViewShell*    _pViewShell,
142cdf0e10cSrcweir                                     SwRect&       _orRightShadowRect,
143cdf0e10cSrcweir                                     bool bRightSidebar );
144cdf0e10cSrcweir 
145cdf0e10cSrcweir     /** determine rectangle for bottom page shadow
146cdf0e10cSrcweir 
147cdf0e10cSrcweir         OD 12.02.2003 for #i9719# and #105645#
148cdf0e10cSrcweir 
149cdf0e10cSrcweir         @author OD
150cdf0e10cSrcweir 
151cdf0e10cSrcweir         @param _rPageRect
152cdf0e10cSrcweir         input parameter - constant instance reference of the page rectangle.
153cdf0e10cSrcweir         Generally, it's the frame area of the page, but for empty pages in print
154cdf0e10cSrcweir         preview, this parameter is useful.
155cdf0e10cSrcweir 
156cdf0e10cSrcweir         @param _pViewShell
157cdf0e10cSrcweir         input parameter - instance of the view shell, for which the rectangle
158cdf0e10cSrcweir         has to be generated.
159cdf0e10cSrcweir 
160cdf0e10cSrcweir         @param _orBottomShadowRect
161cdf0e10cSrcweir         output parameter - instance reference of the bottom shadow rectangle for
162cdf0e10cSrcweir         the given page rectangle
163cdf0e10cSrcweir     */
164cdf0e10cSrcweir 
165cdf0e10cSrcweir     static void GetBottomShadowRect( const SwRect& _rPageRect,
166cdf0e10cSrcweir                                      ViewShell*    _pViewShell,
167cdf0e10cSrcweir                                      SwRect&       _orBottomShadowRect,
168cdf0e10cSrcweir                                      bool bRightSidebar );
169cdf0e10cSrcweir 
17060d78278Smseidel     /** adds the sidebar used for comments to right and left border
171cdf0e10cSrcweir         mod 20.10.2007 for #i6193#
172cdf0e10cSrcweir 
173cdf0e10cSrcweir         @author mod
174cdf0e10cSrcweir 
175cdf0e10cSrcweir         @param aRect
176cdf0e10cSrcweir         input parameter - current rect, we change borders if we want a sidebar
177cdf0e10cSrcweir 
178cdf0e10cSrcweir         @param _pViewShell
179cdf0e10cSrcweir         input parameter - instance of the view shell, for which the rectangle
180cdf0e10cSrcweir         has to be generated.
181cdf0e10cSrcweir 
182cdf0e10cSrcweir         @param bPx
183cdf0e10cSrcweir         input parameter - if set to true, we add in pixel
184cdf0e10cSrcweir     */
185cdf0e10cSrcweir     static void AddSidebarBorders( Rectangle& aRect, ViewShell* _pViewShell, bool bRight, bool bPx = false);
186cdf0e10cSrcweir     static void AddSidebarBorders(       SwRect& aRect, ViewShell* _pViewShell, bool bRight, bool bPx = false);
187cdf0e10cSrcweir 
188cdf0e10cSrcweir protected:
189cdf0e10cSrcweir 	virtual void MakeAll();
190cdf0e10cSrcweir 	virtual void Modify( const SfxPoolItem*, const SfxPoolItem* );
191cdf0e10cSrcweir 
192cdf0e10cSrcweir public:
193cdf0e10cSrcweir 	DECL_FIXEDMEMPOOL_NEWDEL(SwPageFrm)
194cdf0e10cSrcweir 
195cdf0e10cSrcweir 	SwPageFrm( SwFrmFmt*, SwFrm*, SwPageDesc* );
196cdf0e10cSrcweir 	~SwPageFrm();
197cdf0e10cSrcweir 
198cdf0e10cSrcweir 	//public, damit die ViewShell beim Umschalten vom BrowseMode darauf
199cdf0e10cSrcweir 	//zugreifen kann.
200cdf0e10cSrcweir 	void PrepareHeader();	//Kopf-/Fusszeilen anlegen/entfernen.
201cdf0e10cSrcweir 	void PrepareFooter();
202cdf0e10cSrcweir 
GetSortedObjs() const203cdf0e10cSrcweir     const SwSortedObjs  *GetSortedObjs() const  { return pSortedObjs; }
GetSortedObjs()204cdf0e10cSrcweir           SwSortedObjs  *GetSortedObjs()          { return pSortedObjs; }
205cdf0e10cSrcweir 
206cdf0e10cSrcweir     // --> OD 2004-07-02 #i28701# - new methods to append/remove drawing objects
207cdf0e10cSrcweir     void AppendDrawObjToPage( SwAnchoredObject& _rNewObj );
208cdf0e10cSrcweir     void RemoveDrawObjFromPage( SwAnchoredObject& _rToRemoveObj );
209cdf0e10cSrcweir     // <--
210cdf0e10cSrcweir 
211cdf0e10cSrcweir     void AppendFlyToPage( SwFlyFrm *pNew );
212cdf0e10cSrcweir     void RemoveFlyFromPage( SwFlyFrm *pToRemove );
213cdf0e10cSrcweir 	void MoveFly( SwFlyFrm *pToMove, SwPageFrm *pDest );//optimiertes Remove/Append
214cdf0e10cSrcweir 
215cdf0e10cSrcweir 	void  SetPageDesc( SwPageDesc *, SwFrmFmt * );
GetPageDesc()216cdf0e10cSrcweir 		  SwPageDesc *GetPageDesc() { return pDesc; }
GetPageDesc() const217cdf0e10cSrcweir 	const SwPageDesc *GetPageDesc() const { return pDesc; }
218cdf0e10cSrcweir 		  SwPageDesc *FindPageDesc();
219cdf0e10cSrcweir 
220cdf0e10cSrcweir 				 SwCntntFrm  *FindLastBodyCntnt();
221cdf0e10cSrcweir 	inline 		 SwCntntFrm	 *FindFirstBodyCntnt();
222cdf0e10cSrcweir 	inline const SwCntntFrm  *FindFirstBodyCntnt() const;
223cdf0e10cSrcweir 	inline const SwCntntFrm  *FindLastBodyCntnt() const;
224cdf0e10cSrcweir 
225cdf0e10cSrcweir 	//Spezialisiertes GetCntntPos() fuer Felder in Rahmen.
226cdf0e10cSrcweir 	void GetCntntPosition( const Point &rPt, SwPosition &rPos ) const;
227cdf0e10cSrcweir 
IsEmptyPage() const228cdf0e10cSrcweir 	sal_Bool IsEmptyPage() const { return bEmptyPage; } //explizite Leerseite.
229cdf0e10cSrcweir 
230cdf0e10cSrcweir 	void	UpdateFtnNum();
231cdf0e10cSrcweir 
232cdf0e10cSrcweir 	//Immer nach dem Paste rufen. Erzeugt die Seitengeb. Rahmen und Formatiert
233cdf0e10cSrcweir 	//generischen Inhalt.
234cdf0e10cSrcweir 	void PreparePage( sal_Bool bFtn );
235cdf0e10cSrcweir 
236cdf0e10cSrcweir 	//Schickt an alle ContentFrames ein Prepare wg. geaenderter Registervorlage
237cdf0e10cSrcweir 	void PrepareRegisterChg();
238cdf0e10cSrcweir 
239cdf0e10cSrcweir     // --> OD 2005-06-09 #i50432# - adjust method description and synopsis.
240cdf0e10cSrcweir     // Appends a fly frame - the given one or a new one - at the page frame.
241cdf0e10cSrcweir     // Needed for <Modify> and <MakeFrms>
242cdf0e10cSrcweir     // - return value not needed any more
243cdf0e10cSrcweir     // - second parameter is of type <SwFlyFrmFmt*>
244cdf0e10cSrcweir     // - third parameter only needed for assertion, but calling method assures
245cdf0e10cSrcweir     //   this assertion. Thus, delete it.
246cdf0e10cSrcweir     void PlaceFly( SwFlyFrm* pFly, SwFlyFrmFmt* pFmt );
247cdf0e10cSrcweir     // <--
248cdf0e10cSrcweir 
249cdf0e10cSrcweir 	virtual sal_Bool GetCrsrOfst( SwPosition *, Point&,
250cdf0e10cSrcweir 							  SwCrsrMoveState* = 0 ) const;
251cdf0e10cSrcweir 		// erfrage vom Client Informationen
252cdf0e10cSrcweir 	virtual sal_Bool GetInfo( SfxPoolItem& ) const;
253cdf0e10cSrcweir 
254cdf0e10cSrcweir 	virtual void Cut();
255cdf0e10cSrcweir 	virtual void Paste( SwFrm* pParent, SwFrm* pSibling = 0 );
25660d78278Smseidel 	virtual void CheckDirection( sal_Bool bVert );
25760d78278Smseidel 	void CheckGrid( sal_Bool bInvalidate );
25860d78278Smseidel 	void PaintGrid( OutputDevice* pOut, SwRect &rRect ) const;
HasGrid() const25960d78278Smseidel 	sal_Bool HasGrid() const { return bHasGrid; }
260cdf0e10cSrcweir 
26160d78278Smseidel 	//Zeilennummern usw. malen
262cdf0e10cSrcweir 	void RefreshExtraData( const SwRect & ) const;
263cdf0e10cSrcweir 
264cdf0e10cSrcweir 	//Hilfslinien malen.
265cdf0e10cSrcweir 	void RefreshSubsidiary( const SwRect& ) const;
266cdf0e10cSrcweir 
267cdf0e10cSrcweir 	//Fussnotenschnittstelle
IsFtnPage() const268cdf0e10cSrcweir 	sal_Bool IsFtnPage() const									{ return bFtnPage; }
IsEndNotePage() const269cdf0e10cSrcweir 	sal_Bool IsEndNotePage() const								{ return bEndNotePage; }
SetFtnPage(sal_Bool b)270cdf0e10cSrcweir 	void SetFtnPage( sal_Bool b )								{ bFtnPage = b; }
SetEndNotePage(sal_Bool b)271cdf0e10cSrcweir 	void SetEndNotePage( sal_Bool b )							{ bEndNotePage = b; }
272cdf0e10cSrcweir 
GetPhyPageNum() const273cdf0e10cSrcweir 	inline	sal_uInt16 GetPhyPageNum() const	    { return nPhyPageNum;}
SetPhyPageNum(sal_uInt16 nNum)274cdf0e10cSrcweir 	inline	void SetPhyPageNum( sal_uInt16 nNum )	{ nPhyPageNum = nNum;}
DecrPhyPageNum()275cdf0e10cSrcweir 	inline	void DecrPhyPageNum()				{ --nPhyPageNum;	 }
IncrPhyPageNum()276cdf0e10cSrcweir 	inline	void IncrPhyPageNum()				{ ++nPhyPageNum;	 }
277cdf0e10cSrcweir 
278cdf0e10cSrcweir 	//Validieren, invalidieren und abfragen des Status der Seite.
279cdf0e10cSrcweir 	//Layout/Cntnt und jeweils Fly/nicht Fly werden getrennt betrachtet.
280cdf0e10cSrcweir 	inline void InvalidateFlyLayout() const;
281cdf0e10cSrcweir 	inline void InvalidateFlyCntnt() const;
282cdf0e10cSrcweir 	inline void InvalidateFlyInCnt() const;
283cdf0e10cSrcweir 	inline void	InvalidateLayout() const;
284cdf0e10cSrcweir 	inline void	InvalidateCntnt() const;
285cdf0e10cSrcweir 	inline void	InvalidateSpelling() const;
28660d78278Smseidel 	inline void InvalidateSmartTags() const;
287cdf0e10cSrcweir 	inline void	InvalidateAutoCompleteWords() const;
28860d78278Smseidel 	inline void InvalidateWordCount() const;
289cdf0e10cSrcweir 	inline void ValidateFlyLayout() const;
290cdf0e10cSrcweir 	inline void ValidateFlyCntnt() const;
291cdf0e10cSrcweir 	inline void ValidateFlyInCnt() const;
292cdf0e10cSrcweir 	inline void	ValidateLayout() const;
293cdf0e10cSrcweir 	inline void	ValidateCntnt()	const;
294cdf0e10cSrcweir 	inline void	ValidateSpelling()	const;
29560d78278Smseidel 	inline void ValidateSmartTags() const; // SMARTTAGS
29660d78278Smseidel 	inline void ValidateAutoCompleteWords() const;
29760d78278Smseidel 	inline void ValidateWordCount() const;
298cdf0e10cSrcweir 	inline sal_Bool IsInvalid() const;
299cdf0e10cSrcweir 	inline sal_Bool IsInvalidFly() const;
IsInvalidFlyLayout() const300cdf0e10cSrcweir 	sal_Bool IsInvalidFlyLayout() const { return bInvalidFlyLayout; }
IsInvalidFlyCntnt() const301cdf0e10cSrcweir 	sal_Bool IsInvalidFlyCntnt() const { return bInvalidFlyCntnt; }
IsInvalidFlyInCnt() const302cdf0e10cSrcweir 	sal_Bool IsInvalidFlyInCnt() const { return bInvalidFlyInCnt; }
IsInvalidLayout() const303cdf0e10cSrcweir 	sal_Bool IsInvalidLayout() const { return bInvalidLayout; }
IsInvalidCntnt() const304cdf0e10cSrcweir 	sal_Bool IsInvalidCntnt() const { return (bInvalidCntnt || bInvalidFlyInCnt); }
IsInvalidSpelling() const305cdf0e10cSrcweir 	sal_Bool IsInvalidSpelling() const { return bInvalidSpelling; }
IsInvalidSmartTags() const30660d78278Smseidel 	sal_Bool IsInvalidSmartTags() const { return bInvalidSmartTags; } // SMARTTAGS
IsInvalidAutoCompleteWords() const307cdf0e10cSrcweir 	sal_Bool IsInvalidAutoCompleteWords() const { return bInvalidAutoCmplWrds; }
IsInvalidWordCount() const30860d78278Smseidel 	sal_Bool IsInvalidWordCount() const { return bInvalidWordCount; }
309cdf0e10cSrcweir 
310cdf0e10cSrcweir     /** SwPageFrm::GetDrawBackgrdColor - for #102450#
311cdf0e10cSrcweir 
312cdf0e10cSrcweir         29.08.2002:
313cdf0e10cSrcweir         determine the color, that is respectively will be drawn as background
314cdf0e10cSrcweir         for the page frame.
315cdf0e10cSrcweir 
316cdf0e10cSrcweir         @author OD
317cdf0e10cSrcweir 
318cdf0e10cSrcweir         @return reference to an instance of class Color
319cdf0e10cSrcweir     */
320987f0866SArmin Le Grand     const Color GetDrawBackgrdColor() const;
321cdf0e10cSrcweir 
322cdf0e10cSrcweir     /** paint margin area of a page
323cdf0e10cSrcweir 
324cdf0e10cSrcweir         OD 20.11.2002 for #104598#:
325cdf0e10cSrcweir         implement paint of margin area; margin area will be painted for a
326cdf0e10cSrcweir         view shell with a window and if the document is not in online layout.
327cdf0e10cSrcweir 
328cdf0e10cSrcweir         @author OD
329cdf0e10cSrcweir 
330cdf0e10cSrcweir         @param _rOutputRect
331cdf0e10cSrcweir         input parameter - constant instance reference of the rectangle, for
332cdf0e10cSrcweir         which an output has to be generated.
333cdf0e10cSrcweir 
334cdf0e10cSrcweir         @param _pViewShell
335cdf0e10cSrcweir         input parameter - instance of the view shell, on which the output
336cdf0e10cSrcweir         has to be generated.
337cdf0e10cSrcweir     */
338cdf0e10cSrcweir     void PaintMarginArea( const SwRect& _rOutputRect,
339cdf0e10cSrcweir                           ViewShell* _pViewShell ) const;
340cdf0e10cSrcweir 
341ad095790Smseidel     /** paint page border (shadow removed now)
342cdf0e10cSrcweir 
343cdf0e10cSrcweir         OD 12.02.2003 for #i9719# and #105645#
344ad095790Smseidel         implement painting of page border
345cdf0e10cSrcweir 
346cdf0e10cSrcweir         @author OD
347cdf0e10cSrcweir 
348cdf0e10cSrcweir         @param _rPageRect
349cdf0e10cSrcweir         input parameter - constant instance reference of the page rectangle.
350cdf0e10cSrcweir         Generally, it's the frame area of the page, but for empty pages in print
351cdf0e10cSrcweir         preview, this parameter is useful.
352cdf0e10cSrcweir 
353cdf0e10cSrcweir         @param _pViewShell
354cdf0e10cSrcweir         input parameter - instance of the view shell, on which the output
355cdf0e10cSrcweir         has to be generated.
356cdf0e10cSrcweir     */
357*a4b2faf0Smseidel     static void PaintPageBorder( const SwRect& _rPageRect,
358*a4b2faf0Smseidel                                  ViewShell*    _pViewShell,
359*a4b2faf0Smseidel                                  bool bRightSidebar );
360cdf0e10cSrcweir 
361cdf0e10cSrcweir     /** get bound rectangle of border and shadow for repaints
362cdf0e10cSrcweir 
363cdf0e10cSrcweir         OD 12.02.2003 for #i9719# and #105645#
364cdf0e10cSrcweir 
365cdf0e10cSrcweir         author OD
366cdf0e10cSrcweir 
367cdf0e10cSrcweir         @param _rPageRect
368cdf0e10cSrcweir         input parameter - constant instance reference of the page rectangle.
369cdf0e10cSrcweir         Generally, it's the frame area of the page, but for empty pages in print
370cdf0e10cSrcweir         preview, this parameter is useful.
371cdf0e10cSrcweir 
372cdf0e10cSrcweir         @param _pViewShell
373cdf0e10cSrcweir         input parameter - instance of the view shell, for which the rectangle
374cdf0e10cSrcweir         has to be generated.
375cdf0e10cSrcweir 
376cdf0e10cSrcweir         @param _orBorderAndShadowBoundRect
377cdf0e10cSrcweir         output parameter - instance reference of the bounded border and shadow
378cdf0e10cSrcweir         rectangle for the given page rectangle
379cdf0e10cSrcweir     */
380cdf0e10cSrcweir     static void GetBorderAndShadowBoundRect( const SwRect& _rPageRect,
381cdf0e10cSrcweir                                              ViewShell*    _pViewShell,
382cdf0e10cSrcweir                                              SwRect& _orBorderAndShadowBoundRect,
383cdf0e10cSrcweir                                              const bool bRightSidebar );
384cdf0e10cSrcweir 
385cdf0e10cSrcweir     static void PaintNotesSidebar(const SwRect& _rPageRect, ViewShell* _pViewShell, sal_uInt16 nPageNum, bool bRight);
386cdf0e10cSrcweir     static void PaintNotesSidebarArrows(const Point &aMiddleFirst, const Point &aMiddleSecond, ViewShell* _pViewShell, const Color aColorUp, const Color aColorDown);
387cdf0e10cSrcweir 	/**
388cdf0e10cSrcweir 		mod #6i193#
389cdf0e10cSrcweir 
39060d78278Smseidel 		asks the page on which side a margin should be shown, e.g. for comments
391cdf0e10cSrcweir 		returns true for left side, false for right side
392cdf0e10cSrcweir 	*/
393cdf0e10cSrcweir     sw::sidebarwindows::SidebarPosition SidebarPosition() const;
394cdf0e10cSrcweir 
395cdf0e10cSrcweir 	virtual bool FillSelection( SwSelectionList& rList, const SwRect& rRect ) const;
396cdf0e10cSrcweir 
397cdf0e10cSrcweir     // OD 12.02.2003 #i9719#, #105645#
BorderPxWidth() const398cdf0e10cSrcweir     inline sal_Int8 BorderPxWidth() const
399cdf0e10cSrcweir     {
400cdf0e10cSrcweir         return mnBorderPxWidth;
401cdf0e10cSrcweir     }
402cdf0e10cSrcweir 
403cdf0e10cSrcweir     // OD 22.09.2003 #110978#
404cdf0e10cSrcweir     const SwRect PrtWithoutHeaderAndFooter() const;
405cdf0e10cSrcweir 
406cdf0e10cSrcweir     // OD 2004-05-17 #i28701#
IsLayoutInProgress() const407cdf0e10cSrcweir     inline bool IsLayoutInProgress() const
408cdf0e10cSrcweir     {
409cdf0e10cSrcweir         return mbLayoutInProgress;
410cdf0e10cSrcweir     }
SetLayoutInProgress(const bool _bLayoutInProgress)411cdf0e10cSrcweir     inline void SetLayoutInProgress( const bool _bLayoutInProgress )
412cdf0e10cSrcweir     {
413cdf0e10cSrcweir         mbLayoutInProgress = _bLayoutInProgress;
414cdf0e10cSrcweir     }
415cdf0e10cSrcweir 
416cdf0e10cSrcweir     // in case this is am empty page, this function returns the 'reference' page
417cdf0e10cSrcweir     const SwPageFrm& GetFormatPage() const;
418cdf0e10cSrcweir 
419cdf0e10cSrcweir     // return font used to paint the "empty page" string
420cdf0e10cSrcweir     static const Font& GetEmptyPageFont();
421cdf0e10cSrcweir 
422cdf0e10cSrcweir     static SwTwips GetSidebarBorderWidth( const ViewShell* );
423cdf0e10cSrcweir };
424cdf0e10cSrcweir 
FindFirstBodyCntnt()425cdf0e10cSrcweir inline SwCntntFrm *SwPageFrm::FindFirstBodyCntnt()
426cdf0e10cSrcweir {
427cdf0e10cSrcweir 	SwLayoutFrm *pBody = FindBodyCont();
428cdf0e10cSrcweir 	return pBody ? pBody->ContainsCntnt() : 0;
429cdf0e10cSrcweir }
FindFirstBodyCntnt() const430cdf0e10cSrcweir inline const SwCntntFrm *SwPageFrm::FindFirstBodyCntnt() const
431cdf0e10cSrcweir {
432cdf0e10cSrcweir 	const SwLayoutFrm *pBody = FindBodyCont();
433cdf0e10cSrcweir 	return pBody ? pBody->ContainsCntnt() : 0;
434cdf0e10cSrcweir }
FindLastBodyCntnt() const435cdf0e10cSrcweir inline const SwCntntFrm *SwPageFrm::FindLastBodyCntnt() const
436cdf0e10cSrcweir {
437cdf0e10cSrcweir 	return ((SwPageFrm*)this)->FindLastBodyCntnt();
438cdf0e10cSrcweir }
InvalidateFlyLayout() const439cdf0e10cSrcweir inline void	SwPageFrm::InvalidateFlyLayout() const
440cdf0e10cSrcweir {
441cdf0e10cSrcweir 	((SwPageFrm*)this)->bInvalidFlyLayout = sal_True;
442cdf0e10cSrcweir }
InvalidateFlyCntnt() const443cdf0e10cSrcweir inline void	SwPageFrm::InvalidateFlyCntnt() const
444cdf0e10cSrcweir {
445cdf0e10cSrcweir 	((SwPageFrm*)this)->bInvalidFlyCntnt = sal_True;
446cdf0e10cSrcweir }
InvalidateFlyInCnt() const447cdf0e10cSrcweir inline void SwPageFrm::InvalidateFlyInCnt() const
448cdf0e10cSrcweir {
449cdf0e10cSrcweir 	((SwPageFrm*)this)->bInvalidFlyInCnt = sal_True;
450cdf0e10cSrcweir }
InvalidateLayout() const451cdf0e10cSrcweir inline void	SwPageFrm::InvalidateLayout() const
452cdf0e10cSrcweir {
453cdf0e10cSrcweir 	((SwPageFrm*)this)->bInvalidLayout = sal_True;
454cdf0e10cSrcweir }
InvalidateCntnt() const455cdf0e10cSrcweir inline void	SwPageFrm::InvalidateCntnt() const
456cdf0e10cSrcweir {
457cdf0e10cSrcweir 	((SwPageFrm*)this)->bInvalidCntnt = sal_True;
458cdf0e10cSrcweir }
InvalidateSpelling() const459cdf0e10cSrcweir inline void	SwPageFrm::InvalidateSpelling() const
460cdf0e10cSrcweir {
461cdf0e10cSrcweir 	((SwPageFrm*)this)->bInvalidSpelling = sal_True;
462cdf0e10cSrcweir }
463cdf0e10cSrcweir // SMARTTAGS
InvalidateSmartTags() const46460d78278Smseidel inline void SwPageFrm::InvalidateSmartTags() const
465cdf0e10cSrcweir {
46660d78278Smseidel 	((SwPageFrm*)this)->bInvalidSmartTags = sal_True;
467cdf0e10cSrcweir }
InvalidateAutoCompleteWords() const468cdf0e10cSrcweir inline void	SwPageFrm::InvalidateAutoCompleteWords() const
469cdf0e10cSrcweir {
47060d78278Smseidel 	((SwPageFrm*)this)->bInvalidAutoCmplWrds = sal_True;
471cdf0e10cSrcweir }
InvalidateWordCount() const472cdf0e10cSrcweir inline void SwPageFrm::InvalidateWordCount() const
473cdf0e10cSrcweir {
47460d78278Smseidel 	((SwPageFrm*)this)->bInvalidWordCount = sal_True;
475cdf0e10cSrcweir }
ValidateFlyLayout() const476cdf0e10cSrcweir inline void	SwPageFrm::ValidateFlyLayout() const
477cdf0e10cSrcweir {
478cdf0e10cSrcweir 	((SwPageFrm*)this)->bInvalidFlyLayout = sal_False;
479cdf0e10cSrcweir }
ValidateFlyCntnt() const480cdf0e10cSrcweir inline void	SwPageFrm::ValidateFlyCntnt() const
481cdf0e10cSrcweir {
482cdf0e10cSrcweir 	((SwPageFrm*)this)->bInvalidFlyCntnt = sal_False;
483cdf0e10cSrcweir }
ValidateFlyInCnt() const484cdf0e10cSrcweir inline void SwPageFrm::ValidateFlyInCnt() const
485cdf0e10cSrcweir {
486cdf0e10cSrcweir 	((SwPageFrm*)this)->bInvalidFlyInCnt = sal_False;
487cdf0e10cSrcweir }
ValidateLayout() const488cdf0e10cSrcweir inline void	SwPageFrm::ValidateLayout() const
489cdf0e10cSrcweir {
490cdf0e10cSrcweir 	((SwPageFrm*)this)->bInvalidLayout = sal_False;
491cdf0e10cSrcweir }
ValidateCntnt() const492cdf0e10cSrcweir inline void	SwPageFrm::ValidateCntnt() const
493cdf0e10cSrcweir {
494cdf0e10cSrcweir 	((SwPageFrm*)this)->bInvalidCntnt = sal_False;
495cdf0e10cSrcweir }
ValidateSpelling() const496cdf0e10cSrcweir inline void	SwPageFrm::ValidateSpelling() const
497cdf0e10cSrcweir {
498cdf0e10cSrcweir 	((SwPageFrm*)this)->bInvalidSpelling = sal_False;
499cdf0e10cSrcweir }
500cdf0e10cSrcweir // SMARTTAGS
ValidateSmartTags() const50160d78278Smseidel inline void SwPageFrm::ValidateSmartTags() const
502cdf0e10cSrcweir {
50360d78278Smseidel 	((SwPageFrm*)this)->bInvalidSmartTags = sal_False;
504cdf0e10cSrcweir }
ValidateAutoCompleteWords() const505cdf0e10cSrcweir inline void SwPageFrm::ValidateAutoCompleteWords() const
506cdf0e10cSrcweir {
507cdf0e10cSrcweir 	((SwPageFrm*)this)->bInvalidAutoCmplWrds = sal_False;
508cdf0e10cSrcweir }
ValidateWordCount() const509cdf0e10cSrcweir inline void SwPageFrm::ValidateWordCount() const
510cdf0e10cSrcweir {
51160d78278Smseidel 	((SwPageFrm*)this)->bInvalidWordCount = sal_False;
512cdf0e10cSrcweir }
513cdf0e10cSrcweir 
IsInvalid() const514cdf0e10cSrcweir inline sal_Bool SwPageFrm::IsInvalid() const
515cdf0e10cSrcweir {
516cdf0e10cSrcweir 	return (bInvalidCntnt || bInvalidLayout || bInvalidFlyInCnt);
517cdf0e10cSrcweir }
IsInvalidFly() const518cdf0e10cSrcweir inline sal_Bool SwPageFrm::IsInvalidFly() const
519cdf0e10cSrcweir {
520cdf0e10cSrcweir 	return bInvalidFlyLayout || bInvalidFlyCntnt;
521cdf0e10cSrcweir }
522cdf0e10cSrcweir 
523cdf0e10cSrcweir #define GETGRID( pPage ) const SwTextGridItem *pGrid = NULL; \
524cdf0e10cSrcweir  {if( pPage && pPage->HasGrid() && GRID_NONE==(pGrid=(SwTextGridItem*)&pPage->\
525cdf0e10cSrcweir      GetPageDesc()->GetMaster().GetFmtAttr(RES_TEXTGRID))->GetGridType() ) \
526cdf0e10cSrcweir     pGrid = NULL;}
527cdf0e10cSrcweir 
52860d78278Smseidel #define GETGRIDWIDTH( pGrid , pDoc ) pDoc->IsSquaredPageMode() ? \
529cdf0e10cSrcweir 	pGrid->GetBaseHeight(): pGrid->GetBaseWidth()
530cdf0e10cSrcweir 
531cdf0e10cSrcweir 
532cdf0e10cSrcweir #endif	//_PAGEFRM_HXX
533