1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
19 #ifndef INCLUDED_SVX_PAGECTRL_HXX
20 #define INCLUDED_SVX_PAGECTRL_HXX
22 #include <vcl/window.hxx>
23 #include <svx/svxdllapi.h>
24 #include <svx/sdr/attribute/sdrallfillattributeshelper.hxx>
28 class SVX_DLLPUBLIC SvxPageWindow
: public vcl::Window
30 using Window::GetBorder
;
42 bool bResetBackground
;
44 sal_Int32 nFrameDirection
;
50 SvxBoxItem
* pHdBorder
;
56 SvxBoxItem
* pFtBorder
;
59 drawinglayer::attribute::SdrAllFillAttributesHelperPtr maHeaderFillAttributes
;
60 drawinglayer::attribute::SdrAllFillAttributesHelperPtr maFooterFillAttributes
;
61 drawinglayer::attribute::SdrAllFillAttributesHelperPtr maPageFillAttributes
;
75 virtual void Paint(vcl::RenderContext
& rRenderContext
, const Rectangle
& rRect
) SAL_OVERRIDE
;
77 virtual void DrawPage(vcl::RenderContext
& rRenderContext
, const Point
& rPoint
,
78 const bool bSecond
, const bool bEnabled
);
81 void drawFillAttributes(vcl::RenderContext
& rRenderContext
,
82 const drawinglayer::attribute::SdrAllFillAttributesHelperPtr
& rFillAttributes
,
83 const Rectangle
& rPaintRange
, const Rectangle
& rDefineRange
);
86 SvxPageWindow(vcl::Window
* pParent
);
87 virtual ~SvxPageWindow();
88 virtual void dispose() SAL_OVERRIDE
;
91 void setHeaderFillAttributes(const drawinglayer::attribute::SdrAllFillAttributesHelperPtr
& rFillAttributes
)
93 maHeaderFillAttributes
= rFillAttributes
;
95 void setFooterFillAttributes(const drawinglayer::attribute::SdrAllFillAttributesHelperPtr
& rFillAttributes
)
97 maFooterFillAttributes
= rFillAttributes
;
99 void setPageFillAttributes(const drawinglayer::attribute::SdrAllFillAttributesHelperPtr
& rFillAttributes
)
101 maPageFillAttributes
= rFillAttributes
;
103 const drawinglayer::attribute::SdrAllFillAttributesHelperPtr
& getPageFillAttributes() const
105 return maPageFillAttributes
;
108 void SetWidth(long nWidth
)
110 aSize
.Width() = nWidth
;
112 void SetHeight(long nHeight
)
114 aSize
.Height() = nHeight
;
117 void SetSize(const Size
& rSize
)
121 const Size
& GetSize() const
126 void SetTop(long nNew
) { nTop
= nNew
; }
127 void SetBottom(long nNew
) { nBottom
= nNew
; }
128 void SetLeft(long nNew
) { nLeft
= nNew
; }
129 void SetRight(long nNew
) { nRight
= nNew
; }
130 void SetBorder(const SvxBoxItem
& rNew
);
132 long GetTop() const { return nTop
; }
133 long GetBottom() const { return nBottom
; }
134 long GetLeft() const { return nLeft
; }
135 long GetRight() const { return nRight
; }
137 const SvxBoxItem
& GetBorder() const;
139 void SetHdLeft(long nNew
) { nHdLeft
= nNew
; }
140 void SetHdRight(long nNew
) { nHdRight
= nNew
; }
141 void SetHdDist(long nNew
) { nHdDist
= nNew
; }
142 void SetHdHeight(long nNew
) { nHdHeight
= nNew
; }
143 void SetHdBorder(const SvxBoxItem
& rNew
);
145 long GetHdLeft() const { return nHdLeft
; }
146 long GetHdRight() const { return nHdRight
; }
147 long GetHdDist() const { return nHdDist
; }
148 long GetHdHeight() const { return nHdHeight
; }
150 const SvxBoxItem
& GetHdBorder() const { return *pHdBorder
; }
152 void SetFtLeft(long nNew
) { nFtLeft
= nNew
; }
153 void SetFtRight(long nNew
) { nFtRight
= nNew
; }
154 void SetFtDist(long nNew
) { nFtDist
= nNew
; }
155 void SetFtHeight(long nNew
) { nFtHeight
= nNew
; }
156 void SetFtBorder(const SvxBoxItem
& rNew
);
158 long GetFtLeft() const { return nFtLeft
; }
159 long GetFtRight() const { return nFtRight
; }
160 long GetFtDist() const { return nFtDist
; }
161 long GetFtHeight() const { return nFtHeight
; }
163 const SvxBoxItem
& GetFtBorder() const { return *pFtBorder
; }
165 void SetUsage(sal_uInt16 eU
) { eUsage
= eU
; }
166 sal_uInt16
GetUsage() const { return eUsage
; }
168 void SetHeader( bool bNew
) { bHeader
= bNew
; }
169 bool GetHeader() const { return bHeader
;}
170 void SetFooter( bool bNew
) { bFooter
= bNew
; }
171 bool GetFooter() const { return bFooter
;}
173 void SetTable( bool bNew
) { bTable
= bNew
; }
174 bool GetTable() const { return bTable
;}
175 void SetHorz( bool bNew
) { bHorz
= bNew
; }
176 bool GetHorz() const { return bHorz
;}
177 void SetVert( bool bNew
) { bVert
= bNew
; }
178 bool GetVert() const { return bVert
;}
180 void EnableFrameDirection(bool bEnable
);
181 //uses enum SvxFrameDirection
182 void SetFrameDirection(sal_Int32 nDirection
);
184 void ResetBackground();
186 virtual Size
GetOptimalSize() const SAL_OVERRIDE
;
189 #endif // INCLUDED_SVX_PAGECTRL_HXX
191 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */