Version 5.4.3.2, tag libreoffice-5.4.3.2
[LibreOffice.git] / include / svx / pagectrl.hxx
blob438018e08fbd4e40f815c39179cb72604032a3b8
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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>
26 class SvxBoxItem;
27 enum class SvxPageUsage;
28 enum class SvxFrameDirection;
30 class SVX_DLLPUBLIC SvxPageWindow : public vcl::Window
32 using Window::GetBorder;
34 private:
35 Size aWinSize;
36 Size aSize;
38 long nTop;
39 long nBottom;
40 long nLeft;
41 long nRight;
43 SvxBoxItem* pBorder;
44 bool bResetBackground;
45 bool bFrameDirection;
46 SvxFrameDirection nFrameDirection;
48 long nHdLeft;
49 long nHdRight;
50 long nHdDist;
51 long nHdHeight;
52 SvxBoxItem* pHdBorder;
54 long nFtLeft;
55 long nFtRight;
56 long nFtDist;
57 long nFtHeight;
58 SvxBoxItem* pFtBorder;
60 drawinglayer::attribute::SdrAllFillAttributesHelperPtr maHeaderFillAttributes;
61 drawinglayer::attribute::SdrAllFillAttributesHelperPtr maFooterFillAttributes;
62 drawinglayer::attribute::SdrAllFillAttributesHelperPtr maPageFillAttributes;
64 bool bFooter : 1;
65 bool bHeader : 1;
66 bool bTable : 1;
67 bool bHorz : 1;
68 bool bVert : 1;
70 SvxPageUsage eUsage;
72 protected:
73 virtual void Paint(vcl::RenderContext& rRenderContext, const tools::Rectangle& rRect) override;
75 virtual void DrawPage(vcl::RenderContext& rRenderContext, const Point& rPoint,
76 const bool bSecond, const bool bEnabled);
78 void drawFillAttributes(vcl::RenderContext& rRenderContext,
79 const drawinglayer::attribute::SdrAllFillAttributesHelperPtr& rFillAttributes,
80 const tools::Rectangle& rPaintRange, const tools::Rectangle& rDefineRange);
82 public:
83 SvxPageWindow(vcl::Window* pParent);
84 virtual ~SvxPageWindow() override;
85 virtual void dispose() override;
87 void setHeaderFillAttributes(const drawinglayer::attribute::SdrAllFillAttributesHelperPtr& rFillAttributes)
89 maHeaderFillAttributes = rFillAttributes;
91 void setFooterFillAttributes(const drawinglayer::attribute::SdrAllFillAttributesHelperPtr& rFillAttributes)
93 maFooterFillAttributes = rFillAttributes;
95 void setPageFillAttributes(const drawinglayer::attribute::SdrAllFillAttributesHelperPtr& rFillAttributes)
97 maPageFillAttributes = rFillAttributes;
99 const drawinglayer::attribute::SdrAllFillAttributesHelperPtr& getPageFillAttributes() const
101 return maPageFillAttributes;
103 void SetSize(const Size& rSize)
105 aSize = rSize;
107 const Size& GetSize() const
109 return aSize;
112 void SetTop(long nNew) { nTop = nNew; }
113 void SetBottom(long nNew) { nBottom = nNew; }
114 void SetLeft(long nNew) { nLeft = nNew; }
115 void SetRight(long nNew) { nRight = nNew; }
116 void SetBorder(const SvxBoxItem& rNew);
118 long GetTop() const { return nTop; }
119 long GetBottom() const { return nBottom; }
120 long GetLeft() const { return nLeft; }
121 long GetRight() const { return nRight; }
123 void SetHdLeft(long nNew) { nHdLeft = nNew; }
124 void SetHdRight(long nNew) { nHdRight = nNew; }
125 void SetHdDist(long nNew) { nHdDist = nNew; }
126 void SetHdHeight(long nNew) { nHdHeight = nNew; }
127 void SetHdBorder(const SvxBoxItem& rNew);
129 long GetHdLeft() const { return nHdLeft; }
130 long GetHdRight() const { return nHdRight; }
131 long GetHdDist() const { return nHdDist; }
132 long GetHdHeight() const { return nHdHeight; }
134 void SetFtLeft(long nNew) { nFtLeft = nNew; }
135 void SetFtRight(long nNew) { nFtRight = nNew; }
136 void SetFtDist(long nNew) { nFtDist = nNew; }
137 void SetFtHeight(long nNew) { nFtHeight = nNew; }
138 void SetFtBorder(const SvxBoxItem& rNew);
140 long GetFtLeft() const { return nFtLeft; }
141 long GetFtRight() const { return nFtRight; }
142 long GetFtDist() const { return nFtDist; }
143 long GetFtHeight() const { return nFtHeight; }
145 void SetUsage(SvxPageUsage eU) { eUsage = eU; }
146 SvxPageUsage GetUsage() const { return eUsage; }
148 void SetHeader( bool bNew ) { bHeader = bNew; }
149 void SetFooter( bool bNew ) { bFooter = bNew; }
150 void SetTable( bool bNew ) { bTable = bNew; }
151 void SetHorz( bool bNew ) { bHorz = bNew; }
152 void SetVert( bool bNew ) { bVert = bNew; }
154 void EnableFrameDirection(bool bEnable);
155 void SetFrameDirection(SvxFrameDirection nDirection);
157 void ResetBackground();
159 virtual Size GetOptimalSize() const override;
162 #endif // INCLUDED_SVX_PAGECTRL_HXX
164 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */