tdf#130857 qt weld: Implement QtInstanceWidget::strip_mnemonic
[LibreOffice.git] / chart2 / source / controller / inc / DrawViewWrapper.hxx
blob28c2a927ec19c407c217ccf2ddc46e7a462282d3
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 #pragma once
21 #include <memory>
22 #include <svx/view3d.hxx>
24 namespace com::sun::star::drawing { class XShape; }
25 namespace com::sun::star::frame { class XModel; }
27 class SdrModel;
29 namespace chart
32 /** The DrawViewWrapper should help us to reduce effort if the underlying DrawingLayer changes.
33 Another task is to hide functionality we do not need, for example more than one page.
36 class MarkHandleProvider
38 public:
39 virtual bool getMarkHandles( SdrHdlList& rHdlList ) =0;
40 virtual bool getFrameDragSingles() =0;
42 protected:
43 ~MarkHandleProvider() {}
46 class DrawViewWrapper final : public E3dView
48 public:
49 DrawViewWrapper(
50 SdrModel& rSdrModel,
51 OutputDevice* pOut);
53 virtual ~DrawViewWrapper() override;
55 //triggers the use of an updated first page
56 void ReInit();
58 /// tries to get an OutputDevice from the XParent of the model to use as reference device
59 void attachParentReferenceDevice(
60 const css::uno::Reference< css::frame::XModel > & xChartModel );
62 //fill list of selection handles 'aHdl'
63 virtual void SetMarkHandles(SfxViewShell* pOtherShell) override;
65 SdrPageView* GetPageView() const;
67 SdrObject* getHitObject( const Point& rPnt ) const;
69 void MarkObject( SdrObject* pObj );
71 //pMarkHandleProvider can be NULL; ownership is not taken
72 void setMarkHandleProvider( MarkHandleProvider* pMarkHandleProvider );
73 void CompleteRedraw(OutputDevice* pOut, const vcl::Region& rReg, sdr::contact::ViewObjectContactRedirector* pRedirector = nullptr) override;
75 SdrObject* getSelectedObject() const;
76 SdrObject* getTextEditObject() const;
77 SdrOutliner* getOutliner() const;
79 SfxItemSet getPositionAndSizeItemSetFromMarkedObject() const;
81 SdrObject* getNamedSdrObject( const OUString& rName ) const;
82 static bool IsObjectHit( SdrObject const * pObj, const Point& rPnt );
84 virtual void Notify(SfxBroadcaster& rBC, const SfxHint& rHint) override;
86 static SdrObject* getSdrObject( const css::uno::Reference< css::drawing::XShape >& xShape );
88 private:
89 mutable MarkHandleProvider* m_pMarkHandleProvider;
91 std::unique_ptr< SdrOutliner > m_apOutliner;
93 // #i79965# scroll back view when ending text edit
94 bool m_bRestoreMapMode;
95 MapMode m_aMapModeToRestore;
98 } //namespace chart
100 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */