| 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 |
#pragma once |
| 20 |
|
| 21 |
#include <memory> |
| 22 |
#include <svx/view3d.hxx> |
| 23 |
|
| 24 |
namespace com::sun::star::drawing { class XShape; } |
| 25 |
namespace com::sun::star::frame { class XModel; } |
| 26 |
|
| 27 |
class SdrModel; |
| 28 |
|
| 29 |
namespace chart |
| 30 |
{ |
| 31 |
|
| 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. |
| 34 |
*/ |
| 35 |
|
| 36 |
class MarkHandleProvider |
| 37 |
{ |
| 38 |
public: |
| 39 |
virtual bool getMarkHandles( SdrHdlList& rHdlList ) =0; |
| 40 |
virtual bool getFrameDragSingles() =0; |
| 41 |
|
| 42 |
protected: |
| 43 |
~MarkHandleProvider() {} |
| 44 |
}; |
| 45 |
|
| 46 |
class DrawViewWrapper final : public E3dView |
| 47 |
{ |
| 48 |
public: |
| 49 |
DrawViewWrapper( |
| 50 |
SdrModel& rSdrModel, |
| 51 |
OutputDevice* pOut); |
| 52 |
|
| 53 |
virtual ~DrawViewWrapper() override; |
| 54 |
|
| 55 |
//triggers the use of an updated first page |
| 56 |
void ReInit(); |
| 57 |
|
| 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 ); |
| 61 |
|
| 62 |
//fill list of selection handles 'aHdl' |
| 63 |
virtual void SetMarkHandles(SfxViewShell* pOtherShell) override; |
| 64 |
|
| 65 |
SdrPageView* GetPageView() const; |
| 66 |
|
| 67 |
SdrObject* getHitObject( const Point& rPnt ) const; |
| 68 |
|
| 69 |
void MarkObject( SdrObject* pObj ); |
| 70 |
|
| 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; |
| 74 |
|
| 75 |
SdrObject* getSelectedObject() const; |
| 76 |
SdrObject* getTextEditObject() const; |
| 77 |
SdrOutliner* getOutliner() const; |
| 78 |
|
| 79 |
SfxItemSet getPositionAndSizeItemSetFromMarkedObject() const; |
| 80 |
|
| 81 |
SdrObject* getNamedSdrObject( const OUString& rName ) const; |
| 82 |
static bool IsObjectHit( SdrObject const * pObj, const Point& rPnt ); |
| 83 |
|
| 84 |
virtual void Notify(SfxBroadcaster& rBC, const SfxHint& rHint) override; |
| 85 |
|
| 86 |
static SdrObject* getSdrObject( const css::uno::Reference< css::drawing::XShape >& xShape ); |
| 87 |
|
| 88 |
private: |
| 89 |
mutable MarkHandleProvider* m_pMarkHandleProvider; |
| 90 |
|
| 91 |
std::unique_ptr< SdrOutliner > m_apOutliner; |
| 92 |
|
| 93 |
// #i79965# scroll back view when ending text edit |
| 94 |
bool m_bRestoreMapMode; |
| 95 |
MapMode m_aMapModeToRestore; |
| 96 |
}; |
| 97 |
|
| 98 |
} //namespace chart |
| 99 |
|
| 100 |
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |