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/customweld.hxx>
23 #include <svx/svxdllapi.h>
24 #include <svx/sdr/attribute/sdrallfillattributeshelper.hxx>
26 enum class SvxPageUsage
;
27 enum class SvxFrameDirection
;
29 class SVX_DLLPUBLIC SvxPageWindow
: public weld::CustomWidgetController
40 bool bResetBackground
;
42 SvxFrameDirection nFrameDirection
;
47 tools::Long nHdHeight
;
52 tools::Long nFtHeight
;
54 drawinglayer::attribute::SdrAllFillAttributesHelperPtr maHeaderFillAttributes
;
55 drawinglayer::attribute::SdrAllFillAttributesHelperPtr maFooterFillAttributes
;
56 drawinglayer::attribute::SdrAllFillAttributesHelperPtr maPageFillAttributes
;
67 virtual void Paint(vcl::RenderContext
& rRenderContext
, const tools::Rectangle
& rRect
) override
;
69 virtual void DrawPage(vcl::RenderContext
& rRenderContext
, const Point
& rPoint
,
70 const bool bSecond
, const bool bEnabled
);
72 static void drawFillAttributes(vcl::RenderContext
& rRenderContext
,
73 const drawinglayer::attribute::SdrAllFillAttributesHelperPtr
& rFillAttributes
,
74 const tools::Rectangle
& rPaintRange
, const tools::Rectangle
& rDefineRange
);
78 virtual void SetDrawingArea(weld::DrawingArea
* pDrawingArea
) override
;
79 virtual ~SvxPageWindow() override
;
81 void setHeaderFillAttributes(const drawinglayer::attribute::SdrAllFillAttributesHelperPtr
& rFillAttributes
)
83 maHeaderFillAttributes
= rFillAttributes
;
85 void setFooterFillAttributes(const drawinglayer::attribute::SdrAllFillAttributesHelperPtr
& rFillAttributes
)
87 maFooterFillAttributes
= rFillAttributes
;
89 void setPageFillAttributes(const drawinglayer::attribute::SdrAllFillAttributesHelperPtr
& rFillAttributes
)
91 maPageFillAttributes
= rFillAttributes
;
93 const drawinglayer::attribute::SdrAllFillAttributesHelperPtr
& getPageFillAttributes() const
95 return maPageFillAttributes
;
97 void SetSize(const Size
& rSize
)
101 const Size
& GetSize() const
106 void SetTop(tools::Long nNew
) { nTop
= nNew
; }
107 void SetBottom(tools::Long nNew
) { nBottom
= nNew
; }
108 void SetLeft(tools::Long nNew
) { nLeft
= nNew
; }
109 void SetRight(tools::Long nNew
) { nRight
= nNew
; }
111 tools::Long
GetTop() const { return nTop
; }
112 tools::Long
GetBottom() const { return nBottom
; }
113 tools::Long
GetLeft() const { return nLeft
; }
114 tools::Long
GetRight() const { return nRight
; }
116 void SetHdLeft(tools::Long nNew
) { nHdLeft
= nNew
; }
117 void SetHdRight(tools::Long nNew
) { nHdRight
= nNew
; }
118 void SetHdDist(tools::Long nNew
) { nHdDist
= nNew
; }
119 void SetHdHeight(tools::Long nNew
) { nHdHeight
= nNew
; }
121 tools::Long
GetHdLeft() const { return nHdLeft
; }
122 tools::Long
GetHdRight() const { return nHdRight
; }
123 tools::Long
GetHdDist() const { return nHdDist
; }
124 tools::Long
GetHdHeight() const { return nHdHeight
; }
126 void SetFtLeft(tools::Long nNew
) { nFtLeft
= nNew
; }
127 void SetFtRight(tools::Long nNew
) { nFtRight
= nNew
; }
128 void SetFtDist(tools::Long nNew
) { nFtDist
= nNew
; }
129 void SetFtHeight(tools::Long nNew
) { nFtHeight
= nNew
; }
131 tools::Long
GetFtLeft() const { return nFtLeft
; }
132 tools::Long
GetFtRight() const { return nFtRight
; }
133 tools::Long
GetFtDist() const { return nFtDist
; }
134 tools::Long
GetFtHeight() const { return nFtHeight
; }
136 void SetUsage(SvxPageUsage eU
) { eUsage
= eU
; }
137 SvxPageUsage
GetUsage() const { return eUsage
; }
139 void SetHeader( bool bNew
) { bHeader
= bNew
; }
140 void SetFooter( bool bNew
) { bFooter
= bNew
; }
141 void SetTable( bool bNew
) { bTable
= bNew
; }
142 void SetHorz( bool bNew
) { bHorz
= bNew
; }
143 void SetVert( bool bNew
) { bVert
= bNew
; }
145 void EnableFrameDirection(bool bEnable
);
146 void SetFrameDirection(SvxFrameDirection nDirection
);
148 void ResetBackground();
151 #endif // INCLUDED_SVX_PAGECTRL_HXX
153 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */