xref: /aoo41x/main/sw/source/core/inc/pagefrm.hxx (revision 089ea224)
11d2dbeb0SAndrew Rist /**************************************************************
2*089ea224Smseidel  *
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
10*089ea224Smseidel  *
111d2dbeb0SAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12*089ea224Smseidel  *
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.
19*089ea224Smseidel  *
201d2dbeb0SAndrew Rist  *************************************************************/
211d2dbeb0SAndrew Rist 
221d2dbeb0SAndrew Rist 
23*089ea224Smseidel 
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 
70*089ea224Smseidel 	sal_Bool bInvalidCntnt			:1;
71*089ea224Smseidel 	sal_Bool bInvalidLayout			:1;
72*089ea224Smseidel 	sal_Bool bInvalidFlyCntnt		:1;
73*089ea224Smseidel 	sal_Bool bInvalidFlyLayout		:1;
74*089ea224Smseidel 	sal_Bool bInvalidFlyInCnt		:1;
75*089ea224Smseidel 	sal_Bool bFtnPage				:1;	//Diese Seite ist fuer Dokumentende-Fussnoten.
76*089ea224Smseidel 	sal_Bool bEmptyPage				:1; //Dies ist eine explizite Leerseite
77*089ea224Smseidel 	sal_Bool bEndNotePage			:1; //'Fussnotenseite' fuer Endnoten
78*089ea224Smseidel 	sal_Bool bInvalidSpelling		:1; //Das Online-Spelling ist gefordert
79*089ea224Smseidel 	sal_Bool bInvalidSmartTags		:1; //checking for smarttags is needed // SMARTTAGS
80*089ea224Smseidel 	sal_Bool bInvalidAutoCmplWrds	:1; //Auto-Complete Wordliste aktualisieren
81*089ea224Smseidel 	sal_Bool bInvalidWordCount		:1;
82*089ea224Smseidel 	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     static const sal_Int8 mnShadowPxWidth;
91cdf0e10cSrcweir 
92cdf0e10cSrcweir 	void _UpdateAttr( const SfxPoolItem*, const SfxPoolItem*, sal_uInt8 &,
93cdf0e10cSrcweir 					  SwAttrSetChg *pa = 0, SwAttrSetChg *pb = 0 );
94cdf0e10cSrcweir 
95cdf0e10cSrcweir 	// Anpassen der max. Fussnotenhoehen in den einzelnen Spalten
96cdf0e10cSrcweir 	void SetColMaxFtnHeight();
97cdf0e10cSrcweir 
98cdf0e10cSrcweir     /** determine rectangle for page border
99cdf0e10cSrcweir 
100cdf0e10cSrcweir         OD 12.02.2003 for #i9719# and #105645#
101cdf0e10cSrcweir 
102cdf0e10cSrcweir         @author OD
103cdf0e10cSrcweir 
104cdf0e10cSrcweir         @param _rPageRect
105cdf0e10cSrcweir         input parameter - constant instance reference of the page rectangle.
106cdf0e10cSrcweir         Generally, it's the frame area of the page, but for empty pages in print
107cdf0e10cSrcweir         preview, this parameter is useful.
108cdf0e10cSrcweir 
109cdf0e10cSrcweir         @param _pViewShell
110cdf0e10cSrcweir         input parameter - instance of the view shell, for which the rectangle
111cdf0e10cSrcweir         has to be generated.
112cdf0e10cSrcweir 
113cdf0e10cSrcweir         @param _orBorderRect
114cdf0e10cSrcweir         output parameter - instance reference of the border rectangle for
115cdf0e10cSrcweir         the given page rectangle
116cdf0e10cSrcweir     */
117cdf0e10cSrcweir     static void GetBorderRect( const SwRect& _rPageRect,
118cdf0e10cSrcweir                                ViewShell*    _pViewShell,
119cdf0e10cSrcweir                                SwRect& _orBorderRect,
120cdf0e10cSrcweir                                bool bRightSidebar );
121cdf0e10cSrcweir 
122cdf0e10cSrcweir     /** determine rectangle for right page shadow
123cdf0e10cSrcweir 
124cdf0e10cSrcweir         OD 12.02.2003 for #i9719# and #105645#
125cdf0e10cSrcweir 
126cdf0e10cSrcweir         @author OD
127cdf0e10cSrcweir 
128cdf0e10cSrcweir         @param _rPageRect
129cdf0e10cSrcweir         input parameter - constant instance reference of the page rectangle.
130cdf0e10cSrcweir         Generally, it's the frame area of the page, but for empty pages in print
131cdf0e10cSrcweir         preview, this parameter is useful.
132cdf0e10cSrcweir 
133cdf0e10cSrcweir         @param _pViewShell
134cdf0e10cSrcweir         input parameter - instance of the view shell, for which the rectangle
135cdf0e10cSrcweir         has to be generated.
136cdf0e10cSrcweir 
137cdf0e10cSrcweir         @param _orRightShadowRect
138cdf0e10cSrcweir         output parameter - instance reference of the right shadow rectangle for
139cdf0e10cSrcweir         the given page rectangle
140cdf0e10cSrcweir     */
141cdf0e10cSrcweir     static void GetRightShadowRect( const SwRect& _rPageRect,
142cdf0e10cSrcweir                                     ViewShell*    _pViewShell,
143cdf0e10cSrcweir                                     SwRect&       _orRightShadowRect,
144cdf0e10cSrcweir                                     bool bRightSidebar );
145cdf0e10cSrcweir 
146cdf0e10cSrcweir     /** determine rectangle for bottom page shadow
147cdf0e10cSrcweir 
148cdf0e10cSrcweir         OD 12.02.2003 for #i9719# and #105645#
149cdf0e10cSrcweir 
150cdf0e10cSrcweir         @author OD
151cdf0e10cSrcweir 
152cdf0e10cSrcweir         @param _rPageRect
153cdf0e10cSrcweir         input parameter - constant instance reference of the page rectangle.
154cdf0e10cSrcweir         Generally, it's the frame area of the page, but for empty pages in print
155cdf0e10cSrcweir         preview, this parameter is useful.
156cdf0e10cSrcweir 
157cdf0e10cSrcweir         @param _pViewShell
158cdf0e10cSrcweir         input parameter - instance of the view shell, for which the rectangle
159cdf0e10cSrcweir         has to be generated.
160cdf0e10cSrcweir 
161cdf0e10cSrcweir         @param _orBottomShadowRect
162cdf0e10cSrcweir         output parameter - instance reference of the bottom shadow rectangle for
163cdf0e10cSrcweir         the given page rectangle
164cdf0e10cSrcweir     */
165cdf0e10cSrcweir 
166cdf0e10cSrcweir     static void GetBottomShadowRect( const SwRect& _rPageRect,
167cdf0e10cSrcweir                                      ViewShell*    _pViewShell,
168cdf0e10cSrcweir                                      SwRect&       _orBottomShadowRect,
169cdf0e10cSrcweir                                      bool bRightSidebar );
170cdf0e10cSrcweir 
171*089ea224Smseidel     /** adds the sidebar used for comments to right and left border
172cdf0e10cSrcweir         mod 20.10.2007 for #i6193#
173cdf0e10cSrcweir 
174cdf0e10cSrcweir         @author mod
175cdf0e10cSrcweir 
176cdf0e10cSrcweir         @param aRect
177cdf0e10cSrcweir         input parameter - current rect, we change borders if we want a sidebar
178cdf0e10cSrcweir 
179cdf0e10cSrcweir         @param _pViewShell
180cdf0e10cSrcweir         input parameter - instance of the view shell, for which the rectangle
181cdf0e10cSrcweir         has to be generated.
182cdf0e10cSrcweir 
183cdf0e10cSrcweir         @param bPx
184cdf0e10cSrcweir         input parameter - if set to true, we add in pixel
185cdf0e10cSrcweir     */
186cdf0e10cSrcweir     static void AddSidebarBorders( Rectangle& aRect, ViewShell* _pViewShell, bool bRight, bool bPx = false);
187cdf0e10cSrcweir     static void AddSidebarBorders(       SwRect& aRect, ViewShell* _pViewShell, bool bRight, bool bPx = false);
188cdf0e10cSrcweir 
189cdf0e10cSrcweir protected:
190cdf0e10cSrcweir 	virtual void MakeAll();
191cdf0e10cSrcweir 	virtual void Modify( const SfxPoolItem*, const SfxPoolItem* );
192cdf0e10cSrcweir 
193cdf0e10cSrcweir public:
194cdf0e10cSrcweir 	DECL_FIXEDMEMPOOL_NEWDEL(SwPageFrm)
195cdf0e10cSrcweir 
196cdf0e10cSrcweir 	SwPageFrm( SwFrmFmt*, SwFrm*, SwPageDesc* );
197cdf0e10cSrcweir 	~SwPageFrm();
198cdf0e10cSrcweir 
199cdf0e10cSrcweir 	//public, damit die ViewShell beim Umschalten vom BrowseMode darauf
200cdf0e10cSrcweir 	//zugreifen kann.
201cdf0e10cSrcweir 	void PrepareHeader();	//Kopf-/Fusszeilen anlegen/entfernen.
202cdf0e10cSrcweir 	void PrepareFooter();
203cdf0e10cSrcweir 
GetSortedObjs() const204cdf0e10cSrcweir     const SwSortedObjs  *GetSortedObjs() const  { return pSortedObjs; }
GetSortedObjs()205cdf0e10cSrcweir           SwSortedObjs  *GetSortedObjs()          { return pSortedObjs; }
206cdf0e10cSrcweir 
207cdf0e10cSrcweir     // --> OD 2004-07-02 #i28701# - new methods to append/remove drawing objects
208cdf0e10cSrcweir     void AppendDrawObjToPage( SwAnchoredObject& _rNewObj );
209cdf0e10cSrcweir     void RemoveDrawObjFromPage( SwAnchoredObject& _rToRemoveObj );
210cdf0e10cSrcweir     // <--
211cdf0e10cSrcweir 
212cdf0e10cSrcweir     void AppendFlyToPage( SwFlyFrm *pNew );
213cdf0e10cSrcweir     void RemoveFlyFromPage( SwFlyFrm *pToRemove );
214cdf0e10cSrcweir 	void MoveFly( SwFlyFrm *pToMove, SwPageFrm *pDest );//optimiertes Remove/Append
215cdf0e10cSrcweir 
216cdf0e10cSrcweir 	void  SetPageDesc( SwPageDesc *, SwFrmFmt * );
GetPageDesc()217cdf0e10cSrcweir 		  SwPageDesc *GetPageDesc() { return pDesc; }
GetPageDesc() const218cdf0e10cSrcweir 	const SwPageDesc *GetPageDesc() const { return pDesc; }
219cdf0e10cSrcweir 		  SwPageDesc *FindPageDesc();
220cdf0e10cSrcweir 
221cdf0e10cSrcweir 				 SwCntntFrm  *FindLastBodyCntnt();
222cdf0e10cSrcweir 	inline 		 SwCntntFrm	 *FindFirstBodyCntnt();
223cdf0e10cSrcweir 	inline const SwCntntFrm  *FindFirstBodyCntnt() const;
224cdf0e10cSrcweir 	inline const SwCntntFrm  *FindLastBodyCntnt() const;
225cdf0e10cSrcweir 
226cdf0e10cSrcweir 	//Spezialisiertes GetCntntPos() fuer Felder in Rahmen.
227cdf0e10cSrcweir 	void GetCntntPosition( const Point &rPt, SwPosition &rPos ) const;
228cdf0e10cSrcweir 
IsEmptyPage() const229cdf0e10cSrcweir 	sal_Bool IsEmptyPage() const { return bEmptyPage; } //explizite Leerseite.
230cdf0e10cSrcweir 
231cdf0e10cSrcweir 	void	UpdateFtnNum();
232cdf0e10cSrcweir 
233cdf0e10cSrcweir 	//Immer nach dem Paste rufen. Erzeugt die Seitengeb. Rahmen und Formatiert
234cdf0e10cSrcweir 	//generischen Inhalt.
235cdf0e10cSrcweir 	void PreparePage( sal_Bool bFtn );
236cdf0e10cSrcweir 
237cdf0e10cSrcweir 	//Schickt an alle ContentFrames ein Prepare wg. geaenderter Registervorlage
238cdf0e10cSrcweir 	void PrepareRegisterChg();
239cdf0e10cSrcweir 
240cdf0e10cSrcweir     // --> OD 2005-06-09 #i50432# - adjust method description and synopsis.
241cdf0e10cSrcweir     // Appends a fly frame - the given one or a new one - at the page frame.
242cdf0e10cSrcweir     // Needed for <Modify> and <MakeFrms>
243cdf0e10cSrcweir     // - return value not needed any more
244cdf0e10cSrcweir     // - second parameter is of type <SwFlyFrmFmt*>
245cdf0e10cSrcweir     // - third parameter only needed for assertion, but calling method assures
246cdf0e10cSrcweir     //   this assertion. Thus, delete it.
247cdf0e10cSrcweir     void PlaceFly( SwFlyFrm* pFly, SwFlyFrmFmt* pFmt );
248cdf0e10cSrcweir     // <--
249cdf0e10cSrcweir 
250cdf0e10cSrcweir 	virtual sal_Bool GetCrsrOfst( SwPosition *, Point&,
251cdf0e10cSrcweir 							  SwCrsrMoveState* = 0 ) const;
252cdf0e10cSrcweir 		// erfrage vom Client Informationen
253cdf0e10cSrcweir 	virtual sal_Bool GetInfo( SfxPoolItem& ) const;
254cdf0e10cSrcweir 
255cdf0e10cSrcweir 	virtual void Cut();
256cdf0e10cSrcweir 	virtual void Paste( SwFrm* pParent, SwFrm* pSibling = 0 );
257*089ea224Smseidel 	virtual void CheckDirection( sal_Bool bVert );
258*089ea224Smseidel 	void CheckGrid( sal_Bool bInvalidate );
259*089ea224Smseidel 	void PaintGrid( OutputDevice* pOut, SwRect &rRect ) const;
HasGrid() const260*089ea224Smseidel 	sal_Bool HasGrid() const { return bHasGrid; }
261cdf0e10cSrcweir 
262*089ea224Smseidel 	//Zeilennummern usw. malen
263cdf0e10cSrcweir 	void RefreshExtraData( const SwRect & ) const;
264cdf0e10cSrcweir 
265cdf0e10cSrcweir 	//Hilfslinien malen.
266cdf0e10cSrcweir 	void RefreshSubsidiary( const SwRect& ) const;
267cdf0e10cSrcweir 
268cdf0e10cSrcweir 	//Fussnotenschnittstelle
IsFtnPage() const269cdf0e10cSrcweir 	sal_Bool IsFtnPage() const									{ return bFtnPage; }
IsEndNotePage() const270cdf0e10cSrcweir 	sal_Bool IsEndNotePage() const								{ return bEndNotePage; }
SetFtnPage(sal_Bool b)271cdf0e10cSrcweir 	void SetFtnPage( sal_Bool b )								{ bFtnPage = b; }
SetEndNotePage(sal_Bool b)272cdf0e10cSrcweir 	void SetEndNotePage( sal_Bool b )							{ bEndNotePage = b; }
273cdf0e10cSrcweir 
GetPhyPageNum() const274cdf0e10cSrcweir 	inline	sal_uInt16 GetPhyPageNum() const	    { return nPhyPageNum;}
SetPhyPageNum(sal_uInt16 nNum)275cdf0e10cSrcweir 	inline	void SetPhyPageNum( sal_uInt16 nNum )	{ nPhyPageNum = nNum;}
DecrPhyPageNum()276cdf0e10cSrcweir 	inline	void DecrPhyPageNum()				{ --nPhyPageNum;	 }
IncrPhyPageNum()277cdf0e10cSrcweir 	inline	void IncrPhyPageNum()				{ ++nPhyPageNum;	 }
278cdf0e10cSrcweir 
279cdf0e10cSrcweir 	//Validieren, invalidieren und abfragen des Status der Seite.
280cdf0e10cSrcweir 	//Layout/Cntnt und jeweils Fly/nicht Fly werden getrennt betrachtet.
281cdf0e10cSrcweir 	inline void InvalidateFlyLayout() const;
282cdf0e10cSrcweir 	inline void InvalidateFlyCntnt() const;
283cdf0e10cSrcweir 	inline void InvalidateFlyInCnt() const;
284cdf0e10cSrcweir 	inline void	InvalidateLayout() const;
285cdf0e10cSrcweir 	inline void	InvalidateCntnt() const;
286cdf0e10cSrcweir 	inline void	InvalidateSpelling() const;
287*089ea224Smseidel 	inline void InvalidateSmartTags() const;
288cdf0e10cSrcweir 	inline void	InvalidateAutoCompleteWords() const;
289*089ea224Smseidel 	inline void InvalidateWordCount() const;
290cdf0e10cSrcweir 	inline void ValidateFlyLayout() const;
291cdf0e10cSrcweir 	inline void ValidateFlyCntnt() const;
292cdf0e10cSrcweir 	inline void ValidateFlyInCnt() const;
293cdf0e10cSrcweir 	inline void	ValidateLayout() const;
294cdf0e10cSrcweir 	inline void	ValidateCntnt()	const;
295cdf0e10cSrcweir 	inline void	ValidateSpelling()	const;
296*089ea224Smseidel 	inline void ValidateSmartTags() const; // SMARTTAGS
297*089ea224Smseidel 	inline void ValidateAutoCompleteWords() const;
298*089ea224Smseidel 	inline void ValidateWordCount() const;
299cdf0e10cSrcweir 	inline sal_Bool IsInvalid() const;
300cdf0e10cSrcweir 	inline sal_Bool IsInvalidFly() const;
IsInvalidFlyLayout() const301cdf0e10cSrcweir 	sal_Bool IsInvalidFlyLayout() const { return bInvalidFlyLayout; }
IsInvalidFlyCntnt() const302cdf0e10cSrcweir 	sal_Bool IsInvalidFlyCntnt() const { return bInvalidFlyCntnt; }
IsInvalidFlyInCnt() const303cdf0e10cSrcweir 	sal_Bool IsInvalidFlyInCnt() const { return bInvalidFlyInCnt; }
IsInvalidLayout() const304cdf0e10cSrcweir 	sal_Bool IsInvalidLayout() const { return bInvalidLayout; }
IsInvalidCntnt() const305cdf0e10cSrcweir 	sal_Bool IsInvalidCntnt() const { return (bInvalidCntnt || bInvalidFlyInCnt); }
IsInvalidSpelling() const306cdf0e10cSrcweir 	sal_Bool IsInvalidSpelling() const { return bInvalidSpelling; }
IsInvalidSmartTags() const307*089ea224Smseidel 	sal_Bool IsInvalidSmartTags() const { return bInvalidSmartTags; } // SMARTTAGS
IsInvalidAutoCompleteWords() const308cdf0e10cSrcweir 	sal_Bool IsInvalidAutoCompleteWords() const { return bInvalidAutoCmplWrds; }
IsInvalidWordCount() const309*089ea224Smseidel 	sal_Bool IsInvalidWordCount() const { return bInvalidWordCount; }
310cdf0e10cSrcweir 
311cdf0e10cSrcweir     /** SwPageFrm::GetDrawBackgrdColor - for #102450#
312cdf0e10cSrcweir 
313cdf0e10cSrcweir         29.08.2002:
314cdf0e10cSrcweir         determine the color, that is respectively will be drawn as background
315cdf0e10cSrcweir         for the page frame.
316cdf0e10cSrcweir 
317cdf0e10cSrcweir         @author OD
318cdf0e10cSrcweir 
319cdf0e10cSrcweir         @return reference to an instance of class Color
320cdf0e10cSrcweir     */
321cdf0e10cSrcweir     const Color& GetDrawBackgrdColor() const;
322cdf0e10cSrcweir 
323cdf0e10cSrcweir     /** paint margin area of a page
324cdf0e10cSrcweir 
325cdf0e10cSrcweir         OD 20.11.2002 for #104598#:
326cdf0e10cSrcweir         implement paint of margin area; margin area will be painted for a
327cdf0e10cSrcweir         view shell with a window and if the document is not in online layout.
328cdf0e10cSrcweir 
329cdf0e10cSrcweir         @author OD
330cdf0e10cSrcweir 
331cdf0e10cSrcweir         @param _rOutputRect
332cdf0e10cSrcweir         input parameter - constant instance reference of the rectangle, for
333cdf0e10cSrcweir         which an output has to be generated.
334cdf0e10cSrcweir 
335cdf0e10cSrcweir         @param _pViewShell
336cdf0e10cSrcweir         input parameter - instance of the view shell, on which the output
337cdf0e10cSrcweir         has to be generated.
338cdf0e10cSrcweir     */
339cdf0e10cSrcweir     void PaintMarginArea( const SwRect& _rOutputRect,
340cdf0e10cSrcweir                           ViewShell* _pViewShell ) const;
341cdf0e10cSrcweir 
342cdf0e10cSrcweir     /** paint page border and shadow
343cdf0e10cSrcweir 
344cdf0e10cSrcweir         OD 12.02.2003 for #i9719# and #105645#
345cdf0e10cSrcweir         implement paint of page border and shadow
346cdf0e10cSrcweir 
347cdf0e10cSrcweir         @author OD
348cdf0e10cSrcweir 
349cdf0e10cSrcweir         @param _rPageRect
350cdf0e10cSrcweir         input parameter - constant instance reference of the page rectangle.
351cdf0e10cSrcweir         Generally, it's the frame area of the page, but for empty pages in print
352cdf0e10cSrcweir         preview, this parameter is useful.
353cdf0e10cSrcweir 
354cdf0e10cSrcweir         @param _pViewShell
355cdf0e10cSrcweir         input parameter - instance of the view shell, on which the output
356cdf0e10cSrcweir         has to be generated.
357cdf0e10cSrcweir     */
358cdf0e10cSrcweir     static void PaintBorderAndShadow( const SwRect& _rPageRect,
359cdf0e10cSrcweir                                       ViewShell*    _pViewShell,
360cdf0e10cSrcweir                                       bool bPaintRightShadow,
361cdf0e10cSrcweir                                       bool bRightSidebar );
362cdf0e10cSrcweir 
363cdf0e10cSrcweir     /** get bound rectangle of border and shadow for repaints
364cdf0e10cSrcweir 
365cdf0e10cSrcweir         OD 12.02.2003 for #i9719# and #105645#
366cdf0e10cSrcweir 
367cdf0e10cSrcweir         author OD
368cdf0e10cSrcweir 
369cdf0e10cSrcweir         @param _rPageRect
370cdf0e10cSrcweir         input parameter - constant instance reference of the page rectangle.
371cdf0e10cSrcweir         Generally, it's the frame area of the page, but for empty pages in print
372cdf0e10cSrcweir         preview, this parameter is useful.
373cdf0e10cSrcweir 
374cdf0e10cSrcweir         @param _pViewShell
375cdf0e10cSrcweir         input parameter - instance of the view shell, for which the rectangle
376cdf0e10cSrcweir         has to be generated.
377cdf0e10cSrcweir 
378cdf0e10cSrcweir         @param _orBorderAndShadowBoundRect
379cdf0e10cSrcweir         output parameter - instance reference of the bounded border and shadow
380cdf0e10cSrcweir         rectangle for the given page rectangle
381cdf0e10cSrcweir     */
382cdf0e10cSrcweir     static void GetBorderAndShadowBoundRect( const SwRect& _rPageRect,
383cdf0e10cSrcweir                                              ViewShell*    _pViewShell,
384cdf0e10cSrcweir                                              SwRect& _orBorderAndShadowBoundRect,
385cdf0e10cSrcweir                                              const bool bRightSidebar );
386cdf0e10cSrcweir 
387cdf0e10cSrcweir     static void PaintNotesSidebar(const SwRect& _rPageRect, ViewShell* _pViewShell, sal_uInt16 nPageNum, bool bRight);
388cdf0e10cSrcweir     static void PaintNotesSidebarArrows(const Point &aMiddleFirst, const Point &aMiddleSecond, ViewShell* _pViewShell, const Color aColorUp, const Color aColorDown);
389cdf0e10cSrcweir 	/**
390cdf0e10cSrcweir 		mod #6i193#
391cdf0e10cSrcweir 
392*089ea224Smseidel 		asks the page on which side a margin should be shown, e.g. for comments
393cdf0e10cSrcweir 		returns true for left side, false for right side
394cdf0e10cSrcweir 	*/
395cdf0e10cSrcweir     sw::sidebarwindows::SidebarPosition SidebarPosition() const;
396cdf0e10cSrcweir 
397cdf0e10cSrcweir 	virtual bool FillSelection( SwSelectionList& rList, const SwRect& rRect ) const;
398cdf0e10cSrcweir 
399cdf0e10cSrcweir     // OD 12.02.2003 #i9719#, #105645#
BorderPxWidth() const400cdf0e10cSrcweir     inline sal_Int8 BorderPxWidth() const
401cdf0e10cSrcweir     {
402cdf0e10cSrcweir         return mnBorderPxWidth;
403cdf0e10cSrcweir     }
ShadowPxWidth() const404cdf0e10cSrcweir     inline sal_Int8 ShadowPxWidth() const
405cdf0e10cSrcweir     {
406cdf0e10cSrcweir         return mnShadowPxWidth;
407cdf0e10cSrcweir     }
408cdf0e10cSrcweir 
409cdf0e10cSrcweir     // OD 22.09.2003 #110978#
410cdf0e10cSrcweir     const SwRect PrtWithoutHeaderAndFooter() const;
411cdf0e10cSrcweir 
412cdf0e10cSrcweir     // OD 2004-05-17 #i28701#
IsLayoutInProgress() const413cdf0e10cSrcweir     inline bool IsLayoutInProgress() const
414cdf0e10cSrcweir     {
415cdf0e10cSrcweir         return mbLayoutInProgress;
416cdf0e10cSrcweir     }
SetLayoutInProgress(const bool _bLayoutInProgress)417cdf0e10cSrcweir     inline void SetLayoutInProgress( const bool _bLayoutInProgress )
418cdf0e10cSrcweir     {
419cdf0e10cSrcweir         mbLayoutInProgress = _bLayoutInProgress;
420cdf0e10cSrcweir     }
421cdf0e10cSrcweir 
422cdf0e10cSrcweir     // in case this is am empty page, this function returns the 'reference' page
423cdf0e10cSrcweir     const SwPageFrm& GetFormatPage() const;
424cdf0e10cSrcweir 
425cdf0e10cSrcweir     // return font used to paint the "empty page" string
426cdf0e10cSrcweir     static const Font& GetEmptyPageFont();
427cdf0e10cSrcweir 
428cdf0e10cSrcweir     static SwTwips GetSidebarBorderWidth( const ViewShell* );
429cdf0e10cSrcweir };
430cdf0e10cSrcweir 
FindFirstBodyCntnt()431cdf0e10cSrcweir inline SwCntntFrm *SwPageFrm::FindFirstBodyCntnt()
432cdf0e10cSrcweir {
433cdf0e10cSrcweir 	SwLayoutFrm *pBody = FindBodyCont();
434cdf0e10cSrcweir 	return pBody ? pBody->ContainsCntnt() : 0;
435cdf0e10cSrcweir }
FindFirstBodyCntnt() const436cdf0e10cSrcweir inline const SwCntntFrm *SwPageFrm::FindFirstBodyCntnt() const
437cdf0e10cSrcweir {
438cdf0e10cSrcweir 	const SwLayoutFrm *pBody = FindBodyCont();
439cdf0e10cSrcweir 	return pBody ? pBody->ContainsCntnt() : 0;
440cdf0e10cSrcweir }
FindLastBodyCntnt() const441cdf0e10cSrcweir inline const SwCntntFrm *SwPageFrm::FindLastBodyCntnt() const
442cdf0e10cSrcweir {
443cdf0e10cSrcweir 	return ((SwPageFrm*)this)->FindLastBodyCntnt();
444cdf0e10cSrcweir }
InvalidateFlyLayout() const445cdf0e10cSrcweir inline void	SwPageFrm::InvalidateFlyLayout() const
446cdf0e10cSrcweir {
447cdf0e10cSrcweir 	((SwPageFrm*)this)->bInvalidFlyLayout = sal_True;
448cdf0e10cSrcweir }
InvalidateFlyCntnt() const449cdf0e10cSrcweir inline void	SwPageFrm::InvalidateFlyCntnt() const
450cdf0e10cSrcweir {
451cdf0e10cSrcweir 	((SwPageFrm*)this)->bInvalidFlyCntnt = sal_True;
452cdf0e10cSrcweir }
InvalidateFlyInCnt() const453cdf0e10cSrcweir inline void SwPageFrm::InvalidateFlyInCnt() const
454cdf0e10cSrcweir {
455cdf0e10cSrcweir 	((SwPageFrm*)this)->bInvalidFlyInCnt = sal_True;
456cdf0e10cSrcweir }
InvalidateLayout() const457cdf0e10cSrcweir inline void	SwPageFrm::InvalidateLayout() const
458cdf0e10cSrcweir {
459cdf0e10cSrcweir 	((SwPageFrm*)this)->bInvalidLayout = sal_True;
460cdf0e10cSrcweir }
InvalidateCntnt() const461cdf0e10cSrcweir inline void	SwPageFrm::InvalidateCntnt() const
462cdf0e10cSrcweir {
463cdf0e10cSrcweir 	((SwPageFrm*)this)->bInvalidCntnt = sal_True;
464cdf0e10cSrcweir }
InvalidateSpelling() const465cdf0e10cSrcweir inline void	SwPageFrm::InvalidateSpelling() const
466cdf0e10cSrcweir {
467cdf0e10cSrcweir 	((SwPageFrm*)this)->bInvalidSpelling = sal_True;
468cdf0e10cSrcweir }
469cdf0e10cSrcweir // SMARTTAGS
InvalidateSmartTags() const470*089ea224Smseidel inline void SwPageFrm::InvalidateSmartTags() const
471cdf0e10cSrcweir {
472*089ea224Smseidel 	((SwPageFrm*)this)->bInvalidSmartTags = sal_True;
473cdf0e10cSrcweir }
InvalidateAutoCompleteWords() const474cdf0e10cSrcweir inline void	SwPageFrm::InvalidateAutoCompleteWords() const
475cdf0e10cSrcweir {
476*089ea224Smseidel 	((SwPageFrm*)this)->bInvalidAutoCmplWrds = sal_True;
477cdf0e10cSrcweir }
InvalidateWordCount() const478cdf0e10cSrcweir inline void SwPageFrm::InvalidateWordCount() const
479cdf0e10cSrcweir {
480*089ea224Smseidel 	((SwPageFrm*)this)->bInvalidWordCount = sal_True;
481cdf0e10cSrcweir }
ValidateFlyLayout() const482cdf0e10cSrcweir inline void	SwPageFrm::ValidateFlyLayout() const
483cdf0e10cSrcweir {
484cdf0e10cSrcweir 	((SwPageFrm*)this)->bInvalidFlyLayout = sal_False;
485cdf0e10cSrcweir }
ValidateFlyCntnt() const486cdf0e10cSrcweir inline void	SwPageFrm::ValidateFlyCntnt() const
487cdf0e10cSrcweir {
488cdf0e10cSrcweir 	((SwPageFrm*)this)->bInvalidFlyCntnt = sal_False;
489cdf0e10cSrcweir }
ValidateFlyInCnt() const490cdf0e10cSrcweir inline void SwPageFrm::ValidateFlyInCnt() const
491cdf0e10cSrcweir {
492cdf0e10cSrcweir 	((SwPageFrm*)this)->bInvalidFlyInCnt = sal_False;
493cdf0e10cSrcweir }
ValidateLayout() const494cdf0e10cSrcweir inline void	SwPageFrm::ValidateLayout() const
495cdf0e10cSrcweir {
496cdf0e10cSrcweir 	((SwPageFrm*)this)->bInvalidLayout = sal_False;
497cdf0e10cSrcweir }
ValidateCntnt() const498cdf0e10cSrcweir inline void	SwPageFrm::ValidateCntnt() const
499cdf0e10cSrcweir {
500cdf0e10cSrcweir 	((SwPageFrm*)this)->bInvalidCntnt = sal_False;
501cdf0e10cSrcweir }
ValidateSpelling() const502cdf0e10cSrcweir inline void	SwPageFrm::ValidateSpelling() const
503cdf0e10cSrcweir {
504cdf0e10cSrcweir 	((SwPageFrm*)this)->bInvalidSpelling = sal_False;
505cdf0e10cSrcweir }
506cdf0e10cSrcweir // SMARTTAGS
ValidateSmartTags() const507*089ea224Smseidel inline void SwPageFrm::ValidateSmartTags() const
508cdf0e10cSrcweir {
509*089ea224Smseidel 	((SwPageFrm*)this)->bInvalidSmartTags = sal_False;
510cdf0e10cSrcweir }
ValidateAutoCompleteWords() const511cdf0e10cSrcweir inline void SwPageFrm::ValidateAutoCompleteWords() const
512cdf0e10cSrcweir {
513cdf0e10cSrcweir 	((SwPageFrm*)this)->bInvalidAutoCmplWrds = sal_False;
514cdf0e10cSrcweir }
ValidateWordCount() const515cdf0e10cSrcweir inline void SwPageFrm::ValidateWordCount() const
516cdf0e10cSrcweir {
517*089ea224Smseidel 	((SwPageFrm*)this)->bInvalidWordCount = sal_False;
518cdf0e10cSrcweir }
519cdf0e10cSrcweir 
IsInvalid() const520cdf0e10cSrcweir inline sal_Bool SwPageFrm::IsInvalid() const
521cdf0e10cSrcweir {
522cdf0e10cSrcweir 	return (bInvalidCntnt || bInvalidLayout || bInvalidFlyInCnt);
523cdf0e10cSrcweir }
IsInvalidFly() const524cdf0e10cSrcweir inline sal_Bool SwPageFrm::IsInvalidFly() const
525cdf0e10cSrcweir {
526cdf0e10cSrcweir 	return bInvalidFlyLayout || bInvalidFlyCntnt;
527cdf0e10cSrcweir }
528cdf0e10cSrcweir 
529cdf0e10cSrcweir #define GETGRID( pPage ) const SwTextGridItem *pGrid = NULL; \
530cdf0e10cSrcweir  {if( pPage && pPage->HasGrid() && GRID_NONE==(pGrid=(SwTextGridItem*)&pPage->\
531cdf0e10cSrcweir      GetPageDesc()->GetMaster().GetFmtAttr(RES_TEXTGRID))->GetGridType() ) \
532cdf0e10cSrcweir     pGrid = NULL;}
533cdf0e10cSrcweir 
534*089ea224Smseidel #define GETGRIDWIDTH( pGrid , pDoc ) pDoc->IsSquaredPageMode() ? \
535cdf0e10cSrcweir 	pGrid->GetBaseHeight(): pGrid->GetBaseWidth()
536cdf0e10cSrcweir 
537cdf0e10cSrcweir 
538cdf0e10cSrcweir #endif	//_PAGEFRM_HXX
539