xref: /aoo4110/main/svx/inc/svx/pagectrl.hxx (revision b1cdbd2c)
1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 #ifndef _SVX_PAGECTRL_HXX
24 #define _SVX_PAGECTRL_HXX
25 
26 // include ---------------------------------------------------------------
27 
28 #include <vcl/window.hxx>
29 #include "svx/svxdllapi.h"
30 
31 // forward ---------------------------------------------------------------
32 
33 class SvxBoxItem;
34 struct PageWindow_Impl;
35 
36 // class SvxPageWindow ---------------------------------------------------
37 
38 class SVX_DLLPUBLIC SvxPageWindow : public Window
39 {
40 	using Window::GetBorder;
41 
42 private:
43 	Size		aWinSize;
44 	Size 		aSize;
45 
46 	long		nTop;
47 	long		nBottom;
48 	long 		nLeft;
49 	long		nRight;
50 	Color		aColor;
51 
52 	PageWindow_Impl* pImpl;
53 
54 	long 		nHdLeft;
55 	long		nHdRight;
56 	long		nHdDist;
57 	long		nHdHeight;
58 	Color		aHdColor;
59 	SvxBoxItem*	pHdBorder;
60 
61 	long		nFtLeft;
62 	long		nFtRight;
63 	long		nFtDist;
64 	long		nFtHeight;
65 	Color		aFtColor;
66 	SvxBoxItem*	pFtBorder;
67 
68 	sal_Bool		bFooter	:1;
69 	sal_Bool		bHeader	:1;
70 	sal_Bool		bTable	:1;
71 	sal_Bool		bHorz	:1;
72 	sal_Bool		bVert	:1;
73 
74 	sal_uInt16		eUsage;
75 
76 	String		aLeftText;
77 	String		aRightText;
78 
79 protected:
80 	virtual void Paint( const Rectangle& rRect );
81 
82 	virtual void DrawPage( const Point& rPoint,
83 						   const sal_Bool bSecond,
84 						   const sal_Bool bEnabled );
85 
86 public:
87 	SvxPageWindow( Window* pParent, const ResId& rId );
88 	~SvxPageWindow();
89 
SetWidth(long nW)90 	void 		SetWidth( long nW )						{ aSize.Width()  = nW; }
SetHeight(long nH)91 	void    	SetHeight( long nH )					{ aSize.Height() = nH; }
92 
SetSize(const Size & rSz)93 	void		SetSize( const Size& rSz )				{ aSize = rSz; }
GetSize() const94 	const Size&	GetSize() const 						{ return aSize; }
95 
SetTop(long nNew)96 	void		SetTop( long nNew )						{ nTop = nNew; }
SetBottom(long nNew)97 	void		SetBottom( long nNew ) 					{ nBottom = nNew; }
SetLeft(long nNew)98 	void		SetLeft( long nNew )					{ nLeft = nNew; }
SetRight(long nNew)99 	void   		SetRight( long nNew )					{ nRight = nNew; }
SetColor(const Color & rNew)100 	void		SetColor( const Color& rNew )			{ aColor = rNew; }
101 	void		SetBorder( const SvxBoxItem& rNew );
102 	void		SetBitmap( Bitmap* pBmp );
103 
GetTop() const104 	long		GetTop() const							{ return nTop;   }
GetBottom() const105 	long		GetBottom() const						{ return nBottom;}
GetLeft() const106 	long		GetLeft() const							{ return nLeft;  }
GetRight() const107 	long		GetRight() const						{ return nRight; }
108 
GetColor() const109 	const Color&		GetColor() const				{ return aColor; }
110 	const SvxBoxItem& 	GetBorder() const;
111 
SetHdLeft(long nNew)112 	void    	SetHdLeft( long nNew )					{ nHdLeft = nNew; }
SetHdRight(long nNew)113 	void    	SetHdRight( long nNew )					{ nHdRight = nNew; }
SetHdDist(long nNew)114 	void    	SetHdDist( long nNew )					{ nHdDist = nNew; }
SetHdHeight(long nNew)115 	void    	SetHdHeight( long nNew )				{ nHdHeight = nNew; }
SetHdColor(const Color & aNew)116 	void		SetHdColor( const Color& aNew )			{ aHdColor = aNew; }
117 	void		SetHdBorder( const SvxBoxItem& rNew );
118 
GetHdLeft() const119 	long		GetHdLeft() const 						{ return nHdLeft;  }
GetHdRight() const120 	long		GetHdRight() const 						{ return nHdRight; }
GetHdDist() const121 	long		GetHdDist()	const 						{ return nHdDist;  }
GetHdHeight() const122 	long		GetHdHeight() const 					{ return nHdHeight;}
123 
GetHdColor() const124 	const Color&		GetHdColor() const				{ return aHdColor; }
GetHdBorder() const125 	const SvxBoxItem& 	GetHdBorder() const				{ return *pHdBorder; }
126 
SetFtLeft(long nNew)127 	void		SetFtLeft( long nNew )					{ nFtLeft = nNew; }
SetFtRight(long nNew)128 	void		SetFtRight( long nNew )					{ nFtRight = nNew; }
SetFtDist(long nNew)129 	void		SetFtDist( long nNew )					{ nFtDist = nNew; }
SetFtHeight(long nNew)130 	void		SetFtHeight( long nNew )				{ nFtHeight = nNew; }
SetFtColor(const Color & aNew)131 	void		SetFtColor( const Color& aNew )			{ aFtColor = aNew; }
132 	void		SetFtBorder( const SvxBoxItem& rNew );
133 
GetFtLeft() const134 	long		GetFtLeft() const 						{ return nFtLeft;  }
GetFtRight() const135 	long		GetFtRight() const 						{ return nFtRight; }
GetFtDist() const136 	long		GetFtDist()	const 						{ return nFtDist;  }
GetFtHeight() const137 	long		GetFtHeight() const 					{ return nFtHeight;}
138 
GetFtColor() const139 	const Color& 		GetFtColor() const				{ return aFtColor; }
GetFtBorder() const140 	const SvxBoxItem& 	GetFtBorder() const				{ return *pFtBorder; }
141 
SetUsage(sal_uInt16 eU)142 	void		SetUsage( sal_uInt16 eU )					{ eUsage = eU;  }
GetUsage() const143 	sal_uInt16		GetUsage() const						{ return eUsage;}
144 
SetHeader(sal_Bool bNew)145 	void 		SetHeader( sal_Bool bNew )  				{ bHeader = bNew; }
GetHeader() const146 	sal_Bool		GetHeader() const						{ return bHeader;}
SetFooter(sal_Bool bNew)147 	void		SetFooter( sal_Bool bNew )					{ bFooter = bNew; }
GetFooter() const148 	sal_Bool		GetFooter() const						{ return bFooter;}
149 
SetTable(sal_Bool bNew)150 	void 		SetTable( sal_Bool bNew )					{ bTable = bNew; }
GetTable() const151 	sal_Bool		GetTable() const						{ return bTable;}
SetHorz(sal_Bool bNew)152 	void		SetHorz( sal_Bool bNew )					{ bHorz = bNew; }
GetHorz() const153 	sal_Bool		GetHorz() const							{ return bHorz;}
SetVert(sal_Bool bNew)154 	void 		SetVert( sal_Bool bNew )		   			{ bVert = bNew; }
GetVert() const155 	sal_Bool		GetVert() const				   			{ return bVert;}
156 
157     void        EnableFrameDirection(sal_Bool bEnable);
158     //uses enum SvxFrameDirection
159     void        SetFrameDirection(sal_Int32 nFrameDirection);
160 
161     void        ResetBackground();
162 };
163 
164 #endif // #ifndef _SVX_PAGECTRL_HXX
165 
166 
167