Version 6.4.0.0.beta1, tag libreoffice-6.4.0.0.beta1
[LibreOffice.git] / chart2 / source / controller / inc / DrawViewWrapper.hxx
blobc9814bc9602643396a5d793c51ba4ad0a33bda48
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 .
19 #ifndef INCLUDED_CHART2_SOURCE_CONTROLLER_INC_DRAWVIEWWRAPPER_HXX
20 #define INCLUDED_CHART2_SOURCE_CONTROLLER_INC_DRAWVIEWWRAPPER_HXX
22 #include <memory>
23 #include <svx/view3d.hxx>
25 namespace com { namespace sun { namespace star { namespace drawing { class XShape; } } } }
26 namespace com { namespace sun { namespace star { namespace frame { class XModel; } } } }
28 class SdrModel;
30 namespace chart
33 /** The DrawViewWrapper should help us to reduce effort if the underlying DrawingLayer changes.
34 Another task is to hide functionality we do not need, for example more than one page.
37 class MarkHandleProvider
39 public:
40 virtual bool getMarkHandles( SdrHdlList& rHdlList ) =0;
41 virtual bool getFrameDragSingles() =0;
43 protected:
44 ~MarkHandleProvider() {}
47 class DrawViewWrapper : public E3dView
49 public:
50 DrawViewWrapper(
51 SdrModel& rSdrModel,
52 OutputDevice* pOut);
54 virtual ~DrawViewWrapper() override;
56 //triggers the use of an updated first page
57 void ReInit();
59 /// tries to get an OutputDevice from the XParent of the model to use as reference device
60 void attachParentReferenceDevice(
61 const css::uno::Reference< css::frame::XModel > & xChartModel );
63 //fill list of selection handles 'aHdl'
64 virtual void SetMarkHandles(SfxViewShell* pOtherShell) override;
66 SdrPageView* GetPageView() const;
68 SdrObject* getHitObject( const Point& rPnt ) const;
70 void MarkObject( SdrObject* pObj );
72 //pMarkHandleProvider can be NULL; ownership is not taken
73 void setMarkHandleProvider( MarkHandleProvider* pMarkHandleProvider );
74 void CompleteRedraw(OutputDevice* pOut, const vcl::Region& rReg, sdr::contact::ViewObjectContactRedirector* pRedirector = nullptr) override;
76 SdrObject* getSelectedObject() const;
77 SdrObject* getTextEditObject() const;
78 SdrOutliner* getOutliner() const;
80 SfxItemSet getPositionAndSizeItemSetFromMarkedObject() const;
82 SdrObject* getNamedSdrObject( const OUString& rName ) const;
83 static bool IsObjectHit( SdrObject const * pObj, const Point& rPnt );
85 virtual void Notify(SfxBroadcaster& rBC, const SfxHint& rHint) override;
87 static SdrObject* getSdrObject( const css::uno::Reference< css::drawing::XShape >& xShape );
89 private:
90 mutable MarkHandleProvider* m_pMarkHandleProvider;
92 std::unique_ptr< SdrOutliner > m_apOutliner;
94 // #i79965# scroll back view when ending text edit
95 bool m_bRestoreMapMode;
96 MapMode m_aMapModeToRestore;
99 } //namespace chart
100 #endif
102 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */