/src/libreoffice/include/svx/pagectrl.hxx
Line | Count | Source |
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 <svx/svxdllapi.h> |
23 | | #include <svx/sdr/attribute/sdrallfillattributeshelper.hxx> |
24 | | #include <vcl/weld/customweld.hxx> |
25 | | |
26 | | enum class SvxPageUsage; |
27 | | enum class SvxFrameDirection; |
28 | | |
29 | | class SVX_DLLPUBLIC SvxPageWindow : public weld::CustomWidgetController |
30 | | { |
31 | | private: |
32 | | Size m_aWinSize; |
33 | | Size m_aSize; |
34 | | |
35 | | tools::Long m_nTop; |
36 | | tools::Long m_nBottom; |
37 | | tools::Long m_nLeft; |
38 | | tools::Long m_nRight; |
39 | | |
40 | | bool m_bResetBackground; |
41 | | bool m_bFrameDirection; |
42 | | SvxFrameDirection m_nFrameDirection; |
43 | | |
44 | | tools::Long m_nHdLeft; |
45 | | tools::Long m_nHdRight; |
46 | | tools::Long m_nHdDist; |
47 | | tools::Long m_nHdHeight; |
48 | | |
49 | | tools::Long m_nFtLeft; |
50 | | tools::Long m_nFtRight; |
51 | | tools::Long m_nFtDist; |
52 | | tools::Long m_nFtHeight; |
53 | | |
54 | | drawinglayer::attribute::SdrAllFillAttributesHelperPtr maHeaderFillAttributes; |
55 | | drawinglayer::attribute::SdrAllFillAttributesHelperPtr maFooterFillAttributes; |
56 | | drawinglayer::attribute::SdrAllFillAttributesHelperPtr maPageFillAttributes; |
57 | | |
58 | | bool m_bFooter : 1; |
59 | | bool m_bHeader : 1; |
60 | | bool m_bTable : 1; |
61 | | bool m_bHorz : 1; |
62 | | bool m_bVert : 1; |
63 | | |
64 | | SvxPageUsage m_eUsage; |
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, |
73 | | const drawinglayer::attribute::SdrAllFillAttributesHelperPtr& rFillAttributes, |
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 | | |
81 | | void setHeaderFillAttributes(const drawinglayer::attribute::SdrAllFillAttributesHelperPtr& rFillAttributes) |
82 | 0 | { |
83 | 0 | maHeaderFillAttributes = rFillAttributes; |
84 | 0 | } |
85 | | void setFooterFillAttributes(const drawinglayer::attribute::SdrAllFillAttributesHelperPtr& rFillAttributes) |
86 | 0 | { |
87 | 0 | maFooterFillAttributes = rFillAttributes; |
88 | 0 | } |
89 | | void setPageFillAttributes(const drawinglayer::attribute::SdrAllFillAttributesHelperPtr& rFillAttributes) |
90 | 0 | { |
91 | 0 | maPageFillAttributes = rFillAttributes; |
92 | 0 | } |
93 | | const drawinglayer::attribute::SdrAllFillAttributesHelperPtr& getPageFillAttributes() const |
94 | 0 | { |
95 | 0 | return maPageFillAttributes; |
96 | 0 | } |
97 | | void SetSize(const Size& rSize) |
98 | 0 | { |
99 | 0 | m_aSize = rSize; |
100 | 0 | } |
101 | | const Size& GetSize() const |
102 | 0 | { |
103 | 0 | return m_aSize; |
104 | 0 | } |
105 | | |
106 | 0 | void SetTop(tools::Long nNew) { m_nTop = nNew; } |
107 | 0 | void SetBottom(tools::Long nNew) { m_nBottom = nNew; } |
108 | 0 | void SetLeft(tools::Long nNew) { m_nLeft = nNew; } |
109 | 0 | void SetRight(tools::Long nNew) { m_nRight = nNew; } |
110 | | |
111 | 0 | tools::Long GetTop() const { return m_nTop; } |
112 | 0 | tools::Long GetBottom() const { return m_nBottom; } |
113 | 0 | tools::Long GetLeft() const { return m_nLeft; } |
114 | 0 | tools::Long GetRight() const { return m_nRight; } |
115 | | |
116 | 0 | void SetHdLeft(tools::Long nNew) { m_nHdLeft = nNew; } |
117 | 0 | void SetHdRight(tools::Long nNew) { m_nHdRight = nNew; } |
118 | 0 | void SetHdDist(tools::Long nNew) { m_nHdDist = nNew; } |
119 | 0 | void SetHdHeight(tools::Long nNew) { m_nHdHeight = nNew; } |
120 | | |
121 | 0 | tools::Long GetHdLeft() const { return m_nHdLeft; } |
122 | 0 | tools::Long GetHdRight() const { return m_nHdRight; } |
123 | 0 | tools::Long GetHdDist() const { return m_nHdDist; } |
124 | 0 | tools::Long GetHdHeight() const { return m_nHdHeight; } |
125 | | |
126 | 0 | void SetFtLeft(tools::Long nNew) { m_nFtLeft = nNew; } |
127 | 0 | void SetFtRight(tools::Long nNew) { m_nFtRight = nNew; } |
128 | 0 | void SetFtDist(tools::Long nNew) { m_nFtDist = nNew; } |
129 | 0 | void SetFtHeight(tools::Long nNew) { m_nFtHeight = nNew; } |
130 | | |
131 | 0 | tools::Long GetFtLeft() const { return m_nFtLeft; } |
132 | 0 | tools::Long GetFtRight() const { return m_nFtRight; } |
133 | 0 | tools::Long GetFtDist() const { return m_nFtDist; } |
134 | 0 | tools::Long GetFtHeight() const { return m_nFtHeight; } |
135 | | |
136 | 0 | void SetUsage(SvxPageUsage eU) { m_eUsage = eU; } |
137 | 0 | SvxPageUsage GetUsage() const { return m_eUsage; } |
138 | | |
139 | 0 | void SetHeader( bool bNew ) { m_bHeader = bNew; } |
140 | 0 | void SetFooter( bool bNew ) { m_bFooter = bNew; } |
141 | 0 | void SetTable( bool bNew ) { m_bTable = bNew; } |
142 | 0 | void SetHorz( bool bNew ) { m_bHorz = bNew; } |
143 | 0 | void SetVert( bool bNew ) { m_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: */ |