Branch libreoffice-5-0-4
[LibreOffice.git] / include / svx / pagectrl.hxx
blobe0ec05b2884d3f8ff26d3d496fd2c3dd6e5f67e9
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;
28 class SVX_DLLPUBLIC SvxPageWindow : public vcl::Window
30 using Window::GetBorder;
32 private:
33 Size aWinSize;
34 Size aSize;
36 long nTop;
37 long nBottom;
38 long nLeft;
39 long nRight;
41 SvxBoxItem* pBorder;
42 bool bResetBackground;
43 bool bFrameDirection;
44 sal_Int32 nFrameDirection;
46 long nHdLeft;
47 long nHdRight;
48 long nHdDist;
49 long nHdHeight;
50 SvxBoxItem* pHdBorder;
52 long nFtLeft;
53 long nFtRight;
54 long nFtDist;
55 long nFtHeight;
56 SvxBoxItem* pFtBorder;
58 //UUUU
59 drawinglayer::attribute::SdrAllFillAttributesHelperPtr maHeaderFillAttributes;
60 drawinglayer::attribute::SdrAllFillAttributesHelperPtr maFooterFillAttributes;
61 drawinglayer::attribute::SdrAllFillAttributesHelperPtr maPageFillAttributes;
63 bool bFooter : 1;
64 bool bHeader : 1;
65 bool bTable : 1;
66 bool bHorz : 1;
67 bool bVert : 1;
69 sal_uInt16 eUsage;
71 OUString aLeftText;
72 OUString aRightText;
74 protected:
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);
80 //UUUU
81 void drawFillAttributes(vcl::RenderContext& rRenderContext,
82 const drawinglayer::attribute::SdrAllFillAttributesHelperPtr& rFillAttributes,
83 const Rectangle& rPaintRange, const Rectangle& rDefineRange);
85 public:
86 SvxPageWindow(vcl::Window* pParent);
87 virtual ~SvxPageWindow();
88 virtual void dispose() SAL_OVERRIDE;
90 //UUUU
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)
119 aSize = rSize;
121 const Size& GetSize() const
123 return aSize;
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: */