tdf#130857 qt weld: Implement QtInstanceWidget::strip_mnemonic
[LibreOffice.git] / include / svx / sdr / overlay / overlaymanager.hxx
blob696cf5c992c918e482ede365eb1d3fc401acde26
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
20 #ifndef INCLUDED_SVX_SDR_OVERLAY_OVERLAYMANAGER_HXX
21 #define INCLUDED_SVX_SDR_OVERLAY_OVERLAYMANAGER_HXX
23 #include <rtl/ref.hxx>
24 #include <svx/sdr/animation/scheduler.hxx>
25 #include <svx/sdr/overlay/overlayobject.hxx>
26 #include <tools/color.hxx>
27 #include <tools/gen.hxx>
28 #include <svx/svxdllapi.h>
29 #include <basegfx/matrix/b2dhommatrix.hxx>
30 #include <drawinglayer/geometry/viewinformation2d.hxx>
31 #include <salhelper/simplereferenceobject.hxx>
33 class OutputDevice;
34 class SdrModel;
35 namespace vcl { class Region; }
37 namespace sdr::overlay {
38 class OverlayObject;
41 namespace basegfx {
42 class B2DRange;
45 namespace sdr::overlay
47 class SVXCORE_DLLPUBLIC OverlayManager
48 : protected sdr::animation::Scheduler
49 , public salhelper::SimpleReferenceObject
51 private:
52 OverlayManager(const OverlayManager&) = delete;
53 OverlayManager& operator=(const OverlayManager&) = delete;
55 protected:
56 // the OutputDevice to work on, set on construction and not to be changed
57 OutputDevice& mrOutputDevice;
59 // the vector of registered OverlayObjects
60 OverlayObjectVector maOverlayObjects;
62 // Stripe support. All striped OverlayObjects use these stripe
63 // values. Changes change all those objects.
64 Color maStripeColorA; // defaults to COL_BLACK
65 Color maStripeColorB; // defaults to COL_WHITE
66 sal_uInt32 mnStripeLengthPixel; // defaults to 4L
68 // hold buffered the logic length of discrete vector (1.0, 0.0) and the
69 // view transformation belonging to it. Update happens in getDiscreteOne()
70 basegfx::B2DHomMatrix maViewTransformation;
71 drawinglayer::geometry::ViewInformation2D maViewInformation2D;
72 double mfDiscreteOne;
74 // internal
75 void ImpDrawMembers(const basegfx::B2DRange& rRange, OutputDevice& rDestinationDevice) const;
76 void ImpStripeDefinitionChanged();
77 void impApplyRemoveActions(OverlayObject& rTarget);
78 void impApplyAddActions(OverlayObject& rTarget);
80 // return mfDiscreteOne to derivations, but also check for buffered local
81 // ViewTransformation and evtl. correct mfDiscreteOne
82 double getDiscreteOne() const;
84 tools::Rectangle RangeToInvalidateRectangle(const basegfx::B2DRange& rRange) const;
86 OverlayManager(OutputDevice& rOutputDevice);
87 virtual ~OverlayManager() override;
89 public:
90 static rtl::Reference<OverlayManager> create(OutputDevice& rOutputDevice);
92 // access to current ViewInformation2D; this call checks and evtl. updates ViewInformation2D
93 drawinglayer::geometry::ViewInformation2D const & getCurrentViewInformation2D() const;
95 // complete redraw
96 virtual void completeRedraw(const vcl::Region& rRegion, OutputDevice* pPreRenderDevice = nullptr) const;
98 // flush. Do buffered updates.
99 virtual void flush();
101 // get the OutputDevice
102 OutputDevice& getOutputDevice() const { return mrOutputDevice; }
104 // add and remove OverlayObjects
105 void add(OverlayObject& rOverlayObject);
106 void remove(OverlayObject& rOverlayObject);
108 // invalidate the given range at local OutputDevice
109 virtual void invalidateRange(const basegfx::B2DRange& rRange);
111 // stripe support ColA
112 const Color& getStripeColorA() const { return maStripeColorA; }
113 void setStripeColorA(Color aNew);
115 // stripe support ColB
116 const Color& getStripeColorB() const { return maStripeColorB; }
117 void setStripeColorB(Color aNew);
119 // stripe support StripeLengthPixel
120 sal_uInt32 getStripeLengthPixel() const { return mnStripeLengthPixel; }
121 void setStripeLengthPixel(sal_uInt32 nNew);
123 void InsertEvent(sdr::animation::Event& rNew) { Scheduler::InsertEvent(rNew); }
126 } // end of namespace sdr::overlay
128 #endif // INCLUDED_SVX_SDR_OVERLAY_OVERLAYMANAGER_HXX
130 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */