1 /************************************************************** 2 * 3 * Licensed to the Apache Software Foundation (ASF) under one 4 * or more contributor license agreements. See the NOTICE file 5 * distributed with this work for additional information 6 * regarding copyright ownership. The ASF licenses this file 7 * to you under the Apache License, Version 2.0 (the 8 * "License"); you may not use this file except in compliance 9 * with the License. You may obtain a copy of the License at 10 * 11 * http://www.apache.org/licenses/LICENSE-2.0 12 * 13 * Unless required by applicable law or agreed to in writing, 14 * software distributed under the License is distributed on an 15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 * KIND, either express or implied. See the License for the 17 * specific language governing permissions and limitations 18 * under the License. 19 * 20 *************************************************************/ 21 22 #ifndef _SVX_PAGECTRL_HXX 23 #define _SVX_PAGECTRL_HXX 24 25 #include <vcl/window.hxx> 26 #include "svx/svxdllapi.h" 27 #include <svx/sdr/attribute/sdrallfillattributeshelper.hxx> 28 29 class SvxBoxItem; 30 31 // class SvxPageWindow --------------------------------------------------- 32 33 class SVX_DLLPUBLIC SvxPageWindow : public Window 34 { 35 using Window::GetBorder; 36 37 private: 38 Size aWinSize; 39 Size aSize; 40 41 long nTop; 42 long nBottom; 43 long nLeft; 44 long nRight; 45 46 SvxBoxItem* pBorder; 47 sal_Bool bResetBackground; 48 sal_Bool bFrameDirection; 49 sal_Int32 nFrameDirection; 50 51 long nHdLeft; 52 long nHdRight; 53 long nHdDist; 54 long nHdHeight; 55 SvxBoxItem* pHdBorder; 56 57 long nFtLeft; 58 long nFtRight; 59 long nFtDist; 60 long nFtHeight; 61 SvxBoxItem* pFtBorder; 62 63 //UUUU 64 drawinglayer::attribute::SdrAllFillAttributesHelperPtr maHeaderFillAttributes; 65 drawinglayer::attribute::SdrAllFillAttributesHelperPtr maFooterFillAttributes; 66 drawinglayer::attribute::SdrAllFillAttributesHelperPtr maPageFillAttributes; 67 68 sal_Bool bFooter : 1; 69 sal_Bool bHeader : 1; 70 sal_Bool bTable : 1; 71 sal_Bool bHorz : 1; 72 sal_Bool bVert : 1; 73 74 sal_uInt16 eUsage; 75 76 String aLeftText; 77 String aRightText; 78 79 protected: 80 virtual void Paint(const Rectangle& rRect); 81 82 virtual void DrawPage(const Point& rPoint, 83 const sal_Bool bSecond, 84 const sal_Bool bEnabled); 85 86 //UUUU 87 void drawFillAttributes( 88 const drawinglayer::attribute::SdrAllFillAttributesHelperPtr& rFillAttributes, 89 const Rectangle& rPaintRange, 90 const Rectangle& rDefineRange); 91 92 public: 93 SvxPageWindow(Window* pParent,const ResId& rId); 94 ~SvxPageWindow(); 95 96 //UUUU setHeaderFillAttributes(const drawinglayer::attribute::SdrAllFillAttributesHelperPtr & rFillAttributes)97 void setHeaderFillAttributes(const drawinglayer::attribute::SdrAllFillAttributesHelperPtr& rFillAttributes) { maHeaderFillAttributes = rFillAttributes; } setFooterFillAttributes(const drawinglayer::attribute::SdrAllFillAttributesHelperPtr & rFillAttributes)98 void setFooterFillAttributes(const drawinglayer::attribute::SdrAllFillAttributesHelperPtr& rFillAttributes) { maFooterFillAttributes = rFillAttributes; } setPageFillAttributes(const drawinglayer::attribute::SdrAllFillAttributesHelperPtr & rFillAttributes)99 void setPageFillAttributes(const drawinglayer::attribute::SdrAllFillAttributesHelperPtr& rFillAttributes) { maPageFillAttributes = rFillAttributes; } getPageFillAttributes() const100 const drawinglayer::attribute::SdrAllFillAttributesHelperPtr& getPageFillAttributes() const { return maPageFillAttributes; } 101 SetWidth(long nW)102 void SetWidth(long nW) { aSize.Width() = nW; } SetHeight(long nH)103 void SetHeight(long nH) { aSize.Height() = nH; } 104 SetSize(const Size & rSz)105 void SetSize(const Size& rSz) { aSize = rSz; } GetSize() const106 const Size& GetSize() const { return aSize; } 107 SetTop(long nNew)108 void SetTop(long nNew) { nTop = nNew; } SetBottom(long nNew)109 void SetBottom(long nNew) { nBottom = nNew; } SetLeft(long nNew)110 void SetLeft(long nNew) { nLeft = nNew; } SetRight(long nNew)111 void SetRight(long nNew) { nRight = nNew; } 112 void SetBorder(const SvxBoxItem& rNew); 113 GetTop() const114 long GetTop() const { return nTop; } GetBottom() const115 long GetBottom() const { return nBottom; } GetLeft() const116 long GetLeft() const { return nLeft; } GetRight() const117 long GetRight() const { return nRight; } 118 119 const SvxBoxItem& GetBorder() const; 120 SetHdLeft(long nNew)121 void SetHdLeft(long nNew) { nHdLeft = nNew; } SetHdRight(long nNew)122 void SetHdRight(long nNew) { nHdRight = nNew; } SetHdDist(long nNew)123 void SetHdDist(long nNew) { nHdDist = nNew; } SetHdHeight(long nNew)124 void SetHdHeight(long nNew) { nHdHeight = nNew; } 125 void SetHdBorder(const SvxBoxItem& rNew); 126 GetHdLeft() const127 long GetHdLeft() const { return nHdLeft; } GetHdRight() const128 long GetHdRight() const { return nHdRight; } GetHdDist() const129 long GetHdDist() const { return nHdDist; } GetHdHeight() const130 long GetHdHeight() const { return nHdHeight; } 131 GetHdBorder() const132 const SvxBoxItem& GetHdBorder() const { return *pHdBorder; } 133 SetFtLeft(long nNew)134 void SetFtLeft(long nNew) { nFtLeft = nNew; } SetFtRight(long nNew)135 void SetFtRight(long nNew) { nFtRight = nNew; } SetFtDist(long nNew)136 void SetFtDist(long nNew) { nFtDist = nNew; } SetFtHeight(long nNew)137 void SetFtHeight(long nNew) { nFtHeight = nNew; } 138 void SetFtBorder(const SvxBoxItem& rNew); 139 GetFtLeft() const140 long GetFtLeft() const { return nFtLeft; } GetFtRight() const141 long GetFtRight() const { return nFtRight; } GetFtDist() const142 long GetFtDist() const { return nFtDist; } GetFtHeight() const143 long GetFtHeight() const { return nFtHeight; } 144 GetFtBorder() const145 const SvxBoxItem& GetFtBorder() const { return *pFtBorder; } 146 SetUsage(sal_uInt16 eU)147 void SetUsage(sal_uInt16 eU) { eUsage = eU; } GetUsage() const148 sal_uInt16 GetUsage() const { return eUsage; } 149 SetHeader(sal_Bool bNew)150 void SetHeader(sal_Bool bNew) { bHeader = bNew; } GetHeader() const151 sal_Bool GetHeader() const { return bHeader; } SetFooter(sal_Bool bNew)152 void SetFooter(sal_Bool bNew) { bFooter = bNew; } GetFooter() const153 sal_Bool GetFooter() const { return bFooter; } 154 SetTable(sal_Bool bNew)155 void SetTable(sal_Bool bNew) { bTable = bNew; } GetTable() const156 sal_Bool GetTable() const { return bTable; } SetHorz(sal_Bool bNew)157 void SetHorz(sal_Bool bNew) { bHorz = bNew; } GetHorz() const158 sal_Bool GetHorz() const { return bHorz; } SetVert(sal_Bool bNew)159 void SetVert(sal_Bool bNew) { bVert = bNew; } GetVert() const160 sal_Bool GetVert() const { return bVert; } 161 162 void EnableFrameDirection(sal_Bool bEnable); 163 //uses enum SvxFrameDirection 164 void SetFrameDirection(sal_Int32 nDirection); 165 166 void ResetBackground(); 167 }; 168 169 #endif // #ifndef _SVX_PAGECTRL_HXX 170 171 //eof 172