Line data Source code
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 : #ifndef INCLUDED_CHART2_SOURCE_CONTROLLER_INC_DRAWVIEWWRAPPER_HXX
20 : #define INCLUDED_CHART2_SOURCE_CONTROLLER_INC_DRAWVIEWWRAPPER_HXX
21 :
22 : #include <svx/view3d.hxx>
23 : #include <com/sun/star/drawing/XShape.hpp>
24 : #include <com/sun/star/frame/XModel.hpp>
25 :
26 : class SdrModel;
27 :
28 : namespace chart
29 : {
30 :
31 : /** The DrawViewWrapper should help us to reduce effort if the underlying DrawingLayer changes.
32 : Another task is to hide functionality we do not need, for example more than one page.
33 : */
34 :
35 0 : class MarkHandleProvider
36 : {
37 : public:
38 : virtual bool getMarkHandles( SdrHdlList& rHdlList ) =0;
39 : virtual bool getFrameDragSingles() =0;
40 :
41 : protected:
42 0 : ~MarkHandleProvider() {}
43 : };
44 :
45 : class DrawViewWrapper : public E3dView
46 : {
47 : public:
48 : DrawViewWrapper(SdrModel* pModel, OutputDevice* pOut, bool bPaintPageForEditMode);
49 : virtual ~DrawViewWrapper();
50 :
51 : //triggers the use of an updated first page
52 : void ReInit();
53 :
54 : /// tries to get an OutputDevice from the XParent of the model to use as reference device
55 : void attachParentReferenceDevice(
56 : const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel > & xChartModel );
57 :
58 : //fill list of selection handles 'aHdl'
59 : virtual void SetMarkHandles() SAL_OVERRIDE;
60 :
61 : SdrPageView* GetPageView() const;
62 :
63 : SdrObject* getHitObject( const Point& rPnt ) const;
64 :
65 : void MarkObject( SdrObject* pObj );
66 :
67 : //pMarkHandleProvider can be NULL; ownership is not taken
68 : void setMarkHandleProvider( MarkHandleProvider* pMarkHandleProvider );
69 : void CompleteRedraw(OutputDevice* pOut, const vcl::Region& rReg, sdr::contact::ViewObjectContactRedirector* pRedirector = 0) SAL_OVERRIDE;
70 :
71 : SdrObject* getSelectedObject() const;
72 : SdrObject* getTextEditObject() const;
73 : SdrOutliner* getOutliner() const;
74 :
75 : SfxItemSet getPositionAndSizeItemSetFromMarkedObject() const;
76 :
77 : SdrObject* getNamedSdrObject( const OUString& rName ) const;
78 : static bool IsObjectHit( SdrObject* pObj, const Point& rPnt );
79 :
80 : virtual void Notify(SfxBroadcaster& rBC, const SfxHint& rHint) SAL_OVERRIDE;
81 :
82 : static SdrObject* getSdrObject( const ::com::sun::star::uno::Reference<
83 : ::com::sun::star::drawing::XShape >& xShape );
84 :
85 : private:
86 : mutable MarkHandleProvider* m_pMarkHandleProvider;
87 :
88 : ::std::unique_ptr< SdrOutliner > m_apOutliner;
89 :
90 : // #i79965# scroll back view when ending text edit
91 : bool m_bRestoreMapMode;
92 : MapMode m_aMapModeToRestore;
93 : };
94 :
95 : } //namespace chart
96 : #endif
97 :
98 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|