LibreOffice Module svx (master)  1
pagectrl.hxx
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3  * This file is part of the LibreOffice project.
4  *
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/.
8  *
9  * This file incorporates work covered by the following license notice:
10  *
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 .
18  */
19 #ifndef INCLUDED_SVX_PAGECTRL_HXX
20 #define INCLUDED_SVX_PAGECTRL_HXX
21 
22 #include <vcl/customweld.hxx>
23 #include <svx/svxdllapi.h>
25 
26 enum class SvxPageUsage;
27 enum class SvxFrameDirection;
28 
30 {
31 private:
34 
35  long nTop;
36  long nBottom;
37  long nLeft;
38  long nRight;
39 
43 
44  long nHdLeft;
45  long nHdRight;
46  long nHdDist;
47  long nHdHeight;
48 
49  long nFtLeft;
50  long nFtRight;
51  long nFtDist;
52  long nFtHeight;
53 
57 
58  bool bFooter : 1;
59  bool bHeader : 1;
60  bool bTable : 1;
61  bool bHorz : 1;
62  bool bVert : 1;
63 
65 
66 protected:
67  virtual void Paint(vcl::RenderContext& rRenderContext, const tools::Rectangle& rRect) override;
68 
69  virtual void DrawPage(vcl::RenderContext& rRenderContext, const Point& rPoint,
70  const bool bSecond, const bool bEnabled);
71 
72  static void drawFillAttributes(vcl::RenderContext& rRenderContext,
74  const tools::Rectangle& rPaintRange, const tools::Rectangle& rDefineRange);
75 
76 public:
77  SvxPageWindow();
78  virtual void SetDrawingArea(weld::DrawingArea* pDrawingArea) override;
79  virtual ~SvxPageWindow() override;
80 
82  {
83  maHeaderFillAttributes = rFillAttributes;
84  }
86  {
87  maFooterFillAttributes = rFillAttributes;
88  }
90  {
91  maPageFillAttributes = rFillAttributes;
92  }
94  {
95  return maPageFillAttributes;
96  }
97  void SetSize(const Size& rSize)
98  {
99  aSize = rSize;
100  }
101  const Size& GetSize() const
102  {
103  return aSize;
104  }
105 
106  void SetTop(long nNew) { nTop = nNew; }
107  void SetBottom(long nNew) { nBottom = nNew; }
108  void SetLeft(long nNew) { nLeft = nNew; }
109  void SetRight(long nNew) { nRight = nNew; }
110 
111  long GetTop() const { return nTop; }
112  long GetBottom() const { return nBottom; }
113  long GetLeft() const { return nLeft; }
114  long GetRight() const { return nRight; }
115 
116  void SetHdLeft(long nNew) { nHdLeft = nNew; }
117  void SetHdRight(long nNew) { nHdRight = nNew; }
118  void SetHdDist(long nNew) { nHdDist = nNew; }
119  void SetHdHeight(long nNew) { nHdHeight = nNew; }
120 
121  long GetHdLeft() const { return nHdLeft; }
122  long GetHdRight() const { return nHdRight; }
123  long GetHdDist() const { return nHdDist; }
124  long GetHdHeight() const { return nHdHeight; }
125 
126  void SetFtLeft(long nNew) { nFtLeft = nNew; }
127  void SetFtRight(long nNew) { nFtRight = nNew; }
128  void SetFtDist(long nNew) { nFtDist = nNew; }
129  void SetFtHeight(long nNew) { nFtHeight = nNew; }
130 
131  long GetFtLeft() const { return nFtLeft; }
132  long GetFtRight() const { return nFtRight; }
133  long GetFtDist() const { return nFtDist; }
134  long GetFtHeight() const { return nFtHeight; }
135 
136  void SetUsage(SvxPageUsage eU) { eUsage = eU; }
137  SvxPageUsage GetUsage() const { return eUsage; }
138 
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; }
144 
145  void EnableFrameDirection(bool bEnable);
146  void SetFrameDirection(SvxFrameDirection nDirection);
147 
148  void ResetBackground();
149 };
150 
151 #endif // INCLUDED_SVX_PAGECTRL_HXX
152 
153 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
long nHdHeight
Definition: pagectrl.hxx:47
long GetFtHeight() const
Definition: pagectrl.hxx:134
void SetFtRight(long nNew)
Definition: pagectrl.hxx:127
void SetHdRight(long nNew)
Definition: pagectrl.hxx:117
long GetTop() const
Definition: pagectrl.hxx:111
void SetBottom(long nNew)
Definition: pagectrl.hxx:107
void setHeaderFillAttributes(const drawinglayer::attribute::SdrAllFillAttributesHelperPtr &rFillAttributes)
Definition: pagectrl.hxx:81
void SetFooter(bool bNew)
Definition: pagectrl.hxx:140
void SetHdDist(long nNew)
Definition: pagectrl.hxx:118
void setPageFillAttributes(const drawinglayer::attribute::SdrAllFillAttributesHelperPtr &rFillAttributes)
Definition: pagectrl.hxx:89
long GetBottom() const
Definition: pagectrl.hxx:112
SvxFrameDirection nFrameDirection
Definition: pagectrl.hxx:42
SvxFrameDirection
#define SVX_DLLPUBLIC
Definition: svxdllapi.h:28
void SetHdLeft(long nNew)
Definition: pagectrl.hxx:116
void SetFtLeft(long nNew)
Definition: pagectrl.hxx:126
void SetTable(bool bNew)
Definition: pagectrl.hxx:141
long nFtHeight
Definition: pagectrl.hxx:52
void setFooterFillAttributes(const drawinglayer::attribute::SdrAllFillAttributesHelperPtr &rFillAttributes)
Definition: pagectrl.hxx:85
std::shared_ptr< SdrAllFillAttributesHelper > SdrAllFillAttributesHelperPtr
const drawinglayer::attribute::SdrAllFillAttributesHelperPtr & getPageFillAttributes() const
Definition: pagectrl.hxx:93
long GetHdRight() const
Definition: pagectrl.hxx:122
void SetTop(long nNew)
Definition: pagectrl.hxx:106
void SetHeader(bool bNew)
Definition: pagectrl.hxx:139
void SetFtHeight(long nNew)
Definition: pagectrl.hxx:129
void SetHdHeight(long nNew)
Definition: pagectrl.hxx:119
void SetSize(const Size &rSize)
Definition: pagectrl.hxx:97
long GetHdLeft() const
Definition: pagectrl.hxx:121
long GetFtDist() const
Definition: pagectrl.hxx:133
long GetLeft() const
Definition: pagectrl.hxx:113
long GetFtLeft() const
Definition: pagectrl.hxx:131
SvxPageUsage GetUsage() const
Definition: pagectrl.hxx:137
drawinglayer::attribute::SdrAllFillAttributesHelperPtr maFooterFillAttributes
Definition: pagectrl.hxx:55
SvxPageUsage
Definition: pageitem.hxx:34
const Size & GetSize() const
Definition: pagectrl.hxx:101
long GetHdDist() const
Definition: pagectrl.hxx:123
long GetFtRight() const
Definition: pagectrl.hxx:132
drawinglayer::attribute::SdrAllFillAttributesHelperPtr maPageFillAttributes
Definition: pagectrl.hxx:56
drawinglayer::attribute::SdrAllFillAttributesHelperPtr maHeaderFillAttributes
Definition: pagectrl.hxx:54
long GetRight() const
Definition: pagectrl.hxx:114
virtual void SetDrawingArea(weld::DrawingArea *pDrawingArea)
void SetRight(long nNew)
Definition: pagectrl.hxx:109
SvxPageUsage eUsage
Definition: pagectrl.hxx:64
long GetHdHeight() const
Definition: pagectrl.hxx:124
void SetUsage(SvxPageUsage eU)
Definition: pagectrl.hxx:136
void SetHorz(bool bNew)
Definition: pagectrl.hxx:142
bool bFrameDirection
Definition: pagectrl.hxx:41
virtual void Paint(vcl::RenderContext &rRenderContext, const tools::Rectangle &rRect)=0
bool bResetBackground
Definition: pagectrl.hxx:40
void SetLeft(long nNew)
Definition: pagectrl.hxx:108
void SetVert(bool bNew)
Definition: pagectrl.hxx:143
void SetFtDist(long nNew)
Definition: pagectrl.hxx:128