LibreOffice Module svx (master) 1
svdpagv.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
20#pragma once
21
22#include <com/sun/star/awt/XControlContainer.hpp>
23#include <rtl/ustring.hxx>
24#include <tools/color.hxx>
25#include <svx/svdhlpln.hxx>
26#include <svx/svdsob.hxx>
27#include <svx/svdtypes.hxx>
28#include <svx/svxdllapi.h>
29
30#include <memory>
31#include <vector>
33
34
35namespace vcl { class Region; }
36class SdrObjList;
37class SdrObject;
38class SdrPage;
39class SdrUnoObj;
40class SdrPaintWindow;
41class SdrView;
42class SdrPageObj;
43class SdrPageView;
44
45namespace sdr::contact
46{
47 class ViewObjectContactRedirector;
48 class DisplayInfo;
49 class ViewObjectContactRedirector;
50}
51
52// typedefs for a list of SdrPageWindow
53class SdrPageWindow;
54
56{
57private:
60 Point maPageOrigin; // The Page's point of origin
61
66
67 SdrLayerIDSet aLayerVisi; // Set of visible Layers
68 SdrLayerIDSet aLayerLock; // Set of non-editable Layers
69 SdrLayerIDSet aLayerPrn; // Set of printable Layers
70
71 SdrObjList* pCurrentList; // Current List, usually the Page
72 SdrObject* pCurrentGroup; // Current Group; nullptr means none
73
74 SdrHelpLineList aHelpLines; // Helper lines and points
75
76 // #103911# Use one reserved slot (bReserveBool2) for the document color
78
79 // #103834# Use one reserved slot (bReserveBool1) for the background color
81
82 std::vector< std::unique_ptr<SdrPageWindow> > maPageWindows;
83
84 // #i72752# member to remember with which SdrPageWindow the BeginDrawLayer
85 // was done
87
88public:
89 sal_uInt32 PageWindowCount() const { return maPageWindows.size(); }
90 SdrPageWindow* FindPageWindow( const SdrPaintWindow& rPaintWindow ) const;
91 SdrPageWindow* FindPageWindow( const OutputDevice& rOutDev ) const;
92 SdrPageWindow* GetPageWindow(sal_uInt32 nIndex) const;
93
100 const SdrPageWindow* FindPatchedPageWindow( const OutputDevice& rOutDev ) const;
101
102private:
103 void ImpInvalidateHelpLineArea(sal_uInt16 nNum) const;
104
105 void SetLayer(const OUString& rName, SdrLayerIDSet& rBS, bool bJa);
106 bool IsLayer(const OUString& rName, const SdrLayerIDSet& rBS) const;
107
109 void CheckCurrentGroup();
110
111 void AdjHdl();
112
113public:
114 SdrPageView(SdrPage* pPage1, SdrView& rNewView);
115 ~SdrPageView();
116
117 SdrPageView& operator=( SdrPageView const & ) = delete; // MSVC2017 workaround
118 SdrPageView( SdrPageView const & ) = delete; // MSVC2017 workaround
119
120
122 void ModelHasChanged();
123
124 void Show();
125 void Hide();
126
127 void AddPaintWindowToPageView(SdrPaintWindow& rPaintWindow);
128 void RemovePaintWindowFromPageView(SdrPaintWindow& rPaintWindow);
129
130 SdrView& GetView() { return mrView; }
131 const SdrView& GetView() const { return mrView; }
132
140 css::uno::Reference< css::awt::XControlContainer >
141 GetControlContainer( const OutputDevice& _rDevice ) const;
142
144 void SetDesignMode( bool _bDesignMode ) const;
145
146 bool IsVisible() const { return mbVisible; }
147
149 void InvalidateAllWin();
150
152 void PrePaint();
153
155 void CompleteRedraw( SdrPaintWindow& rPaintWindow, const vcl::Region& rReg, sdr::contact::ViewObjectContactRedirector* pRedirector );
156
158 void setPreparedPageWindow(SdrPageWindow* pKnownTarget);
159
160 void DrawLayer(SdrLayerID nID, OutputDevice* pGivenTarget, sdr::contact::ViewObjectContactRedirector* pRedirector = nullptr,
161 const tools::Rectangle& rRect = tools::Rectangle(),
162 basegfx::B2IRectangle const* pPageFrame = nullptr);
163 void DrawPageViewGrid(OutputDevice& rOut, const tools::Rectangle& rRect, Color aColor = COL_BLACK );
164
165 tools::Rectangle GetPageRect() const;
166 SdrPage* GetPage() const { return mpPage; }
167
169 SdrObjList* GetObjList() const { return pCurrentList; }
170
172 SdrObject* GetCurrentGroup() const { return pCurrentGroup; }
173
175 void SetCurrentGroupAndList(SdrObject* pNewGroup, SdrObjList* pNewList);
176
177 bool HasMarkedObjPageView() const { return mbHasMarked; }
178 void SetHasMarkedObj(bool bOn) { mbHasMarked = bOn; }
179
180 const tools::Rectangle& MarkBound() const { return aMarkBound; }
181 const tools::Rectangle& MarkSnap() const { return aMarkSnap; }
182 tools::Rectangle& MarkBound() { return aMarkBound; }
183 tools::Rectangle& MarkSnap() { return aMarkSnap; }
184
185 void SetLayerVisible(const OUString& rName, bool bShow) {
186 SetLayer(rName, aLayerVisi, bShow);
187 if(!bShow) AdjHdl();
188 InvalidateAllWin();
189 }
190 bool IsLayerVisible(const OUString& rName) const { return IsLayer(rName, aLayerVisi); }
191
192 void SetLayerLocked(const OUString& rName, bool bLock) { SetLayer(rName, aLayerLock, bLock); if(bLock) AdjHdl(); }
193 bool IsLayerLocked(const OUString& rName) const { return IsLayer(rName,aLayerLock); }
194
195 void SetLayerPrintable(const OUString& rName, bool bPrn) { SetLayer(rName, aLayerPrn, bPrn); }
196 bool IsLayerPrintable(const OUString& rName) const { return IsLayer(rName, aLayerPrn); }
197
199 bool IsReadOnly() const;
200
202 const Point& GetPageOrigin() const { return maPageOrigin; }
203 void SetPageOrigin(const Point& rOrg);
204
205 void LogicToPagePos(Point& rPnt) const { rPnt-=maPageOrigin; }
206 void LogicToPagePos(tools::Rectangle& rRect) const { rRect.Move(-maPageOrigin.X(),-maPageOrigin.Y()); }
207 void PagePosToLogic(Point& rPnt) const { rPnt+=maPageOrigin; }
208
209 void SetVisibleLayers(const SdrLayerIDSet& rSet) { aLayerVisi=rSet; }
210 const SdrLayerIDSet& GetVisibleLayers() const { return aLayerVisi; }
211 void SetPrintableLayers(const SdrLayerIDSet& rSet) { aLayerPrn=rSet; }
212 const SdrLayerIDSet& GetPrintableLayers() const { return aLayerPrn; }
213 void SetLockedLayers(const SdrLayerIDSet& rSet) { aLayerLock=rSet; }
214 const SdrLayerIDSet& GetLockedLayers() const { return aLayerLock; }
215
216 const SdrHelpLineList& GetHelpLines() const { return aHelpLines; }
217 void SetHelpLines(const SdrHelpLineList& rHLL);
218 //void SetHelpLinePos(sal_uInt16 nNum, const Point& rNewPos);
219 void SetHelpLine(sal_uInt16 nNum, const SdrHelpLine& rNewHelpLine);
220 void DeleteHelpLine(sal_uInt16 nNum);
221 void InsertHelpLine(const SdrHelpLine& rHL);
222
227 bool IsObjMarkable(SdrObject const * pObj) const;
228
233 bool EnterGroup(SdrObject* pObj);
234
236 void LeaveOneGroup();
237
239 void LeaveAllGroup();
240
242 sal_uInt16 GetEnteredLevel() const;
243
244 // #103834# Set background color for svx at SdrPageViews
245 void SetApplicationBackgroundColor(Color aBackgroundColor);
246
248
249 // #103911# Set/Get document color for svx at SdrPageViews
250 void SetApplicationDocumentColor(Color aDocumentColor);
251 const Color& GetApplicationDocumentColor() const { return maDocumentColor;}
252};
253
254/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
FPDF_PAGE mpPage
Color maBackgroundColor
SlideSorterView & mrView
constexpr tools::Long Y() const
constexpr tools::Long X() const
Abstract DrawObject.
Definition: svdobj.hxx:260
tools::Rectangle aMarkBound
Definition: svdpagv.hxx:62
const SdrLayerIDSet & GetVisibleLayers() const
Definition: svdpagv.hxx:210
const SdrView & GetView() const
Definition: svdpagv.hxx:131
bool IsVisible() const
Definition: svdpagv.hxx:146
SdrPageView(SdrPageView const &)=delete
SdrHelpLineList aHelpLines
Definition: svdpagv.hxx:74
tools::Rectangle & MarkSnap()
Definition: svdpagv.hxx:183
SdrView & mrView
Definition: svdpagv.hxx:58
SdrPageWindow * mpPreparedPageWindow
Definition: svdpagv.hxx:86
bool HasMarkedObjPageView() const
Definition: svdpagv.hxx:177
void LogicToPagePos(tools::Rectangle &rRect) const
Definition: svdpagv.hxx:206
SdrPage * mpPage
Definition: svdpagv.hxx:59
SdrObjList * GetObjList() const
Return current List.
Definition: svdpagv.hxx:169
void SetLockedLayers(const SdrLayerIDSet &rSet)
Definition: svdpagv.hxx:213
SdrLayerIDSet aLayerPrn
Definition: svdpagv.hxx:69
sal_uInt32 PageWindowCount() const
Definition: svdpagv.hxx:89
void LogicToPagePos(Point &rPnt) const
Definition: svdpagv.hxx:205
void SetVisibleLayers(const SdrLayerIDSet &rSet)
Definition: svdpagv.hxx:209
void SetHasMarkedObj(bool bOn)
Definition: svdpagv.hxx:178
void PagePosToLogic(Point &rPnt) const
Definition: svdpagv.hxx:207
SdrLayerIDSet aLayerVisi
Definition: svdpagv.hxx:67
bool mbHasMarked
Definition: svdpagv.hxx:64
bool IsLayerVisible(const OUString &rName) const
Definition: svdpagv.hxx:190
void SetPrintableLayers(const SdrLayerIDSet &rSet)
Definition: svdpagv.hxx:211
tools::Rectangle & MarkBound()
Definition: svdpagv.hxx:182
SdrView & GetView()
Definition: svdpagv.hxx:130
const SdrHelpLineList & GetHelpLines() const
Definition: svdpagv.hxx:216
const Color & GetApplicationBackgroundColor() const
Definition: svdpagv.hxx:247
SdrObject * GetCurrentGroup() const
Return current Group.
Definition: svdpagv.hxx:172
SdrPageView & operator=(SdrPageView const &)=delete
void SetLayerVisible(const OUString &rName, bool bShow)
Definition: svdpagv.hxx:185
const tools::Rectangle & MarkBound() const
Definition: svdpagv.hxx:180
Point maPageOrigin
Definition: svdpagv.hxx:60
const SdrLayerIDSet & GetLockedLayers() const
Definition: svdpagv.hxx:214
bool mbVisible
Definition: svdpagv.hxx:65
void SetLayerLocked(const OUString &rName, bool bLock)
Definition: svdpagv.hxx:192
Color maDocumentColor
Definition: svdpagv.hxx:77
const tools::Rectangle & MarkSnap() const
Definition: svdpagv.hxx:181
std::vector< std::unique_ptr< SdrPageWindow > > maPageWindows
Definition: svdpagv.hxx:82
void SetLayerPrintable(const OUString &rName, bool bPrn)
Definition: svdpagv.hxx:195
SdrPage * GetPage() const
Definition: svdpagv.hxx:166
SdrObjList * pCurrentList
Definition: svdpagv.hxx:71
const Color & GetApplicationDocumentColor() const
Definition: svdpagv.hxx:251
bool IsLayerLocked(const OUString &rName) const
Definition: svdpagv.hxx:193
SdrLayerIDSet aLayerLock
Definition: svdpagv.hxx:68
tools::Rectangle aMarkSnap
Definition: svdpagv.hxx:63
const SdrLayerIDSet & GetPrintableLayers() const
Definition: svdpagv.hxx:212
const Point & GetPageOrigin() const
The Origin always refers to the upper left corner of the Page.
Definition: svdpagv.hxx:202
bool IsLayerPrintable(const OUString &rName) const
Definition: svdpagv.hxx:196
Color maBackgroundColor
Definition: svdpagv.hxx:80
SdrObject * pCurrentGroup
Definition: svdpagv.hxx:72
A SdrPage contains exactly one SdrObjList and a description of the physical page dimensions (size / m...
Definition: svdpage.hxx:379
void Move(tools::Long nHorzMoveDelta, tools::Long nVertMoveDelta)
constexpr OUStringLiteral IsReadOnly(u"IsReadOnly")
static SfxItemSet & rSet
#define SVXCORE_DLLPUBLIC
Definition: svxdllapi.h:35
bool mbVisible