Line data Source code
1 : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : /*
3 : * This file is part of the LibreOffice project.
4 : *
5 : * This Source Code Form is subject to the terms of the Mozilla Public
6 : * License, v. 2.0. If a copy of the MPL was not distributed with this
7 : * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 : *
9 : * This file incorporates work covered by the following license notice:
10 : *
11 : * Licensed to the Apache Software Foundation (ASF) under one or more
12 : * contributor license agreements. See the NOTICE file distributed
13 : * with this work for additional information regarding copyright
14 : * ownership. The ASF licenses this file to you under the Apache
15 : * License, Version 2.0 (the "License"); you may not use this file
16 : * except in compliance with the License. You may obtain a copy of
17 : * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 : */
19 : #ifndef _SVX_PAGECTRL_HXX
20 : #define _SVX_PAGECTRL_HXX
21 :
22 : #include <vcl/window.hxx>
23 : #include "svx/svxdllapi.h"
24 :
25 : // forward ---------------------------------------------------------------
26 :
27 : class SvxBoxItem;
28 : struct PageWindow_Impl;
29 :
30 : // class SvxPageWindow ---------------------------------------------------
31 :
32 : class SVX_DLLPUBLIC SvxPageWindow : public Window
33 : {
34 : using Window::GetBorder;
35 :
36 : private:
37 : Size aWinSize;
38 : Size aSize;
39 :
40 : long nTop;
41 : long nBottom;
42 : long nLeft;
43 : long nRight;
44 : Color aColor;
45 :
46 : PageWindow_Impl* pImpl;
47 :
48 : long nHdLeft;
49 : long nHdRight;
50 : long nHdDist;
51 : long nHdHeight;
52 : Color aHdColor;
53 : SvxBoxItem* pHdBorder;
54 :
55 : long nFtLeft;
56 : long nFtRight;
57 : long nFtDist;
58 : long nFtHeight;
59 : Color aFtColor;
60 : SvxBoxItem* pFtBorder;
61 :
62 : sal_Bool bFooter :1;
63 : sal_Bool bHeader :1;
64 : sal_Bool bTable :1;
65 : sal_Bool bHorz :1;
66 : sal_Bool bVert :1;
67 :
68 : sal_uInt16 eUsage;
69 :
70 : String aLeftText;
71 : String aRightText;
72 :
73 : protected:
74 : virtual void Paint( const Rectangle& rRect );
75 :
76 : virtual void DrawPage( const Point& rPoint,
77 : const sal_Bool bSecond,
78 : const sal_Bool bEnabled );
79 :
80 : public:
81 : SvxPageWindow( Window* pParent, const ResId& rId );
82 : SvxPageWindow( Window* pParent );
83 : ~SvxPageWindow();
84 :
85 : void SetWidth( long nW ) { aSize.Width() = nW; }
86 : void SetHeight( long nH ) { aSize.Height() = nH; }
87 :
88 0 : void SetSize( const Size& rSz ) { aSize = rSz; }
89 0 : const Size& GetSize() const { return aSize; }
90 :
91 0 : void SetTop( long nNew ) { nTop = nNew; }
92 0 : void SetBottom( long nNew ) { nBottom = nNew; }
93 0 : void SetLeft( long nNew ) { nLeft = nNew; }
94 0 : void SetRight( long nNew ) { nRight = nNew; }
95 0 : void SetColor( const Color& rNew ) { aColor = rNew; }
96 : void SetBorder( const SvxBoxItem& rNew );
97 : void SetBitmap( Bitmap* pBmp );
98 :
99 0 : long GetTop() const { return nTop; }
100 0 : long GetBottom() const { return nBottom;}
101 0 : long GetLeft() const { return nLeft; }
102 0 : long GetRight() const { return nRight; }
103 :
104 0 : const Color& GetColor() const { return aColor; }
105 : const SvxBoxItem& GetBorder() const;
106 :
107 0 : void SetHdLeft( long nNew ) { nHdLeft = nNew; }
108 0 : void SetHdRight( long nNew ) { nHdRight = nNew; }
109 0 : void SetHdDist( long nNew ) { nHdDist = nNew; }
110 0 : void SetHdHeight( long nNew ) { nHdHeight = nNew; }
111 0 : void SetHdColor( const Color& aNew ) { aHdColor = aNew; }
112 : void SetHdBorder( const SvxBoxItem& rNew );
113 :
114 0 : long GetHdLeft() const { return nHdLeft; }
115 0 : long GetHdRight() const { return nHdRight; }
116 0 : long GetHdDist() const { return nHdDist; }
117 0 : long GetHdHeight() const { return nHdHeight;}
118 :
119 : const Color& GetHdColor() const { return aHdColor; }
120 : const SvxBoxItem& GetHdBorder() const { return *pHdBorder; }
121 :
122 0 : void SetFtLeft( long nNew ) { nFtLeft = nNew; }
123 0 : void SetFtRight( long nNew ) { nFtRight = nNew; }
124 0 : void SetFtDist( long nNew ) { nFtDist = nNew; }
125 0 : void SetFtHeight( long nNew ) { nFtHeight = nNew; }
126 0 : void SetFtColor( const Color& aNew ) { aFtColor = aNew; }
127 : void SetFtBorder( const SvxBoxItem& rNew );
128 :
129 0 : long GetFtLeft() const { return nFtLeft; }
130 0 : long GetFtRight() const { return nFtRight; }
131 0 : long GetFtDist() const { return nFtDist; }
132 0 : long GetFtHeight() const { return nFtHeight;}
133 :
134 : const Color& GetFtColor() const { return aFtColor; }
135 : const SvxBoxItem& GetFtBorder() const { return *pFtBorder; }
136 :
137 0 : void SetUsage( sal_uInt16 eU ) { eUsage = eU; }
138 0 : sal_uInt16 GetUsage() const { return eUsage;}
139 :
140 0 : void SetHeader( sal_Bool bNew ) { bHeader = bNew; }
141 : sal_Bool GetHeader() const { return bHeader;}
142 0 : void SetFooter( sal_Bool bNew ) { bFooter = bNew; }
143 : sal_Bool GetFooter() const { return bFooter;}
144 :
145 0 : void SetTable( sal_Bool bNew ) { bTable = bNew; }
146 : sal_Bool GetTable() const { return bTable;}
147 0 : void SetHorz( sal_Bool bNew ) { bHorz = bNew; }
148 : sal_Bool GetHorz() const { return bHorz;}
149 0 : void SetVert( sal_Bool bNew ) { bVert = bNew; }
150 : sal_Bool GetVert() const { return bVert;}
151 :
152 : void EnableFrameDirection(sal_Bool bEnable);
153 : //uses enum SvxFrameDirection
154 : void SetFrameDirection(sal_Int32 nFrameDirection);
155 :
156 : void ResetBackground();
157 :
158 : virtual Size GetOptimalSize(WindowSizeType eType) const;
159 : };
160 :
161 : #endif // #ifndef _SVX_PAGECTRL_HXX
162 :
163 :
164 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|