xref: /aoo41x/main/sw/source/core/layout/virtoutp.hxx (revision cdf0e10c)
1 /*************************************************************************
2  *
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
5  * Copyright 2000, 2010 Oracle and/or its affiliates.
6  *
7  * OpenOffice.org - a multi-platform office productivity suite
8  *
9  * This file is part of OpenOffice.org.
10  *
11  * OpenOffice.org is free software: you can redistribute it and/or modify
12  * it under the terms of the GNU Lesser General Public License version 3
13  * only, as published by the Free Software Foundation.
14  *
15  * OpenOffice.org is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU Lesser General Public License version 3 for more details
19  * (a copy is included in the LICENSE file that accompanied this code).
20  *
21  * You should have received a copy of the GNU Lesser General Public License
22  * version 3 along with OpenOffice.org.  If not, see
23  * <http://www.openoffice.org/license.html>
24  * for a copy of the LGPLv3 License.
25  *
26  ************************************************************************/
27 #ifndef _VIRTOUTP_HXX
28 #define _VIRTOUTP_HXX
29 
30 #include <vcl/virdev.hxx>
31 
32 #include "swtypes.hxx"		// UCHAR
33 #include "swrect.hxx"		// SwRect
34 
35 class ViewShell;
36 #define VIRTUALHEIGHT 64
37 
38 /*************************************************************************
39  *						class SwTxtVout
40  *************************************************************************/
41 
42 class SwLayVout
43 {
44 	friend void _FrmFinit();	//loescht das Vout
45 private:
46 	ViewShell*		pSh;
47 	OutputDevice*	pOut;
48 	VirtualDevice*	pVirDev;
49 	SwRect			aRect;
50 	SwRect			aOrgRect;
51 	Size			aSize;
52 	sal_uInt16			nCount;
53 
54 	sal_Bool DoesFit( const Size &rOut );
55 
56 public:
57     SwLayVout() : pSh(0), pOut(0), pVirDev(0), aSize(0, VIRTUALHEIGHT), nCount(0) {}
58 	~SwLayVout() { delete pVirDev; }
59 
60     /// OD 27.09.2002 #103636# - change 2nd parameter <rRect> - no longer <const>
61     void Enter( ViewShell *pShell, SwRect &rRect, sal_Bool bOn );
62 	void Leave() { --nCount; Flush(); }
63 
64 	void SetOrgRect( SwRect &rRect ) { aOrgRect = rRect; }
65 	const SwRect& GetOrgRect() const { return aOrgRect; }
66 
67 	sal_Bool IsFlushable() { return 0 != pOut; }
68 	void _Flush();
69 	void Flush() { if( pOut ) _Flush(); }
70 };
71 
72 
73 
74 #endif
75