LibreOffice Module svx (master) 1
objectcontact.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#ifndef INCLUDED_SVX_SDR_CONTACT_OBJECTCONTACT_HXX
21#define INCLUDED_SVX_SDR_CONTACT_OBJECTCONTACT_HXX
22
25#include <svx/svxdllapi.h>
27
28class SdrLayerIDSet;
29namespace tools { class Rectangle; }
30class SdrPageView;
31class OutputDevice;
32
33namespace vcl {
34 class PDFExtOutDevData;
35}
36
37namespace basegfx {
38 class B2DRange;
39 class B2DHomMatrix;
40}
41
42namespace sdr::contact {
43
44class DisplayInfo;
45class ViewContact;
46class ViewObjectContactRedirector;
47
49{
50private:
51 // make ViewObjectContact a friend to exclusively allow it to use
52 // AddViewObjectContact/RemoveViewObjectContact
53 friend class ViewObjectContact;
54
55 // All VOCs which are created using this OC, thus remembering this OC
56 // as a reference. All those VOCs need to be deleted when the OC goes down.
57 // Registering and de-registering is done in the VOC constructors/destructors.
58 std::vector< ViewObjectContact* > maViewObjectContactVector;
59
60 // A new ViewObjectContact was created and shall be remembered.
61 void AddViewObjectContact(ViewObjectContact& rVOContact);
62
63 // A ViewObjectContact was deleted and shall be forgotten.
64 void RemoveViewObjectContact(ViewObjectContact& rVOContact);
65
66 // the primitiveAnimator which is used if this View and/or the contained primitives
67 // support animatedSwitchPrimitives
69
70 // The redirector. If set it is used to pipe all supported calls
71 // to the redirector
73
74 // the Primitive2DParameters containing view information
76
77 // flag for preview renderer
79
80protected:
81 // Interface to allow derivates to travel over the registered VOC's
82 sal_uInt32 getViewObjectContactCount() const { return maViewObjectContactVector.size(); }
83 ViewObjectContact* getViewObjectContact(sal_uInt32 a) const { return maViewObjectContactVector[a]; }
84
85 // interface to allow derivates to set PreviewRenderer flag
86 void setPreviewRenderer(bool bNew) { mbIsPreviewRenderer = bNew; }
87
88 // interface to allow derivates to set ViewInformation2D
89 void updateViewInformation2D(const drawinglayer::geometry::ViewInformation2D& rViewInformation2D) { maViewInformation2D = rViewInformation2D; }
90
91public:
92 // basic constructor
94 virtual ~ObjectContact() COVERITY_NOEXCEPT_FALSE;
95
96 // LazyInvalidate request. This is used from the VOCs to mark that they
97 // got invalidated by an ActionChanged() call. An active view needs to remember
98 // this and take action on it. Default implementation directly calls back
99 // triggerLazyInvalidate() which promptly handles the request
100 virtual void setLazyInvalidate(ViewObjectContact& rVOC);
101
102 // call this to support evtl. preparations for repaint. Default does nothing
103 virtual void PrepareProcessDisplay();
104
105 // Process the whole displaying
106 virtual void ProcessDisplay(DisplayInfo& rDisplayInfo);
107
108 // test if visualizing of entered groups is switched on at all. Default
109 // implementation returns sal_False.
110 virtual bool DoVisualizeEnteredGroup() const;
111
112 // get active group's (the entered group) ViewContact
113 virtual const ViewContact* getActiveViewContact() const;
114
115 // Invalidate given rectangle at the window/output which is represented by
116 // this ObjectContact. Default does nothing.
117 virtual void InvalidatePartOfView(const basegfx::B2DRange& rRange) const;
118
119 // Get info about the need to visualize GluePoints. The default
120 // is that it is not necessary.
121 virtual bool AreGluePointsVisible() const;
122
123 // method to get the primitiveAnimator
124 sdr::animation::primitiveAnimator& getPrimitiveAnimator() { return maPrimitiveAnimator; }
125
126 // check if text animation is allowed. Default is sal_true.
127 virtual bool IsTextAnimationAllowed() const;
128
129 // check if graphic animation is allowed. Default is sal_true.
130 virtual bool IsGraphicAnimationAllowed() const;
131
132 // access to ViewObjectContactRedirector
133 ViewObjectContactRedirector* GetViewObjectContactRedirector() const { return mpViewObjectContactRedirector; }
134 void SetViewObjectContactRedirector(ViewObjectContactRedirector* pNew);
135
136 // print? Default is false
137 virtual bool isOutputToPrinter() const;
138
139 // display page decoration? Default is true
140 virtual bool isPageDecorationActive() const;
141
142 // display mster page content (ViewContactOfMasterPage)? Default is true
143 virtual bool isMasterPageActive() const;
144
145 // recording MetaFile? Default is false
146 virtual bool isOutputToRecordingMetaFile() const;
147
148 // pdf export? Default is false
149 virtual bool isOutputToPDFFile() const;
150 virtual bool isExportTaggedPDF() const;
151 virtual ::vcl::PDFExtOutDevData const* GetPDFExtOutDevData() const;
152
153 // gray display mode
154 virtual bool isDrawModeGray() const;
155
156 // high contrast display mode
157 virtual bool isDrawModeHighContrast() const;
158
159 // check if this is a preview renderer. Default is sal_False.
160 bool IsPreviewRenderer() const { return mbIsPreviewRenderer; }
161
162 // get Primitive2DParameters for this view
163 const drawinglayer::geometry::ViewInformation2D& getViewInformation2D() const { return maViewInformation2D; }
164
166 virtual SdrPageView* TryToGetSdrPageView() const;
167
169 virtual OutputDevice* TryToGetOutputDevice() const;
170
171 // interface to support GridOffset for non-linear ViewToDevice transformation (calc)
172 virtual bool supportsGridOffsets() const;
173 virtual void calculateGridOffsetForViewOjectContact(
174 basegfx::B2DVector& rTarget,
175 const ViewObjectContact& rClient) const;
176 virtual void calculateGridOffsetForB2DRange(
177 basegfx::B2DVector& rTarget,
178 const basegfx::B2DRange& rB2DRange) const;
179 void resetAllGridOffsets();
180};
181
182}
183
184
185#endif // INCLUDED_SVX_SDR_CONTACT_OBJECTCONTACT_HXX
186
187/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
ViewObjectContact * getViewObjectContact(sal_uInt32 a) const
std::vector< ViewObjectContact * > maViewObjectContactVector
void updateViewInformation2D(const drawinglayer::geometry::ViewInformation2D &rViewInformation2D)
const drawinglayer::geometry::ViewInformation2D & getViewInformation2D() const
drawinglayer::geometry::ViewInformation2D maViewInformation2D
sal_uInt32 getViewObjectContactCount() const
ViewObjectContactRedirector * GetViewObjectContactRedirector() const
void setPreviewRenderer(bool bNew)
sdr::animation::primitiveAnimator maPrimitiveAnimator
ViewObjectContactRedirector * mpViewObjectContactRedirector
uno_Any a
#define SVXCORE_DLLPUBLIC
Definition: svxdllapi.h:35