LibreOffice Module svx (master) 1
objectcontact.cxx
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
21#include <tools/debug.hxx>
24
25using namespace com::sun::star;
26
27namespace sdr::contact {
28
30{
31 // default does not support GridOffset
32 return false;
33}
34
36 basegfx::B2DVector& /*rTarget*/,
37 const ViewObjectContact& /*rClient*/) const
38{
39 // default does not on-demand calculate GridOffset
40}
41
43 basegfx::B2DVector& /*rTarget*/,
44 const basegfx::B2DRange& /*rB2DRange*/) const
45{
46 // default does not on-demand calculate GridOffset
47}
48
50: mpViewObjectContactRedirector(nullptr),
51 mbIsPreviewRenderer(false)
52{
53}
54
55ObjectContact::~ObjectContact() COVERITY_NOEXCEPT_FALSE
56{
57 // get rid of all registered contacts
58 // #i84257# To avoid that each 'delete pCandidate' again uses
59 // the local RemoveViewObjectContact with a search and removal in the
60 // vector, simply copy and clear local vector.
61 std::vector< ViewObjectContact* > aLocalVOCList;
62 aLocalVOCList.swap(maViewObjectContactVector);
63
64 for (const auto & pCandidate : aLocalVOCList)
65 // ViewObjectContacts only make sense with View and Object contacts.
66 // When the contact to the SdrObject is deleted like in this case,
67 // all ViewObjectContacts can be deleted, too.
68 delete pCandidate;
69
70 // assert when there were new entries added during deletion
71 DBG_ASSERT(maViewObjectContactVector.empty(), "Corrupted ViewObjectContactList (!)");
72}
73
74// LazyInvalidate request. Default implementation directly handles
75// this by calling back triggerLazyInvalidate() at the VOC
77{
79}
80
81// call this to support evtl. preparations for repaint. Default does nothing
83{
84}
85
86// A new ViewObjectContact was created and shall be remembered.
88{
89 maViewObjectContactVector.push_back(&rVOContact);
90}
91
92// A ViewObjectContact was deleted and shall be forgotten.
94{
95 std::vector< ViewObjectContact* >::iterator aFindResult = std::find(maViewObjectContactVector.begin(), maViewObjectContactVector.end(), &rVOContact);
96
97 if(aFindResult != maViewObjectContactVector.end())
98 {
99 maViewObjectContactVector.erase(aFindResult);
100 }
101}
102
103// Process the whole displaying
105{
106 // default does nothing
107}
108
109// test if visualizing of entered groups is switched on at all
111{
112 // Do not do that as default
113 return false;
114}
115
116// get active group's (the entered group) ViewContact
118{
119 // default has no active VC
120 return nullptr;
121}
122
123// Invalidate given rectangle at the window/output which is represented by
124// this ObjectContact.
126{
127 // nothing to do here in the default version
128}
129
130// Get info about the need to visualize GluePoints
132{
133 return false;
134}
135
136// check if text animation is allowed. Default is sal_true.
138{
139 return true;
140}
141
142// check if graphic animation is allowed. Default is sal_true.
144{
145 return true;
146}
147
149{
151 {
153 }
154}
155
156// print? Default is false
158{
159 return false;
160}
161
162// display page decoration? Default is true
164{
165 return true;
166}
167
168// display mster page content (ViewContactOfMasterPage)? Default is true
170{
171 return true;
172}
173
174// recording MetaFile? Default is false
176{
177 return false;
178}
179
180// pdf export? Default is false
182{
183 return false;
184}
185
187{
188 return false;
189}
190
192{
193 return nullptr;
194}
195
196// gray display mode
198{
199 return false;
200}
201
202// high contrast display mode
204{
205 return false;
206}
207
208// access to SdrPageView. Default implementation returns NULL
210{
211 return nullptr;
212}
213
214// access to OutputDevice. Default implementation returns NULL
216{
217 return nullptr;
218}
219
221{
222 const sal_uInt32 nVOCCount(getViewObjectContactCount());
223
224 for(sal_uInt32 a(0); a < nVOCCount; a++)
225 {
227 assert(pVOC && "ObjectContact: ViewObjectContact list Corrupt (!)");
228 pVOC->resetGridOffset();
229 }
230}
231
232}
233
234/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual bool isDrawModeGray() const
virtual void ProcessDisplay(DisplayInfo &rDisplayInfo)
virtual void InvalidatePartOfView(const basegfx::B2DRange &rRange) const
void SetViewObjectContactRedirector(ViewObjectContactRedirector *pNew)
virtual bool isPageDecorationActive() const
virtual void calculateGridOffsetForB2DRange(basegfx::B2DVector &rTarget, const basegfx::B2DRange &rB2DRange) const
virtual SdrPageView * TryToGetSdrPageView() const
access to SdrPageView. May return 0L like the default implementations do. Override as needed.
ViewObjectContact * getViewObjectContact(sal_uInt32 a) const
std::vector< ViewObjectContact * > maViewObjectContactVector
virtual bool isMasterPageActive() const
virtual void PrepareProcessDisplay()
void RemoveViewObjectContact(ViewObjectContact &rVOContact)
virtual bool supportsGridOffsets() const
virtual ~ObjectContact() COVERITY_NOEXCEPT_FALSE
virtual ::vcl::PDFExtOutDevData const * GetPDFExtOutDevData() const
virtual void calculateGridOffsetForViewOjectContact(basegfx::B2DVector &rTarget, const ViewObjectContact &rClient) const
virtual bool isDrawModeHighContrast() const
virtual bool isExportTaggedPDF() const
virtual bool DoVisualizeEnteredGroup() const
virtual OutputDevice * TryToGetOutputDevice() const
access to OutputDevice. May return 0L like the default implementations do. Override as needed.
virtual bool isOutputToPDFFile() const
virtual bool isOutputToPrinter() const
virtual bool IsTextAnimationAllowed() const
virtual void setLazyInvalidate(ViewObjectContact &rVOC)
virtual const ViewContact * getActiveViewContact() const
sal_uInt32 getViewObjectContactCount() const
virtual bool IsGraphicAnimationAllowed() const
virtual bool AreGluePointsVisible() const
void AddViewObjectContact(ViewObjectContact &rVOContact)
ViewObjectContactRedirector * mpViewObjectContactRedirector
virtual bool isOutputToRecordingMetaFile() const
#define DBG_ASSERT(sCon, aError)
uno_Any a